🎉 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!

3d math problem

Started by
2 comments, last by Styles 23 years, 11 months ago
hi i am currently working on a space game (sort of) and i want to be able to rotate on y-axis with the left and right arrow keys and rotate on the x-axis with the up and down arrow keys and then move forward with the space-bar. So how do you do that. please help! lots of source code would be nice. Thanks! Styles shit! Edited by - styles on 8/4/00 9:44:31 PM
Styles peace!
Advertisement
You can perform such rotations with sin/cos. Make sure you know trigonometry. You might even try Quaternions. Do you need source for a Quaternion class ?

Tim

--------------------------
www.gamedev.net/hosted/glvelocity
glvelocity.gamedev.net
www.glvelocity.com
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
Hi...
everything you need is glRotate*() or glTranslate*();

a is angle...
glRotatef(a,1,0,0) rotates around x axis
glRotatef(a,0,1,0) rotates around y axis ...

glRotatef(a,1,1,0) rotates around y=x line...

and what about glRotatef(a, 1.0f, 0.5f, 0)


if you don''t get what I''m talking about ( I dont ! ) everything is in NeHe''s tutorials... and the RedBook


Pet

Pet
You can use gluLookAt

You always save the eye position, the up vector and the center position

then you just rotate or the center position or the up vector relativement to the eye position



PROgrammer

This topic is closed to new replies.

Advertisement