Skip to content
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

Implement ThreeJS Interactive + multiple NFT #377

Open
vincenzobologna opened this issue Feb 10, 2024 · 0 comments
Open

Implement ThreeJS Interactive + multiple NFT #377

vincenzobologna opened this issue Feb 10, 2024 · 0 comments

Comments

@vincenzobologna
Copy link

vincenzobologna commented Feb 10, 2024

Hallo @kalwalt,

i moved to this package from your ARnft wonderfull kit because i need to load multiple NFT markers and with this one the performance are better. Very powerfull!

Now i moving interactions for each marker here with this package and i pretty done the task, attaching the following event listener to each geometry i linked to each target:

geometry.addEventListener('mousedown', (e) => {
        e.stopPropagation()
        if(marker.name === e.target.name && e.intersected === true) console.log('[found!]', marker.name, e)
})

Where geometry is the object where i setup the geometry (a simple PlaneGeometry with a texture) and marker is the object where i store metadata linked to the target.
In this case, with the interaction simply log the name of object.

The issue: when i add more than one marker in scene. Sometimes fired mousedown event intersect the wrong geometry and respond with a log of another marker and not the clicked one.
I tried to compare wrong fired event with the right one, but the only differences between them are in "distance" property, but the float number cant help me to filter events, because i haven't a usefull comparing range number.

The question: how can i filter the wrong fired events? Becaues it seems the InteractionManager can't perform well clicked geometries appeared in scene.
Anyone encounter this issue? How you resolved it?

My configuration is:

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant