问题
weird issues with 3d max 2013 obj to three.js 59 rev, in my 3d max scene i have 5 objects , cubes ...Then when i import into three.js scene i now only have 3 cubes. also there pivot point shares to the middle of all objects:
var loader = new THREE.OBJMTLLoader();
loader.load( 'models/cubes.obj') ;
loader.addEventListener( 'load', function ( event ) {
object = event.content;
for(k in object.children){
group.add(object.children[k]); // console said there 5 objects
}
});
scene.add(group);
Any idea?
If i was to :
group.add(object); // i will see my five cubes or
scene.add(object) //but then i cant access the children at all
Its very strange.
回答1:
The first issue is:
var loader = new THREE.OBJMTLLoader(); //should be using OBJLoader
The other issue was the pivot point, from what i have read up around the net that the obj format has a known issue with its pivot, centre of object varies depending on the parent. for example:
If you have three meshes cubes equal as each other, spaced out however. The pivot point of each object is not its center of its self but the centre of all the objects together.
After putting each object in its own 3d Container, this still does not solve the issue.
来源:https://stackoverflow.com/questions/20547365/three-js-not-displaying-all-meshes