🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

I wanna Fly!!!!

Started by
3 comments, last by dweeb 24 years ago
Hi im dweeb!!! Im kind of making a space flying simulations thingy. And i have a problem moving around in my 3-d world. In 2-d it simple... But how sould i do it in 3-d? my guess was something like this xpos += (float)sin(horisontal_angle) * radius; ypos += (float)sin(verical_angle)*radius; //this is wrong zpos += (float)cos(horisontal_angle) * radius; glRotatef(horisontal_angle,0.0,1.0,0.0); glRotatef(vertical_angel,1.0,0.0,0.0); translatef(-xpos,-ypos,-zpos); Please guys....
______________________________ohh well what the heck lets try it?
Advertisement
xpos += (float)cos(horisontal_angle) * cos(vertical_angle) * radius;
ypos += (float)sin(horisontal_angle) * cos(vertical_angle) * radius;
zpos += (float)sin(vertical_angle) * radius;

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
I know I didn''t post the question but I would like to say thank you for the answer! I have been having the EXACT same problem

-----------------------------

Blue*Omega

(Insert Witty Quote Here)
// Tojiart
Thanx a lot man..

I''ve been at this for a week!!!

phew happy that it is over now..

ohh well what the heck lets try it?
______________________________ohh well what the heck lets try it?
Yoo...
But what if u pitch or yaw the plane after you have rolled.
Then you are not total 3d.!?

I think it can be solved by using the roll-angle to use in calculating the pitch and yaw angle.

should be something like:
pichangle += cos(rollangle) * degOfPitch
yawangle += sin(rollangle) * degOfPitch

Workes fine for me (downstairs on an other machine).
(Ok.... i caaaan be wrong)

Me....!? What more can I say?

This topic is closed to new replies.

Advertisement