Hi, I am using the following app.json code for my app.
var loader = new THREE.FileLoader();
loader.load( 'app.json', function ( text ) {
var player = new APP.Player();
player.load( JSON.parse( text ) );
player.setSize( window.innerWidth, window.innerHeight );
player.play();
document.body.appendChild( player.dom );
window.addEventListener( 'resize', function () {
player.setSize( window.innerWidth, window.innerHeight );
} );
} );
This was generated by Three.js after I exported my model to GLTF.
How do I get to Zoom, Pan, Tilt my model in the browser. I have been looking and reading everything and nowhere have I found a way.
Can you point me in the right direction?
Open app.js and add the following line under: this.setCamera( loader.parse( json.camera ) );.
var controls = new THREE.OrbitControls( camera, renderer.domElement );
I don’t know if there is a way to apply OrbitControls directly in the editor. In general it would be better if users don’t need to modify the exported source files.
Unfortunately not. I think it’s best when you study the examples and the related code in the library.
You basically define a path with a curve or a sequence of curves. Then you sample this path in order to get new position values for your camera. By using camera.lookAt() you can ensure that the camera always looks to the model.