Closed LihengGong closed 6 years ago
Hi, I don't understand the question, could you please elaborate? The only difference between Orthographic and Perspective is how you generate the rays: the intersection code should be the same. For the assignment, you should not make any assumption on d and e.
Thank you. I'll talk to you then.
Just add one comment: I was trying to understand the provided example program so that I can understand how ray tracing algorithm works in source code's perspective.
My understanding of the provided example is that
d
) is parallel to axis z
e
) is in (x, y) plane(or plane z=0) so that z · e
= 0.From the above, the determinate of the example is written as:
sqrt(sphere_radius*sphere_radius - ray_on_xy.squaredNorm())
My guess is that the answer is yes. Will close this for now.
Yes, that's correct.
For Orthographic View, suppose line equation is p(t) = e + td
Sphere is: (p - c)·(p - c) = R^2
Then d is parallel to axis z, and e is in x-y plane, so that e·d = 0 ?