Jump to content

multiple mesh models


Bladetrick
 Share

Recommended Posts

hello!

I have inherited a model that has several layers.  Its a vehicle that is broken down into engine, body, exhaust, and break systems.  Each component is a new mesh layer.
As I was using babylon js to iterate through the layers of the model, I noticed that every mesh in the entire model has a position of (0, 0 , 0).  Is this normal?

Link to comment
Share on other sites

haha.  That sounds SO goofy, but true. 

I guess... what?   Slowly rotate each mesh, and it's easier to see offset-distances of vert positions... from mesh 0,0,0 origin.

Likely, the point-of-pivot will NOT be in the center of the actual mesh-"volume" (on certain layer-mesh).

I think there is a way to set the mesh origin to a more bounding-box-centered position.  Some setPivotPoint or setPivotMatrix BJS feature.  Here, I found this, somewhere:

mesh.setPivotMatrix(BABYLON.Matrix.Identity()); 
mesh.makeGeometryUnique();
mesh.setPivotPoint(mesh.getBoundingInfo().boundingBox.centerWorld, BABYLON.Space.WORLD);

I dunno what that stuff does, but it's fun to experiment-with.  I hear makeGeometryUnique() ensures that pivot point changes happen on THIS mesh only, and NOT its parent.  Clones are also involved, and possibly instancesForum search for 'makeGeometryUnique' == good idea.

Ok, that's enough Wingnut interrupting/yammering for THIS post.  :) Party on!

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