Closed nicrf closed 5 years ago
Hi,
I don't know why, but the normal calculation seen not working with me?
Also, can we get a tree of Group class? One of my problem is VRML can be use tree hierarchy, but when I parse it, they don't are present in group.
function parseNode(data,parent,model) { console.log("Parse an node " + data.node); if (data.name) { console.log("Parse an node " + data.name); } var object = parent; switch(data.node) { case 'Transform' : case 'Group' : object = new xeogl.Group(); //... } if (data.children) { for ( var i = 0, l = data.children.length; i < l; i ++ ) { parseNode( data.children[ i ], object,model ); } }
Hi,
I try to build an VRML parser for xeogl from Threejs & bartmcleod is Vrml parser. I stock on IndexedFaceSet , here is my trie (full source) : ` if (data.node === 'IndexedFaceSet') { var normals = data.normalIndex; var colors = data.colorIndex; var positions = []; var indices; for (var i = 0; i < data.coord.point.length; i ++ ) { positions.push(data.coord.point[i].x,data.coord.point[i].y,data.coord.point[i].z); } if (data.ccw === undefined ) data.ccw = true; indices = data.coordIndex.toString().split(",");
if (data.coordIndex) {
indices = data.coordIndex.toString().split(",");
} else { indices = new Int32Array(positions.length / 3); for (var ni = 0, len = indices.length; ni < len; ni++) { indices[ni] = ni; } }
} ` Can you help me with that?
I got :![image](https://user-images.githubusercontent.com/29955546/52924298-2f66f480-32fa-11e9-8c00-a0cbd17f8935.png)
versus :![image](https://user-images.githubusercontent.com/29955546/52924323-4a396900-32fa-11e9-87b2-1c28a57bbef4.png)