ebcj Posted January 22, 2014 Share Posted January 22, 2014 Hi everybody, I am new in Babylon. I needsomehelp as follows: I copied, from Babylon.js site, source for Physics demo (the one with a lot of red-white spheres). I copied also babylon.js, cannon.js and hand.js. I wite a main.js function : window.onload = function(){ var canvas = document.getElementById("canvas"); // Check support if (!BABYLON.Engine.isSupported()) { window.alert('Browser not supported'); } else { // Babylon var engine = new BABYLON.Engine(canvas, true); //Creating scene scene = CreatePhysicsScene(engine); scene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function () { scene.render(); }); // Resize window.addEventListener("resize", function () { engine.resize(); }); }};The html is like that : <html> <head> <title>First Babylon experience</title> <script src="js/hand.js"></script> <script src="js/cannon.js"></script> <script src="js/babylon.js"></script> <script type="text/javascript" src="js/main.js"></script> <script type="text/javascript" src="js/physicsscene.js"></script> <style type="text/css"> html,body,#canvas { width:100%; height:100%; padding:0; margin:0; overflow: hidden; } </style> </head> <body> <canvas id="canvas"></canvas> </body></html> Everything works, except for the fact that all spheres pass through the floor, they don't bump like in the demo. I checked the files and they are OK. May be I missed something but I don't know what. Thanx, Ebcj Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.