Jump to content

Gwir
 Share

Recommended Posts

Hi!

i have a scene with some meshes and a FreeCamera, i interact with meshes using a Leap Motion. The user hands are represented by two cursors (two spheres in the scene). I need to set the cursors position relative to the camera orientation too.

At the moment i managed to do it relatively to camera translation, the cursors correctly follow the camera position in the scene. I can't set the correct cursors position if the camera rotates. 

This is the code:

handCursorR.position.x = (camera._currentTarget.x) + frame.hands[0].palmPosition[0]/motionScaleFactor;
handCursorR.position.y = (camera._currentTarget.y-10) + frame.hands[0].palmPosition[1]/motionScaleFactor;
handCursorR.position.z = (camera._currentTarget.z+10) -frame.hands[0].palmPosition[2]/motionScaleFactor;

 

Link to comment
Share on other sites

Hiya Gwir... welcome to the forum!  Wow, I'm sorry for slow replies.  Have you had any success, yet?  Any chance you could parent both spheres...TO the camera?  Then when the camera turns, both spheres should remain at the same location in the camera view.

Hope this helps.  I'm thinking on it. (not really a good thing)  :) 

I'm off to research Leap Motion... see what the heck that thing is.  Looks kind of cool.  There's probably a 2D layer/sub-canvas involved, and that needs to be aligned with BJS clientX/Y, and ohh... it might be messy.  Learning... 

Again, welcome.

Link to comment
Share on other sites

9 hours ago, Wingnut said:

Hiya Gwir... welcome to the forum!  Wow, I'm sorry for slow replies.  Have you had any success, yet?  Any chance you could parent both spheres...TO the camera?  Then when the camera turns, both spheres should remain at the same location in the camera view.

Hope this helps.  I'm thinking on it. (not really a good thing)  :) 

I'm off to research Leap Motion... see what the heck that thing is.  Looks kind of cool.  There's probably a 2D layer/sub-canvas involved, and that needs to be aligned with BJS clientX/Y, and ohh... it might be messy.  Learning... 

Again, welcome.

Hi!

Parenting cursors with camera is actually the solution, need to sync mesh movement with camera but i solved some days ago. Thanks anyway for help!

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