-
Notifications
You must be signed in to change notification settings - Fork 4
Matrix and vector
As we don't have float, all math are done in integer. There is different interpreation of these integer values through the library. For matrix and vector, the range [-1.0,1.0] in float is represent by the range [-64,64]. That mean that 64x64=64 or 32x32=16. For model conversion however, the scaling from a blender model is 1.0=256. This is mainly because blender model are usually smaller (and it is more practical to work with a smaller model by the way). Matrix are row major.
Those matrix hold information about a transformation in the model space. It is composed by a 3x3 matrix and a 3x1 vector. The 3x3 matrix is a classical rotation matrix. 3x1 vector is a translation vector, formed by three 16 bits integer. This translation exist in the model space, so it should have the same 256 factor as discuted above. Beware of overflow of the 16bits though.
This matrix hold the transformation between model space to world space. It has the usual 3x3 rotation matrix. The translation part is however composed of 3 24bits integer which should have a x64 factor applied over the 'model space' value. For this matrix, a 256 units translation in model space should effectively be a 16384 translation.