danielepanozzo / cg-old

44 stars 16 forks source link

[Assignment 1] Question about Orthographic View #75

Closed LihengGong closed 6 years ago

LihengGong commented 6 years ago

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 ?

danielepanozzo commented 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.

LihengGong commented 6 years ago

Thank you. I'll talk to you then.

LihengGong commented 6 years ago

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

From the above, the determinate of the example is written as:

sqrt(sphere_radius*sphere_radius - ray_on_xy.squaredNorm())
LihengGong commented 6 years ago

My guess is that the answer is yes. Will close this for now.

danielepanozzo commented 6 years ago

Yes, that's correct.