Jump to content
  • Advertisement
Sign in to follow this  
Wizumwalt

mouse rotation

This topic is 4886 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

Hey all, I have a few problems when rotating my object on the screen. Problem #1) When I do left mouse button down, my object rotates faster than the pointer moves. How do I match the rotation speed so that it looks like my mouse is hovering over the same point on the object as it rotates? Problem #2) While trying to get better manipulation control, when I press the left mouse button, I want my object to rotate with the speed increasing exponentially with the distance from the mouse-down origin. (I think this is the Open Inventor style). This is saying ... the further down on the Y axis from the center of the screen (y = 0), the faster it rotates, correct? Any idea how to increase my rotation value in that way? Any help much apprecia

Share this post


Link to post
Share on other sites
Advertisement
1) When you are responding to mouse move messages, work out the angle between the centre of rotation and the point that you are dragging. By rotating the object through this angle your object should rotate at the same rate as the mouse.

2) Calculate the rate of rotation relative to the y distance between the current mouse point and the point you clicked the button.

Share this post


Link to post
Share on other sites
Does anyone know if the NeHe tutorial 48 on ArcBall (which I think is just a way of manipulating an object via the mouse) is in java somewhere's, preferably in JOGL.

Or at least maybe some example app somewhere's so I can see what arcball really does?

Any help much appreciated.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!