diff --git a/prototype/index.md b/prototype/index.md
index 060050b..b790815 100644
--- a/prototype/index.md
+++ b/prototype/index.md
@@ -26,6 +26,7 @@ button.
+
diff --git a/static/js/PointerCamera.js b/static/js/PointerCamera.js
index b4d699a..add4360 100644
--- a/static/js/PointerCamera.js
+++ b/static/js/PointerCamera.js
@@ -247,6 +247,16 @@ PointerCamera.prototype.log = function() {
console.log("(" + this.target.x + "," + this.target.y + ',' + this.target.z + ')');
}
+PointerCamera.prototype.save = function() {
+ this.backup = {};
+ this.backup.position = this.position.clone();
+ this.backup.target = this.target.clone();
+}
+
+PointerCamera.prototype.load = function() {
+ this.move(this.backup);
+}
+
// Static members
PointerCamera.DISTANCE_X = 1000;
PointerCamera.DISTANCE_Z = 300;
diff --git a/static/js/prototype/main.js b/static/js/prototype/main.js
index c63b73a..ffb0315 100644
--- a/static/js/prototype/main.js
+++ b/static/js/prototype/main.js
@@ -65,6 +65,10 @@ function init() {
showArrows = showarrows.checked;
}
+ document.getElementById('undo').onclick = function() {
+ cameras.mainCamera().load();
+ }
+
// on initialise le moteur de rendu
container = document.getElementById('container');
container.style.height = container_size.height() + 'px';
@@ -474,8 +478,10 @@ function updateMouse(event) {
function click(event) {
var newCamera = pointedCamera(event);
- if (newCamera !== undefined)
+ if (newCamera !== undefined) {
+ cameras.mainCamera().save();
cameras.mainCamera().move(newCamera);
+ }
}
function pointedCamera(event) {