Forum: Q & A

Thread: Creating Rectangular faces instead of CubeFaces?

back to threads list | this thread is closed
Search the forums:
Author  Message 
Henri Smeets

Posts: 232
Location: Amsterdam, Netherlands
Registered: 28 Nov 2006
Creating Rectangular faces instead of CubeFaces?
Posted: 19 Mar 2010 at 12:16 GMT
Is there a way to transform an equirectangular panorama into rectangular faces and setting the dimensions for those faces. This to be able to decorate an entire room (obviously not cubic) with a panorama, when viewed from the absolute centre of the room the panorama should display correctly!

Anybody an idea, I guess it 'just' takes some math but I'm not the person to go down that road wink
alert moderator
dkloi

Posts: 25
Location: Glasgow, United Kingdom
Registered: 2 Jul 2007
Re: Creating Rectangular faces instead of CubeFaces?
Posted: 20 Mar 2010 at 15:42 GMT
Very simple trigonometry. You just need to draw your box with the length, width and height, and then consider the cross-sections which will be rectangles with the respective side lengths. From the centre of the room, you can work out the angles to the edges of the room from these rectangles.

E.g. Get a piece of paper and follow these steps:
Your room is x metres wide, y metres deep, and z metres high. You have two opposite walls which are x times z in dimension, and the two other walls are y times z. Your floor is x times y, as is your ceiling. You need to figure out the angles of view to the edges of the room if the viewer is in the middle of the room.

Consider looking at the ceiling and working out the angle of view between the top front edge and top right edge of your box. Draw a cross-section of your room looking from the side, i.e. the wall which is y times z. From the viewpoint in the middle of the room, you can draw lines to the top corners of the rectangle. This forms an isosceles triangle, the top side is length y and the height is z/2. The angle between the two equal length sides will be given by 2*arctan(y/z).

The angle of view of the ceiling from top left to top right edges of the room will be similarly 2*arctan(x/z) by considering the front cross-section (wall which is x times z). Now you can use Hugin or similar to output a face of your room with these angles of view. Just import your equirect pano, rotate the pano so that the centre is facing directly up, set the output horizontal and vertical angle of view to those calculated above, and then set the output resolution. To get the same angular resolution on all 6 faces, the output sizes should be proportional to the wall sizes.

I've uploaded a spreadsheet to dkloi.net/RectangleCalc.ods in OpenOffice format. I think it works but I make no guarantees.
alert moderator
Henri Smeets

Posts: 232
Location: Amsterdam, Netherlands
Registered: 28 Nov 2006
Re: Creating Rectangular faces instead of CubeFaces?
Posted: 21 Mar 2010 at 10:37 GMT
Thanks for this elaborate tip, I'll give it a go as soon as my client figures out if he wants that room decorated with a pano!
alert moderator
dkloi

Posts: 25
Location: Glasgow, United Kingdom
Registered: 2 Jul 2007
Re: Creating Rectangular faces instead of CubeFaces?
Posted: 21 Mar 2010 at 13:16 GMT
The spreadsheet should be simple to use, just enter the dimensions of the room, your prefered output size of the pano. The settings you need for the angle of view and cubeface sizes should be automatically calculated and displayed in the output section. In order to have the cube faces an integer number of pixels, the output sizes are adjusted compared to the prefered input size.
alert moderator