Varsha Kamble Posted June 5, 2018 Share Posted June 5, 2018 Hi @Deltakosh, I am adding axis to root node of model with which i can move whole model. Currently i am adding fixed length axis. But i want it to be dynamic depending on height - width of model. With fixed length i am facing following issue. For some models , height (or width ) is greater that the length of axis, due to which arrow of that axis is not visible (as it is inside the model). So i am not able to drag model in axis direction. For above model, root node is at bottom of model, so Y axis is inside the model, due to which i am not able to drag model in Y direction. For this model, fixed length works fine as all axis arrows are dragable. Can you please help me to get height-width of model, so that i can create axis with dynamic length. Thanks. Regards, Varsha Quote Link to comment Share on other sites More sharing options...
JohnK Posted June 5, 2018 Share Posted June 5, 2018 You can use bounding box to calculate width, height, etc of a mesh. PG https://www.babylonjs-playground.com/#10JFPK#4 Quote Link to comment Share on other sites More sharing options...
Varsha Kamble Posted June 5, 2018 Author Share Posted June 5, 2018 Hi @JohnK, Yes. with boundingBox we can do it. But here i want height of whole model not only of mesh. So if i calculate it by iterating over meshes in model, it will give me wrong answer as i don't know which mesh is placed where. Thanks. Regards, Varsha Quote Link to comment Share on other sites More sharing options...
JohnK Posted June 5, 2018 Share Posted June 5, 2018 If the model is not changing size etc after loading you could try forming a dummy mesh by merging all the meshes of the model without deleting the model, dis-enable the dummy so it does not appear and find and store the info from the bounding box of the dummy and then dispose of the dummy. Never tried it but it might be worth a go! ? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2018 Share Posted June 5, 2018 You can also use this function: http://doc.babylonjs.com/api/classes/babylon.abstractmesh#gethierarchyboundingvectors babbleon 1 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.