lkang2 / glmatrix

Automatically exported from code.google.com/p/glmatrix
0 stars 0 forks source link

quat4.toMat4 and quat4.toMat3 are wrong #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. var quat = quat4.create( [ 0, 0, Math.sin( Math.PI / 4 ), Math.cos( Math.PI 
/ 4 ) ] )
2. var mat1 = quat4.toMat3( quat );
3. var mat2 = mat3.toMat4( mat1 );
4. var vector1 = quat4.multiplyVec3( quat, [ 1, 0, 0 ] );
5. var vector2 = mat4.multiplyVec3( mat1, [ 1, 0, 0 ] );
6. var vector3 = mat4.multiplyVec3( mat2, [ 1, 0, 0 ] );

What is the expected output? What do you see instead?
All vectors should be [ 0, 1, 0 ]. vector1 is correct but vector2 and vector3 
are [ 0, -1, 0 ].

What version of the product are you using? On what operating system?
Tested with glMatrix 0.9.5 (1.0 RC2) in Google Chrome 14.0.835.94 beta.

Please provide any additional information below.
The two defected function produce the transposed matrix of the expected result. 
I'm attaching the patch to fix the problem.

Original issue reported on code.google.com by petros...@gmail.com on 19 Aug 2011 at 5:10

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by Tojiro@gmail.com on 6 Oct 2011 at 11:57

GoogleCodeExporter commented 8 years ago
Issue 59 has been merged into this issue.

Original comment by Tojiro@gmail.com on 6 Oct 2011 at 11:57

GoogleCodeExporter commented 8 years ago

Original comment by Tojiro@gmail.com on 7 Oct 2011 at 6:54