RasterMagic

12-03-2003, 06:49 AM

I was uner the impression that I actaully understood modeling transformations in OpenGL. I was wrong.

Let me quote Richard Wrigth, OpenGL SuperBible, Second Edition, p. 138:

"All of the various transformations change the current coordinate system with respect to eye coordinates."

I find this clear. Very clear. In essence I understand like this: I do not rotate any object but rather the coordinate system the object is defined in.

This, though, makes me unable to comprehend his figure at page 140.

The figure explains that the order of modeling transformation is important. Part 1 of the figure shows a cube first rotated around the z-axis and the translated along the x-axis. According to the figure the cube is now somewhere in the first quadrant, rotated. This I don't understand.

According to his quote all transformations are done "with respect to the eye coordinates", thus I think part 1 of the figure should be as follows:

1. First the rotation rotates, not the cube but the coordinate system, with respect to the eye corrdinate system. Hence the cube is now rotated with respect to the z-axis. This is ok, and as shown.

2. The next transformation is a translation with respect to the x-axis, and this is where I'm having problems. According to the figure this moves the cubes out of the new x-axis (the one created by the rotation descirbed in 1. above), but according to how I understand this (as from the quote in the beginning of my post), this SHOULD translate the COORDINATE SYSTEM with respect to the EYE COORDINATE SYSTEM and NOT the cube with respect to the NEWLY created coordinate system. Ergo I think the cube should be with its center at the x-axis an rotated, but it's not.

Let me quote Richard Wrigth, OpenGL SuperBible, Second Edition, p. 138:

"All of the various transformations change the current coordinate system with respect to eye coordinates."

I find this clear. Very clear. In essence I understand like this: I do not rotate any object but rather the coordinate system the object is defined in.

This, though, makes me unable to comprehend his figure at page 140.

The figure explains that the order of modeling transformation is important. Part 1 of the figure shows a cube first rotated around the z-axis and the translated along the x-axis. According to the figure the cube is now somewhere in the first quadrant, rotated. This I don't understand.

According to his quote all transformations are done "with respect to the eye coordinates", thus I think part 1 of the figure should be as follows:

1. First the rotation rotates, not the cube but the coordinate system, with respect to the eye corrdinate system. Hence the cube is now rotated with respect to the z-axis. This is ok, and as shown.

2. The next transformation is a translation with respect to the x-axis, and this is where I'm having problems. According to the figure this moves the cubes out of the new x-axis (the one created by the rotation descirbed in 1. above), but according to how I understand this (as from the quote in the beginning of my post), this SHOULD translate the COORDINATE SYSTEM with respect to the EYE COORDINATE SYSTEM and NOT the cube with respect to the NEWLY created coordinate system. Ergo I think the cube should be with its center at the x-axis an rotated, but it's not.