Re: How to test a normal that is facing up?
- From: legalize+jeeves@xxxxxxxxxxxxxxxxx (Richard [Microsoft Direct3D MVP])
- Date: Tue, 26 Aug 2008 15:56:49 -0700
[Please do not mail me a copy of your followup]
"Jack" <jl@xxxxxxxxxx> spake the secret code
<O$Fad$bBJHA.1180@xxxxxxxxxxxxxxxxxxxx> thusly:
I'd like to know how do you test a normal that is facing up? or nearly up?
Take the normal vector and dot product it with the vector for the
Y-axis. The dot product of two vectors is the product of their
magnitudes and the cosine of the angle between the vectors. Assuming
the two vectors are unit vectors, then the dot product will simply be
the cosine of the angle between the vectors. Cosine of angles that are
small is very close to 1. So if the dot product of the normal and the
Y-axis vector is close to 1, then the vectors are nearly coincident.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>
Legalize Adulthood! <http://blogs.xmission.com/legalize/>
.
- Follow-Ups:
- Re: How to test a normal that is facing up?
- From: Jack
- Re: How to test a normal that is facing up?
- Prev by Date: Re: Direct3D 7 antialiasing triangle strips
- Next by Date: Re: How to test a normal that is facing up?
- Previous by thread: Re: How to test a normal that is facing up?
- Next by thread: Re: How to test a normal that is facing up?
- Index(es):
Relevant Pages
|