jPCT - a 3d engine for Java > Bugs

Matrix.rotateX rotates clockwise

(1/2) > >>

Emmanuel:
Hello,

Thanks for your work. I think I might have encountered a misleading method description. Indeed the doc says rotateX creates a counter-clockwise rotation for positive angles but it appears to create a clockwise rotation matrix.

How you can test:

--- Code: ---Matrix mat = new Matrix();
mat.rotateX((float)Math.PI/2);
Logger.Log(mat.ToString());

--- End code ---

You get the matrix:
1  0  0  0
0  0  -1 0
0  1  0  0
0  0  0  1
Which sends (0  1  0  0) to (0  0  -1  0). (I'm assuming row vectors)
Which corresponds to clockwise

EgonOlsen:
I think you are right. I'll change the docs for the next release.

Emmanuel:
Thanks for the quick response.

BTW, I believe rotateY and rotateZ also have the same problem.

EgonOlsen:
Thinking about this again, i think that the docs are correct. (0  1  0  0) to (0  0  -1  0) means that a vector pointing down now points to the front which is, when viewed along the x-axis, a counter clockwise rotation, isn't it?

Emmanuel:
I have to disagree going from (0 1 0 0) to (0 0 -1 0) is clockwise. (I am "looking" from positive X)

Navigation

[0] Message Index

[#] Next page

Go to full version