Posted 15 January 2009 - 01:43 AM
Iam looking into backface culling, most literature use the dot product between the surface normal and a point from the face to the camera to tell whether it is a back or front face, I found a couple of articles (which seems more logical to me) that use the dot product between the normal and the camera view vector (ie [0 0 1]) to tell whether it is a front or back face. Could anyone please explain why the majority use the first definition? Is that more "correct" and why?
Thanks for all your help
Posted 15 January 2009 - 02:00 AM
In fact, you're not even interested in your own view direction. What matters is whether your location with respect to the wall is in front or behind it's plane. Even if you rotate, your position with respect to the wall's plane stays the same. So no matter your view direction, if the wall was facing you, it will continue to face you.
Currently working on: the 3D engine for Tomb Raider.
Posted 15 January 2009 - 12:07 PM
As .oisyn pointed out though it's a very common mistake to use that method in 3D space before projection. It might look intuitive at first to compare the normal with the forward vector but that leads to incorrect results.
Anyway, none of the correct methods is "more" correct than the other. They are mathematically equivalent. They can however differ in performance and robustness. The optimal choice depends on what you're really doing.
Posted 16 January 2009 - 01:58 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users