Scroll mouse in obj example

camera-controls

#1

Hi! I manage to to mofify the obj example (https://threejs.org/examples/#webgl_loader_obj) with another object (house), but would like to add a function so that with the wheel of the mouse the camera moves back/forward. How can I do that?


#2

One solution: You could add an instance of THREE.OrbitControls like this.

<script src="js/controls/OrbitControls.js"></script>
// in your code
var controls = new THREE.OrbitControls( camera, renderer.domElement );

Full example: https://threejs.org/examples/webgl_decals.html


#3

Thank you - that did the trick!