-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raycast Picker issue #14
Comments
If you require the closest collision to be returned, you should be using Raycaspicker(true). |
I have checked with Raycastpicker(true) option, its Not working for all
conditions.
I have attached one obj (shirt.obj). In the attached object pocket and
Front-strap meshes are top of the front-left mesh .
1. clicking on pocket is detecting front-left mesh with Raycast
picker(true) option.
2. clicking on Front-strap is detecting front-left mesh with Raycast
picker(false) option.
On Fri, Jan 12, 2018 at 5:25 PM, Rob Bateman ***@***.***> wrote:
If you require the closest collision to be returned, you should be using
Raycaspicker(true).
|
Any update on this?
On Mon, Jan 22, 2018 at 5:14 PM, Prarthana Hegde <[email protected]
… wrote:
I have checked with Raycastpicker(true) option, its Not working for all
conditions.
I have attached one obj (shirt.obj). In the attached object pocket and
Front-strap meshes are top of the front-left mesh .
1. clicking on pocket is detecting front-left mesh with Raycast
picker(true) option.
2. clicking on Front-strap is detecting front-left mesh with Raycast
picker(false) option.
On Fri, Jan 12, 2018 at 5:25 PM, Rob Bateman ***@***.***>
wrote:
> If you require the closest collision to be returned, you should be using
> Raycaspicker(true).
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#14 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/ARwDmBvHwf13C-ZLFjKvKXG-zpSSIXdKks5tJ0gxgaJpZM4Qetyu>
> .
>
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#m_-5132792643872046407_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
|
Something else you can try is to define a PickingCollider object on the meshes you are trying to detect by default, picking will only detect against bounding boxes which may be why you're still getting the wrong mesh ie the bounding box of the front-left mesh encloses the bounding box of the front-strap. if you want to do per-triangle picking, you need to set a PickingCollider object on the meshes. You can do this by listening for Mesh objects on ASSET_COMPLETE and adding a new JSPickingCollider object by doing the following:
I realise this system is currently a little unwieldy - if you can't get it to work then you should check out the mouse interaction example source here that implements the same code above: https://github.com/awayjs/awayjs-examples/blob/dev/src/Intermediate_MouseInteraction.ts hth |
Hi Rob,
Thank you so much for your reply.
As per your suggestion, I tried implementing both options but unfortunately
both don't seem to work.
It works for a few objects but not for the attached shirt object.
I am not sure how to solve this issue. Request you to please help once
again.
The desired behaviour should be: If clicked on pocket/front-strap, it
should detect the pocket/front-strap respectively, not the front-left mesh.
Thanks & Regards,
Prarthana
…On Thu, Mar 1, 2018 at 9:45 PM, Rob Bateman ***@***.***> wrote:
Something else you can try is to define a PickingCollider object on the
meshes you are trying to detect
by default, picking will only detect against bounding boxes which may be
why you're still getting the wrong mesh ie the bounding box of the
front-left mesh encloses the bounding box of the front-strap. if you want
to do per-triangle picking, you need to set a PickingCollider object on the
meshes. You can do this by listening for Mesh objects on ASSET_COMPLETE and
adding a new JSPickingCollider object by doing the following:
view.setCollider(mesh, new JSPickingCollider(true));
I realise this system is currently a little unwieldy - if you can't get it
to work then you should check out the mouse interaction example source here
that implements the same code above:
https://github.com/awayjs/awayjs-examples/blob/dev/src/
Intermediate_MouseInteraction.ts
hth
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ARwDmBLdFYNkxGdGw1Kn68ROmEdN--k5ks5taB6IgaJpZM4Qetyu>
.
|
I am using awayjs lib to render complex 3D models. I have assigned mouse click event for 3d model meshes using Raycaspicker(false).
Raycast Picker is not picking meshes correctly, its not returning the first collision encountered.
The text was updated successfully, but these errors were encountered: