Jump to content

[solved]how to get boundingbox info of a parent mesh with all children size


lhx880619
 Share

Recommended Posts

hi all,

i'm trying to calculate the boundingbox of a parent mesh, so that i may get a good camera asprect.

but failed to get the boundingbox size of the parent. are there any tricks there?

pg http://www.babylonjs-playground.com/#QVIDL9

 

// Our built-in 'sphere' shape. Params: name, subdivs, size, scene
    var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene); 
    // Move the sphere upward 1/2 its height
    sphere.position.y = 1;

    // Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
    var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
   

    var parent = new BABYLON.Mesh("parent",scene);
    sphere.parent = parent;
    ground.parent=parent;
    parent.showBoundingBox =true;  

 

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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