cedricpinson/osgexport — Issue #8: Matrix transform is exported incorrectly
Author: rhodesg
Created: 2012-02-26 05:13:01+00:00
State: open

I have tested with osgexport 0.9.0 and 0.10.0 for Blender 2.5+. For even very simple files the Matrix element of a MatrixTransform node is transposed, producing very incorrect results. This does not appear if an object is built in world space and therefore has an identity transform. I have a sample blender file that demonstrates the problem. If I can find a way to attach the file to the project, I will do so; however, in case I cannot, here is a snippet. First, the exported *.osg file has a MatrixTransform that looks like this:

MatrixTransform {
UniqueID uniqid_MatrixTransform_928
name "Cylinder"
cullingActive TRUE
Matrix {
0.4532 -0.0000 0.0528 1.0000
0.2113 0.0000 -0.1133 -0.3000
0.0000 0.5000 0.0000 0.5000
0.0000 0.0000 0.0000 1.0000
}
num_children 1
...
Geode...
}

The Matrix is the TRANSPOSE of what OpenSceneGraph expects. The CORRECT MatrixTransform for OpenSceneGraph is this:

MatrixTransform {
UniqueID uniqid_MatrixTransform_928
name "Cylinder"
cullingActive TRUE
Matrix {
0.4532 0.2113 0.0000 0.0000
0.0000 0.0000 0.5000 0.0000
0.0528 -0.1133 0.0000 0.0000
1.0000 -0.3000 0.5000 1.0000
}
num_children 1
...
Geode...
}