MarianG Posted January 31, 2018 Share Posted January 31, 2018 Hi. As the title say, I'm trying to do a menu with 3d objects and you can drag objects from menu to the scene. It is basic yet. I'll add more features soon. I've been trying to fix it for a while, so I decided to ask for help So it's simple. We have a scene with a grid, and on top a menu with 3d objects. The mesh that holds the 3d objects is parented to the camera., and about 300 on z axis. I create a transparent plane at the same distance from camera and parent it to camera too, for drag and drop. It works well, but on drop I want to project the position of the 3d object on the grid somehow, but I do not figure it out. So I decide to put it on midle default. Here is the sample: http://playground.babylonjs.com/#ANU67L#3 #line 131 is the default, and on #line 130 i tried something but without succes. Any help are welcome. Pace and love brianzinn, babbleon and Arte 3 Quote Link to comment Share on other sites More sharing options...
Amarth2Estel Posted February 1, 2018 Share Posted February 1, 2018 Hi MarianG ! You may use the pickingInfo returned by the method pick of scene to get the exact picked point of the ground on drop. Here is a PG to show it. The predicate is done to pick only the ground. MarianG 1 Quote Link to comment Share on other sites More sharing options...
MarianG Posted February 1, 2018 Author Share Posted February 1, 2018 Yay. This is it. Many thanks @Amarth2Estel 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.