function runCode(app) {
// add your code here, e.g. console.log('Hello, World!');
var isFP = false;
var prevControls = app.controls; //save OrbitControls with all parameters
$("#change_control").click( function() {
console.log("controls changed");
if (isFP) {
app.controls = prevControls;
app.controls.enabled = true; //enable OrbitControls
}
else {
app.controls.enabled = false; //disable OrbitControls
app.controls = new v3d.FirstPersonControls(app.camera, app.renderer.domElement);
//app.controls.zoomSpeed = 0; //disable wheel zoom
}
isFP = !isFP;
})
}
When I click it once and switch to FirstPerson, the mouse wheel does not zoom correctly
that’s because Orbit and FirstPerson controls were both active )))
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.