0
votes

When I export a scene from Blender via three.js json exporter and load it into my project the objects are flipped/rotated.

I have tried:

  • to use master, dev branch
  • different combinations in json exporter
  • to create a clean blender file and add some basic objects, had the same issue

Example:

Blander

Blender example

Three.js

Three.js example

Code for loading json object

var loader = new THREE.ObjectLoader();
loader.load('model/cam.json', addModelCam);

function addModelCam(object){
    scene.add(object);
}

Here are my export settings:

threejs json export settings

1

1 Answers

0
votes

Managed to fix it by setting rotation Z to 0 on all imported objects.

var loader = new THREE.ObjectLoader();
loader.load('model/cam.json', addModelCam);

function addModelCam(object){

    object.traverse(function(child){
        if( child.type == 'Mesh' ){
            child.rotation.z = 0;
        }
    });

    scene.add(object);
}