text: [{"Owner":"Kilombo","Date":"2014-06-17T18:38:13Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Hello community_co__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I_t_m in need of help with something on my project._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I need do draw a new scene in the same scene stuck in a while loop (while the option exit isn_t_t pressed)._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_By that I mean_co_ that i would like to clear the all screen when this function is started_co_ then_co_ when exit is pressed_co_ the _qt_state machine_qt_ would come back to the main scene._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I_t_m not beeing able to find any function to do this._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Any suggestions ?_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Thanks in advance_co__lt_/p_gt__lt_p_gt_ _lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Temechon","Date":"2014-06-17T19:10:16Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Hi_co__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Are you working on a menu or something like that ? Could you give us an example or a mockup (even in paint) to help us understand ?_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Anyway_co_ would set all meshes in your _qt_all scene_qt_ to visible_eq_false be enough ?_lt_/p_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_while(exitOptionNotSelected) {   allScene.meshes.forEach(function(mesh) {       mesh.isVisible _eq_ false_sm_   }}allScene.meshes.forEach(function(mesh) {       mesh.isVisible _eq_ true_sm_}_lt_/pre_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Kilombo","Date":"2014-06-17T19:23:20Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Thanks Temechon._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Go to my project in _lt_a href_eq__qt_http_dd_//www.andromedaquest.tk_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.andromedaquest.tk_lt_/a_gt_ enter with username_dd_ xpto and password_dd_ xpto (I_t_ll keep the user active for the next 24 hours at least). _lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_When you hoover the planets_co_ you can see the option _qt_colonize planets_qt_._lt_/p_gt__lt_p_gt_And if a planet is already colonized_co_ what will apear is base details._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_So... When that option is pressed the screen has to change to the _qt_base_qt_ screen_co_ I have to draw a new floor_co_ with new texture_co_ the structures and anything else. Then when the player presses _qt_exit_qt_ it will come back to the _qt_space ambient_qt_._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Temechon","Date":"2014-06-17T19:44:23Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Nice work !_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_For your problem_co_ I would save the player position in the space scene_co_ and completely destroy it (scene.dispose())_co_ and finally build your base scene._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_On exit_co_ retrieve the player position from indexDb (for example_co_ or localStorage_co_ or memory or whatever) and load your space scene as you do it in your init game._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Kilombo","Date":"2014-06-17T19:46:37Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Thanks Temechon. That_t_s a good idea_co_ it_t_s so obvious. _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2014-06-17T22:35:37Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Hi gang.  Couldn_t_t the space scene be in engine.scenes[0]_co_ and when a base needs to be assembled_co_ do it in engine.scenes[1]_co_ and switch to it?  Then switch back to engine.scenes[0] upon base exit?  *shrug*_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I have never tried scene switching... and know nothing about it_co_ but maybe easier?  If you do tests on scene switching_co_ Kilombo_co_ report your discoveries to us_co_ ok?  Cool._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Kilombo","Date":"2014-06-17T23:30:08Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_In fact_co_ that looks really interesting... Hmmm. one array of scene objects _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt_ That_t_s one great idea. Where did that come from_co_ eheheh I_t_ll try it and report._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2014-06-17T23:55:24Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_That_t_s Deltakosh_t_s idea.  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_The babylon engine is already designed for multiple scenes.  How one goes about switching between engine.scenes[0] and engine.scenes[1]...  I have no idea.  But others might.  And you know Deltakosh and the other big dogs around here.  If its possible_co_ they will install a function to help you do it.  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt__lt_a href_eq__qt_http_dd_//www.babylonjs.com/playground/#1IZVFS_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs.com/playground/#1IZVFS_lt_/a_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_The playground makes the first scene FOR you... as the first alert indicates.  Then I make another scene_co_ and the second alert tells us it worked.  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_ohmy.png_qt_ alt_eq__qt__dd_o_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/ohmy@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2014-06-18T01:15:55Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Because you control the renderLoop_co_ you can just load all your scenes and then_dd__lt_/p_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_engine.runRenderLoop(function() {   engine.scenes[currentSceneIndex].render()_sm_})_sm__lt_/pre_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"gryff","Date":"2014-06-18T04:30:21Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote data-ipsquote_eq__qt__qt_ class_eq__qt_ipsQuote_qt__gt__lt_div_gt_you can just load all your scenes_lt_/div_gt__lt_/blockquote_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I_t_m curious - in fact quite overwhelmed - about the code that allows loading _qt__lt_em_gt_all your scenes_lt_/em_gt__qt_ ?_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Not something I have seen in any tuts - and how does it handle all the textures you might be loading?_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_cheers_co_ gryff _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Kilombo","Date":"2014-06-18T13:02:35Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_It_t_s implemented. Quite easy actually. And works amazingly well._lt_/p_gt__lt_p_gt_I load the scenes in a _qt_sta.rt_qt_ function by calling two diferent funtions (each calls his scenes[0] and scenes[1])._lt_/p_gt__lt_p_gt_Then_co_ in the render loop i use some global booleans two trigger the rendering between them._lt_/p_gt__lt_p_gt_There_t_s the example code._lt_/p_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_function start() {    canvas _eq_ document.getElementById(_qt_renderCanvas_qt_)_sm_    var info1 _eq_ document.getElementById(_qt_info1_qt_)_sm_    var info2 _eq_ document.getElementById(_qt_info2_qt_)_sm_    var shipposition _eq_ document.getElementById(_qt_shipposition_qt_)_sm_            if (!BABYLON.Engine.isSupported()) {        window.alert(_t_Browser not supported_t_)_sm_    } else {        renderCanvas _eq_ document.getElementById(_qt_renderCanvas_qt_)_sm_        engine _eq_ new BABYLON.Engine(renderCanvas_co_ true)_sm_        var systems _eq_ new Array()_sm_        systems _eq_ sceneSpace()_sm_                sceneBase()_sm_    }_sm_engine.runRenderLoop(function() {if (base _eq__eq__eq_ true){        space _eq_ false_sm_        scenes[1].render()_sm_    }    if (space _eq__eq__eq_ true){        base _eq_ false_sm_        scenes[0].render()_sm_    }        })_sm__lt_/pre_gt__lt_p_gt_Thanks for the help guys._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]