1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <html>
- <head>
- <meta charset="UTF-8">
- <title>mesh_parent</title>
- <!-- edit path - name of babylon library as required -->
- <script src="./lib/babylon.js"></script>
- <script src="./TOB-out/mesh_parent.js"></script>
- <script src="./lib/mesh_parent_common.js"></script>
- <style>
- html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; }
- #renderCanvas{ width: 100%; height: 100%; }
- #button {
- color: white; background-color: Dimgray;
- font-size: 14pt; font-weight: bold;
- padding-left:4pt; padding-right:4pt;
-
- border: black outset 2pt; line-height: 2em;
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div id="buttonbar" style="background-color: Darkorange;">
- <span id="button" onclick="pausePlay()"> Pause - Play </span>
- <span id="button" onclick="orphanConceive()"> Orhpan - Conceive </span>
- </div>
- <canvas id="renderCanvas"></canvas>
- <script>
- if (BABYLON.Engine.isSupported()) {
- var canvas = document.getElementById("renderCanvas");
- var engine = new BABYLON.Engine(canvas, true);
- console.log("Babylon version: " + BABYLON.Engine.Version);
- var scene = new BABYLON.Scene(engine);
- materialsRootDir = "./TOB-out"; // edit when texture files in a different dir than html
- mesh_parent.initScene(scene, materialsRootDir);
- scene.activeCamera.attachControl(canvas);
-
- engine.runRenderLoop(function () {
- animate(scene);
- scene.render();
- });
- }else{
- alert("WebGL not supported in this browser.\n\n" +
- "If in Safari browser, check 'Show Develop menu in menu bar' on the Advanced tab of Preferences. " +
- "On the 'Develop' menu, check the 'Enable WebGL' menu item.");
- }
- //Resize
- window.addEventListener("resize", function () {
- engine.resize();
- });
-
- </script>
- </body>
- </html>
|