Search the Community
Showing results for tags 'stl babylon import load sceneload file.stl'.
-
Hello! For start, sorry for my English, I'm a french developer.I am a newbie on this forum, and I come to an issue with the displaying of a file. stl. so, my web page html/javascript is served by an express (nodejs) server.All is running good with another html page for import file. obj.for file.stl, without success... i push the stl file in join's file, he's named bane-test.stl this is my code for loading stl file in web browser, some help is welcome <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Babylon.js sample code</title> <!-- Babylon.js --> <!-- Latest compiled and minified CSS --> <script src="http://cdn.babylonjs.com/2-5/babylon.js"></script> <script src="http://cdn.babylonjs.com/2-5/babylon.max.js"></script> <script src="http://cdn.babylonjs.com/2-5/babylon.noworker.js"></script> <script src="http://cdn.babylonjs.com/2-5/babylon.core.js"></script> <script src="babylon.stlFileLoader.js"></script> </head> <body> <body> <canvas id="renderCanvas"></canvas> <script> var canvas = document.getElementById('renderCanvas'); // load the 3D engine var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "bane-test.stl", engine, function (newScene) { var scene = new BABYLON.Scene(engine); // Create Light new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); // Create cam var cam = new BABYLON.ArcRotateCamera("ArcRotateCamera", 1, 0.8, 15, new BABYLON.Vector3(0, 3, 0), scene); cam.attachControl(canvas); scene.clearColor = new BABYLON.Color4(0, 0, 0, 0); newScene.activeCamera.attachControl(canvas, false); engine.runRenderLoop(function () { newScene.render(); }); }); /* var loader = BABYLON.SceneLoader.Load("/", "bane-test.stl", engine, function (scene) { console.log("passe here "); }); */ </script> </body> </html> </body> </html> Thanks a lot for your help. bane-test.stl