kewur / assimp-net

Automatically exported from code.google.com/p/assimp-net
0 stars 0 forks source link

Degrees to Radians conversion is incorrect #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in AssImpContext.BuildMatrix the following code is incorrect:

Matrix4x4 xRot = Matrix4x4.FromRotationX(m_xAxisRotation * (float) (180.0d / 
Math.PI));
Matrix4x4 yRot = Matrix4x4.FromRotationY(m_yAxisRotation * (float) (180.0d / 
Math.PI));
Matrix4x4 zRot = Matrix4x4.FromRotationZ(m_zAxisRotation * (float) (180.0d / 
Math.PI));

multiplying by 180/pi is the conversion from radians to degrees but in this 
case its supposed to be converting from degrees to radians.

See
http://en.wikipedia.org/wiki/Radian#Conversion_between_radians_and_degrees

So the * needs to be changed to / or the fraction needs to be inverted to pi/180

This only affects anyone actually setting the build time transformations 
otherwise everything is 0 and there is no difference.

Original issue reported on code.google.com by z...@thezbuffer.com on 19 Nov 2014 at 12:26

GoogleCodeExporter commented 8 years ago
Corrected conversion. Can't believe I missed that ;)

Original comment by nicholas.woodfield on 19 Nov 2014 at 4:50