Spiderman

01-14-2001, 11:46 PM

Hi there,

I think I have a problem with some multiplications in my OpenGL program.

I designed a cube: I can move, spin, increase/decrease the size (it works)

I also designed a coordinatesystem to show the position of the cube in space.

And now my problem:

I start with the cube at the position (3,3,3).

Then I move the cube to the Point (0,0,0), now I spin it 10 degrees in direction of the negative z-axis. After that I want to move my cube again, for example in the positive x-axis. After the multiplication with the matrix:

(x-axis-translation +1)

1 0 0 1

0 1 0 0

0 0 1 0

0 0 0 1

my cube moves in the x-direction and! in the negative y-direction. The matrix on the stack changes the y-value from -2.34 to -2,55. So my cube is a little bit under the x-z-plane. I think this is because of the rotation i did before.

How can I move the cube only in the x-direction?

I think I have a problem with some multiplications in my OpenGL program.

I designed a cube: I can move, spin, increase/decrease the size (it works)

I also designed a coordinatesystem to show the position of the cube in space.

And now my problem:

I start with the cube at the position (3,3,3).

Then I move the cube to the Point (0,0,0), now I spin it 10 degrees in direction of the negative z-axis. After that I want to move my cube again, for example in the positive x-axis. After the multiplication with the matrix:

(x-axis-translation +1)

1 0 0 1

0 1 0 0

0 0 1 0

0 0 0 1

my cube moves in the x-direction and! in the negative y-direction. The matrix on the stack changes the y-value from -2.34 to -2,55. So my cube is a little bit under the x-z-plane. I think this is because of the rotation i did before.

How can I move the cube only in the x-direction?