🎉 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!!!!
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....
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
ypos += (float)sin(horisontal_angle) * cos(vertical_angle) * radius;
zpos += (float)sin(vertical_angle) * radius;
Visit our homepage: www.rarebyte.de.st
GA
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)
-----------------------------
Blue*Omega
(Insert Witty Quote Here)
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?
I''ve been at this for a week!!!
phew happy that it is over now..
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)
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement