PDA

View Full Version : flying objects in 3d world



Starnut coder
02-07-2001, 10:48 PM
I want a sphere to fly from the camera strait forward. I use the glTranslatef and glRotatef functions to set the camera position. The screen is updated using sinus and cosinus functions.
I kept trying but couldnt manage to make a function for the sphere.

Can someone help please!

rIO
02-07-2001, 11:15 PM
IF you have camera organized your camera like eye, pitch,yaw and roll, it simple to get the vector in wich the camera is looking.
If you use the eye - target way just normalize the target coords after translating the camera in 0 and you get the vector in wich the caemra is looking.
Just use this vector for the sphere movements.


rIO http://www.spinningkids.org/umine

Starnut coder
02-08-2001, 03:08 AM
Yes thats a good solution, just one thing, what shall i use as target vector?

-Starnut