chicagobob123 Posted January 5, 2018 Share Posted January 5, 2018 I am loading a scene exported from 3DS and it will load in the http://sandbox.babylonjs.com/ But in code it fails on this line as parsedData.cameras is undefined. for (index = 0, cache = parsedData.cameras.length; index < cache; index++) Is this because there are no cameras in the Babylon scene file and if so should that matter because I created a camera for the scene Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 5, 2018 Share Posted January 5, 2018 If it works in Sandbox it should work in your code. Can you share your code? Also please make sure that you are not getting a 404 Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted January 5, 2018 Author Share Posted January 5, 2018 I probably screwed up. (More background) At first was getting a 404 for a .manifest file. I created the a file and named it .manifest <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Measurement</title> <style> html, body { height: 100%; width: 100%; padding: 0; margin: 0; overflow: hidden; position: fixed; } #renderCanvas { width: 100%; height: 100%; margin: 0; padding: 0; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <div id="MessageDisplay" style="position: absolute; top: 50px; left: 200px; background-color: black; opacity: 0.8; color:white; touch-action:none;"></div> <script src="babylon.max.js"></script> <script> var sps; var Tail=1; var nb = 50000; // particle number function writeToScreen(message) { var pre=document.getElementById("MessageDisplay"); pre.style.wordWrap="break-word"; pre.innerHTML=message; } window.addEventListener('DOMContentLoaded',function() { var canvas = document.getElementById('renderCanvas'); var engine=new BABYLON.Engine(canvas,true); sleepFor=function(sleepDuration) { var now = new Date().getTime(); while(new Date().getTime()<now+sleepDuration) { /* do nothing */ } } var createScene=function() { BABYLON.Engine.enableOfflineSupport = false; var scene = new BABYLON.Scene(engine); var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 100), scene); var camera = new BABYLON.ArcRotateCamera("camera1", 0, 0, 0, new BABYLON.Vector3(0, 0, -0), scene); camera.setPosition(new BABYLON.Vector3(0, 0, -150)); BABYLON.SceneLoader.Append("models/", "YardTile001.babylon", scene); scene.registerBeforeRender(function() { light.position = camera.position; }); // the canvas/window resize event handler window.addEventListener('resize', function(){ engine.resize(); }); return scene; } // call the createScene function var scene=createScene(); function onMessage(evt) { } scene.executeWhenReady(function () { // Attach camera to canvas inputs scene.activeCamera.attachControl(canvas); // Once the scene is loaded, register a render loop engine.runRenderLoop(function() { scene.render(); }); }); }); </script> </body> </html> Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 5, 2018 Share Posted January 5, 2018 Should work..Do you mind saving it on a running server to see the error live? Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted January 5, 2018 Author Share Posted January 5, 2018 I would if you can tell me what that means. I tried to attach it here but its too big. Its ~11MB Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted January 5, 2018 Author Share Posted January 5, 2018 NEVER MIND it was my browser cache. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 5, 2018 Share Posted January 5, 2018 Oh lol..At least it is fixed ;D 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.