Search the Community

Showing results for tags 'scene'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 63 results

  1. Hi, I'm working on a medical application where anatomical 3d Models are shown in the Browser. At the moment I am working with Threejs, but I am looking for alternatives and Babylon.js looks very good, especially from a documentation perspective. But I cant find much information about loading Scenes/STLs using XHR Requests. In most tutorials they are loaded as assets directly from the webserver the app is hosted on. So my Questions are: Is it possible to load a scene from an application server which is not the webserver using http GET, including an x-auth-token in the header ? Is it possible to load the file as a binary stream, or in a small format? (Because the models often have a high poly-count) Thanks in advance :-)
  2. Hi everyone, I have now been stuck with a problem for a while and figured I would ask here to see if anyone knew how to fix it. I have a scene where you can dynamically add your own images to it, that will than be transformed into a material with the images as the diffusetexture. The transforming happens by using the raw image data to create the texture with the function: BABYLON.Texture.LoadFromDataString - it looks something like this: material = new BABYLON.StandardMaterial("imageMaterial", scene); var imgTexture = new BABYLON.Texture.LoadFromDataString("data:" + Math.random(), RAW IMG DATA, scene); material.diffuseTexture = imgTexture; This all works fine, the problem that I am having is that I want to be able to save the scene and load it again later. But it seems the the SceneSerializer doesn't save the texture/material information (the raw image data), so that when I load the scene I get the error: Materials: Name: groundMaterial babylon.custom.js:5 Uncaught TypeError: Cannot read property 'width' of null at E (babylon.custom.js:5) at n.createTexture (babylon.custom.js:5) at new i (babylon.custom.js:11) at babylon.custom.js:11 at Function.t.Parse (babylon.custom.js:2) at Function.i.Parse (babylon.custom.js:11) at Function.t.Parse (babylon.custom.js:2) at Function.r.Parse (babylon.custom.js:17) at Function.t.Parse (babylon.custom.js:14) at Object.load (babylon.custom.js:28) Looking at the saved serialized scene, I can also see that it is not saving the raw image data, so I have customized the serialize() function to find and save the data when the scene is saved, then the idea was to unpack it when it loads somehow. But I still can't stop the above error from happening. Is there anyone that knows a good way to do this or a fix to how I'm trying to do it? In short: I am trying to save and load a scenes that have material/texture that I created from my own images. But the loader and saver, doesn't seem to recognize/save the custom material properly. Thank you!
  3. // @flow // $FlowIgnore import * as BABYLON from 'babylonjs'; import shortid from 'shortid'; type Color = { r: number, b: number, g: number, }; export default class Scene { _scene: BABYLON.Scene; _camera: BABYLON.ArcRotateCamera; _light: BABYLON.HemisphericLight; constructor(engine: BABYLON.Engine, canvas: HTMLElement) { const scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color4(0.5, 0.8, 0.6, 0.8); const camera = new BABYLON.ArcRotateCamera('Camera', 1.5 * Math.PI, Math.PI / 8, 50, BABYLON.Vector3.Zero(), scene); camera.setTarget(BABYLON.Vector3.Zero()); camera.attachControl(canvas, false); const light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(1, 1, 1), scene); light.intensity = 0.5; const sphereMaterial = new BABYLON.StandardMaterial('texture1', scene); sphereMaterial.alpha = 1; // sphereMaterial.diffuseColor = new BABYLON.Color3(0.5, 0.5, 0.5); sphereMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0.5); const boxCfg = { size: 5, updatable: true, }; const sphere = BABYLON.MeshBuilder.CreateBox('sphere1', boxCfg, scene); sphere.material = sphereMaterial; sphere.position.y = 5; this._scene = scene; this._camera = camera; this._light = light; } render = () => { this._scene.render(); } dispose = () => { this._scene.dispose(); } } import { Engine } from 'babylonjs'; import Scene from './Scene'; export default class RenderEngine { constructor(container) { this._container = container; } animate() { this._engine.runRenderLoop(this._scene.render); window.addEventListener('resize', this._engine.resize); } createScene() { this._scene = new Scene(this._engine, this._canvas); } render = () => { this._canvas = document.createElement('canvas'); this._container.appendChild(this._canvas); this._engine = new Engine(this._canvas, false); this.createScene(); this.animate(); } reRender = () => { this._engine.dispose(); this._container.removeChild(this._canvas); this.render(); } } const root = document.getElementById('root'); const engine = new RenderEngine(root); engine.render(); if ( {'./RenderEngine', () => { engine.reRender(); }); } I am currently learning babylon.js and with my set up I have hot reloading, so when any files are changed, engine.reRender() will be called. To test it out I change up color of sphereMaterial. It creates new canvas, but for some reason it still shows the old colors... Is there any way to clear out the scene and engine to load the webgl with new configuration? Thank you.
  4. I am working on a project that switches between a handful of scenes. To do this I load all of my scenes at the start so you can switch between them quickly. You start out in an overall view of the area and you can click markers to go into rooms. In the rooms are more makers that are hooked up to click events. However If one of the markers in the scene is in the bottom left of the screen per say and I move to a different scene, If I would click in the bottom left of the screen the click event of the previous room triggers. How do I make sure that click events are only active for the currently active scene?
  5. Hi community, I want to propose you some addition to assetManager and sceneOptimizer. If the solution already exist, said me assetManager : 1. Get loading percent, not on x file loaded but on stream data loaded when it's possible. > for more precision and to show state if you load some big files. 2. Add "abort" function and "onAbort" callback to cancel running tasks and loading files. > Currently "clean" function delete tasks in assetManager but not abort current loads. That mean if you have a big file in loading, it don't stop. sceneOptimizer : 1. Add a starter level to try optimizing render : > I tested the current sceneOptimizer and the problem is it try the best render first. If you have an older device, the website crash and the browser reload page before that sceneOptimizer can downgrade the render. So, it's a loop without ending. 2. Create two steps to optimize render : > First : upgrading. The sceneOptimizer try to reach "x" FPS with the starter level. If it's ok, it upgrade render again until when it can't reach "x" FPS. > Second : dowgrading. If the last try (or the first try with the starter level ) not reach FPS, the sceneOptimizer downgrade until when it can reach FPS. If the sceneOptimizer reach "x" FPS, it stop. > Of course, we keep "trackerDuration" : time in milliseconds between passes. > You will can restart the sceneOptimizer when you add or change something like the current version What do you think about this ? Have a nice day !
  6. Hi, Got strange situation, one mesh, that was exported from 3d max , is not appearing in `scene.mesh` list, but it works with `scene.getMeshByName("meshName");` var mesh; mesh = scene.getMeshByName("meshName"); // Works scene.meshes.forEach((m) => { console.log(; // Doesn't appear here if( === "meshName") { mesh = m; // Never happens } }
  7. Hi guys! I have small problem, If I dispose WorldSpaceCanvas2D, material from canvas stay on the scene Example, you need look in console, you can see after disposing canvas the material on scene "myCanvas_Material" How I can dispose this material? Thanks!
  8. I've exported my scene from 3Dsmax. Now I want to get individual meshes and want to do something with them. How can I select a mesh in the scene? with its name or ID... ?
  9. Hi guys! Found very usefull feature in three.js like ability to set texture as scene backgorund ( Is there something like that in Babylon? Ofcourse we can use two scenes, put texture to plane, setup orthogonal camera... but it's very uncomfortable
  10. hy everyone, can i use sceneLoader.load for obj.ext files to load a scene?
  11. Does anyone have any evidence (anecdotal even) on which method would be quickest? Scenario A: Dispose of 200 static meshes and create 12 new ones. Scenario B: Dispose of the whole scene and create a new scene with 13 static meshes. Scenario C: Not sure this is possible, but can you make babylon.js not render meshes? I could "turn off" the 200 static meshes so they do not interact with lights and player input. This would be the preferred method, I think, since it would minimize object creation, which in C is an expensive process. I can test it, of course, but was wondering if anyone had any best practices on how to make that as seamless as possible. Thanks for any input. EDIT: Looks like setEnabled() may make Scenario C possible! I will test it!
  12. Hello, I'm trying to export a model which is about 400,000 Polys. I know the maximum export is somewhere around 60, 000 for any one mesh. I am thinking about breaking and exporting the mesh in different parts. Will this lead to issues in the scene? Also, what is the best polygon count for a babylon scene for efficiency in web and mobile? Finaly, what is the maximum polygon count for a babylon scene before it crashes? Thank you in advance!
  13. I have an existing scene made in Babylon.js (scene1) I have a `.babylon` file (scene2) I want to append to scene1. Before appending scene2 to scene1 I want to do some operations on the meshes of scene2. `BABYLON.SceneLoader.Append` just immediately dumps everything from scene2 into the scope of scene1. This is not helpful. I have a lot of meshes in scene2 and scene1 with dynamic names so it's a lot of work to manually go through the merged array and look for the meshes that were in scene2. I was hoping I could use `BABYLON.SceneLoader.Load` for this. Load scene2, iterate over the scene2 meshes, then manually add them to scene1. Maybe I've missed something but, it doesn't like there is straightforward support for this. Seems like `BABYLON.SceneLoader.Load` is designed to load an initial scene only.
  14. I am clearing my scene entirely, where I use completely new sounds and new plans/textures. What is the proper way to do this? I'm first going through each of my planes and removing the plane and animations for each of them: item.plane.dispose(); item.animateR.reset(); item.animateX.reset(); item.animateY.reset(); and do the same for the sounds. Then I go to the scene and do the following: scene.dispose(); scene.disposeSounds(); The problem is I still see a lot of memory being used up, even after I do this and have an empty canvas on the screen. Am I missing a step or going about this wrong? Thanks, Jeff
  15. Hi, my project with BabylonJS is growing day to day. Now, I am going to introduce interaction to my scene. I dont know how can I get this. I would like click to some object and see on screen show information of it. To do this I need to know differents way to interact with objects of scene. Also using a gui, I am interested to hide or show differents elements of my world. Could you show me similar examples? Thanks.
  16. var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var initBallSpeed = 0.05; var ballSpeed = initBallSpeed; var xDirection = 1; var yDirection = 1; var boardX = -3.0; var boardY = 3.0; var keyState = {}; var MainScene = function () { // This creates a basic Babylon Scene object (non-mesh) var scene = new BABYLON.Scene(engine); // This creates and positions a free camera (non-mesh) var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 0, -20), scene); //camera.attachControl(canvas, true); var light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene); //Setup the bat for the scene. Dont know what else to call it. var bat = BABYLON.Mesh.CreateBox("bat", 0.5, scene); bat.scaling.x = 5.0; bat.position.y = -5.0; //Setup the ball var ball = BABYLON.Mesh.CreateSphere("ball", 5, 0.5,scene); ball.position.y = bat.position.y + 1; ball.position.x = bat.position.x; //Register keypress actions with the ball scene.actionManager = new BABYLON.ActionManager(scene); window.addEventListener('keydown',function(e){ keyState[e.keyCode || e.which] = true; },true); window.addEventListener('keyup',function(e){ keyState[e.keyCode || e.which] = false; },true); // scene.actionManager.registerAction(new BABYLON.ExecuteCodeAction( // BABYLON.ActionManager.OnEveryFrameTrigger, // function (evt) { // })); //Setup the walls // Top Wall var topWall = BABYLON.Mesh.CreateBox("topWall", 0.5, scene); topWall.position.y = 6.0; topWall.scaling.x = 25.0; // Left Wall var leftWall = BABYLON.Mesh.CreateBox("leftWall", 0.5, scene); leftWall.position.x = -6.0; leftWall.position.y = 1.0; leftWall.scaling.y = 25.0; // Right Wall var rightWall = BABYLON.Mesh.CreateBox("rightWall", 0.5, scene); rightWall.position.x = 6.0; rightWall.position.y = 1.0; rightWall.scaling.y = 25.0; var enemy = BABYLON.Mesh.CreateBox("enemy1", 1.0, scene); enemy.position.x = boardX; enemy.position.y = boardY; var matBB = new BABYLON.StandardMaterial("matBB", scene); matBB.emissiveColor = new BABYLON.Color3(1, 1, 1); enemy.material = matBB; scene.registerBeforeRender(function(){ ball.position.x += ballSpeed * xDirection; ball.position.y += ballSpeed * yDirection; if(ball.position.y < -7){ ball.position.y = bat.position.y + 1; ball.position.x = bat.position.x; ballSpeed = initBallSpeed; xDirection = yDirection = 1; } if(ball.intersectsMesh(rightWall, true)){ xDirection = -1; } if(ball.intersectsMesh(leftWall, true)){ xDirection = 1; } if(ball.intersectsMesh(topWall, true)){ yDirection = -1; } if(ball.intersectsMesh(bat, true)){ yDirection = 1; if(ballSpeed <= 0.25) ballSpeed+=0.01; } if(ball.intersectsMesh(enemy, true)) { xDirection = -1; yDirection = -1; enemy.material.emissiveColor = new BABYLON.Color3(1, 0, 0); } if (keyState[37] || keyState[65]){ bat.position.x-=ballSpeed*2; } if (keyState[39] || keyState[68]){ bat.position.x+=ballSpeed*2; } }); return scene; }; var scene = MainScene(); engine.runRenderLoop(function () { scene.render(); }); // Resize window.addEventListener("resize", function () { engine.resize(); }); Either I am really high or the enemy block is turning red before my ball can even collide with the block. Any ideas?
  17. Hi, i would like to import an OBJ file into my scene and I have got it. However, I don't get change the position and scale of the mesh. ┬┐How could I do it? This is my code: var loader = new BABYLON.AssetsManager(scene); var edificioB4 = loader.addMeshTask("A2", "", "http://localhost:8080/modelos/A2/", "A2.obj"); BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true; loader.load(); Thanks, JuanMa J.R.
  18. Hi! We just released a new Phaser Editor version (1.3.0) Updated to the latest Eclipse version (Neon.1): Performance improvements and much more. Eclipse Marketplace Client: to install third party plugins, like EGit. We are evaluating the typescript plugins developed by the Eclipse community. Automatic Updates: all components of the editor will be updated automatically, including the latest Phaser official version (no Phaser CE support for now) Improved JS Editor: small changes in the JS type inference engine that results in a much better content assist (yet not *perfect*) Bug fixing, performance improvements and *minor* features in the scene editor, asset pack, local HTTP server, project templates and chains. New learning content: we wrote a tutorial in the GameDevAcademy blog, about how to make a platformer game with the visual scene editor. Read more in the release notes For the next release we plan to focus on: Do a research of the available Typescript plugins and write a tutorial about how to install them. Start with the implementation of the P2 Physics tools for the visual level editor. Support Phaser v3 if it is released in the next 3 months. See you soon! Arian (Scene editor: Added two new parameters to the Animations editor) (Scene editor: recovery from missing assets) (Check for Updates) (Eclipse Marketplace)
  19. Hello, Currently I'm working on my game environment. So I found and bought low poly but quite large forest scene. Almost everything works fine except that when moving camera around some trees are rendered in wrong order. I actually don't have a clue what could be wrong. Is it a model? or maybe some properties of the mesh or whole scene is set wrong? Adding a screenshot of the scene and the bug.
  20. I am building a game using babylon.js and I just ran into a problem. The game is about a chicken that has to find its way back to the henhouse, and on the way there are several tractors driving around that can run over the chicken. The scene loads allright, but when I add animation so that the tractors can move, the scene doesn't load when I start it and I have to refresh it a few times. Does anyone know what could be the problem and how to solve it so that the scene will load when you start the game? here is my main code: var engine; var scene; var canvas; var chicken; var henhouse; var tractor; var tractor2; var tractor3; document.addEventListener("DOMContentLoaded", function () { onload(); }, false); window.addEventListener("resize", function () { if (engine) { engine.resize(); } },false); var onload = function () { canvas = document.getElementById("renderCanvas"); engine = new BABYLON.Engine(canvas, true); initScene(); engine.runRenderLoop(function () { scene.render(); }); }; var createSkybox = function() { var skybox = BABYLON.Mesh.CreateSphere("skyBox", 100, 1000, scene); BABYLON.Engine.ShadersRepository = "shaders/"; var shader = new BABYLON.ShaderMaterial("gradient", scene, "gradient", {}); shader.setFloat("offset", 10); shader.setColor3("topColor", BABYLON.Color3.FromInts(0,119,255)); shader.setColor3("bottomColor", BABYLON.Color3.FromInts(240,240, 255)); shader.backFaceCulling = false; skybox.material = shader; }; var initScene = function() { scene = new BABYLON.Scene(engine); scene.clearColor=new BABYLON.Color3(0.8,0.8,0.8); // Camera attached to the canvas -> chicken doesnt move //var camera = new BABYLON.ArcRotateCamera("Camera", 0.67, 1.2, 150, BABYLON.Vector3.Zero(), scene); //camera.attachControl(canvas); //Create the camera -> chicken is moving camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(200, 6,-300), scene); camera.setTarget(new BABYLON.Vector3(0,0,0)); var h = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, -1), scene); h.intensity = 0.85; var d = new BABYLON.DirectionalLight("dir", new BABYLON.Vector3(1, -1, -2), scene); d.position = new BABYLON.Vector3(-300,300,600); var shadowGenerator = new BABYLON.ShadowGenerator(2048, d); createSkybox(); var ground = BABYLON.Mesh.CreateGround("ground", 1000, 2000, 2, scene); ground.material = new BABYLON.StandardMaterial("ground", scene); ground.material.diffuseColor = BABYLON.Color3.FromInts(193, 181, 151); ground.material.specularColor = BABYLON.Color3.Black(); ground.receiveShadows = true; scene.gravity = new BABYLON.Vector3(0, -0.9, 0); var tg = new TreeGenerator(scene, shadowGenerator); // Number of lanes var LANE_NUMBER = 4; var LANE_INTERVAL = 160; // distance between lanes var LANES_POSITIONS = []; // Function to create lanes var createLane = function (id, position) { var lane = BABYLON.Mesh.CreateBox("lane"+id, 1, scene); lane.scaling.y = 0.1; lane.scaling.x = 15; lane.scaling.z = 1100; lane.position.x = position; lane.position.z = lane.scaling.z/2-600; lane.rotation.y = 180; }; var currentLanePosition = LANE_INTERVAL * -1 * (LANE_NUMBER/2); for (var i = 0; i<LANE_NUMBER; i++){ LANES_POSITIONS[i] = currentLanePosition; createLane(i, currentLanePosition); currentLanePosition += LANE_INTERVAL; } // MESH IMPORTS BABYLON.SceneLoader.ImportMesh("", "assets/", "chicken.babylon", scene, function (newMeshes) { chicken = newMeshes[0]; chicken.position.y = 1; chicken.position.x = 180; chicken.position.z = -280; = chicken; chicken.rotation.y = -1; }); BABYLON.SceneLoader.ImportMesh("", "assets/", "henhouse.babylon", scene, function (newMeshes) { henhouse = newMeshes[0]; henhouse.scaling.x = 4; henhouse.scaling.y = 4; henhouse.scaling.z = 4; henhouse.position.z = 350 ;//+ 50; henhouse.position.x = -200; henhouse.rotation.y += -0.5; }); BABYLON.SceneLoader.ImportMesh("", "", "assets/tractor.babylon", scene, function (newMeshes) { tractor = newMeshes[0]; tractor.scaling.x = 4; tractor.scaling.y = 4; tractor.scaling.z = 4; tractor.position.y = 3.6; tractor.position.x = -72; tractor.rotation.z = 0.04; tractor.rotation.y = -0.6; }); BABYLON.SceneLoader.ImportMesh("", "", "assets/tractor.babylon", scene, function (newMeshes) { tractor2 = newMeshes[0]; tractor2.scaling.x = 4; tractor2.scaling.y = 4; tractor2.scaling.z = 4; tractor2.position.y = 3.6; tractor2.position.x = 95; tractor2.position.z = -20; tractor2.rotation.z = 0.04; tractor2.rotation.y = -3.5; }); BABYLON.SceneLoader.ImportMesh("", "", "assets/tractor.babylon", scene, function (newMeshes) { tractor3 = newMeshes[0]; tractor3.scaling.x = 4; tractor3.scaling.y = 4; tractor3.scaling.z = 4; tractor3.position.y = 3.6; tractor3.position.x = -15; tractor3.position.z = -190; tractor3.rotation.z = 0.04; tractor3.rotation.y = -0.6; }); //tractor animation scene.registerBeforeRender(function() { tractor.position.x += 0.6; if(tractor.position.x >=90){ tractor.position.x = -72; } tractor2.position.x -= 0.6; if(tractor2.position.x <=-80){ tractor2.position.x = 95; } tractor3.position.x += 0.6; if(tractor3.position.x >=170){ tractor3.position.x = -15; } }); }; //moving the chicken window.addEventListener("keydown", function (event) { switch(event.keyCode) { /*case 76: chicken.position.z += 1; chicken.rotation.x += 0.5; camera.position.z += 1; break;*/ case 37: //right chicken.position.x += -1; chicken.rotation.y += -0.001; camera.position.x += -1; //camera.rotation.y += -0.01; break; case 39: //left chicken.rotation.y += 0.001; chicken.position.x += 1; camera.position.x += 1; //camera.rotation.y += 0.005; break; case 40: //backwards chicken.position.z += -1; camera.position.z += -1; break; case 38: //forward chicken.position.z += 1; camera.position.z += 1; break; case 32: //jumping chicken.position.y += 2; camera.position.z += 1; chicken.position.z += 1; //pause //yield to.sleep(.500); setTimeout(function(){ chicken.position.y -= 2; },150); break; } }, true);
  21. Hi, How do you unload a scene? There's a BABYLON.SceneLoader.Load, but no Unload? How do I remove a scene completely? Here's my dilemma: I've got a game with 3 levels. I'm not loading assets through the assets manager as all three scenes are Blender exports (with lights and cameras set up). At the end of each level I want to unload the previous scene (instances, clones, sounds, etc) and load a new one. Surely there must be a way, but I just cant find it... Thanks!
  22. This request is more for the BabylonJS maintainers like David. I talked you guys into letting me add node.metadata which is WORKING GREAT... SO GREAT that i really need (and hope you can see the same value as well) of having the same serializable metadata at the scene level. So i am asking SOMEONE to please: @serialize() public metadata:any = null; to babylon.scene.ts so it can be used exactly like node.metedata. Right now if i want to store SCENE level metadata i gotta put a DUMMY mesh (or node) into the scene and search the all the scene.meshes to find some node.metadata that has been aliased to be used as scene level data. That kinda sucks (Note: I DONT MEAN BABYLONJS sucks in any way... remember... I luv you guys and the very concept of babylonjs ). Just not a clean way to store and retrieve any scene level metadata. Adding scene.metadata would give that same 'automatic de-serialization' of the built in babylon parsing framework. We will end up with a real javascript object scene.metadata JUST LIKE node.metadata Please REALLY think about it... I would luv to clean up some of my BabylonJS loader code and having to look thru the scene nodes to grab a dummy node with my scene level metadata, really bugs my OCD Thanks again for even thinking about it
  23. Hi everybody, I am very new to both Blender and Babylon. Basically I am trying to load a scene exported from Blender and create a skybox afterward, the scene is nothing more than a default blender scene(the one consists of a box, camera and light, I load this scene just to make sure I hadn't added or modified anything in the scene that may leads to other issues once I export the scene into babylon file). I try to create a skybox after loading the scene, using code below: =============================================== var canvas; var engine; var scene; function initScene() { canvas = document.getElementById("renderCanvas"); engine = new BABYLON.Engine(canvas, true); scene = new BABYLON.Scene(engine); BABYLON.SceneLoader.Load("babylon/","testScene.babylon",engine,function(newScene){ newScene.executeWhenReady(function(){ newScene.activeCamera.attachControl(canvas,false); var ground = BABYLON.Mesh.CreateGround("ground", 10, 10, 2, newScene); var skybox = BABYLON.Mesh.CreateBox("skyBox",1000.0,newScene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox",newScene); skyboxMaterial.backFaceCulling = false; skybox.infiniteDistance = true; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("images/skybox/cloudSkyBox/DaySkybox", newScene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.disableLighting = true; skybox.material = skyboxMaterial; engine.runRenderLoop(function(){ newScene.render(); }); }); },function(progress){}); } function initBB(){ if (BABYLON.Engine.isSupported()){ initScene(); }else{ console.log("not support BB"); } } document.addEventListener("DOMContentLoaded",initBB,false); document.addEventListener("resize",function(){ engine.resize(); }); =============================================== The blender scene "newScene" is loaded(I can see the box, a directional light of the blender default scene, I can use the free camera preset in blender scene), the ground mesh added into the newScene can be seen as well, but the skybox is not shown! There is no error message shown on the browser console, I had tried to google for similar problem but couldn't find the solution... I am not sure if I set up the blender scene wrongly before I export or there is other factor that cause this issue. Any help would be greatly appreciated!
  24. Hi, I hava a question/suggestion re BJS Cameras/Scenes. 1) In THREE.js a Camera inherits all 3d properties from a Node, including Scale, which is VERY handy: by changing the scale of camera, you're changing the World's scale. 2) Same applies to a Scene: you can simply state myScene.scale.x = 2 and it works beautifully! Now, maybe I'm missing something in BJS, but what do I do if I need to scale an imported Scene? Iterating through meshes seems like an awkward way of doing things - same as creating an empty parent for all objects in the scene. Is there a simple solution? 3) Are there any helper objects in BJS, e.g. light cones, floor grids etc? Thanks.
  25. This playground makes 9 meshes and tries to delete them all at once in a loop. It does not work. Am I missing something? I defeated the problem via this unholy function ... function deleteAllMeshes(scene){ var countMesh = 0; scene.meshes.forEach(function(m) { countMesh++; console.log(; m.dispose(); }); console.log(countMesh + " meshes deleted"); var x = countMeshes(scene); if(x > 0) { deleteAllMeshes(scene); } } Here is the output of the unholy function proving only half of the meshes are deleted per function call.