Degree rotation to normal ???

Started by
3 comments, last by Tree Penguin 20 years, 4 months ago
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
Advertisement
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
"Knowledge is no more expensive than ignorance, and at least as satisfying." -Barrin
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.
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.
Never mind, i''ve decided to use my own modelview matrix for all 3d viewing, this solves a lot difficulties .

This topic is closed to new replies.

Advertisement