Skip to content

Commit bee8a92

Browse files
author
Viktoria de Koning
committed
Gave TransparentMaterial another Shot. It's now black and some kind of transparent. Better using DavidsTransparentMaterial though ;)
1 parent 027494d commit bee8a92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Material/TransparentMaterial.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Color colorFor(Hit hit, World world, RecursiveTracer recursiveTracer)
2828
// Normal of the hit object
2929
Normal3 normal = hit.n;
3030
// Vector pointing in the negative direction of d (-d)
31-
Vector3 e = hit.ray.direction.mul(-1.0);
31+
Vector3 e = hit.ray.direction;
3232
// Vector which is reflected by the Material using the Normal normal
3333
Vector3 r = e.reflectedOn(normal);
3434
// Vector pointing to the light source
@@ -88,7 +88,7 @@ public Color colorFor(Hit hit, World world, RecursiveTracer recursiveTracer)
8888
// calculate R (Reflexion) R = R0 + (1 - R0)(1 - cosTheta_1)^5
8989
Double rR = Math.pow((r0 + (1 - r0) * (1 - cosThetaI)), 5.0);
9090
// calculate T (Transmission) T = 1 - R
91-
Double tT = 1- rR;
91+
Double tT = 1 - rR;
9292

9393
// c = R * fr[(pr, rd)] + T * fr[(pr, rt)]
9494
// Reflexion added to the color

0 commit comments

Comments
 (0)