index.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Babylon.js sample code</title>
  6. <!-- Babylon.js -->
  7. <script src="http://www.babylonjs.com/hand.minified-1.2.js"></script>
  8. <script src="http://www.babylonjs.com/cannon.js"></script>
  9. <script src="http://www.babylonjs.com/oimo.js"></script>
  10. <script src="http://www.babylonjs.com/babylon.js"></script>
  11. <style>
  12. html, body {
  13. overflow: hidden;
  14. width: 100%;
  15. height: 100%;
  16. margin: 0;
  17. padding: 0;
  18. }
  19. #renderCanvas {
  20. width: 100%;
  21. height: 100%;
  22. touch-action: none;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <canvas id="renderCanvas"></canvas>
  28. <script>
  29. var canvas = document.getElementById("renderCanvas");
  30. var engine = new BABYLON.Engine(canvas, true);
  31. ####INJECT####
  32. engine.runRenderLoop(function () {
  33. scene.render();
  34. });
  35. // Resize
  36. window.addEventListener("resize", function () {
  37. engine.resize();
  38. });
  39. </script>
  40. </body>
  41. </html>