I’m trying to rotate an array camera rather than a single camera, and I can’t make that work.
I’ve tried the following approaches without success:
- rotating the main camera using its .rotation property
- using the sample orbit controls script
- iterating over the camera array itself and using the .rotation property of each camera
Is there a solution to this problem?
AFAIK, transforming an instance of ArrayCamera
so it affects its subcameras is not supported. It’s just a container for multiple cameras which is used to avoid redundant tasks during rendering and to perform view-frustum culling for it’s subcameras.
Have you tried to put your single cameras in a THREE.Group
object and transform the group instead?
I see. I just tried to use a group and that didn’t work, but perhaps I implemented it incorrectly. I’ll take some more time with it.
That said, I think it’s a much better solution to have this work through the ArrayCamera! For example, OrbitControls expect a camera and break when they get a group, I believe.
That’s correct. You have to pass in a camera. Nevertheless, ArrayCamera
was not designed for such a use case. It’s primary application area is VR rendering.
Yeah I have a particularly strange use case! I’ll put in a feature request to make this work, as it would simplify a lot for me for the library I’m trying to make.
Just for anyone who ends up here, I solved this in the end by copying the main camera’s rotation to each of its subcameras each frame (or, at least, each time the value has changed).