Jump to content

Get bounds


Recommended Posts

Hia guys!

On my current simple physics engine test (http://www.babylonjs-playground.com/#1BVXYE#6), I'm trying to grab the boundaries of meshes in a global way.

So I'm just trying to get the bounding box's coordinates.

I tried using minimum and maximum, but that doesn't seem to change depending on rotation of the mesh.

minimumWorld and maximumWorld works, but not... the values are really strange, and sometimes logs correctly and other times are identical to min and max.

If I need to make an example playground I will :)

Link to comment
Share on other sites

kind of hard to know what your pg is supposed to look like, but saying you were having problems with min/maxWorlds, I switched to extendSize, which is amount extended past origin.  It is basically your halfSize.  After more clean up, I get http://www.babylonjs-playground.com/#1BVXYE#9

I that what it is supposed to look like?

Link to comment
Share on other sites

Hmmm problem is I'm trying to find the bounding box that reacts to rotations of meshes. See how the plane is rotated? Theres that wireframe mesh that's supposed to visualize the bounding box I'm trying to get.

Extend size doesn't seem to do this. I print the object's extend size's z, and it prints 0 for the plane (incorrect) and 1 for the sphere (correct)

EDIT: HOLY CRAP IT WORKS! http://www.babylonjs-playground.com/#1BVXYE#12 

I was using minimum world bounds incorrectly, turns out it works :)

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...