Archived

This topic is now archived and is closed to further replies.

Big Cheez

Rotate Viewpoint

Recommended Posts

Brother Bob    10344
As I said, glRotate. Get the mouse movements, and feed the movements as angles to glRotate.

For example, if you want to look up/down by moving the mouse up/down, get the mouse movements in the Y-direction, scale it as you like (to "convert" from distance to degrees, choose whatever factor you like; higher factor, higher sensitivity), and rotate that amount about the X-axis. Simple, but works.

Share this post


Link to post
Share on other sites
Actually, instead of answering the question I'm just going to point you to some OpenGL tutorials that would be many times more helpful than any one post I would make:
http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg1.htm

Edit: Yes, yes, it's not NeHe, I know. But gluLookAt isn't terrible, as best as I can tell, and it does the job.




"Remember: Silly is a state of Mind, Stupid is a way of Life." -- Dave Butler


[edited by - Indigo Darkwolf on January 27, 2004 5:20:27 PM]

Share this post


Link to post
Share on other sites
Tree Penguin    262
At the beginning of your drawing routine (after positioning the camera) i use glRotatef(xrot,1,0,0) and glRotatef(zrot,0,0,1) which lets the user/player look down (x) and look around the vertical axis (z). This works perfect.

Share this post


Link to post
Share on other sites
Big Cheez    122
GLRotate works... kinda. See, sometimes your turning to face the square and your turn "rebounds". If you want the code i''d be happy to send it to you. And you have to press the down arrow key to see the square.

Oh, and another thing... You kinda "slide" on a line perpendicular to the square no matter which direction your facing.

Share this post


Link to post
Share on other sites