I'm working on a 3d Scene, Now becoming a 3d Enviroment scene. I am working on key input.
I have succesfully implemented movement on the means of the Z, and X axis.
But now I want to implement a means of rotating. Rotation on the "Y" Axis.
To set the appearance of "Turning" in a direction. Well, I tried
where the int "Z" is Increased/Decreased by 0.3f upon the single touch of a button.
Well, it worked kind of. The Rotation works. But the Forward,left,right,reverse keys get mixed up. Along with Rendered objects, (walls and a cylinder to be exact) I am unsure. But is this the correct approach? Or is it a simple mathamatcal and/or OpenGL function misuse error?
Remember that when you rotate you also rotate your coordinate system so future calls are about this rotated coord system. look at push and popmatrix as well as loadidentity.
There's similar stuff in another post plus a possible solution. The link is below.
Erm, well, I am still a bit confused.
I added that to the drawing of my cylinder. The rotation math works, in the esscence of the cylinder being in the right place.
But when I attempt to add it to my room function. either: A: nothing rotates.
or B: it doesn't work.
if yuo want, you can download a zip of my code. and scroutinize it.
here on my server:
[This message has been edited by ThinIce (edited 02-22-2002).]
is there a way to do so with gluLookAt();
???? PLEASE HELP!
Take a look at
There is also a very well-documented example on the usage of gluLookAt().