text: [{"Owner":"grire974","Date":"2015-09-22T14:44:56Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_This is probably quite a simple problem to solve_sm_ but I_t_m pretty new to BabylonJS.  I would like users of my code to be able to arbitrarily scale a 3D model loaded from a .babylon file using code like this_dd__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_div_gt__lt_br_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_BABYLON.SceneLoader.Load(_qt__qt__co_ _qt_model.babylon_qt__co_ engine_co_ function (newScene) {newScene.executeWhenReady(function () {..._lt_/pre_gt__lt_/div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt_After the scene has been rendered using_co_ _lt_/div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt__lt_br_gt__lt_div_gt__lt_br_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_engine.runRenderLoop(function() {newScene.render()_sm_})_sm__lt_/pre_gt__lt_/div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt_I_t_m then trying to apply the user defined scaling value like this (for example 200% scaling)_dd__lt_/div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt__lt_br_gt__lt_div_gt__lt_br_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_for (i _eq_ 0_sm_ i &lt_sm_ newScene.meshes.length_sm_ i++){        newScene.meshes[i].scaling _eq_ new BABYLON.Vector3(2_co_ 2_co_ 2)_sm_  } _lt_/pre_gt__lt_/div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt_As you can see from the attached images of normal vs scaled_sm__lt_/div_gt__lt_div_gt__lt_a class_eq__qt_ipsAttachLink ipsAttachLink_image_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_09_2015/post-16528-0-01284000-1442933040.jpg_qt_ rel_eq__qt_external nofollow_qt__gt__lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_09_2015/post-16528-0-01284000-1442933040.jpg_qt_ data-fileid_eq__qt_5156_qt_ class_eq__qt_ipsImage ipsImage_thumbnailed_qt_ alt_eq__qt_post-16528-0-01284000-1442933040.jpg_qt__gt__lt_/a_gt__lt_/div_gt__lt_div_gt__lt_a class_eq__qt_ipsAttachLink ipsAttachLink_image_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_09_2015/post-16528-0-67915200-1442933040.jpg_qt_ rel_eq__qt_external nofollow_qt__gt__lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_09_2015/post-16528-0-67915200-1442933040.jpg_qt_ data-fileid_eq__qt_5157_qt_ class_eq__qt_ipsImage ipsImage_thumbnailed_qt_ alt_eq__qt_post-16528-0-67915200-1442933040.jpg_qt__gt__lt_/a_gt__lt_/div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt_the 200 percent scaled version isn_t_t scaled proportionately_sm_ e.g. the wheels out grow the chassis of the vehicle.  Is this the correct way to scale a scene of multiple meshes?  Should I instead be adding all my meshes to a parent node and then scaling that? (if so how)._lt_/div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt_Appreciate the help_sm_ thanks!_lt_/div_gt__lt_/div_gt__lt_/div_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":"ChrisR","Date":"2015-09-22T20:04:46Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_This could be because the scale of the mesh before you set it isn_t_t 1_co_1_co_1 (which is sometimes the case when importing meshes)._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_You could try_co__lt_/p_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_for (i _eq_ 0_sm_ i &lt_sm_ newScene.meshes.length_sm_ i++){        newScene.meshes[i].scaling.multiply(new BABYLON.Vector3(2_co_ 2_co_ 2))_sm_  } _lt_/pre_gt__lt_p_gt_What happens to the mesh if you set it to (1_co_1_co_1) does the mesh change size?_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":"grire974","Date":"2015-09-23T02:42:01Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Good question - I think I_t_d already tried that_sm_ Tried it again just to be sure... All 6 meshes are showing initial scaling of {x_dd_ 1_co_ y_dd_ 1_co_ z_dd_ 1}.. also noticed that you added the .multiply member of the Vector3 class into your code_sm_ so I tried some variations of that - however as you have it_sm_ I don_t_t think it will have any effect as its a statement rather than an assignment_co_ I did try something like this though_dd__lt_/p_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_newScene.meshes[i].scaling _eq_ newScene.meshes[i].scaling.multiply(new BABYLON.Vector3(2_co_ 2_co_ 2))_sm__lt_/pre_gt__lt_p_gt__lt_span style_eq__qt_color_dd_rgb(102_co_102_co_0)_sm__qt__gt_However this still gave me the out of proportion scaling shown in my 200 percent attachment.  Any other thoughts?_lt_/span_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":"2015-09-23T02:48:06Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_a good idea would be to have an object which will be the parent of all others objects and just set parent.scaling _eq_ new BABYLON.Vector3(2_co_ 2_co_ 2)_sm__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":"grire974","Date":"2015-09-23T02:59:37Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Yeh I figured it would be something like that.. Using cocos3d I used something similar_sm_ attaching the model (including its meshes) to a node_sm_ &amp_sm_ then performing scaling / positioning/ rotation operations on that parent node.._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Looking at the API documentation for Babylon though_sm_ I_t_m not too sure how that might look_sm_ the Node class doesn_t_t have the scaling member_sm_ and Scene doesn_t_t seem to extend any other classes (nor does it have the scaling property either)._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Any hints? _lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_p.s thanks for the quick reply!_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":"grire974","Date":"2015-09-23T03:01:17Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_more specifically I mean_sm_ what type of parent class should I be adding my imported .babylon file to? &amp_sm_ what does the code for that look like?_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":"2015-09-23T04:05:52Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_just create a box_co_ make it like box.isVisible _eq_ false and then set myObject.parent _eq_ box_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":"grire974","Date":"2015-09-23T13:49:28Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Thanks for that tip.. I tried something like this_dd__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_div_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_var m _eq_ BABYLON.Mesh.CreateBox(_t_pmesh_t__co_15000_co_ newScene)_sm_m.isVisible _eq_ false_sm_ for (i _eq_ 0_sm_ i &lt_sm_ newScene.meshes.length_sm_ i++){         newScene.meshes[i].parent _eq_ m_sm_}  m.scaling _eq_ new BABYLON.Vector3(2_co_ 2_co_ 2)_sm__lt_/pre_gt__lt_/div_gt__lt_div_gt__lt_div_gt_ _lt_/div_gt__lt_div_gt_However_co_ unfortunately it doesn_t_t work_sm_ I get a javascript error with babylon.js_dd_ Uncaught RangeError_dd_ Maximum call stack size exceeded.  Its citing line 6_sm_ however the file is minified so I_t_m not so sure.  Before the error is thrown_co_ there are numerous console logs_dd_ _lt_/div_gt_\t\t\t\tt.isEnabled\t\t\t\t\t\t\t@\t\t\t\t\t\t\t_lt_a title_eq__qt_https_dd_//www.arbuilder.com/assets/scripts/babylon.js_dd_6_qt_ rel_eq__qt_external nofollow_qt__gt_babylon.js_dd_6_lt_/a_gt_\t\t_lt_p_gt_ _lt_/p_gt__lt_p_gt_Any thoughts?_lt_/p_gt__lt_/div_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":"2015-09-23T15:48:23Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_I think that this is because you try to set m.parent _eq_ m _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_ you have to check if _lt_span_gt_newScene_lt_/span_gt__lt_span style_eq__qt_color_dd_rgb(102_co_102_co_0)_sm__qt__gt_._lt_/span_gt__lt_span_gt_meshes_lt_/span_gt__lt_span style_eq__qt_color_dd_rgb(102_co_102_co_0)_sm__qt__gt_[_lt_/span_gt__lt_span_gt_i_lt_/span_gt__lt_span style_eq__qt_color_dd_rgb(102_co_102_co_0)_sm__qt__gt_] !_eq__eq_ m in your loop_lt_/span_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":"grire974","Date":"2015-09-24T02:56:31Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_aha! Of course.. Thanks for that.  For those of you reading the thread this was my code that solved it for me_dd__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_div_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_var m _eq_ BABYLON.Mesh.CreateBox(_t_pmesh_t__co_15000_co_ newScene)_sm_m.isVisible _eq_ false_sm_ for (i _eq_ 0_sm_ i &lt_sm_ newScene.meshes.length_sm_ i++){                if(newScene.meshes[i].id _eq__eq_ _t_ground1_t_){continue}//substitute _t_ground1_t_ for the id of any mesh you don_t_t want to scale                if(newScene.meshes[i].id _eq__eq_ _t_pmesh_t_){continue}                newScene.meshes[i].parent _eq_ m_sm_}  m.scaling _eq_ new BABYLON.Vector3(2_co_ 2_co_ 2)_sm_//e.g. for 200% scaling_lt_/pre_gt__lt_/div_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":"grire974","Date":"2015-09-24T02:58:26Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_p.s. deltakosh - on a side note while I_t_ve got you here_sm_ not sure if you_t_re interested but I made a fix to the FBX exporter visual c++ solution a couple of weeks back.. However couldn_t_t get my pull request to be accepted_sm_ are there any permissions that I need to be aware of for the github repo?_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":"2015-09-24T03:45:22Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Hello!_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_No there is no permission_dd_ jsut fork it_co_ make your fix_co_ commit and create a pull request _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_"}]