Adem Posted December 17, 2016 Share Posted December 17, 2016 Hello, i tried to create a skybox in my exported scene .babylon, but i couldn't see the skybox, it was just the imported scene here's the code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Using babylon.js - How to load a scene</title> <script src="http://www.babylonjs.com/hand.minified-1.2.js"></script> <script src="http://www.babylonjs.com/cannon.js"></script> <script src="http://www.babylonjs.com/oimo.js"></script> <script src="http://www.babylonjs.com/babylon.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> </body> </html> This page is pretty simple because all you need is just a canvas and a reference to babylon.js. Then you will have to use BABYLON.SceneLoader object to load your scene. To do so, just add this script block right after the canvas: <script> if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("Retail/", "Retail.babylon", engine, function (newScene) { // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { var box = new BABYLON.Mesh.CreateBox("box",6100, newScene); // 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> Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 17, 2016 Share Posted December 17, 2016 The problem is here: var box = new BABYLON.Mesh.CreateBox("box",6100, newScene); Your box is way too big. The camera is I think inside the box and the camera can not see the box if it is inside Adem 1 Quote Link to comment Share on other sites More sharing options...
Adem Posted December 17, 2016 Author Share Posted December 17, 2016 it's finally working Quote Link to comment Share on other sites More sharing options...
adam Posted December 17, 2016 Share Posted December 17, 2016 Looks like I'm going to have to set an avatar. Adem looks too much like Adam Adem 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted December 17, 2016 Share Posted December 17, 2016 @adam nice Quote Link to comment Share on other sites More sharing options...
Adem Posted December 17, 2016 Author Share Posted December 17, 2016 @adam true Quote Link to comment Share on other sites More sharing options...
gryff Posted December 19, 2016 Share Posted December 19, 2016 @Adem : in reply to your PM, add the skybox in code like this: // create a skybox var skybox = BABYLON.Mesh.CreateBox("skyBox", 500.0, newScene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", newScene); skyboxMaterial.backFaceCulling = false; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("skybox/skybox", newScene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0.0, 0.0, 0.0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skybox.material = skyboxMaterial; The distance away for this skybox, in the first line above, is 500 units - you can set your own value for this. Make sure you set the camera as well : camera.maxZ= 500; If the MaxZ value is less than the size of the skybox you can get odd behaviour. More info here. cheers,gryff Adem 1 Quote Link to comment Share on other sites More sharing options...
Adem Posted December 19, 2016 Author Share Posted December 19, 2016 Thanks that works well Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 19, 2016 Share Posted December 19, 2016 I see that I was not the only one to receive a PM for this same subject. I assume Adem that you get the same response from each person who had the same PM? It is often that I get PMs for help. And it is annoying, the forum is made for that, the PM are for private messages, not a private help forum. GameMonetize and Adem 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 20, 2016 Share Posted December 20, 2016 Can't agree more Dad72 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 21, 2016 Share Posted December 21, 2016 Depends. If you are kind... you hug the users, no matter how they communicate. Perhaps teach PM-sender that on-forum help requests are better, because they help everyone. I never scold a user... unless they are intentionally being annoying. I have had NO PM's for help... that were intentionally being annoying, or seeking to cause anger. Zero. Maybe we can request a forum software change. Perhaps add some text where we can remind PM writers... that asking for help with BJS scenes... is best done on-forum, and why. Nowhere do we publicly announce that PM for "personal help"... is unwanted/discouraged, and "tact" is different across various international borders. If you want to start a "policy" where PM for personal help is "wrong", then we need to tell that to users... prominently... where all can see it, and learn of this new unvoted-upon policy. "policy" and "police" are related... and "police disease" is a terrible addiction that easily happens to people with no feeling-of-empowerment in their lives. This forum should avoid "police addictions" at all costs, in my opinion. We all have better things to do... than patrol the forum for policy breakers who need spankings. I am guilty of this "attempted steering" of users... myself... and I really don't like that part of me. I prefer to build bobsleds and spray particles. If I feel I must try to steer someone or some policy, I try to do it with love, just like this attempt. Perhaps I am doing "forum kindness policing" with this post, eh? *nod* Don't worry, I have no gun or stick.... just a mouth for convincing. Others seem to be attempting to convince... that PM for help.... should be labeled as "wrong". I don't agree. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 21, 2016 Share Posted December 21, 2016 I'm not saying it's bad, but that help from PM does not help. If a user has the same problem, he does not find the answers in the PM. What I find regrettable is that some members send multiple PM with the same message hoping for a quick response from the first one that responds. That's what I do not think is correct. I regularly help by PM, but I prefer that PM for particular messages, issues that do not have their place on public. With the PM one is like to obliged to answer and if one can not help, what to say ? If you want to say hello to me, ask me how my family or other, PM is done for this, not to ask Help in private by sending the same message to multiple users. I see things like that. That said, I have lot helped by PM, but sometimes it annoys me when the message is anti personal or brief: hello I need to do this, it does not work, thank you to help me. (to shorten it). Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 21, 2016 Share Posted December 21, 2016 Yep, well said. "obliged"... perfect word. It's about "manners" and "tact". Can we find a way to remind users of policy preferences? Perhaps some text below "Compose New"... The BabylonJS forum admin asks that you publicly post (on-forum) ALL project questions, and avoid sending personal messages requesting project help. Thanks! I suppose this would require a modification to the forum software, or an add-on extension to it. hmm. 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.