www.jpct.net
jPCT  a 3d engine for Java => Bugs => Topic started by: Emmanuel on June 30, 2013, 10:10:22 pm

Hello,
Thanks for your work. I think I might have encountered a misleading method description. Indeed the doc says rotateX creates a counterclockwise rotation for positive angles but it appears to create a clockwise rotation matrix.
How you can test:
Matrix mat = new Matrix();
mat.rotateX((float)Math.PI/2);
Logger.Log(mat.ToString());
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

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

Thanks for the quick response.
BTW, I believe rotateY and rotateZ also have the same problem.

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 xaxis, a counter clockwise rotation, isn't it?

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

"From positive X" means that you are looking at the origin from some xvalue? If that's the case, i would say that you are looking into the wrong direction... ???

Yes I am looking at the origin from a positive X value because rotation axis is positive X

I'm not sure if there is an "official" way of looking along axes, but to me, this is the wrong direction. To me, that's like saying that my left hand is actually my right one, because somebody who is looking at me sees it that way. However, i can add this little detail to the docs and we both should be happy...!?

Ok thanks a lot.
You might want to know there is a mathematical convention. ANYWAY
If everybody likes it that way its great
Love the engine, just wanted to help.
Thanks again