Original Post
Hello, This is probably an easy one for the maths gurus!
I am trying to make an automatic tracking camera, but I am struggling with the maths
Basically, I want the camera to rotate from its current position so that its pointing towards a defined point. This way, I will be able to track an object with the camera, since I have the objects coordinates.
Now , I could really do with some help for the maths behind this one.
Say I am looking (via glulookat) straight forward, and the point I want to be looking at ( a 3D vector ) is forward but slightly to the left of the camera's view. Now, because this point I want to look at is simply a 3D vector, how can I tell if my camera view is looking at it? Or how do I tell which way to swing my cameras view until it IS looking at that point?
I have attempted to use cross product calculations in order to get the angle, but I am still unsure how to progress from here. Am I needing something from frustrum culling, or is there a more efficient (read less code) method? My camera is based on Gametutorials camera class, just in case you are interested.
Any suggestions are greatly appreciated!
[edited by - Dark_Streak on June 7, 2002 7:44:13 PM]