Blender 3D: Noob to Pro/Looking All Around - Panorama Settings
|Applicable Blender version: 2.37a.|
This Article is Out Of Date
Panoramic features were changed somewhere between 2.37a and 2.42. More information, including how to actually use panorama, can be found in this thread in the forums: http://blenderartists.org/forum/showthread.php?p=797886
Building the Example Scene
Ever wondered how that cool looking 360 degree panoramas that you see on some websites are made? Well, I don't know either, so someone else will have to tell about that. What I found out though is how to make Blender output a 360 degree panoramic image - quite probably this at least is the first step when making something like on those websites.
Now, let's try to progress like in a tutorial, as in the other pages of this Wikibook. So, fire up Blender, and look at the well known initial box scene. Or rather, change it somehow. Assuming you have read the book in order, it shouldn't be hard to get something like in the picture.
I placed the camera and the light both above the origin, deleted the cube, and added 8 cylinders, all around the origin. One way to do this is to place one cylinder, then duplicate and rotate it around the origin. For this to work, set the rotation center to the 3D-cursor (with the Pivot button), and position the 3D cursor at the origin (use SHIFT+S to make the 3D cursor snap to the grid).Place the first cylinder using GKEY and then holding CTRL while moving the mouse. Change to object mode, then use SHIFT+D to duplicate it. Next, press RKEY to rotate it, then hold CTRL while rotating it by 45 degrees. Repeat the same for the remaining cylinders. Use G to move the light. Use NKEY to enter the camera values like shown, so it looks parallel to the ground.
Speaking of ground, lets also add a ground. I added another cylinder, below the other ones, as shown. It's easy to add by switching to front view (NUM1), duplicating a cylinder (SHIFT+DKEY), and then moving it holding CTRL pressed again, so it snaps to the grid. To scale it, use the SKEY , but hit SHIFT+ZKEY to lock the z scaling, and hold CTRL pressed while scaling in x and y direction so you can snap to the exact size you want.
Now, to have a complete scene, we need some colors. I made the ground cylinder green, the 8 example cylinders gray, and also added a noise normal to the ground. This doesn't really matter here though, just needed some example scene for the 360° camera.
Something more interesting is the sky texture, because Blender's sky can be made to seamlessly wrap around with 360 degree. Below is a screenshot of the sky settings I used. To get there, click on the Shading button, then select World.
To change the texture, click the textures button or press F6, then add a new texture with the small button with two arrows, and select the type (e.g. "Marble" or "Clouds") instead of "None" for the texture. Go back to the World pane, and enable the Real and Blend buttons. And don't forget to use nice colors, I used blue and white. Now it looks a bit like white clouds in a blue sky.
[Maybe should add here more details? What is important so you don't get a seam at the 0 - 360 degree point? How do you map pre-made sky textures?]
And we are already done, this is the example scene. All that is left to do is to render it as a panorama.
Go to the render settings (F10), and click the Pano button. Change the Xparts value to 4. The value in Xparts will tell how many times the camera will 'turn' horizontally when rendering. The Yparts value would do the same vertically. Each part (Xparts or Yparts) will render the size of the whole image you set. To make things easier, make the output image size quadratic and set both X and Y Aspect to 100. E.g. make your image size 600x600, but not 800x600, otherwise the following will not work.
If you want a seemless 360 degree view, it is important to know how many degrees one single image spans. For example, if you know one image is 90 degree, then you can set Xparts to 4, and the result will be a single panoramic picture, and with the right panorama viewer, you can spin around in it endlessly.
But, how do you make a single picture 90 degree? The angle a picture spans is called field of view (FOV). And it is a property of the camera. To change it, select your camera, then click the edit button (or hit F9). Make sure you haven't set your camera to orthographic (the "Ortho" button), since FOV only exists with a normal camera.
You can directly enter the FOV in Blender's camera settings (as of version 2.42) - Toggle the 'D' button on, next to the parameter called Lens. Type in 90 to get a 90 degree FOV. Now hit F12 to render our test image.
If you want, you can also try it out with any other scene. Place the camera somewhere in the middle with a good view all around, set the camera's Lens to 90, and go into the render settings (F10). Set Xparts to 4, enable Pano, and render. You should get an image 4 times as wide as a normal image, and the left and right edges should fit together seemlessly. Also note that Blender doesn't know if it should apply the FOV as horizontal or vertical viewing angle, but we always want it to be the horizontal angle. Therefore just make the single images of the panorama quadratic, as mentioned above - then horizontal and vertical FOV is the same and Blender gets it right.
This is the resulting panoramic image:
Warning: Didn't convert following lens settings to the new possibility with the 'D'-button for passing the FOV value directly. One problem remains, the image will be quite distorted. This is because a FOV of 90 degree is too high. Let's try with 45 degree and 8 XParts instead. As you will have noticed when playing around with the Lens parameter before, setting Lens to 8 instead of 16 will not achieve this, it will make the FOV even bigger. Setting it to 32 looks better, but definitely is not 45 degree. The picture to the right explains how FOV and Lens relate to each other:
The camera is at the bottom, the red angle is our desired FOV, and the length of the green line is what the Lens parameter represents in Blender. Therefore, the formula to calulcate Lens when we know FOV:
- Lens = 16 / tan(FOV / 2)
For a FOV of 45 degree, we therefore get a Lens of 38.627. Now, write that into the Lens field in the camera settings, and render with 8 XParts. This time it will render an output image which is 8 times as wide as a normal output image, and again it will be a seamless 360 degree all around panorama of your scene. And this time with less distortion. With the above formula, you can now use any number of XParts you want - just divide 360 by the number of parts, and calculate the Lens parameter for the resulting FOV. Note that you also need to take the Aspect settings into account, unless you set it to 100 and create a quadratic output, as we did.
Some Lens settings:
- 4 parts: 16
- 8 parts: 38.627
- 16 parts: 80.437
The output with 8 parts can be seen below.
As always, feel free to modify this page in any way you want or add feedback to the Talk page.