The Persistence Of Vision Raytracer is a popular, freely available renderer. This brief tutorial describes how to use it to create cubic environment maps (also known as panoramas or backgrounds or skyboxes).
Thanks to Armagon for suggesting this tutorial and providing the POV file and batch script that makes this easy.
A cubic environment map is just six square images-- a view looking forward, backward, left, right, up and down. This POV file will create backgrounds in either the format required by VRML or Quake 2. Modify the lines marked by the bold comments to specify which format you are using, the name of your POV scene, and where to put the center of the background.
// POV VRML background generator
// Created by Armagon <armagon@my-dejanews.com> Aug. 24, 1998
// Modified for Quake II use Mar. 6, 1999
// Render with something like +KFF6 +W256 +H256 +FN
// +KFF6 sets it to render six frames; one for each view
// +W and +H control the width and height, repectively
// +FN sets it to render PNGs; +FT instead does uncompressed TGAs
// The width and height may be changed to other powers of 2,
// and although this saves files as PNGs, you probably want to change
// them to jpegs.
#declare Quake2 = 1; // Comment out this line for use with VRML
#include "MyScene.pov" // Replace with name of your POV scene
camera{
up y
right x
location 0
look_at z * -100
angle 90
#switch (int(clock*5))
#case (0)
// Front
// Do nothing
#break
#case (1)
// Left
rotate y * 90
#break
#case (2)
// Right
rotate y * -90
#break
#case (3)
// Back
rotate y * 180
#break
#case (4)
// Top
rotate x * 90
rotate y * 180
#ifdef (Quake2)
rotate y * 90
#end
#break
#case (5)
// Bottom
rotate x * -90
rotate y * 180
#ifdef (Quake2)
rotate y * 90
#end
#break
#end
// Move the camera to somewhere in the world. It may also be rotated.
translate y * 200 // This spot will be the center of the background.
}
The six images created in Step 1 will be named "Backgro1 - Backgro6". They must be renamed to use them with Quake2 or tools that read cubic environment maps; here are two DOS batch files that do the appropriate renaming for Quake2 or VRML backgrounds:
REM Rename POV-generated files to Quake2 convention ren Backgro1.tga Backgroundft.tga ren Backgro2.tga Backgroundlf.tga ren Backgro3.tga Backgroundrt.tga ren Backgro4.tga Backgroundbk.tga ren Backgro5.tga Backgroundup.tga ren Backgro6.tga Backgrounddn.tga
REM Rename POV-generated files to VRML convention ren Backgro1.tga Background_fr.tga ren Backgro2.tga Background_lf.tga ren Backgro3.tga Background_rt.tga ren Backgro4.tga Background_bk.tga ren Backgro5.tga Background_up.tga ren Backgro6.tga Background_dn.tga
Finally, it is time to admire your results. You can use SkyPaint to view your backgrounds, or to add scenery that might be difficult to create in POV.
Read Chapter 5 of the SkyPaintGE Users Manual for information on using backgrounds in your Quake worlds. If you are creating backgrounds for VRML, read Chapter 6 of the SkyPaint User Manual for information on using backgrounds in VRML worlds.
Read our other tutorials if you want to publish your POV panoramas on the Web, or use them as backdrops for a 3DStudio animation.