OpenTKstart's picture

Rotate 3d Object free in the room

hey,

i want to rotate a 3d-object free in the room. I have...

 protected override void OnRenderFrame(FrameEventArgs e)
        { 
//.....
 GL.Rotate(angleY, Vector3d.UnitY);  //rotation on Y-achis
            GL.Rotate(angleX, Vector3d.UnitX);  //rotation on X-achis
            GL.Rotate(angleZ, Vector3d.UnitZ);  //rotation on Z-achis
//.....
 
}

and...

 void MouseMove(object sender, MouseMoveEventArgs e)
        {
            if (Mouse[MouseButton.Left])  //Move
            {
                MoveObject(e.XDelta, e.YDelta);
            }
            if (Mouse[MouseButton.Right])  //Rotate
            {
                // just my first idea to test it, but i need also a rotation on the z-achis in some cases...
                angleX += e.YDelta;
                angleY -= e.XDelta;
 
            }
 
        }

Any idea?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
OpenTKstart's picture

sry, not my fault, can be deleted>

OpenTKstart's picture
OpenTKstart's picture