Sign in to follow this  
hcmetal

Does rotation work differently on built-in mesh and imported mesh?

Recommended Posts

Hello everyone,

I am wondering if the "mesh.roation" attribute work differently on built-in mesh and imported mesh?

As shown in this PG:

https://playground.babylonjs.com/#WQGZB5

As I set the same rotation attribute:

scene.registerBeforeRender(function() {
    rotationtest.rotation.y = 0.02;
    box.rotation.y = 0.02;
});

The imported mesh rotates with a constant speed while the built-in box stays put.

It apears as if the imported mesh rotates incrementally by local axis and the built-in box rotates by directly setting the rotation vector.

What's happening under the hood?

Can I make the imported mesh rotate like the built-in mesh (which makes much more sense to me)?

Hope someone can point me to the right direction.

Thanks alot!

Share this post


Link to post
Share on other sites

What @NasimiAsl did works, but it's hiding the underlying problem, which is that the imported mesh has the rotationQuaternion set.  Maybe we need to update our docs as this has come up a few times and it can be confusing! :)

https://playground.babylonjs.com/#WQGZB5#2

 

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.