-
Notifications
You must be signed in to change notification settings - Fork 21
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
How to access Three.js custom objects created on scene
?
#4970
Comments
scene
children with custom objects created?scene
?
@RodrigoRVSN To get intersection for custom objects added into Reveal, you can use
Note: The API is still in Beta, but it can be used. |
Thanks for the answer @pramod-cog I tried to do it like this const getHitObject = useCallback(
async (event: MouseEvent) => {
const intersection = await viewer?.getAnyIntersectionFromPixel(
new THREE.Vector2(event.offsetX, event.offsetY),
{
predicate: () => true,
}
)
console.log(intersection)
return intersection
},
[viewer]
) It is triggered in a Am I missing something in this implementation? |
You need to pass the custom object in
|
Question
How can I get the children of the scene, including the custom objects added with
addObject3D
?Workaround
I managed to do that using
With some TS errors (
cadNode
is not defined in TS), but would like to know if there's a more straightforward way to do that that I'm missing since it looks likegetScene()
was removedContext
^4.15.1
of libraryLineSegments
, etc. created on the sceneThe text was updated successfully, but these errors were encountered: