trois
trois copied to clipboard
Use GLTF camera
Hello!
As I see inside renderer, I can't substitute the camera as it's treated as a computed. Am I wrong?
I want to use the camera from my gltf but for now no luck...
Any ideas?
Thank you so much for your work 💚
Hi, there's a camera getter/setter in renderer component but I think it's better to copy gltf camera position.
When Gltf model is loaded you can copy camera position, something like this :
const camera = this.$refs.camera
camera.position.copy(model.cameras[0].position)
camera.quaternion.copy(model.cameras[0].quaternion)
camera.scale.copy(model.cameras[0].scale)