Hi,
I think my last topic was a little bit misunderstood. I’m explaining my problem with more details …
I have designed a cube. with some keys i can move, rotate, … the cube. This works everything, no problem. After every keystroke my object is new computed and shown (mostly correct ). Only in one situation there is a mistake:
I can move my cube along the axis correctly,
but after a rotation of my cube (for example 45 degrees in direction of the negative z-axis) the translation isn’t anymore in the direction of the coordinate axis. When i want to move my object in the positive x-axis (right), the cube moves in two directions: right and down
here are the matrices, where i store my moves:
after the first translation (one step left):
matrix on the stack
1 0 0 -1
0 1 0 0
0 0 1 0
0 0 0 1
after the rotation (-45 degrees, z-axis)
(The figures are not the real, i have only taken some)
matrix on the stack
0.707 0.707 0 -0,1111
-0.707 0.707 0 -0,2222
0 1 1 0
0 0 0 1
now i want to move the spinned cube one step in the positive x-direction.
matrix on the stack
0.707 0.707 0 0,777
-0.707 0.707 0 -0,888 ***
0 1 1 0
0 0 0 1
Why do my value ***, which is responsible for the y-direction, change ?? Because of this change my object moves downwards too, but i only want to move the spinned cube in the x-direction.
my translation-matrix for x-direction +1 is
1 0 0 1
0 1 0 0
0 0 1 0
0 0 0 1
Sorry for posting this again, but it is very impotant. I hope somebody can answer my question, thx a lot …