SOLVED
See my last post for details.
I am programming a 3x3 puzzle cube (aka Rubik’s Cube) and I am having some difficulty with axis rotations.
When i press “X” i have the rotX increase by 90 degrees, the same goes for Y, and Z. You can only rotate on one axis at a time.
The problem is, I wish for my cube to rotate relative to my perspective. An example of what happens now is if i rotate 90 degrees on the X axis, then try rotating on the Y axis, the cube turns on (what i see to be) the Z axis.
GL11.glRotatef(rotX, 1.0f, 0.0f, 0.0f);
GL11.glRotatef(rotY, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(rotZ, 0.0f, 0.0f, 1.0f);
If you wish to demo the program: File Beam
Controls:
1 - turn red
2 - turn orange
3 - turn blue
4 - turn green
5 - turn yellow
6 - turn white
X - rotate on “X” axis
Y - rotate on “Y” axis
Z - rotate on “Z” axis
Left Shift - Hold to turn / rotate opposite direction.
Right Shift - Reset cube.
Escape - Exit.
Enter - Scramble cube.
Backspace - Undo last move (includes scramble moves).