Add reset button
This commit is contained in:
parent
dd97e1466b
commit
ec3ed413bf
@ -14,6 +14,7 @@ render();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function loadData(_callback) {
|
||||
// Load Data (hopefully) before the rest of the place loads.
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
@ -31,6 +32,12 @@ function loadData(_callback) {
|
||||
|
||||
}
|
||||
|
||||
function reset_view() {
|
||||
camera.position.set(-9300,50,550);
|
||||
controls.target.x = jsonEmpire['UFP'].cenx;
|
||||
controls.target.y = jsonEmpire['UFP'].ceny;
|
||||
controls.target.z = jsonEmpire['UFP'].cenz;
|
||||
}
|
||||
|
||||
function init() {
|
||||
scene = new THREE.Scene();
|
||||
|
@ -9,10 +9,13 @@
|
||||
<style type="text/css">
|
||||
body { margin: 0; }
|
||||
canvas { width: 100%; height: 100% }
|
||||
#reset-button { position: absolute; top:0; left:90%; background-color:#AAA; width: 50px; height:25px; color:#FFF; font-weight: bold; text-align:center;}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<div id="reset-button" onClick="reset_view();"> Reset </div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user