Jump to content

Cannot Show Babylon Scene


wind
 Share

Recommended Posts

I follow a Microsoft tutorial to show a scene that I exported from 3ds Max. The tutorial link is:

https://blogs.msdn.microsoft.com/eternalcoding/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender/

The Babylon scene can be seen on the Sandbox, but not offline. Here is my page code:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Using babylon.js - How to load a scene</title>
    <script src="babylon.js"></script>
    <script src="hand.js"></script>
    <script src="cannon.js"></script>  <!-- optional physics engine -->
    <script src="oimo.js"></script>
    <style>
        html, body {
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;
            overflow: hidden;
        }

        #renderCanvas {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <canvas id="renderCanvas"></canvas>
    
<script>
    if (BABYLON.Engine.isSupported()) {
        var canvas = document.getElementById("renderCanvas");
        var engine = new BABYLON.Engine(canvas, true);

        BABYLON.SceneLoader.Load("", "TestExportFrom3dsMax.babylon", engine, function (newScene) {
            // Wait for textures and shaders to be ready
            newScene.executeWhenReady(function () {
                // Attach camera to canvas inputs
                newScene.activeCamera.attachControl(canvas);

                // Once the scene is loaded, just register a render loop to render it
                engine.runRenderLoop(function() {
                    newScene.render();
                });
            });
        }, function (progress) {
            // To do: give progress feedback to user
        });
    }
</script>
 </body>
</html>

How to show the Babylon scene on web browser offline?

Link to comment
Share on other sites

Hi Wind, Hi Deltakosh.

Yeah, when "they" changed the XmlHttpRequest (XHR) object in browsers worldwide, they took away some of our fun, didn't they?  Them danged "theys"... I never really liked those people.  :)

Some hacker used XHR to sneak past some barrier, and then suddenly, XHR lost much of its power.  hrmph!

Who can we complain-to?  The W3C?  Rumor has it... the changes are for OUR protection... but I want to see proof.  heh.

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...