You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using the GLTFModel component to load my models.
Unfortunately, I can't programmatically modify or even access them.
The documentation provides this example:
<script setup lang="ts">
import { GLTFModel, OrbitControls } from '@tresjs/cientos'
const modelRef = shallowRef<THREE.Object3D>()
watch(modelRef, (model) => {
// Do something with the model
model.position.set(0, 0, 0)
})
</script>
Unfortunately, the object I receive in return is not a 3D Model. I don't even know what it is.
It looks like a ref without a .value, and I can't access any value.
I found a better approach, but unfortunately, it produces the same results. Instead of using watch, I’m now using the @resolve event from Suspense, which wraps the GLTFModel.
How can we programmatically modify the object when using the GLTFModel component?
Hi, I don't understand this one. I check your repro link and is there, I think there is another issue because is under value.value nested.
As a suggestion you can apply affine transformations (rotation, translation, scale) directly on the model instead of creating an extra group layer, will be a layer less when access to it
Describe the bug
I've been using the
GLTFModel
component to load my models.Unfortunately, I can't programmatically modify or even access them.
The documentation provides this example:
Unfortunately, the object I receive in return is not a 3D Model. I don't even know what it is.
It looks like a
ref
without a.value
, and I can't access any value.It's something like this:
I found a better approach, but unfortunately, it produces the same results. Instead of using
watch
, I’m now using the@resolve
event fromSuspense
, which wraps theGLTFModel
.How can we programmatically modify the object when using the
GLTFModel
component?Reproduction
https://stackblitz.com/edit/tresjs-basic-tktzn1zk?file=src%2Fcomponents%2FTheExperience.vue
Steps to reproduce
System Info
Used Package Manager
npm
Code of Conduct
The text was updated successfully, but these errors were encountered: