Skip to content

Commit

Permalink
Fix wrong interpolation weight
Browse files Browse the repository at this point in the history
  • Loading branch information
minnerbe committed Jan 6, 2025
1 parent 090246e commit 9f9e41c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ShadingModel getModel(final int z) {
// between two models -> interpolate
final ModelSpec modelSpecA = sortedModelSpecs.get(i - 1);
final ModelSpec modelSpecB = sortedModelSpecs.get(i);
final double t = (z - modelSpecA.getZ()) / (double) (modelSpecB.getZ() - modelSpecA.getZ());
final double t = (modelSpecB.getZ() - z) / (double) (modelSpecB.getZ() - modelSpecA.getZ());
return new InterpolatedShading(modelSpecA.getModel(), modelSpecB.getModel(), t);
}
}
Expand Down

0 comments on commit 9f9e41c

Please sign in to comment.