How would you use a camera from an imported blender model?

I have a blender model that was exported as a gltf. In blender there are cameras set up to swing around when the animation is played. I feel like it should be possible to traverse the model and set the perspectiveCamera to those camera animations, however, I can’t find any examples. Is it possible? Can anyone point me to an example or show me how it would be done, please?

1 Like

Yes, you’ll need to find the camera and then use it to render. For example:

var camera;
model.traverse((object) => {
  if (object.isCamera) camera = object;
});

// ... in animation loop ...

renderer.render(scene, camera);
2 Likes