Jump to content
  • Advertisement

Archived

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

Rotate Viewpoint

This topic is 5228 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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
Before I go into depth, I''d want to know: Do you want the simplest hack possible, or do you want a movable camera?




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

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!