Corn975

Difference Between MeshBuilder.CreateBox and SceneLoader.Append

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.