Browse files

Changed matrices to be transposed (opposite of collada)

Updated to the newest scenejs in the repo
  • Loading branch information...
1 parent 5bbbd17 commit 552bee3065968c474ba833fe67effa632417b03c @rehno-lindeque rehno-lindeque committed Apr 8, 2011
Showing with 3,698 additions and 2,732 deletions.
  1. +1 −1 test/lines.js
  2. +1 −1 test/linespointsfaces.js
  3. +1 −1 test/quadtexlit.js
  4. +3,693 −2,727 test/scenejs.js
  5. +2 −2 translator.py
View
2 test/lines.js
@@ -72,7 +72,7 @@ SceneJS.createNode({
constantAttenuation: 1.0,
},
],
- elements: [-0.290864348412,-0.771100878716,0.566393256187,4.07624483109,0.955171227455,-0.199883148074,0.218391031027,1.00545394421,-0.055189050734,0.604524731636,0.794672250748,5.90386199951,0.0,0.0,0.0,1.0,],
+ elements: [-0.290864348412,0.955171227455,-0.055189050734,0.0,-0.771100878716,-0.199883148074,0.604524731636,0.0,0.566393256187,0.218391031027,0.794672250748,0.0,4.07624483109,1.00545394421,5.90386199951,1.0,],
type: 'matrix',
},
{
View
2 test/linespointsfaces.js
@@ -87,7 +87,7 @@ SceneJS.createNode({
constantAttenuation: 1.0,
},
],
- elements: [-0.290864348412,-0.771100878716,0.566393256187,4.07624483109,0.955171227455,-0.199883148074,0.218391031027,1.00545394421,-0.055189050734,0.604524731636,0.794672250748,5.90386199951,0.0,0.0,0.0,1.0,],
+ elements: [-0.290864348412,0.955171227455,-0.055189050734,0.0,-0.771100878716,-0.199883148074,0.604524731636,0.0,0.566393256187,0.218391031027,0.794672250748,0.0,4.07624483109,1.00545394421,5.90386199951,1.0,],
type: 'matrix',
},
{
View
2 test/quadtexlit.js
@@ -81,7 +81,7 @@ SceneJS.createNode({
constantAttenuation: 1.0,
},
],
- elements: [1.0,0.0,0.0,4.19914579391,0.0,1.0,0.0,-0.827423512936,0.0,0.0,1.0,3.74212694168,0.0,0.0,0.0,1.0,],
+ elements: [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,4.19914579391,-0.827423512936,3.74212694168,1.0,],
type: 'matrix',
},
{
View
6,420 test/scenejs.js
3,693 additions, 2,727 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
4 translator.py
@@ -323,8 +323,9 @@ def _translate_scene_nodes(nodes):
jschild_nodes = _translate_scene_nodes(node.nodes)
# Don't append the transform node unless it has children (isolated transform nodes are redundant)
if jschild_nodes:
+ # Matrices from COLLADA are transposed
+ elems = [float(element) for row in node.matrix.transpose() for element in row]
# Light nodes should always be placed first in the list (because they are activated in order)
- elems = [float(element) for row in node.matrix for element in row]
if contains_light_nodes(jschild_nodes):
jsnodes.insert(0, {
'type': 'matrix',
@@ -452,6 +453,5 @@ def translate_scene(scene):
'clearColor': { 'r': 0.4, 'g': 0.4, 'b': 0.4 },
'nodes': [ jscamera ]
}]
-
}

0 comments on commit 552bee3

Please sign in to comment.