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

Get faces/triangles normals when Raycasting in ThreeJS #141

Open
geoptex opened this issue May 19, 2022 · 3 comments
Open

Get faces/triangles normals when Raycasting in ThreeJS #141

geoptex opened this issue May 19, 2022 · 3 comments

Comments

@geoptex
Copy link

geoptex commented May 19, 2022

Hello Federico,

Is it possible to get faces/triangles normals when raycasting to a Nexus object like in other model formats in ThreeJS ?

The raycaster.intersectObjects seems to return only the position of the intersection.

Thank you in advance.

@ponchio
Copy link
Contributor

ponchio commented May 19, 2022

Hi,
right now nexus_three.js (in the master branch) or Nexus3D.js (in the threejsES6 branch) use the lowest resolution LOD for raycasting: the model can be pretty large, so traversing the tree and raycasting multiple nodes is more complicated and expensive (also in terms of RAM, since I have to keep all the nodes in javascript, vs. just keeping the GPU buffers).

For obvious reasons picking can only be done on the model at the resolution that has been already loaded, I could add a switch to enable higher resolution picking.

Otherwise I can patch nexus_three.js to also return the face and the face normal (the face index would not be that useful i guess).
Nexus3D.js is using the ThreeJS internal raycasting, albeit at the coarse LOD, and should return face and face index.

@geoptex
Copy link
Author

geoptex commented May 20, 2022

Hi,
Thanks for your answer. I believe patching nexus_three.js would be more helpful.

@geoptex
Copy link
Author

geoptex commented Aug 8, 2022

Hi Federico,
Have there been any progress regarding the higher resolution raycasting or returning face normals ?

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

2 participants