Getting started with POV-Ray

The Persistence Of Vision Ray Tracer (Pov-Ray) originally began life in 1986. David Kirk Buck developed DKBTrace on an Amiga after having been inspired by a Unix Ray Tracing program written in C. Since that time the number of contributors and the number of platforms that POV-Ray has been ported to have grown substantially.

Earn with Bitconnect!Earn with Bitconnect!

POV-Ray offers a feature set that is quite different from many of the current 3D trends today. There is no Graphical User Interface as a part of the core package. Instead, scenes are built using POV-Ray’s built in (Turing Complete) scripting language : The Scene Description Language (SDL).

NOTE : POV-Ray’s SDL is not to be confused with Simple DirectMedia Layer (libsdl) which is a 2D graphics library.

A Turing Complete language is one that can simulate a simple computer. Even the simplest computer is capable of fully simulating the most complex computer (at the cost of performance).

Primitives are not described as Polygons and the output from POV-Ray is not displayed in realtime. Modern graphics cards both work with Polygons and display scenes in realtime. They update their scenes several times each second (30 frames per second is a nice minimum to ensure smooth motion) which allows us to play 3D games.

POV-Ray on the other hand can take a very long time to render a single frame. There is a direct correlation between how long a scene takes to render and the underlying complexity of the scene.

Because POV-Ray Renders scenes using Ray Tracing, defines primitives mathematically and is free from the constraint of displaying results in realtime, it produces imagery that is more accurate and realistic.

Installing POV-Ray

Installing POV-Ray on a Debian or Ubuntu Linux Distribution is a very simple process.

sudo apt-get povray

At times the version of POV-Ray in the software repositories lag behind the source code releases on the official POV-Ray web site. If you require the latest version, you may have to compile it from source. In most cases you should be fine (especially if you are just learning) to just use the version of POV-Ray that is released in the Debian/Ubuntu Software Repository.

If you require Binaries of POV-Ray for Windows, Mac or Linux or you are interested in compiling from source please visit the official POV-Ray download page.

Building your first 3D Scene

POV-Ray is invoked from the command line, so you will need to open up a terminal application in order to use it. Create a new file entitled demo.pov in your favorite text editor. Enter the contents below and save the file in a convenient location.

camera {
	angle 60
	location <3,3,1>
	look_at <0,0,0>
}

sky_sphere {
	pigment { color rgb <0.5,0.78431372549,1> }
}

light_source { <0,1000,700> color rgb <1,1,1> }

plane { <0, 1, 0> 0
	texture {
		checker
		texture {
			pigment { color rgb <0.2,0.2,0.2> }
		}
		texture {
			pigment { color rgb <0.5,0.537254901961,1> }
		}
	}
}

sphere { <0, 0, 0>, 1
	texture {
		pigment { rgbt <0.9, 0.9, 0.9, 0.0> }
		finish {
			diffuse 0.5
			ambient 0.0
			reflection 0.5
			metallic
			}
		}
	scale 1
	translate <0, 0.5, 0>
}

Please do not worry if you do not understand the code above. This article is merely introducing you to POV-Ray.

In your terminal application, navigate to the Directory where you stored demo.pov. Render the scene file by simply passing the filename to POV-Ray.

povray demo.pov

When the rendering is complete (it should be quite fast on most computers these days) POV-Ray will create an image file as output. The PNG file will be named after your .pov source file, and in this case becomes demo.png.

You may notice the result is quite blocky or pixelated in some areas. To overcome this, we are able to provide POV-Ray with additional command line parameters. These will force POV-Ray to Anti-Alias and Jitter every pixel.

povray demo.pov +A0.0 +R6 +J

The rendering process will take a little longer this time to complete. However, it should produce a far smoother end result.

Having a large following of 3rd party support, POV-Ray remains as a terrific tool both for creating amazing graphics, and for learning about them.

Earn with Bitconnect!Earn with Bitconnect!

Comments

  1. Carlita Penley says:

    Its superb as your other blog posts : D, appreciate it for posting .

Speak Your Mind

*

Read previous post:
PHP from the Command Line

PHP is capable of being more than just a scripting language for web sites. While it is far and away...

Close