i know that many people may see this topic bit strange,but of course the problem is not to rotate a cube actually.
i made an application to rotate a cube and i know that it is very simple one but the problem that when i rotate the cube it rotate the (X,Y,Z) axis with it !!!
u can see it when i rotate the cube with angle 90 around Y-axis then when i rotate around X-axis it rotate around Z-axis because i rotate the axis with the cube ?!!!
Sample of the Code :
Gl.glScalef(45, 45, 45);
Gl.glRotatef(cubeAngley, 0, 1, 0);
Gl.glRotatef(cubeAnglex, 1, 0, 0);
private void Oglctrl_KeyDown(object sender, KeyEventArgs e)
// rotating cube
if (e.KeyCode == Keys.W)
cubeAnglex -= 5;
else if (e.KeyCode == Keys.S)
cubeAnglex += 5;
else if (e.KeyCode == Keys.A)
cubeAngley -= 5;
else if (e.KeyCode == Keys.D)
cubeAngley += 5;