Added reset button
This commit is contained in:
@@ -5,13 +5,17 @@
|
||||
camera with the arrow keys of your keyboard, and change the
|
||||
angle of the camera by dragging and dropping the scene around
|
||||
it (you can also use your numpad, 2 to look lower, 8 to look
|
||||
higher, 4 to look on the left and 6 to look on the right).
|
||||
higher, 4 to look on the left and 6 to look on the right, but
|
||||
if you're more comfortable with non-numpad keys, you can also
|
||||
use i for up, j for left, k for down, and l for right).
|
||||
</p>
|
||||
<p>
|
||||
Recommended views are displayed with a transparent red screen.
|
||||
By clicking on this screen, your camera will move to the
|
||||
recommended viewpoint.
|
||||
Recommended views are displayed with a transparent red arrow.
|
||||
They disappear when you come closer to them, and you can
|
||||
automatically move to them by clicking on them. You can reset
|
||||
the camera at anytime by clicking on the reset button.
|
||||
</p>
|
||||
<button id="reset" style="margin-bottom:10px">Reset camera</button>
|
||||
<div style="border-width:1px; border-style: solid;" id="container"></div>
|
||||
#
|
||||
</section>
|
||||
|
||||
6
prototype/js/main.js
vendored
6
prototype/js/main.js
vendored
@@ -16,6 +16,9 @@ init();
|
||||
animate();
|
||||
|
||||
function init() {
|
||||
// Add the listener on the button
|
||||
document.getElementById('reset').onclick = function() { cameras.mainCamera().reset(); };
|
||||
|
||||
// on initialise le moteur de rendu
|
||||
container = document.getElementById('container');
|
||||
container.style.height = container_size.height + 'px';
|
||||
@@ -51,8 +54,7 @@ function init() {
|
||||
// on initialise la camera que l’on place ensuite sur la scène
|
||||
var camera1 = new PointerCamera(50, container_size.width / container_size.height, 0.01, 100000, container);
|
||||
camera1.speed = 0.001;
|
||||
camera1.position = new THREE.Vector3(0,2,0);
|
||||
camera1.phi = -0.1;
|
||||
camera1.reset();
|
||||
scene.add(camera1);
|
||||
cameras.push(camera1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user