AllForum Posted August 6, 2014 Share Posted August 6, 2014 Hello,I don't know html nor javascript but I would like to test webgl...I am trying because it seems easy : create a .babylon file containing a camera, a light and a cube and draw it using babylon.js.But nothing works... I don't know if it is due to the file or to the code to load or...Here are my questions :1- To be sure : I can test locally, without web server, by opening a local html file in my web browser and using a .babylon file on my local disk, isn't it ?2- I don't know if the load does not work due to the file or to my Sceneloader use. Where can I find a valid .babylon file ? If possible the simplest one with a camera, a light and a cube mesh.(to explain why a such question, before posting this question :a- I read this forum and found 2 git sites with .babylon files. But for me the sandbox seems not reliable : loads stop during loading and have to be restarted several times, when something is drawn sometimes the number of vertices is 0, etc.b- I don't know what is correct : I found in .babylon files the "activeCameraID" keyword but it is not in the babylon file format description. Is the documentation up to date ?c- I tried to load in the sandbox the sample of the documentation but it does not draw (https://github.com/BabylonJS/Babylon.js/wiki/Babylon.js-file-format) )I think that the problem is in these 2 questions because I use the SceneLoader code I found in your posts. Thanks in advance for your answer. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 6, 2014 Share Posted August 6, 2014 Hello, 1- no, Need you a local server (Wamps or EasyPHP for example)2- You can download the scene of sample site here: https://github.com/BabylonJS/Samplesyou can also download from the tutorial here: https://github.com/BabylonJS/Babylon.js/wiki/Tutorials Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 6, 2014 Share Posted August 6, 2014 Hi, Welcome in the wonderful Babylon world To keep up with the first answer : 1. You need a webserver if you want to load external files, like a babylon file, a texture, ... If you use only babylon primitives (box, sphere, ...), you don't need it.2. As Dad said, You can find babylon files here https://github.com/BabylonJS/Samples. Be careful, a babylon file does not contains any texture. Be sure to have the texture in the same folder as your babylon file if you want to load one. If you want to try, here is a babylon file : http://pixelcodr.com/tutos/toad_attack/babylon/toad.zip, and here is the code to load it : // The function ImportMesh will import our custom model in the scene given in parameterBABYLON.SceneLoader.ImportMesh("red_toad", "assets/", "toad.babylon", scene, function (meshes) { var m = meshes[0]; m.scaling = new BABYLON.Vector3(0.5,0.5,0.5);});Good luck Cheers , Quote Link to comment Share on other sites More sharing options...
andrewjoypappu Posted August 6, 2014 Share Posted August 6, 2014 Hai Temechon,I am new to babylon and when i load a .babylon made in blender in xampp/ htdocs, it doesnot work and without .babylon blender file it works flawlessly.i have used the above file also, but it doesnot work. can u help? Quote Link to comment Share on other sites More sharing options...
AllForum Posted August 6, 2014 Author Share Posted August 6, 2014 Thanks for your answers.As I tried without webserver it may explain why nothing works...With your toad.babylon file I think that I have understood why some files are not drawn in the sandbox : they probably only contain geometry without lights and cameras.Thanks for your help Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 6, 2014 Share Posted August 6, 2014 Indeed, if you have no light nor camera, you won't see anything Cheers, Quote Link to comment Share on other sites More sharing options...
AllForum Posted August 6, 2014 Author Share Posted August 6, 2014 I can load a mesh file or a full scene file. If a full beginner like me read this post :- It is plug&play to install iis on windows 7 : http://technet.microsoft.com/fr-fr/library/cc731179.aspx- To be able to load a file these lines have to be added to the web.config file : http://www.html5gamedevs.com/topic/6737-cant-get-babylon-files-to-load/ I can play with Babylon now !Thanks. PS:For information, only with firefox (nothing with seamonkey or IE), all seems to work well but I have a message in the web console :- when I load your mesh file :"BJS - [16:59:23]: Valid manifest file not found. Scene & textures will be loaded directly from the web server." babylon.1.12.js:3- when I load a full scene :InvalidStateError babylon.1.12.js:9 Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 6, 2014 Share Posted August 6, 2014 Hey there, Congratulations ! I'm sure you will love to play with Babylon For your information : Valid manifest file not found. Each mesh can be linked to a manifest file (as explained here : https://github.com/BabylonJS/Babylon.js/wiki/Caching-the-resources-in-IndexedDB) in order to cache all resources in the client browser. With this, your scene can play offline. You don't have to do it though, and babylon will retrieve all assets from the webserver (Scene & textures will be loaded directly from the web server.) Cheers, Quote Link to comment Share on other sites More sharing options...
Maverton Posted April 12, 2016 Share Posted April 12, 2016 Babylon sound like a great tool just a deep learning curve for non programmers like myself 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.