Enable mouse rotate, pan, and zoom with TrackballControls

This commit is contained in:
Glen Whitney 2019-12-12 14:04:11 -05:00
parent c7f2feab1f
commit 9c2038e3c9
2 changed files with 28 additions and 7 deletions

View file

@ -3,7 +3,9 @@
When you load dyna3, you should initially see a three-dimensional coordinate system with labeled axes.
```javascript
import {threeLoaded, three as J3} from './externals.js'
import {threeLoaded,
three as J3,
TrackballControls as J3x} from './externals.js'
LTx = { dashed: true, plain: false }
@ -48,7 +50,11 @@ When you load dyna3, you should initially see a three-dimensional coordinate sys
camera = new J3.PerspectiveCamera 75, rwd/rht, 0.1, 1000
camera.position.z = 5
renderer.render scene, camera
controls = new J3x.TrackballControls camera, renderer.domElement
renderer.setAnimationLoop ->
controls.update()
renderer.render scene,camera
threeLoaded.then main
```