Replies: 1 comment 1 reply
-
@khughitt this module does not have any understanding of the three-fiber environment, so it won't understand if you pass a r3f object directly to it. It expects a ThreeJS object, typically a Mesh. So if there's a way to extract a Mesh from your r2f object you can just feed that into this lib. On the other hand, if you're already working in a r2f scene, you could also consider doing it the other way and import a three-forcegraph object onto your scene. Then you'll everything under the same roof. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
Is it possible to use a react-three-fiber (r3f) component, e.g. something like the
Box
component in their README, withnodeThreeObject
?I have a r3f component that I'm using elsewhere in an application, and would like to render the same entities in the network.
Attempting to pass the component directly fails, since it's not actually a three.js mesh ("Uncaught TypeError: can't define property "__graphObjType": Object is not extensible").
I also tried creating a ref in the component where
<ForceGraph3D>
is instantiated:And then passing that in as a prop into the r3f component and then in turn setting that as the "ref" prop for the parent level
<mesh>
returned in the r3f component, but that also didn't work:ref.current
never evaluated to anything besidesnull
..Passing refs in that way could also become awkward once one tries to render multiple nodes this way.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions