Gwir Posted May 25, 2016 Share Posted May 25, 2016 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; Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 31, 2016 Share Posted May 31, 2016 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. Quote Link to comment Share on other sites More sharing options...
Gwir Posted June 1, 2016 Author Share Posted June 1, 2016 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! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.