0

I am using OrthographicTrackballControls along with an orthographic camera. I am loading geometry into the scene using STLLoader. The geometry loads fine, but when I begin zooming/rotating/panning, the geometry will randomly disappear from the scene. Is this a known issue with OrthographicTrackball controls? I don't seem to have this issue when using perspective camera and trackball controls...

My code:

camera = new THREE.OrthographicCamera(window.innerWidth/-zoomDefault, window.innerWidth/zoomDefault, window.innerHeight/zoomDefault, window.innerHeight/-zoomDefault, -200, 500);

renderer = new THREE.WebGLRenderer({alpha: true});

var loader = new THREE.STLLoader();
loader.load('file.php?model_id='+modelId+'', function ( geometry ) {

    var material = new THREE.MeshPhongMaterial( { color: 0xff5533, specular: 0x111111, shininess: 100 } );
    var mesh = new THREE.Mesh( geometry, material );

    mesh.position.set( 0, 0, 0 );
    mesh.rotation.set( 0, - Math.PI / 2, 0 );
    mesh.scale.set( 0.5, 0.5, 0.5 );

    // center the rotational pivot point on center of geometry
    mesh.translation = THREE.GeometryUtils.center(geometry);

    mesh.castShadow = true;
    mesh.receiveShadow = true;

    scene.add( mesh );

} );

controls = new THREE.OrthographicTrackballControls(camera, renderer.domElement);
controls.zoomSpeed = 0.1;
controls.dynamicDampingFactor = 0.5;
carpekd
  • 99
  • 9
  • Try reading [this answer](https://stackoverflow.com/questions/17558085/three-js-orthographic-camera/17567292#17567292) and update to the current three.js version. – WestLangley May 27 '17 at 19:53
  • I've updated to the latest version and made sure I'm calling the controls and camera correctly, but the 3d object will still randomly disappear once I start manipulating it with the mouse... – carpekd May 30 '17 at 19:57
  • Maybe someone will be able to help you if you show your updated code. – WestLangley May 30 '17 at 20:51

0 Answers0