BabylonJS - spaces
by kolar
HTML
<script src="https://dl.dropboxusercontent.com/u/12395133/babylon.1.11.js"></script>
<div id="rootDiv">
<canvas id="canvas"></canvas>
</div>
CSS
html, body, div, canvas {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
#log {
position:fixed;
color:#555;
font-size:11px;
font-family:courier;
width:180px;
height:300px;
}
JavaScript
var canvas = document.getElementById("canvas");
var engine = new BABYLON.Engine(canvas, false);
var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.ArcRotateCamera("Camera", 1, 0.8, 10, new BABYLON.Vector3(0, 0, 0), scene);
camera.setPosition(new BABYLON.Vector3(0, 5, -5));
var light0 = new BABYLON.HemisphericLight("Omni", new BABYLON.Vector3(0, 0, 10), scene);
scene.activeCamera.attachControl(canvas);
engine.runRenderLoop(function () {
scene.render();
});
BABYLON.SceneLoader.ImportMesh(null, "https://dl.dropboxusercontent.com/u/12395133/", "bieber.babylon", scene, function (newMeshes, particleSystems, skeletons) {
var chlop = newMeshes[0];
scene.beginAnimation(skeletons[0], 1, 11, true, 1.0);
chlop.position.x = -1;
});
BABYLON.SceneLoader.ImportMesh(null, "https://dl.dropboxusercontent.com/u/12395133/", "bieber.babylon", scene, function (newMeshes, particleSystems, skeletons) {
var chlop = newMeshes[0];
scene.beginAnimation(skeletons[0], 11, 30, true, 1.0);
});
BABYLON.SceneLoader.ImportMesh(null, "https://dl.dropboxusercontent.com/u/12395133/", "bieber.babylon", scene, function (newMeshes, particleSystems, skeletons) {
var chlop = newMeshes[0];
scene.beginAnimation(skeletons[0], 1, 11, true, 1.0);
scene.beginAnimation(skeletons[0], 11, 30, true, 1.0);
chlop.position.x = 1;
});