Replies: 1 comment
-
The sketch fab looks like it makes use of cssRendering. Rather than free clicking an object mesh. For getting the mesh position when clicking on the model you can use raycasting that is set from the camera. Check out 'intersectObject()' which returns a point of intersection in world coordinates given an 3DObject to test against. Then use the coordinates to update the camera. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Discussed in #2833
Originally posted by cody0203 April 12, 2023
Hello guys,
I have a question about mesh interaction. Could i get the mesh's position when i clicked on it to rotate and move the camera to it like sketchfab annotation?
https://sketchfab.com/3d-models/california-bungalow-exterior-9253163a82664090972e58f2a52425d2
I have tried Bounds component from
@react-three/drei
but i don't want the camera zoom to the mesh.This is my reproduce.
https://codesandbox.io/s/bold-https-400s5p?file=/src/Scene.js:177-194
Thank you guys.
Beta Was this translation helpful? Give feedback.
All reactions