Post by thurizas on Aug 29, 2020 23:32:13 GMT
In the final refraction test we have the default world, with the two spheres
sitting on a transparent plane and a third sphere below the plane. The final
refracted color is supposed to be (0.93642, 0.68642, 0.68642), however I'm
getting (1.0, 0.68642, 0.68642) and I can't figure out why.
The information that I have is this:
(A) the initial ray has an origin of (0, 0, -3, 1) with a direction of
[0, -0.707107, and 0.707107].
From hand calculations, I have that the ray
will intersect the plane at a t=1.41421 and intersect the third sphere at
t=3.53553 and t=4.94975.
The intersection vector (the xs collection) contains:
1.41421:3, 3.53553:4, 4.94975:4
This corresponds to the hand calculations. Using the first intersection, the
precomputed intersection data is:
time value : 1.41421
object id : 3
inside shape: false
in a shadow : false
over point : ( 0, -0.99999, -2, 1)
world point : ( 0, -1, -2, 1)
under point : ( 0, -1.00001, -2, 1)
eye vector : [ -0 ,0.707107 ,-0.707107 ,0 ]
normal vec : [ 0 ,1 ,0 ,0 ]
reflect vec : [ 0 ,0.707107 ,0.707107 ,0 ]
Where I have confirmed the value of the world point.
Now the plane is and transparent, I believe that the refracted ray will have its
origin at (0, -1.00001, -2), the under point from the above intersection data,
and a direction of [0, -0.881817, 0.471405, 0].
Using these parameters, the
refracted ray should hit sphere 3 at t=1.93042 and t=3.90327. The
intersection vector contains:
1.92237:4, 3.90141:4
These do not agree with the hand calculated values, but I'm not sure where
the error is coming in at. The precomputed data for the intersection is:
time value : 1.92237
object id : 4
inside shape: false
in a shadow : false
over point : ( 0, -2.69537, -1.09379, 1)
world point : ( 0, -2.69538, -1.09379, 1)
under point : ( 0, -2.69539, -1.09378, 1)
eye vector : [ -0 ,0.881917 ,-0.471405 ,0 ]
normal vec : [ 0 ,0.804622 ,-0.593788 ,0 ]
reflect vec : [ 0 ,0.710468 ,-0.70373 ,0 ]
The complete code can be found at: github.com/thurizas/Ray-Tracer-Challenge
Thanks for any help you can provide.
sitting on a transparent plane and a third sphere below the plane. The final
refracted color is supposed to be (0.93642, 0.68642, 0.68642), however I'm
getting (1.0, 0.68642, 0.68642) and I can't figure out why.
The information that I have is this:
(A) the initial ray has an origin of (0, 0, -3, 1) with a direction of
[0, -0.707107, and 0.707107].
From hand calculations, I have that the ray
will intersect the plane at a t=1.41421 and intersect the third sphere at
t=3.53553 and t=4.94975.
The intersection vector (the xs collection) contains:
1.41421:3, 3.53553:4, 4.94975:4
This corresponds to the hand calculations. Using the first intersection, the
precomputed intersection data is:
time value : 1.41421
object id : 3
inside shape: false
in a shadow : false
over point : ( 0, -0.99999, -2, 1)
world point : ( 0, -1, -2, 1)
under point : ( 0, -1.00001, -2, 1)
eye vector : [ -0 ,0.707107 ,-0.707107 ,0 ]
normal vec : [ 0 ,1 ,0 ,0 ]
reflect vec : [ 0 ,0.707107 ,0.707107 ,0 ]
Where I have confirmed the value of the world point.
Now the plane is and transparent, I believe that the refracted ray will have its
origin at (0, -1.00001, -2), the under point from the above intersection data,
and a direction of [0, -0.881817, 0.471405, 0].
Using these parameters, the
refracted ray should hit sphere 3 at t=1.93042 and t=3.90327. The
intersection vector contains:
1.92237:4, 3.90141:4
These do not agree with the hand calculated values, but I'm not sure where
the error is coming in at. The precomputed data for the intersection is:
time value : 1.92237
object id : 4
inside shape: false
in a shadow : false
over point : ( 0, -2.69537, -1.09379, 1)
world point : ( 0, -2.69538, -1.09379, 1)
under point : ( 0, -2.69539, -1.09378, 1)
eye vector : [ -0 ,0.881917 ,-0.471405 ,0 ]
normal vec : [ 0 ,0.804622 ,-0.593788 ,0 ]
reflect vec : [ 0 ,0.710468 ,-0.70373 ,0 ]
The complete code can be found at: github.com/thurizas/Ray-Tracer-Challenge
Thanks for any help you can provide.