Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

degrees/radians conversion #1

Open
hero101111 opened this issue Apr 6, 2011 · 1 comment
Open

degrees/radians conversion #1

hero101111 opened this issue Apr 6, 2011 · 1 comment

Comments

@hero101111
Copy link

Hi,

I've noticed that the Matrix3D class (jiglib/maths/matrix3d.js) possibly has a bug in the appendRotation() and angleAxis() functions. The conversion from degrees to angles is done with angle=angle/(pi_2), whereas it should be angle=angle_pi/180 (or angle_2_pi/360). I am also wondering why in the appendRotation() function you negate the axis of rotation (Vector3DUtil.negate(axis)).
If, for example, I set the rotation angles [10, 20, 30] of an object and I apply inverse transformations to the orientation matrix I get the rotation angles [350, 340, 330](with degrees/radians conversion fixed). If I comment the axis negation part I get the right values ([10, 20, 30]).

Regards,
Gabriel

@supereggbert
Copy link
Owner

Good spots, I'm not sure why it's that way I'll do some investigation not sure where the code came from initially. Although, the conversion one would certainly explain some funky behaviour I've seen. I know many of the functions in the maths part aren't used by jiglib which maybe how they've gone unnoticed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants