diamondage Posted August 30, 2015 Share Posted August 30, 2015 Hi I am just starting out with Babylon JS for a research project and it seems I am stuck finding a solution for mapping 2D screen mouse coords to 3D XZ movements relative to the camera. The project involves simple moving and stacking cubes. The problem is when my camera is looking into the z-axis I am able to figure out how to make the x and y of the mouse related to XZ in the app. However this goes to heck when I move the camera out of the z axis say by 90 degrees. The x and y will still translate the object as x and z but in from the camera perspective I've turned 90 degrees and the x and y of the mouse should change to z and x. I've tried unproject but it seems I don't understand the problem well enough and am missing the Z for the screen coordinates. I cannot use the pick ground strategy because it causes blocks stacked on top to 'jump' to the ray that hits the ground behind it. My sample is here:http://www.babylonjs-playground.com/#BTHKN Thanks in advance for any help!Wil Quote Link to comment Share on other sites More sharing options...
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.