Archived

This topic is now archived and is closed to further replies.

Tree Penguin

Degree rotation to normal ???

Recommended Posts

Hi, i am building a camera class and i now need the normal of a rotation so i can determine exactly what''s viewed and what''s not. For rotation i''ve got two doubles (xrot and yrot) and i use those to rotate the scene with the camera as the origin using glRotated. So, does anyone know how to calculate this normal? Thanks in advance, TP

Share this post


Link to post
Share on other sites
Hello!

For determinig what is visible or not, you should use the direction of the camera, not the normal of the rotation. Or maybe i have something misunderstood? (my english is u know...)
Btw what is the normal of a rotation? I can calculate it for you, if you explain your problem more detailed.

cu

"Knowledge is no more expensive than ignorance, and at least as satisfying." -Barrin

Share this post


Link to post
Share on other sites
Well ok, what i mean with the normal of a rotation is the directional vector (=normal) of the direction the camera is looking in.
Lets say the camera is rotated 32.0 degrees around the x axis and 172.7 degrees around the y axis, how do i calculate the direction it''s looking in.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You should keep a vector that represents the initial direction which is down the Z axis (can''t remember if positive or negative). Then you just rotate that vector manually by the same amount as your camera.

Share this post


Link to post
Share on other sites