Hi ;
i’ taking a graphics class and i’m trying to write a camera class that i can reuse through out the rest of the course. i have it so that i can do the pitch, yaw roll and slide through the three dimensions. Now i would like to add the ability to rotate the camera around an object. I’m using vectors to orient the camera. What i have is based upon what i found in my text book. i can’t seem to make the camera move without the point of view moving. Any suggestions?
Your question is not quite clear.
If you are actually trying to orbit the camera around a 3-space object the point of view will change continuously.
If you are just rotating the camera around a centerline through the lense to the object the rotational transformations are straightforward
and if GL doesn’t have a routine for this I will be happy to e-mail them to you.
Hope this helps
D.M.Phillips
Maybe that would help you:
http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=2;t=021484
If I understand correctly, you already have a method to translate the camera around to different positions, and you have a method to rotate it in place.
Thus, to rotate around a point it’s observing:
- translate “forward” to the point.
- rotate as desired, in place
- translate “backward” to the original viewing distance.
Of course, the forward and backward vectors will be things you’ll need to calculate. The forward one should be easy, at least.