Jump to content

Changing the local axes of a mesh according to camera movement


heavymetalmonk
 Share

Recommended Posts

I'm trying to move meshes using on screen buttons shaped like arrows. In the default view, the right arrow pushes the mesh to the right side of the screen and so on. But when the camera is moved, using the arrows is a bit confusing. For example, pressing right moves the mesh to its right, but towards the screen's top edge.

 

I'm using mesh.translate(new BABYLON.Vector3(10, 0, 0), 1, BABYLON.Space.LOCAL); for the translation.

 

So, is it possible to move the local axes with the camera, so that whatever I do with the camera, pressing the right arrow button (on-screen) pushes the mesh towards the right edge of the screen only.

 

Or is there any other way to achieve this?

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