Jump to content

How to rotate mesh instead of the camera?


amarneethi
 Share

Recommended Posts

8 hours ago, amarneethi said:

@Nockawa I had a look at your playground, with all respect the movement looks very similar to what it is in my other playground scene. Maybe this is because the inertia is not implemented yet (as you mentioned) or something else, I dunno. But thanks for pitching in buddy.

@Vousk-prod. Yeah you are right about the movement being followed perfectly, but that can be fixed by increasing the factor from 300 to 500 at line 85 and 86 in the playground scene. As for the unexpected rotation, I have no idea how to fix that. haha. Let's see if someone from the forum can throw some light on the solution.

http://babylonjs-playground.com/#CGXLT#5

@amarneethi: mine solve the "unexpected rotation" issue you have, try rotating 90° on X, then 90° on Y, you will see the mesh always rotates in the direction of the mouse.

Which is not the case for you because you apply mouse move in Rotation.x/y of the mesh, so it's always local and it's disturbing the user because he/she expects a rotation in camera space, not the mesh's space.

Link to comment
Share on other sites

This needs to be easier, maybe.

Babylon.meshCamera class?

Maybe a constructed-frozen universalCamera, aimed directly at its .target.  The input activity (mouse, gamepad, touch)... controls .target mesh AS IF the target mesh was an ArcRotateCamera viewed from a distance.

I'm not sure what we would do with the mouse wheel.  Technically, the mousewheel would move the target mesh closer/farther, but, maybe the mousewheel stays with the camera (the ONLY characteristic of the meshCamera that moves via input device).

Or, maybe not.  *shrug*  :)

Link to comment
Share on other sites

  • 10 months later...

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