Thema Posted August 17, 2017 Share Posted August 17, 2017 Hello, I cannot figure out how the get an updated Bounding Box after the rotation, position or scaling of a mesh. Here the playground: https://www.babylonjs-playground.com/#5HP8KU#1 Thanks in advance for the help Quote Link to comment Share on other sites More sharing options...
jerome Posted August 17, 2017 Share Posted August 17, 2017 force the mesh WM computation before the rendering (line 30) then use minimumWorld and maximumWorld instead : https://www.babylonjs-playground.com/#5HP8KU#2 Quote Link to comment Share on other sites More sharing options...
Thema Posted August 17, 2017 Author Share Posted August 17, 2017 Thanks, it works perfect. Quote Link to comment Share on other sites More sharing options...
Thema Posted August 18, 2017 Author Share Posted August 18, 2017 Hello, I reopened the topic, the getBoundingInfo is not working when the rotation in degrees is not a divisor of 180. Example: 8 degrees is not a divisor of 180, 180 / 8 = 22.5 https://www.babylonjs-playground.com/#5HP8KU#3 Quote Link to comment Share on other sites More sharing options...
jerome Posted August 18, 2017 Share Posted August 18, 2017 Actually, I guess the maximumWorld, minimumWorld are the values of Axis Aligned Bounding Box vertices (meaning the World Axis). Quote Link to comment Share on other sites More sharing options...
jerome Posted August 18, 2017 Share Posted August 18, 2017 mmmh... I suppose my answer is probably not enough as I can imagine you will wonder then how to set the spheres to rotated BBox positions, won't you ? https://www.babylonjs-playground.com/#5HP8KU#4 Just apply the same transformation than the mesh to its BBox Quote Link to comment Share on other sites More sharing options...
Thema Posted August 18, 2017 Author Share Posted August 18, 2017 There is no more need of computeWorldMatrix? Quote Link to comment Share on other sites More sharing options...
jerome Posted August 19, 2017 Share Posted August 19, 2017 nope computeWorldMatrix was necessary because we had to update the WM that is used to update the maxWorld and winWorld of the BBox before the rendering (maxWorld and minWorld are automatically updated only at rendering time, not before when you needed them) Now we don't use maxWorld but max/min instead, everything can be computed at the same step at the rendering time. 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.