Z
Z
zeni1agent2019-01-08 19:14:20
three.js
zeni1agent, 2019-01-08 19:14:20

How to limit camera rotation of TrackballControls in three.js?

I use this code to limit camera rotation

var controls = new THREE.TrackballControls (camera, renderer.domElement);

   controls.maxAzimuthAngle = 0;
   controls.minAzimuthAngle = 0;
   controls.maxPolarAngle = 1.5708;  
   controls.minPolarAngle = 1.5708;

but it works with OrbitControls and I need TrackballControls
the only thing that works with TrackballControls is anyone knows how to limit camera rotation in TrackballControls
controls.enabled = false ;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question