nomadic_aviator

Members
  • Content Count

    17
  • Joined

  • Last visited

About nomadic_aviator

  • Rank
    Member

Contact Methods

  • Twitter
    @CosmiqCloud

Recent Profile Visitors

536 profile views
  1. Hello, I have another question about the real estate project I am working on. I am using Node.js as the server for this project. It is fairly straightforward and I have gotten the application to work except for one part. When i look at the console, it appears that the app wont get the .babylon file I am importing into my scene. I am not sure how to solve this but I have uploaded this project on Github if you would like to take a look: https://github.com/nomadicvince/WebGL-and-Node I have found an Babylon.js npm, but I don't see any tutorials on how to use it in the app. Is my approach to this wrong?
  2. iiceman, that was my theory too. It doesn't get added until I upload it to my server, which is a real problem. I am going to talk to the admin of this server space and figure out why that gets added. I have been meaning to look at another option for server space anyway. Which leads me to my last question, maybe this has been asked before, but is there a thread that explains how to use Babylon with Node.js? I am sure I will find it in a search, but I figured I'd ask just in case there are resources elsewhere for that. Thank you.
  3. dad72. The realestate.babylon file is what I exported from Blender using the Babylon exporter. Not sure why it would be a three.js file if I used that exporter. I'll export it once more and see if I get that error still. Deltakosh. Thank you.
  4. I think I have sort of figured this out. I have another version of this scene built with Three.js. The JSON file that loads seems to work fine. That link is here: http://www.cosmiqcloud.com/webgl/three/ With this scene, I believe that my server doesn't recognize the .babylon file as JSON. I believe this because it keeps adding JavaScript at the end of the .babylon file that causes the error. At least that is my theory anyway. Problem is, I am not sure how to fix that. I may have to just have a chat with the administrator. So I have one more question. Once, I import a scene, is there a way to add materials to each individual mesh, or do I need to place the materials on them before they are imported?
  5. Here is the link to the site on the live server. http://www.cosmiqcloud.com/webgl/ Is there a way I can prevent this site from adding this code?
  6. I am using Apache. I am also not the admin for my server. I am using a webhosting company. I have used Babylon on this server before. this is the first time I am seeing this error. I noticed that the server seems to add code to the end of the .babylon file. I think that is where the error is coming from.
  7. Hello, thank you for your reply. No I didn't enable the .babylon MIME type on my server. How would I do that?
  8. I have successfully created a scene and imported it, which shows up on my localhost, but when I put it on a live server (http://www.cosmiqcloud.com/webgl), I get an endless loading screen and this error in the console in Chrome: Uncaught SyntaxError: Unexpected token , e.SceneLoader.RegisterPlugin.load @ babylon.js:17u @ babylon.js:17e.onreadystatechange @ babylon.js:4 And this error in Firefox: SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 454 column 23 of the JSON data babylon.js:16:26015 Here is the code for the app <!DOCTYPE html><head> <title>3D Real Estate Application | Babylon.js version</title> <script src="http://cdn.babylonjs.com/2-1/babylon.js"></script> <style> html, body { overflow: hidden; width : 100%; height : 100%; margin : 0; padding : 0; } #renderCanvas { width : 100%; height : 100%; touch-action: none; } </style></head><body> <canvas id="renderCanvas"></canvas> <script> window.addEventListener('DOMContentLoaded', function(){ // get the canvas DOM element var canvas = document.getElementById('renderCanvas'); // load the 3D engine var engine = new BABYLON.Engine(canvas, true); // createScene function that creates and return the scene var createScene = function(){ // create a basic BJS Scene object var scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color3(.25, .181, .240); // create a FreeCamera, and set its position to (x:0, y:5, z:-10) var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 0,13), scene); // target the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // attach the camera to the canvas camera.attachControl(canvas, false);BABYLON.SceneLoader.Load("", "realestate.babylon", engine, function(newScene){ if (!newScene.activeCamera) { newScene.activeCamera = new BABYLON.FreeCamera("Camera", new BABYLON.Vector3(3, 2,0), newScene); } newScene.executeWhenReady(function() { newScene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }); // return the created scene return scene; }; // call the createScene function var scene = createScene(); // run the render loop engine.runRenderLoop(function(){ scene.render(); }); // the canvas/window resize event handler window.addEventListener('resize', function(){ engine.resize(); }); }); </script></body></html>I have also attached a screenshot of what is supposed to appear in the browser. I wanted to make sure it wasn't something in my code that is causing this. Thank you for your help.
  9. Then I am very confused. The first code block I got from your blog on this link: http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx The only thing I changed was the .babylon file i was trying to load. Has this changed? Is there an updated way to do this?
  10. So I added a camera and I still get the same error. if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var createScene = function() { var scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color3(.25, .181, .240); //Scene lights var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 0, 0), scene); light.intensity = 10; //Scene camera var camera = new BABYLON.FreeCamera("Camera", new BABYLON.Vector3(0, 5,-10), scene); var ground = new BABYLON.Mesh.CreateGround('ground1', 6, 6, 2, scene); //Import scene BABYLON.SceneLoader.Load("", "realestate.babylon", engine, function(newScene){ var mesh = newScene; mesh.executeWhenReady(function() { camera.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }); // return the created scene return scene; }; // call the createScene function var scene = createScene(); }
  11. I am trying to test a scene I created in Blender, but I keep getting the following error. "Uncaught TypeError: Cannot read property 'attachControl' of undefined" Here is my code: if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "realestate.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 }); }I have been away from Babylon.js for a little while, I figured I may have missed something, but I am not sure. I have searched to see if this has been a problem that has been solved. Any help you can give is much appreciated.Thank you.
  12. Hi gryff, Thanks for the comment. I know the scene looks weird, but I am really figuring out how elements of Babylon.js work. I actually have a plan to create something not so weird as soon as I figure this portion out, so bear with my weirdness for a little bit. The mesh appears as a cloud with a star in it, much like the cloud logo I have up top. The video mesh is just me figuring out how video textures work. That is a video of an ocean. I am a bit new to JavaScript, so where exactly should I put the videoMat? Also, I tried the scaling change that Temechon suggested, which worked, but now the mesh is very small. I created it in Blender, so I will probably fix the scaling on that end. Thank you.