I am developing a interface to be able to display a single simulation view using twenty-eight computers connected to twenty-eight projectors. My problem is, that I am not able to find a correct equations to calculate cameras alignment.
I would like to have a single view of twenty-eight cameras divided into 4 rows with 7 cameras in it. I don’t know if it is even possible but I was able to manually configure few cameras to be almost aligned correctly. Cameras positions are identical. The only thing which is changing is a X, Y, Z angle for every camera - based on a single main one.
Does anyone has any idea how can I achieve this? Main camera position and angles will be changed, because there is possibility to move like in a spectator mode.
I am posting a sample image to support my explanations.
Or is it some kind of curved display like a 360 surround or curve?
For the alignment of the cameras you can do the rotation you’re trying to do if you’ve only got a single camera for each horizontal rotation, though it’s actually a little wrong for a flat display. For this you just need to rotate the camera by its horizontal FOV and everything should line up. The Unity camera FOV value is the vertical FOV so you need to convert this to horizontal. The math for this is:
There’s a few threads on the forum showing how to do this in Unity using C#.
For the vertical you can’t do this simple rotation (or rather you can, but not at the same time as rotating horizontally). Instead what you need to look into is skewed projection matrices. The Unity scripting manual on camera matrices actually gives an example of how to do this with the “off center projection” script.
For a flat display it’s actually more accurate to do this skew for both vertical and horizontal. Using the example code I believe it should be as easy as +/- 1.0 to the top/bottom and sides for each camera off of the main camera. Note: you probably want to narrow the FOV of the main camera when you do this as the cameras furthest from the center will get quite distorted. What you’re doing is recreating the same frustum (and distortion) a very wide FOV camera would have. Rotating the camera around the horizontal direction will result in less extreme distortion, but for it to be correct to map multiple rotated camera views to a flat monitor with out obvious angle changes requires some additional image processing to get the equivalent of a curved panoramic image.
Thank you - I think, it will be helpful what you have written. I need to check if calculations from this equation are correct and can lead me to something. When I tried to align few cameras together to get one correct row I needed to change all of transformation’s rotation angles: X, Y, Z based on my central one. I don’t know yet if therm horizontal FOV will be enough but I am going to check it out.
I am using a display wall as showed on your first picture. It is just a flat display.
Thank you. I hope it will lead me a bit further with my project, and of course - I will let you know.