danielepanozzo / cg-old

44 stars 16 forks source link

[Assignment 1] line - sphere intersection: which root should be kept for the quadratic equation ? #73

Closed LihengGong closed 6 years ago

LihengGong commented 6 years ago

The text book states:

If the discriminant is positive, there are two solutions: one solution where the ray enters the sphere and one where it leaves.

Question is:

hankstag commented 6 years ago

yes, if there are two intersection points then you should pick the one that's closer to the camera