Using ref is not handy
We should maybe find another way to get access to renderer and threejs objects.
At least with a reference to <Renderer>, we have getObjectByName method to access children objects? https://threejs.org/docs/index.html#api/en/core/Object3D.getObjectByName
To get access to object id that took some time to find the troisjs has it. I didn't see some docs examples. Looking that src files.
This is vuejs 3 setup but the old version should work.
<script setup>
import { RendererInjectionKey, SceneInjectionKey } from 'troisjs'
import {inject, onMounted, onUnmounted} from "vue";
const renderer = inject(RendererInjectionKey);
console.log(renderer)
const scene = inject(SceneInjectionKey);
console.log(scene)
</script>
You can read more about it vuejs docs.
https://vuejs.org/guide/components/provide-inject.html#prop-drilling
Thanks @Lightnet, sorry for this late answer, I am quite busy lately.
I think the main problem is how to normalize the way to access components (and threejs objects), e.g.:
If I want to set positions on an instanced mesh, I can use 'created' event : https://github.com/troisjs/trois/blob/0.3.4/src/core/Object3D.ts#L115
If I want to animate this instanced mesh I'll have to use renderer.onBeforeRender and a ref, do you see what I mean ?