I am trying to get laterals views on a second camera attached to a moving object.
While the object is moving and the primary camera is facing front I want to lookAt left, right, up … with a second camera without attached controls.
Both cameras have the same position and should have the same z rotation.
My first approach was to copy the rotation of the primary camera in the second and then rotate by PI/2 the x or y or z depending on where I want the second camera to look at.
This is working fine only when no rotation applied to the primary camera or if you move left/right and look at left/right.
In all other cases where rotation is applied to the primary camera the second camera have wrong z rotation.
The second approach was to lookAt specific points attached to the object by calculating their new position after applying the position and rotation of the primary camera to these points.
Again the results was the same.
Any idea about what I am doing wrong or the proper way to do it ?