Jump to content

Difference Between MeshBuilder.CreateBox and SceneLoader.Append


Corn975
 Share

Recommended Posts

Hiya Corn975, welcome aboard.

What IF... Assassin.stl has many "sub-mesh".  Your object (assassin) might be an ARRAY, and thus, you cannot position an array.

Here is another way to load-in STL files, using a thing called the AssetsManager.

https://www.babylonjs-playground.com/#V4WNE7#11

This demo is rotating and positioning a cube that was loaded with stl.

The most important thing is... notice that this demo uses task.loadedMeshes[0].

In YOUR file, perhaps you should try something like... assassin[0].position.x += 0.01 * sign;

You can send assassin to console...   console.log(assassin) and check the JS console... see if it IS an array.  It might be.

console.log(assassin[0]) might be a BabylonJS mesh... an object-type that is better-equipped to accept a .position setting.  :)

*shrug*  Just some things to try/test.  Keep us posted, and stay tuned for more comments.

Note:  Often, in multi-mesh models, the "master handle" or "primary parent" is called the model's "root".  You position, rotate, and/or scale the root, and the rest of the model's submesh... do the same.  You can think of it as the model's "control gizmo" and it is sometimes invisible or has no dimensions/geometry.

Link to comment
Share on other sites

10 hours ago, Wingnut said:

Hiya Corn975, welcome aboard.

What IF... Assassin.stl has many "sub-mesh".  Your object (assassin) might be an ARRAY, and thus, you cannot position an array.

That may be it It. As ir was just something I pulled from online, thanks for the lead

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