Jump to content

scene.pick not working when too close to a mesh


Ruffle
 Share

Recommended Posts

Hi, 
I don't know if you could really call this a bug or maybe it's working as intended and I'm doing it wrong... (sorry)

If you get sufficiently close and intimate with a mesh you can't pick it.
Here's a playground:

http://www.babylonjs-playground.com/#1KNCOA

The important parameter to look at is the Z coordinate of the camera.
If I set it to -1.06 then I can successfully pick the front face of the box and distance to the box is 0.01. (I'm printing pickResult in the console)
If I set it to -1.04 then I can only pick the back face of the box yet I can still see the front face.
If I set it to more than -1 then I can't see the box so I can't pick it, that's normal.

It's as If the ray's origin wasn't exacly in the camera's viewframe but 1 unit length in front of it.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...