oschakravarthi Posted January 6, 2019 Share Posted January 6, 2019 PG: https://www.babylonjs-playground.com/#ASDN0P#1 Hi,I am getting the same BoundingInfo after scaling the mesh. var bb1 = sphere.getBoundingInfo().boundingBox; sphere.scaling=new BABYLON.Vector3(2,2,2); sphere.refreshBoundingInfo(); var bb2 = sphere.getBoundingInfo().boundingBox; //I am getting a bounding box with the same values of bb1. var areEqual=bb1.minimumWorld.equals(bb2.minimumWorld) && bb1.maximumWorld.equals(bb2.maximumWorld); alert(areEqual); //It is showing "true". It should show "false" Thanks in advance Quote Link to comment Share on other sites More sharing options...
Raggar Posted January 6, 2019 Share Posted January 6, 2019 It is discouraged to keep using this forum, instead create a thread at forum.babylonjs.com This seems to work: https://www.babylonjs-playground.com/#ASDN0P#2 I (think!) changing the transforms of a mesh only updates the boundingInfo, without creating a new one, so the reference bb1 gets updated as well, making both references bb1 and bb2 the same. Why the baking of transforms worked, I have no idea, but it seems to be needed in order to work in this example. Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted January 6, 2019 Author Share Posted January 6, 2019 56 minutes ago, Raggar said: It is discouraged to keep using this forum, instead create a thread at forum.babylonjs.com This seems to work: https://www.babylonjs-playground.com/#ASDN0P#2 I (think!) changing the transforms of a mesh only updates the boundingInfo, without creating a new one, so the reference bb1 gets updated as well, making both references bb1 and bb2 the same. Why the baking of transforms worked, I have no idea, but it seems to be needed in order to work in this example. Thank you @Raggar. I did not know that forum is available in babylonjs website. I will use forum going forward. Lets complete this question here. I added a dummy mesh and set it as the parent to my sphere. Now I set the scaling of the parent. It is not working as expected. I have updated the PG https://www.babylonjs-playground.com/#ASDN0P#3 Please have a look and help me. Thanks in advance. 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.