Nick Fan
[NodalNinja]
Posts: 696
Location: Hong Kong
Registered: 26 May 2006
|
cubic face size
Posted: 10 Mar 2010 at 17:37 GMT
|
|
I read that the cubic face size is the width of an equirectangular image divided by Pi. Any one know the theoretical basis for this?
Thanks a lot.
nick
|
|
alert moderator
|
|
|
Guest
|
Re: cubic face size
Posted: 10 Mar 2010 at 17:58 GMT updated: 14 Mar 2011 at 16:13 GMT
|
|
Don't know the theoretical basis, but the formula is correct.
If you feed PTgui an equirectangular image measuring 6000x3000, you get cube faces of 1.910 x 1.910 after the conversion to cube faces. That equals 6000/3.14159.....
|
|
|
|
erik leeman
Posts: 144
Location: Netherlands
Registered: 24 Aug 2007
|
Re: cubic face size
Posted: 10 Mar 2010 at 18:07 GMT updated: 10 Mar 2010 at 18:27 GMT
|
|
It's not a rule, it's not a 'law', it's a choice. Not a bad one mind you, but still a choice.
To visualize it: draw a circle, then draw a square around it so the (middle of) the four sides just touch the circle. There are your equirect (the circle) and cubefaces (the square), as seen 'from above'.
This means only the pixels in the centre of each cube face are exact copies of pixels in the equirect, all other pixels are 'stretched' to fit the square so to speak.
Another choice could be to draw the square inside the circle, with only the corners touching the circle. Then almost all pixels would have to be 'compressed' to fit the square cube faces.
Or you can choose a formula that evens things out a bit, so the centre pixels are compressed a bit, and the outer pixels stretched, but not as much as in the first formula.
Again, it's a choice, not a fixed rule.
Erik
|
|
alert moderator
|
|
Ron Simkins
Posts: 5
Location: United States
Registered: 8 Dec 2009
|
Re: cubic face size
Posted: 10 Mar 2010 at 18:22 GMT updated: 10 Mar 2010 at 18:23 GMT
|
|
An equirectangular image is a sphere, put into two dimensional space. The length of the image is thus the same as the circumference of the sphere or a circle. A cube is the smallest box in which the sphere would fit: that is, the sphere touches the center of each cube face. Thus, the size of the cube faces would equal the diameter of the sphere, which is the length of the image divided by pi.
You can, of course, make your cube larger or smaller in relation to the sphere, but you get the optimum size when you divide by pi (if the cube is smaller, you throw away pixels; if it is larger, you interpolate pixels).
|
|
alert moderator
|
|
Doug Aurand
Posts: 3282
Location: Albuquerque, NM, United States
Registered: 2 Jan 2008
|
Re: cubic face size
Posted: 10 Mar 2010 at 18:29 GMT
|
|
I'm not quite getting the Pi approach
I've just used the width of the Equirectangular Projection divided by four
My thinking is that is you measure around the Equator of a Cube, the four sides, it should match the Equator of the Equirec Projection.
A 6000x3000 pixel Equirec Projection would convert to a Cube with faces of 1500 pixels
Doug Aurand Albuquerque, NM
|
|
alert moderator
|
|
erik leeman
Posts: 144
Location: Netherlands
Registered: 24 Aug 2007
|
Re: cubic face size
Posted: 10 Mar 2010 at 18:37 GMT updated: 10 Mar 2010 at 18:38 GMT
|
|
Sorry Doug, but in principle your thinking is wrong because the cube faces are flat, and not 'bent' (in two directions) like the sphere. But theory really doesn't matter much as long as your results are good enough for you.
|
|
alert moderator
|
|
Doug Aurand
Posts: 3282
Location: Albuquerque, NM, United States
Registered: 2 Jan 2008
|
Re: cubic face size
Posted: 10 Mar 2010 at 18:46 GMT
|
|
Erik Wouldn't the projection from the center of the cube be the same pixels?
Doug Aurand Albuquerque, NM
|
|
alert moderator
|
|
erik leeman
Posts: 144
Location: Netherlands
Registered: 24 Aug 2007
|
Re: cubic face size
Posted: 10 Mar 2010 at 19:25 GMT
|
|
|
You cannot 'fold' cube faces around a sphere to make a cylinder, and even if you could they would only fit at the equator of the sphere (or horizon in your equirect image).
|
|
alert moderator
|
|
erik leeman
Posts: 144
Location: Netherlands
Registered: 24 Aug 2007
|
Re: cubic face size
Posted: 10 Mar 2010 at 19:40 GMT updated: 10 Mar 2010 at 19:47 GMT
|
|
There's something about that pi-equirect-cubeface formula that not everyone might immediately think of: you can use it to calculate the 'ideal' cubeface size for every known display screen size. I won't tire you by explaining all the utterly boring technical details involved, but what it comes down to is the following table:
screensize-------cubeface 1024x768--------1852x1852 1280x800--------1932x1932 1440x900--------2173x2173 1680x1050-------2533x2533 1920x1200-------2894x2894 2560x1440-------3471x3471
The formula was used for this table just as it was in the equirect/cubeface relation Nick asked about, and again the results are the consequence of a choice, not a rule. But they work, so it's a good choice 
If you want to read more about these things have a look here: Ken Turkowski's pano calculators www.worldserver.com/turk/quicktimevr/panores.html
Erik
|
|
alert moderator
|
|
Doug Aurand
Posts: 3282
Location: Albuquerque, NM, United States
Registered: 2 Jan 2008
|
Re: cubic face size
Posted: 10 Mar 2010 at 19:56 GMT
|
|
I know it doesn't work perfectly because of the "stretching" to fit into the corners, but I usually make the Equirectangular Projection bigger than I plan to use it.
So a 5000x2500 pixels Equirec Projection converted to 750 to 1000 pixel cube faces has little or no loss of resolution
Later Doug Aurand
|
|
alert moderator
|
|
iam360Texas
Posts: 288
Location: Fort Worth, Texas, United States
Registered: 12 Jul 2006
|
Re: cubic face size More
Posted: 10 Mar 2010 at 19:57 GMT
|
|
I think the cube face dimension formula is
Image width / divide by Pi (3.1415)
So if panorama is 6000 pixel wide / 3.1415 = 1909.9156.. rounded 1910. The larger cube face size controls the image detail quality.
Interesting table, so if my monitor is 1920 x 1200 (24.5" Samsung) and I want it to be optimum full screen displayed I should use a cube face size of 2894 x 2894 ?
Several years ago, I read and actually understood Kens display size calculator. BUT have slept since then.
Thanks for Kens page link. Maybe I will revisit and RELEARN what I probably forgot.
|
|
alert moderator
|
|
erik leeman
Posts: 144
Location: Netherlands
Registered: 24 Aug 2007
|
Re: cubic face size More
Posted: 10 Mar 2010 at 20:11 GMT updated: 10 Mar 2010 at 20:15 GMT
|
|
iam360Texas said: so if my monitor is 1920 x 1200 (24.5" Samsung) and I want it to be optimum full screen displayed I should use a cube face size of 2894 x 2894 ?
Yes, but only if you allow people to zoom in so far that a pixel on their screen = a pixel in your panorama. This is called '100% zoom' or 'zoom ratio = 1.0' by some (not all), and with Pano2VR you'll get that at a Vertical Field of View of 45 degrees.
Not everyone is brave enough to let people zoom in that far, so not everyone needs to use that table 
Erik
|
|
alert moderator
|
|
erik leeman
Posts: 144
Location: Netherlands
Registered: 24 Aug 2007
|
Re: cubic face size More
Posted: 10 Mar 2010 at 20:25 GMT updated: 10 Mar 2010 at 20:26 GMT
|
|
For the 'less brave': if '75% zoom' or a 'zoom ratio of 0.75' is good enough for you, you should limit the vertical FOV setting in your pano to 60ยบ, allowing no one to zoom in any deeper. Then choose a screen size that you think is big enough to cater for, and size your cube faces like this:
screensize-------cubeface 1024x768--------1330x1330 1280x800--------1386x1386 1440x900--------1558x1558 1680x1050-------1818x1818 1920x1200-------2078x2078 2560x1440-------2494x2494
Cheers!
Erik
|
|
alert moderator
|
|
Nick Fan
[NodalNinja]
Posts: 696
Location: Hong Kong
Registered: 26 May 2006
|
Re: cubic face size More
Posted: 11 Mar 2010 at 3:54 GMT
|
|
thanks a lot for all the replies.
Nick
|
|
alert moderator
|
|
erik leeman
Posts: 144
Location: Netherlands
Registered: 24 Aug 2007
|
Re: cubic face size More
Posted: 13 May 2010 at 8:40 GMT
|
|
I just noticed I forgot to mention that there is a limit to the cube face size we can use for Flash panoramas. The largest possible cube face for Flash 9 was (and still is) 2880x2880, and there seems to be a problem with Flash 10 if you go beyond 4096x4096, but I've never tried that myself. For the time being dimensions above 2880x2880 aren't very practical for on-line use anyway, a typical 2880x2880 pano will be about 5 to 8MB which even today is a bit much.
Erik
|
|
alert moderator
|
|