haestflod Posted January 12, 2017 Share Posted January 12, 2017 Hi, I have a scene where I am calculating the direction of a ray and then tries to intersect a specific mesh to get the pickingInfo so I can get the surfaceNormal of the closest surface. I have replicated it here. http://playground.babylonjs.com/#1QXOXX#5 If I create a new mesh with the scaled values of the mesh it hits the mesh and everything works. Since the ray doesn't hit the mesh that is scaled I'm wondering what I'm doing wrong? Quote Link to comment Share on other sites More sharing options...
adam Posted January 12, 2017 Share Posted January 12, 2017 This example might help: http://playground.babylonjs.com/#ZHDBJ#19 Quote Link to comment Share on other sites More sharing options...
haestflod Posted January 12, 2017 Author Share Posted January 12, 2017 Hi, thanks Adam that did help. The important part was this: BABYLON.Vector3.TransformCoordinates(raypos, mesh.getWorldMatrix()) The direction I could use what I have already calculated. The updated playground: http://playground.babylonjs.com/#1QXOXX#6 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.