I'm trying to figure out how I can get the scene
object programatically in React Three Fiber, so that I can add a Three component in the traditional way: scene.add(myThing)
. I've tried using const canvasRef = useRef()
with <Canvas ref={canvasRef} />
but the ref seems to be undefined when passing to another Component.
I know this is probably really bad practice, but what I'm trying to do, is convert this for use in React Three Fiber, but Geometry
has been replaced with BufferGeometry
and I'm a bit lost. I found this, but as mentioned, I'm just trying to use scene.add()
for now until I can figure more out about the inner workings of Three.
Thanks for any help.