Jump to content
  • Advertisement
Sign in to follow this  

arcBall - how to rotate it __proper__

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

Hi I am writing a program in Java to display VRML files; I am also using arcBall implementation form Nehe lesson(i spend a half a day to convert code form vc++ to Java ) and It works; But When I load models I use gluLookAt function like below to have it dispayed form given vievpoint: --cut-- gl.glMatrixMode (GL.GL_PROJECTION_MATRIX); gl.glLoadIdentity(); glu.gluLookAt( vp.position.x, vp.position.y, vp.position.z, 0,0,0, vp.orientation.x, vp.orientation.y, vp.orientation.z); //some defined position gl.glMatrixMode (GL.GL_MODELVIEW); gl.glTranslatef(arcBallPos.X,arcBallPos.Y,arcBallPos.Z); float[] M= { Transform.M00,Transform.M10,Transform.M20,Transform.M30, Transform.M01,Transform.M11,Transform.M21,Transform.M31, Transform.M02,Transform.M12,Transform.M22,Transform.M32, Transform.M03,Transform.M13,Transform.M23,Transform.M33 }; gl.glMultMatrixf(M); model.draw(); --cut-- when I use rotation(drag mouse) - it rotates me in wrog direction - sometimes; i was thinking to do that: = i have a model - i do not do anything wit it -it is static(its position); = changes only wievpoints - camera pos and dest pos; = my arcball s the thing though my model looks as if is is rotating - but: 1. the model have statioc position ==> so i have to multiply some way the viewpoint and the coords of my arcball HOW??? I need Your help! any help welcomed!!! -- wito

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!