Lande Posted March 2, 2017 Share Posted March 2, 2017 Hello everyone!. I am developing an application with Babylon.js and I have setup the WebVRFreeCamera on my scene. I have been playing with babylon actions, pickResults etc using the mouse pointer, and now I was trying to get the mesh that is in the camera view trajectory so I can trigger actions or activate behaviours. I have tried using Babylon.Ray and looking around the documentation with no luck, I have been also testing React VR, and it has event binding to the meshes on the scene. Something like this: <Mesh source={{mesh:'cube.obj', texture:'cube.jpg'}} onEnter={this.OnEnterCallback} onExit={this.OnExitCallback} /> It makes easy triggering events when gaze in / gaze out happens around the different meshes, and I would like to know if you can guide me in the right direction to do this with babylon. I have seen that scene has scene.getActiveMeshes, but I returns an SmartArray of visible meshes in the camera, and It would be cool to have something more precise. I hope you can guide me!. Thanks! Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 2, 2017 Share Posted March 2, 2017 Hi Lande, funny, I just answered the exact question in an email So, a simple playground to get things started: http://www.babylonjs-playground.com/#1IDANY - this is almost exactly what babylon is already going every frame for checking the meshUnderPointer, of course in this case I am using the middle of the screen and not the XY of the pointer. The same can be done in VR to check where the camera is looking at. Hope this gets you and everyone with the same issue started! 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.