Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
175
rated 0 times [  180] [ 5]  / answers: 1 / hits: 18442  / 11 Years ago, tue, november 12, 2013, 12:00:00

I am trying to have some camera control in a threejs scene.



I looked at this example and it seems that it is completely handled with those lines :



controls = new THREE.TrackballControls( camera );
controls.rotateSpeed = 1.0;
controls.zoomSpeed = 1.2;
controls.panSpeed = 0.8;
controls.noZoom = false;
controls.noPan = false;
controls.staticMoving = true;
controls.dynamicDampingFactor = 0.3;


Those lines use THREE.TrackballControls which comes from js/controls/TrackballControls.js



My question is : what exactly is TrackballControls.js? I cannot find it in the threejs download bundle. Is it an extension? Where can I find it? (Apart from taking it directly from the example's file)


More From » three.js

 Answers
21

TrackballControls.js is in the jsm/controls sub-directory of the examples directory.


https://github.com/mrdoob/three.js/tree/master/examples/jsm/controls


It is part of the examples -- not the library. You must include it explicitly in your project. You are free to modify it to your liking.


You may also want to consider OrbitControls, which is appropriate if your scene has a natural "up" direction.


three.js r.147


[#74337] Monday, November 11, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jocelyntrishar

Total Points: 48
Total Questions: 96
Total Answers: 83

Location: South Sudan
Member since Sun, Jul 11, 2021
3 Years ago
;