Latest

Archive

Community news

C++

Communities and Content

Databases

Editorials

Emacs

General

HTML

Java

Notices

PHP

XML

Apache

C++

Database

General

HTML

Java

Javascript

Linux

Object oriented programming

Open source

Perl

PHP

Python

Ruby

SOAP

XML

Suggest a link

Advertise on zez

Contribute

Contact us

About zez


Free Multiplatform raytracing with POV-Ray



To infinity... and beyond!



A plane
We start with the most basic of basics: A camera, a light, and a yellow and green checkered plane that stretches out into infinity. The scene code is included below: (save it as scene1.pov)

#include "colors.inc"

// Monitor brightness
global_settings { assumed_gamma 2.2 }

// Background color
background { color LightBlue }

// The camera
camera {
    location <6, 3, -4>
    look_at <2.5, 2, 0>
}

// A light
light_source { <8, 7, -7> color White }

// An infinite checkered plane
plane {
    <0, 1, 0>,
    0
    pigment {
 checker color Yellow, color Green
    }
    finish {
 ambient 0.3
 diffuse 0.6
    }
}


A short explanation of the contents: Lines starting with two slashes are comments, and are not evaluated by POV-Ray. The first statements includes the file colors.inc from your POV-Ray library. This file specifies the RGB values of some named colors. The next statement adjusts the brightness of the image according to the gamma value of your monitor, 2.2 is usually a sensible value on PC monitors. The background statement simply sets the background to a pale blue color.

The camera statement contains the first two three-dimensional coordinates, one for the camera location and one for the point in space the camera is looking at. Such coordinates are always written on the form . The coordinate <0, 0, 0> is "the center of the universe", or origo. Negative values of x are points to the left of origo, positive values are to the right. Negative values of y are points below origo, positive values are above origo. Negative values of z are points in front of origo, positive values are behind it. A scene must have one camera, no more, no less.

The next item is a light source, which has a location in space and a color. A scene must have at least one light source, or else you won't be able to see any objects.

Finally, we add a plane. A plane is a two-dimensional surface whose area is infinite. It can be used to model the sky or a completely flat ground, as we do here. The value <0, 1, 0> is not a coordinate in this case, it is a vector that describes the surface normal of the plane. The second value describes the distance between the plane and origo, if you want to lower the plane, try to set this to a negative value. The plane has two statements describing its appearance, pigment that describes the checker pattern and finish that in this case describes the lighting of the plane.

To render this scene yourself, run

povray +Iscene1.pov

and open the resulting file scene1.png in your favorite image viewer.

Alternately, if you want to see the image as it renders, save the following text to the file standard.ini

; POV-Ray 3.1 Standard INI file
Antialias=on
Display=on
Pause_When_Done=on
Preview_Start_Size=32
Preview_End_Size=4

and run

x-povray standard.ini +Iscene1.pov

If you want to render at a different resolution, add the +W and +H arguments, for example +W640 +H480 for 640x480 resolution.


<< Previous page | 1 | < 2 > | 3 | 4 | 5 | Next page >> | Printer-friendly page |

Comment List


Topic: Author:
Time:
Intro to POV Dr M 15.05.2005 06:19

So many website talk about POV;
but this is the first time,
I learnt how to use POV
and that too in 15 minutes.
Keep up the good work.

I am in Silly-Con valley, where clear
explanations are hard to find.


Great Article! John Holden 17.02.2002 16:03

This has been a really informative article. Although it isn't in-depth, it's perfect for a beginner like me.

Thanks for putting it up here!

John


sp. origin Vik Olliver 24.11.2001 04:48

Are we meant to proofread here?

It's origin, not origo.

Vik :v)


   RE: sp. origin Gunnstein Lye 26.11.2001 13:16

> Are we meant to proofread here?
> It's origin, not origo.

I'm not a native english speaker, but my dictionary states that the word "origo" can be used when speaking of coordinate systems. But I'll change it if "origin" is more commonly used or more correct.

Gunnstein




Forgot your password?

Register a new user

Results

Polls