Jump to content

Mesh importing issues


Seyren
 Share

Recommended Posts

I know this is probably solved over a thousand times but i can't manage to get it working, i searched everywhere but i didn't manage to get it working.

 

I'm trying to use the BABYLON.SceneLoader.Load, but it doesn't seem to find the babylon file, the stuff is positioned the following way:

 

fc5041ca02.png

4f2dd58241.png

 

(Please omit the main and scene js, they are not being used, they are to test the index.html from the tutorials and it all works fine.).

 

And yes, i did copied the test.babylon in both places in the folder from the outside and the inside  in case i was not getting it, but none of them worked.

 

This is the Babylon.html i'm using:

<!DOCTYPE html><!-- saved from url=(0023)http://localhost:45478/ --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">    <title>Babylon.js</title>    <script src="../hand.js"></script>    <script src="../babylon.js"></script>    <style type="text/css">        html, body, div, canvas {            width: 100%;            height: 100%;            padding: 0;            margin: 0;            overflow: hidden;        }        #waitLabel {            position: absolute;            width: 100%;            height: 100%;            font-size: 40px;            text-align: center;            top: 50%;            margin-top: -20px;            font-family: Arial;            font-weight: bold;        }    </style></head><body>    <canvas id="canvas" width="1366" height="600"></canvas>    <div id="waitLabel" style="display: none;">loading....please wait</div>    <script type="text/javascript">        var canvas = document.getElementById('canvas');        var engine = new BABYLON.Engine(canvas, true);        BABYLON.SceneLoader.Load('', 'test.babylon', engine, function (newScene) {            newScene.executeWhenReady(function () {                newScene.activeCamera.attachControl(canvas);                engine.runRenderLoop(function() {                    newScene.render();                });                window.addEventListener('resize', function () {                    engine.resize();                });                document.getElementById('waitLabel').style.display = 'none';            });        });    </script></body></html>

I got it from the 3DS max exporter and the babylon works fine:

 

2b2c8dd0ff.png

 

So i saved that html that the script created and tried to put it here in hopes of getting working any babylon i would like to load or combining more than one, but i can't manage to get it working.

 

This is probably a noob issue but this is what is killing me and i can't manage to fix it.

 

What do i lack?

 

Thanks in advance

Link to comment
Share on other sites

Your problem is here: (line 5 and 6)
 
<script src="../hand.js"></script>
<script src="../babylon.js"></script>
 
You search engine babylon in the parent folder or it is a root, this would be rather:

<script src="hand.js"></script>
<script src="babylon.js"></script>
 
You can remove   width="1366" height="600" Your css is your canvas 100%
<canvas id="canvas" width="1366" height="600"></canvas>

 

You also need to load a scene before creating a new one with SceneLoader.Load :

 

scene = new BABYLON.Scene(engine);

BABYLON.SceneLoader.Load('', 'test.babylon', engine, function (newScene) {

...

...

});

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...