Jump to content

Scene.pick results off on larger distances?


Recommended Posts


I use the scene.pick function which is very nice. But I notice is it off on larger distances, is this because of JS number accuracy or is something wrong with the pick function?
I've made a small gif to show the problem. First close up, good, then a bit further, and you can see the chest is below the mouse pointer, like 20 px or so.


Thanks for insights



Link to comment
Share on other sites

Hi Temechon, thanks for your reply.

No I didn't use the camera parameter. My old code was:

let pickresult = gEditor.getScene().pick(mouseX, mouseY);

New code:

let pickresult = gEditor.getScene().pick(mouseX, mouseY, null, true, gEditor.getCamera());

But the result is exactly the same, the code for setting the mesh position is simply:

gEditor.getAttachedMesh().position = pickresult.pickedPoint;


It's not a huge problem for me, I just find it odd.

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.

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.


  • Recently Browsing   0 members

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