Dad72 Posted December 18, 2013 Share Posted December 18, 2013 Hi, How to do a progresscallback on a ground: BABYLON.Mesh.CreateGroundandBABYLON.Mesh.CreateGroundFromHeightMapI see that it can be done on a scene to load or a template to load, but I do not find for the terrains. My ground with my water and the sky puts some seconds to load and i would like to show a progression of loading. Thank You Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 19, 2013 Author Share Posted December 19, 2013 Good, it doesn't seem possible. I am going to do otherwise. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 19, 2013 Share Posted December 19, 2013 CreateGround and CreateGroundFromHeightMap are almost instantaneous so no need for a progress report:) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 19, 2013 Author Share Posted December 19, 2013 Yes, but if there is:1 CreateGround (grid level water)+ 1 CreateGround (ground) with loading a backup file of the terrain+ 1 CreateGround (water)+ 1 CreateBox (sky)This puts some seconds to load (5 second). But I've find a solution to do what I wanted..Thank You Deltakosh GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 19, 2013 Author Share Posted December 19, 2013 For info, if its can help another person: I load an image in the canvas when I selected a terrain to load with:function openTerrain(TerrainName){ document.getElementById("chargement").innerHTML = "<img src='Data/patienter.gif' />"; $.ajax({ url:'Fonctions/Open_terrain.fonction.php', type:'post', data: "terrainName=" + TerrainName, success:function(data){ data = data.split(";"); var savedPosition = data[0]; var savedNormal = data[1]; subdivision = data[2]; dimX = data[3]; dimY = data[4]; LoadTerrain(savedPosition, savedNormal, false, false, dimX, dimY, subdivision, null); } });}I then put ca in the function that loads the terrain which disables the image load in progress:function LoadTerrain(...) {....$(canvas).ready(function(){ if(ground.isReady() && grid.isReady() && water.isReady() && skybox.isReady()) { document.getElementById("chargement").innerHTML = ""; $("#chargement").hide(); } });}My image appears some moment and disappears when the ground, the water, the sky is loaded. I do not know if there are other ways to do this, but this solution works well. 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.