Jump to content

How to set the matrix of mesh in BabylonJs


curry
 Share

Recommended Posts

Hi guys,

I was trying to load obj meshes to the scene and for reusing them, I tried the method "createInstance".

However, I can't set the matrix of each instance by assigning each mesh a "_worldMatrx".

I am confused with the issue. Is there any methods for setting the mesh matrix? 

Sorry for the rookie question, any suggestion will be helpful. Thank you in advance.

Link to comment
Share on other sites

Hiya @curry, welcome to the forum.  I KNOW there are many ways to transform mesh with matrices, here.  I'm just not very knowledgeable about using matrices.  SO, I'm only "bumping" your questions... to the top of the Q&A forum.  Likely, I have no good answers for you.  Sorry.

Um... take a look at this...

http://doc.babylonjs.com/classes/2.4/Mesh#baketransformintovertices-transform-rarr-void

Notice that is part of the Babylon Mesh class, so it would be mesh.bakeTransformIntoVertices(someMatrix), I suppose.  That might work for you.  Not sure.  We'll talk... and hopefully others (smarter folks than I) will comment soon.  Again, welcome.

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