PDA

View Full Version : UV Sphere versus Cube for 3D Panoramic Images/Movies...



tmason
02-06-2015, 04:11 PM
Hello,

Simple question; wondering what is the best option for displaying 3D panormic images and movies, a cube or a 3D sphere?

I tried the 3D sphere but so far the image is distorted at the top and the bottom.

Would a cube work better?

Thank you for your time.

Alfonse Reinheart
02-06-2015, 04:45 PM
There is no way to map a 2D image, no matter how large, as a background for a panorama (https://en.wikipedia.org/wiki/Panorama) (which is effectively a sphere) without a distortion somewhere. Those distortions could be when looking vertically or in some other way (such as when doing sphere mapping). But there will be some kind of distortion somewhere.

Now, if your panorama image is a cubemap (https://www.opengl.org/wiki/Cubemap_Texture), that would work without distortion. But it would work equally well on a sphere as on a cube. And you have to get a cubemap image.

tmason
02-07-2015, 01:12 AM
There is no way to map a 2D image, no matter how large, as a background for a panorama (https://en.wikipedia.org/wiki/Panorama) (which is effectively a sphere) without a distortion somewhere. Those distortions could be when looking vertically or in some other way (such as when doing sphere mapping). But there will be some kind of distortion somewhere.

Now, if your panorama image is a cubemap (https://www.opengl.org/wiki/Cubemap_Texture), that would work without distortion. But it would work equally well on a sphere as on a cube. And you have to get a cubemap image.

I see, my question goes along the lines of this:

What would be the best option to load images on the fly like this? The goal is just to have a program that you can simply open the file and then see the 360 degree panoramic image.

Should I use a UV sphere or a tweaked cube for this?

Thank you for your time.

http://s1.postimg.org/aqoarfofj/Cologne_Panoramic_Image_of_the_old_town_at_dus.jpg

Alfonse Reinheart
02-07-2015, 07:45 AM
What would be the best option to load images on the fly like this?

How is that related to panoramas? How you get the image into memory is essentially irrelevant; it's what you do with it.


The goal is just to have a program that you can simply open the file and then see the 360 degree panoramic image.

Should I use a UV sphere or a tweaked cube for this?

I thought I was clear on this. The problem is not the geometry you map the texture to; it's the fact that the texture is two dimensional. It is mathematically impossible to map a 2D image to a sphere without distortion. That's why every 2D map of the Earth has some distortion or discontinuity somewhere, unless that map is a globe.

If you want to be able to view this background from any direction without distortion, you need a cubemap.