You are on page 1of 437

The Online POV-Ray Tutorial

Welcome to

If this is your first visit, you may want to start on the Path of Learning below. Or, if you are interested in specific information, you may want to browse through the Exploration Toolkit, Reference Shelf and Libraries below. You can also read about the Tutorial's design. If you're not sure where to find what you want, try the Help Desk. NEW!: A word about the release of POV-Ray 3.0.

The Path of Learning

The Path of Learning is meant to lead you, step by step, from a ray-tracing novice to a full-fledged POV-Ray expert. If you are a beginner, we recommend you start at Step 1. If used other ray-tracing programs before, or just can't wait any longer, jump ahead to step Step 3. Step 1: Introduction to POV-Ray and Ray-tracing What is ray-tracing? What is POV-Ray? If you've never done any ray-tracing before, this is a good place to start reading. It provides a brief overview of what ray-tracing is, how it works, and how it's used. This section will also tell you what exactly POV-Ray is, how it relates to the rest of the ray-tracing world, where to find it and how to set it up. Step 2: POV-Ray Basics
http://library.thinkquest.org/3285/?tqskip=1 (1 of 4) [9/12/2001 3:15:15 PM]

The Online POV-Ray Tutorial

What do I need to know before I start? This section covers all the vital information you need to know before you can start creating your own scenes in POV-Ray, including the mathematical background necessary (yes, there is a little) and information about source code. Step 3: Creating Simple Scenes How do I get started? This section covers the basics of scene creation in POV-Ray. If you're anxious to get going, start here. Step 4: Advanced POV-Ray Features What else can POV-Ray do? This section covers some of the more powerful (and complex) elements of the language, including advanced objects, attributes, lighting techniques and camera options. Step 5: Conclusion What now? A few words of advice, and some congratulations on your new-found skills. The (sigh) end of the Path of Learning.

Reference Shelf

If you need quick access to specific information, one of the resources below may be able to help you. POV-Ray Language Reference A searchable glossary of all keywords and directives of the POV-Ray language. Covers the meaning, syntax and usage of all POV-Ray terms. Glossary / Index A combination glossary and index containing ray-tracing, POV-Ray, and other technical terms, as well as references to the Tutorial and Language Reference. Command-line Parameter Reference A complete description of all command-line parameters that POV-Ray takes, what they do, and how to use them. Tips and Tricks Tips and tricks covering the practical and the artistic sides of ray-tracing. Find out how to save yourself time in ray-tracing, as well as what makes your scene look realistic, artistic and, of course, cool.

http://library.thinkquest.org/3285/?tqskip=1 (2 of 4) [9/12/2001 3:15:15 PM]

The Online POV-Ray Tutorial

Libraries

The libraries below contain useful bits of information. You can browse through each of them, or even submit your own for the rest of the world to use. Texture Library A library of included and contributed textures. Contains source code and sample images for all textures included with POV-Ray releases, as well as textures contributed by other readers. Object Library A library of built-in, included and contributed objects. Contains source code and sample images for all non-primitive objects included in POV-Ray releases, as well as objects contributed by other readers. Scenes Library A library of nifty scenes, with source code! Feel free to contribute your own, if you think you've got something worth sharing. Resource Library A library of contributed POV-Ray resources: web pages, programs, and anything that can be of use to POV-Ray artists.

Exploration Tools

These tools are provided in order to give you a quick and accurate "look-and-feel" of many of POV-Ray's features. Note that if your web browser does not support forms, Javascript or Java, some of the tools may not work. Color Tool Displays the color corresponding to a particular RGB vector. The vector elements are selected by the user. Helpful in finding the right color for an object. Normal Tool An explorable interactive graphical demonstration of all the normal attributes: bumps, dents,
http://library.thinkquest.org/3285/?tqskip=1 (3 of 4) [9/12/2001 3:15:15 PM]

The Online POV-Ray Tutorial

ripples, waves, and wrinkles. Finish Tool An explorabale interactive graphical demonstration of all the finish attributes: ambient, brilliant, crand, diffuse, phong, reflection, refraction, roughness, specular. Top of Document

The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team

http://library.thinkquest.org/3285/?tqskip=1 (4 of 4) [9/12/2001 3:15:15 PM]

The Online POV-Ray Tutorial: About the Tutorial's Design

The Online POV-Ray Tutorial
About the Tutorial's Design
A lot of thinking went into the design of the Online POV-Ray Tutorial. After discussion, we developed three major design guidelines: 1. To take advantage of the abilities HTML presents; 2. To constrain presentation methods to the simple and intuitive; and 3. To design with the slow network in mind. By the first, we mean that design should be based upon the original goal of HTML: to provide a clean method of presenting information portable over various output devices. The authors feel that far too often Web page designers lose track of this and attempt to use HTML as some kind of page layout system with multimedia extensions, which it is most definitely not. By the second, we mean recognizing the difference between situations that help the user to understand the information and situations that hinder the user with confusing data. The authors' favorite example is that of HTML frames: when done wrong (as is easy to do) frames quickly become a nightmare for the user. When done right, however, frames become an extremely valuable tool. The authors feel that their implementation of frames in the Tutorial meets this guideline, and is as small and user-friendly as possible. By the third, we mean keeping the cutesy stuff to a minumum. The authors all have extensive experience with slow networks and know very well the frustration of waiting for unnecessary animations or large images to load; furthermore, given the relative income of the targeted population (students and their schools) with respect to hardware, the authors feel that more likely than not many users of the Tutorial will be subject to the same speed constraints they have been. As such, the Tutorial has taken on several noticeable design characteristics: q It has stayed away from large images (except when specifically requested). Not only are they not portable across differently-sized screens (violation of design principle #1) but are also slow (violation of design principle #2); q It has stayed away from image maps. They provide a slower, clumsier version of what is already possible (violation of design principle #2); q It has stayed stayed away from dinky animations and scrolling text displays. They bloat loading time with unnecessary information (violation of design principle #2). q It has done everything possible to make the information presented clear, fast, and easily accessible. The result is that the Tutorial is not as cutesy as it could be. There are no animations or music; there is a lot of text and it is all the same size and color. There are small images, when needed to illustrate a point. There are large images, but only when specifically requested by the user. There are Java applets and CGI scripts, but only when the information must be interactive, or could not have been presented as intuitively another way. More importantly, the Tutorial is portable, compact, and fast. This is not an advertisement for some
http://library.thinkquest.org/3285/design.html (1 of 2) [9/12/2001 3:15:20 PM]

The Online POV-Ray Tutorial: About the Tutorial's Design

multimedia company, it is a serious piece of on-line reference material and contains a lot of information. We are not catering to your Saturday-morning-cartoon-bred need for jumping frogs and scrolling LED displays, we are providing you with serious information when and where you need it. If this means sacrificing a few image maps and animations for a little more speed and portability, so be it. We feel that the final design of the Tutorial has met our guidelines fully, and that serious web users will not only find the Tutorial informative and useable, but will appreciate the work we have put into the design as well as the data. Top of Document Main Page

The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team

http://library.thinkquest.org/3285/design.html (2 of 2) [9/12/2001 3:15:20 PM]

The Online POV-Ray Tutorial: Help Desk

The Online POV-Ray Tutorial
Help Desk
The Help Desk is here to help you find what you're looking for. Browse the links below: Question Don't know a thing about ray-tracing? Advice Try starting on the Path of Learning. It will take you, step by step, through all you need to become a ray-tracing expert (well, almost). Search the Glossary / Index. It contains references to every single topic in the Tutorial. Try browsing the Tips and Tricks page. It contains valuable hints on how to up the artistic juice in your page. Try searching the Language Reference. It will show you the exact syntax, meaning and purpose of every command in the POV-Ray language. Try searching the Glossary / Index. It contains definitions of many terms relating to ray-tracing and POV-Ray, and even a few things that aren't related. Browse through the Texture Library. It contains sample textures included with the POV-Ray software package or contributed by other users of the Tutorial. Try putting salt on its tail. Browse through the Object Library. It contains sample objects included with the POV-Ray software package and contributed by other users of the Tutorial. Experiment with the Color Tool. It will help you find just the right color, quickly and painlessly.

Need to find information on a specific topic? Want to make your scenes look good?

Need to know the syntax for a specific command?

Trying to find the definition of a technical term?

Looking for just the right texture, or have one to share?

Trying to catch a bird? Looking for a common object, or have one to share?

Can't find the right color?

http://library.thinkquest.org/3285/helpdesk.html (1 of 2) [9/12/2001 3:15:25 PM]

The Online POV-Ray Tutorial: Help Desk

Looking for ideas? Need more information?

Browse through the Scenes Library. You'll find great pictures and the source code behind them. Check out the Resource Library. It contains links to other POV-Ray and ray-tracing resources on the Internet.

Top of Document

Main Page

The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team

http://library.thinkquest.org/3285/helpdesk.html (2 of 2) [9/12/2001 3:15:25 PM]

(Language Reference) Bicubic Patch: a complex mathematical object which can be used to describe an smooth surface in space. POV-Ray uses triangles to approximate the surface. (Language Reference) Ambient: in POV-Ray. Area Light: a type of light source which is used to create shadows with soft edges. (Tutorial) (Language Referece) Bounds: a simple object which surrounds a more complex one. (Tutorial) (Language Reference) Blob: another complex mathematical object which can be used to create organic and. Adaptive sampling is a method of speeding up lengthy shadow calculations by only checking parts of the light for visibility. By default. See ambient.The Online POV-Ray Tutorial: Glossary / Index The Online POV-Ray Tutorial Glossary / Index ABCDEFGHIJKLMNOPQRSTUVWXYZ A Adaptive: used to specify the level of adaptive sampling done with area lights.html (1 of 11) [9/12/2001 3:16:48 PM] . an arbitrary amount of light added to an object to simulate the effects of ambient light. usually referring to a light source. Axis: a line of reference in a coodinate system. well. this is black. POV-Ray first does intersection tests against the simple bounding object. blobby (for lack of a better way to describe them) objects.g.org/3285/glossindex. When tracing. If the ray does not intersect the bounding object. B Background: the POV-Ray keyword determining what color will be assigned to a light ray that does not intersect with any object. red.thinkquest. (Language Reference) Agate: a pigment which has very swirly and turbulent bands of color. well defined edges. e. (Language Reference) (Exploration Tool) Ambient light: light so scattered from various objects that no discernable source is evident. instead of those with the usual hard. (Language Reference) Attenuate: to decrease in intensity with distance. it http://library. Attribute: a property of an object.

The pattern of bumps is specified with an image. (Language Reference) Bumps: a normal modifier which gives an object the appearance of having a bumpy surface. The default color map is a blend from black to white. (Language Reference) (Exploration Tool) Bump Map: a normal modifier which allows you to map a pattern of bumps around an object. used for including human text in source code files to improve clarity. including objects and light sources. (Language Reference) Comment: a section of source code that is ignored by POV-Ray. controls how polished or metallic the object seems. (Language Reference) Brilliance: in POV-Ray. (Language Reference) (Command-line Reference) Color: used to set the color of any number of things. The clipped_by statement can be used to assign a clipping object to another object. Clock: a built-in variable you can use to create simple animations. (Tutorial) (Language Reference) http://library. (Language Reference) Clipped By: the clipped_by statement allows you clip away parts of an object. Its value is set by command-line parameter. (Command-line Parameter Reference) Bounded By: this statement can be used to assign a bounding object to any other object.org/3285/glossindex.. except clipping shows an object's hollow interior. just how it looks. Thus. Automatic bounding objects is controlled with a command-line parameter. Note that this does not actually change the surface.The Online POV-Ray Tutorial: Glossary / Index does not intersect the complex one (since the complex one is entirely inside the simple one). box. (Language Reference) (Exploration Tool) C Camera: the object which defines how you want to look at the scene.. well. POV-Ray doesn't have to perform a lengthy test with the complex object. (Language Reference) Clipping: refers to the use of one object to trim away parts of another. (Tutorial) (Language Reference) Checker: a pigment which consists of alternating blocks of color.thinkquest. (Tutorial) (Language Reference) Color Map: a list of colors that is used by many pigments to color an object. (Language Reference) Bozo: a pigment which consists of splotches and swirls of color. It is similar in function to intersection. (Language Reference) Box: a three-dimensional geometric object that can be though of as a mathematically perfect. The bounded_by statement is used to assign bounds to an object. an attribute that affects the angle between incoming light rays and an object.html (2 of 11) [9/12/2001 3:16:48 PM] .

(Tutorial) (Language Reference) Cubic: A third-order polynomial object. a difference is just an intersection with some of the objects inverted. (Language Reference) Degree: a unit of angle measurement. texture. (Language Reference) Coordinates: a set of numbers specifying a point on a coordinate system. Once you have this name. 0 degrees corresponds to no tilt. You can declare a default pigment (normally black). CSG can be used to group objects together (union and merge). but are mapped back to between 0 and 360. Dents: a normal modifier which makes an object look like a gorilla had at it with a sledgehammer. a technique of combining simple objects into much more complex ones. or use objects to carve away parts of other objects (difference and intersection). (Language Reference) (Exploration Tool) CSG: Constructive Solid Geometry. 180 degrees corresponds to a half-turn. well. a polynomial in which the highest power a variable is raised to is 3. (Tutorial) (Language Reference) #default: this statement allows you to change the initial texture on an object.e. (Tutorial) (Language Reference) http://library.thinkquest. In POV-Ray. and a default normal (normally flat). used to simulate roughness or graininess on an object. The amount of denting can be adjusted between "baby gorilla" and "psychopathic gorilla". of course). you can easily create multiple copies of the object with only a minimum of extra typing. i. (Language Reference) (Exploration Tool) Difference: a CSG statement used to take an object and carve different shapes out of it. POV-Ray also lets you easily create cone that have their points chopped off. as well.org/3285/glossindex. Degrees above 360 and below 0 are valid. POV-Ray uses degrees whenever angles are required. 360 degrees corresponds to a full turn. (Tutorial) (Language Reference) Cylinder: A cone with equal radii throughout. You can also declare constant vectors and floats.html (3 of 11) [9/12/2001 3:16:48 PM] . a default finish (normally unpolished). (Language Reference) D #declare: a POV-Ray directive which allows you to assign a name to an object. (Tutorial) Crand: in POV-Ray. always in vector form.The Online POV-Ray Tutorial: Glossary / Index Cone:a three-dimensional geometric object that can be thought of as a perfect. ice-cream cone (minus the ice cream. (Tutorial) Coordinate system: a mathematical system of describing absolute positions in terms of distance (and direction) from a given point. or just about anything else that can exist. Really.

i. Fog: used to add colored mist to a scene. (Language Reference) E Eggplant: a vegetable (well. no component deals with infinity.g. (Language Reference) Frequency: a modifier for certain pigments and certain normals. (Tutorial) (Language Reference) http://library. Floating Point: a real number. You can also create discs with holes in the center.e.The Online POV-Ray Tutorial: Glossary / Index Diffuse: in POV-Ray. Using small amounts of fog can greatly enhance the realism on nearly any scene. (Tutorial) (Language Reference) Finish: in POV-Ray. how objects interact with light. fruit technically) which insures that have something in the "E" category of this glossary. reflectivity. GIFs support 256 colors and a number of other features. it controls how many times the color map is cycled through in a given "distance". With pigments. roughness.. an attribute that controls how much of an object's color comess from direct light. (Language Reference) (Exploration Tool) Disc: a two dimensional object which is basically a filled-in circle.html (4 of 11) [9/12/2001 3:16:48 PM] . (Language Reference) G GIF: an image stored in CompuServe's Graphical Interchange Format. e. they are a good general purpose image format and are popular because of their good compression system and short decompression time. (Language Reference) Float: see floating point. F Filter: an aspect of a color which defines how much light it transmits. (Language Reference) (Tutorial) (Exploration Tool) Finite Primitive: a primitive in POV-Ray with well-defined limits. See kumquat.org/3285/glossindex. With ripples and waves it controls the density of the waves. See also infinite primitive. refractivity.thinkquest. Gradient: a pigment which consists of parallel planes of color. All in all.

(Language Reference) H Height Field: a surface created from an image file which basically defines a mesh of triangles in space. all of which are equilateral triangles. See also finite primitive. (Language Reference) (Exploration Tool) Infinite Primitive: A primitive in POV-Ray which contains elements dealing with infinity.g. http://library. (Tutorial) (Language Reference) Inverse: a keyword which tells POV-Ray to switch an object's "inside" and "outside".The Online POV-Ray Tutorial: Glossary / Index Granite: a pigment which consists of spots of on color surrounded by bands of other colors. it can create a very convincing stone texture. POV-Ray doesn't come with a built in facility to create icosahedra. Intersection: a CSG statement which is used to make a new object out of the regions that are inside two or more other objects. The only time inside and outside of an object matter is when it's in a CSG object or if it's clipping another object. This is the easiest and least painful way to create mountains. except intersections don't show a hollow interior. Generated by POV-Ray from source code files. It's very useful for creating libraries of objects or textures. e. (Tutorial) (Language Reference) Index of Refraction: how much a translucent object refracts light rays passing through it. Image: a computer term for a displayable file.thinkquest. but there's an example with the triangles in the Language Reference. (Language Reference) Hexagon: a pigment which consists of hexagonal cylinders of color running parallel to the y-axis of the space. Image Map: a technique for wrapping an image around an object.html (5 of 11) [9/12/2001 3:16:48 PM] . The height of each individual triangle is defined by the color of the pixel in the corresponding location in the source image.org/3285/glossindex. It's similar to clipped_by. Image mapping is perfect for coloring an object when the standard fare of pigments doesn't contain exactly what you need. When used with the proper color map. a plane. (Language Reference) #include: a directive which tells POV-Ray to read the specified file as if its contents were actually part of the current file. (Language Reference) I Icosahedron: a three dimensional geometric shape with 20 faces.

but that's the basic idea. (Language Reference) Light ray: an imaginary geometric line describing the path of light as it leaves the light source. Surprisingly.org/3285/glossindex. Material maps use images as templates to do a sort of "paint-by-numbers" operation on an object. Note that the only connection with POV-Ray is that it puts something in the "K" section. Marble also creates parallel planes of color. Well.thinkquest. See eggplant. With some turbulence it can create a very good looking marble texture. like a leopard's coat. J Jitter: refers to random jostling of things. it would have to be a very geometric leopard.html (6 of 11) [9/12/2001 3:16:48 PM] . Light source: an object that emits light. (Tutorial) (Language Reference) M Mandel: a pigment which paints the famous Mandelbrot fractal onto an object. With anti-aliasing. but uses the color map in a different fashion. it bumps the extra rays around a bit. (Language Reference) Marble: a pigment which is a variation on the gradient theme. (Language Reference) (Command Line Reference) K Kumquat: an orange-like fruit with an edible rind and a bitter pulp. (Tutorial) (Language Reference) Material Map: a method for mapping complete textures around objects. L Leopard: a pigment which consists of regularly spaced spots of color. Material maps are very powerful for http://library. When applied to area lights is causes the lights to be shaken up a bit to prevent shadow bands from forming. See also point light source. which breaks up edges.The Online POV-Ray Tutorial: Glossary / Index (Tutorial) (Language Reference) IOR: see Index of Refraction. this is not very time consuming for all the extra calculation that must be done.

boxes. (Language Reference) Merge: a type of CSG which is very similar to a union.html (7 of 11) [9/12/2001 3:16:48 PM] . a merge takes the resulting object and removes an internal surfaces. (Resource Library) N Near-photorealistic: obviously not taken from a physical camera (but not blatantly so) Normal: in POV-Ray. (Language Reference) (Tutorial) (Exploration Tool) O Object: a thing in space. like the layers of skin on an onion. However. This is primarily useful on transparent objects. With ripples and waves it controls the position of the waves. a bright highlight on an object caused by light rays hitting directly from a light source. (Tutorial).org/3285/glossindex. P Phase: a keyword which modifies pigments and some normals. Objects are what you see when you render a scene. See also near-photorealistic. Examples of objects are spheres. and CSG objects. (Language Reference) Origin: the center of a coordinate system.The Online POV-Ray Tutorial: Glossary / Index creating exciting textures. surface effects simulated on objects by manipulation of light rays. Pigment: in POV-Ray. where any internal surfaces would be visible (bad). (Language Reference) (Tutorial) (Exploration Tool) Photorealistic: as if taken from a physical camera. (Language Reference) Phong: in POV-Ray. (Language Reference) Onion: a pigment which consists of concentric spheres of color. how colors or patterns of colors are assigned to an object. (Language Reference) (Tutorial) http://library. (Tutorial) (Language Reference) Modeller: a program that provides a visual interface to creating scenes in POV-Ray. often extremely useful for large scenes in which mental visualization ccan be tricky. With pigments. it controls where the pigment begins when it looks at the color map.thinkquest.

and quartic.The Online POV-Ray Tutorial: Glossary / Index Pixel: abbreviation for picture element. (Tutorial) Real number: a number between positive and negative infinity that does not have any imaginary components (an imaginary component is in terms of i. Point light source: an infinitly-small light-emitting point. (Language Reference) (Tutorial) Polynomial: In POV-Ray. the simplest type of light source: invisible. an attribute which controls how much an object will reflect its surroundings. (Language Reference) Ray-tracing: the process of mathematically generating near-photorealistic images form a given description of a scene or object via geometrical modeling of light rays. Also see quadric. and cylinders. an object that can be described in mathematical terms as the summation of the product of the position vector elements x. In POV-Ray.e. (Tutorial) Reflection: in POV-Ray. cubic. a polynomial in which the highest power a variable is raised to is 4.html (8 of 11) [9/12/2001 3:16:48 PM] . (Language Reference) Quartic: A fourth-order polynomial object. i.html#quartic">Language Reference) R Radial: a pigment which takes the color map and wraps it around the y-axis. (Tutorial) (Language Reference) Primitive: one of the basic building blocks of all objects in POV-Ray. (Tutorial) Q Quadric: A second-order polynomial object. One of the thousands of tiny "dots" that serve to make up the display portion of a computer screen. fast. (Tutorial) HREF="language/iobject. Used to generated mathematically-defined objects. You also need to specify an index of refraction. (Language Reference) (Tutorial) (Exploration Tool) Refract: the process in which a light ray is bent slightly when entering a translucent object. a polynomial in which the highest power a variable is raised to is 2. Reflect: the process in which a light ray bounces off an object and continues travelling.org/3285/glossindex. the type of number that POV-Ray works with.thinkquest. cones. y and z raised to some power and user-specified coefficients.(Tutorial) Refraction: a keyword which tells POV-Ray to refract light that is being transmitted by an object. (Language Reference) http://library.e. non-attenuating. i. Examples of primitives include boxes. or the square root of -1).

(Tutorial) (Language Reference) S Scale: a transformation which changes the size of an object.The Online POV-Ray Tutorial: Glossary / Index Ripples: a normal modifier which makes the surface appear like a lake into which a stone was thrown. reflective sphere. Specular: in POV-Ray. (Tutorial) (Language Reference) (Exploration Tool) Rotate: a transformation which revolves an object around an axis of the space. (Tutorial) (Language Reference) Software: a set of instructions executed by a computer in the form of a program. Source code: the human-generated code given to POV-Ray to be converted into an image. (Tutorial) (Language Reference) Torus: the mathematical name for a doughnut or ring shape. It's one thing to have a sphere. (Tutorial) (Language Reference) http://library. (Language Reference) Translate: a transformation which moves an object to a new location. It creates nice.html (9 of 11) [9/12/2001 3:16:48 PM] . this is a quartic shape. A texture is composed of a pigment. Their only drawback is their size. except it doesn't respond to turbulence. This makes them a good choice for POV-Ray output (see the F command line parameter). Technically.org/3285/glossindex. (Language Reference) Spotted: a pigment which is identical to bozo. Targas are versatile and easy to use. as far as physical laws are concerned. (Language Reference) T Targa: an image stored in the TrueVision Targa format. See also GIF. a highlight similar to phong but more accurate. It's another to have a striped. a finish.thinkquest. bumpy. and a normal. Texture: the texture of an object defines how it looks. (Language Reference) (Exploration Tool) Sphere: a three-dimensional geometric object that can be thought of as a perfectly round ball. but it's so useful that POV-Ray authors created an easy way to define one. (Tutorial) (Language Reference) Spotlight: a type of light source which only emits light in a certain direction. as POV-Ray outputs them in an uncompressed format. cirlcular ripples which originate from the origin. and can support 24-bit color.

0>. such as <0.spaces. Waves are similar to ripples. (Language Reference) U Union: a CSG object which takes a number of objects and combines them together into one. enclosed with angle braces.html (10 of 11) [9/12/2001 3:16:48 PM] .thinkquest. (Language Reference) (Exploration Tool) White space: the computer term referring to all "invisible" characters -. In POV-Ray. Either that. tab characters. (Language Reference) Wrinkles: a normal modifier which makes a surface appear like it had been wadded up and then stretched back out again. etc. (Language Reference) (Exploration Tool) http://library.The Online POV-Ray Tutorial: Glossary / Index Translucent: able to let light pass though. Exactly what you'd expect from a triangle. new line characters.(Tutorial) W Waves: a normal modifier which creates waves on the surface of an object. The basic unit of physical dimension in ray-tracing. except waves are not evenly spaced. V Vector: a set of related numbers. or left out in the sun too long. valid in comparison only to itself. Triangle: a two dimesional object which has three vertices and three sides. (Tutorial) (Language Reference) Unit: an arbitrary dimensionless quantity. Wood: a pigment which consists of concentric cylinders of color. kind of like growth rings in a tree. (Tutorial) (Language Reference) Turbulence: a pigment and normal modifier which can be used to stir up a pattern.org/3285/glossindex.

as far as case is concerned) with the value <1.The Online POV-Ray Tutorial: Glossary / Index X X: a built-in vector (actually x.thinkquest. Z Z: a built-in vector (actually z. 0>.org/3285/glossindex. 0. Y Y: a built-in vector (actually y. 0>. 0. Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. 1.html (11 of 11) [9/12/2001 3:16:48 PM] . 1>. as far as case is concerned) with the value <0. as far as case is concerned) with the value <0.

The Online POV-Ray Tutorial: Lights

The Online POV-Ray Tutorial
Lights
The following topics are covered in this section. q Adaptive
q q q q q q q q q

Area Light Falloff Jitter Light Source Looks Like Point At Radius Spotlight Tightness

The following scene will be used to demonstrate the effects of different lighting effects.

Adaptive
The adaptive keyword controls the rendering of area lights. Normally, when you create an area light, POV-Ray has to test the visibility of each point in the array. So for a 5 by 5 area light, POV-Ray has to do 25 times as much work to light one surface than it normally would. The adaptive keyword tells POV-Ray to use adaptive sampling of the area light. Adaptive sampling works by only testing the corners of the light for visibility. If about the same amount of light is received from each corner, POV-Ray assumes the light is either fully visible or fully blocked. If different amounts of light are received, POV-Ray assumes the light is partially visible and divides the light up further to determine how much shadow to use. The parameter for adaptive is an integer, greater than or equal to zero, which controls the minimum amount of subdividing to use. With "adaptive 0", POV-Ray will do its initial test with only four rays (each of the corners). While this is fast, it can lead to errors in the shadows (which

http://library.thinkquest.org/3285/language/light.html (1 of 8) [9/12/2001 3:17:36 PM]

The Online POV-Ray Tutorial: Lights

manifest themselves as bright spots where there shouldn't be any). "adaptive 1" will initially test with 9 rays, "adaptive 2" will initially test with 16 rays, etc. Note that POV-Ray will not do an adaptive test with more rays than you have lights in the array. This means that if you have an array with 10 lights, using anything higher than "adaptive 1" won't do any adaptive sampling.

Area Light
Area lights are used to spread out shadows to make them more realistic. One of the hallmarks of raytraced or computer generated images is the hard, well-defined shadow boundaries. This results from the zero dimensional quality of the standard light source. Since the light is a point, it's either visible, or it's not. Hence an area is either shaded, or it's not. Area lights can rectify this situation somewhat. They work by spreading the intensity of the light out into a rectangle. Since the light now has an area, it can be partially blocked, leading to shadows which have soft edges. The general syntax for declaring an area light like this light_source { <location> color color area_light <side-1>, <side-2>, len-1, len-2 [adaptive adaptive value] [jitter] /* specifications for spotlight, if desired */ } Adaptive and jitter are both optional, and are covered in their own sections. side-1 and side-2 are <x, y, z> vectors describing the orientation of the sides. Since area lights are rectangular, these vectors should be perpendicular. Your light will not end up like you intended if they are at some weird angle. The lengths of these vectors correspond the lengths of the sides. len-1 and len-2 are the number of lights along the corresponding dimensions of the light. For example light_source { <0, 0, 0> color White area_light <2, 0, 0>, <0, 0, 2>, 6, 6 } This defines an area light centered at <0, 0, 0> in the x-z plane. The light is two units on a side and contains 36 point sources. The intensity of the light is divided evenly between the 36 points. Interesting shadow effects can be created with linear lights. A linear light is an area light that only has one light along one of its dimensions. This can be used to simulate fluorescent light bars. Here's a sample image using an area light instead of a point source. Note how the shadows get softer
http://library.thinkquest.org/3285/language/light.html (2 of 8) [9/12/2001 3:17:36 PM]

The Online POV-Ray Tutorial: Lights

towards the top of the image.

For more information on declaring light sources, see the light source section.

Falloff
The falloff keyword only applies to spotlights. The float parameter for falloff controls the angle at which the lighting from the spotlight goes to zero. This parameter should always be larger than the radius value and smaller than 180. Setting this to the same value as the radius of the hot spot gives the spotlight a hard (and rather unrealistic looking) edge. The larger the falloff value, the softer the edge. The tightness parameter can control exactly how the light falls off between the radius value and the falloff value. As with the radius keyword, the parameter for this keyword is the angle (in degrees) between the center of the hotspot and the edge of the lit area. The following images give examples of the falloff keyword. All three images use "radius 1.5". The first uses "falloff 1.5" (note the hard edge on the light), the second uses "falloff 2", and the third uses "falloff 3".

The falloff radius for a spotlight needs to be specified. For more information about declaring lights, see the light source section.

Jitter
The jitter keyword only applies to area lights. This keyword is just a toggle, it takes no parameter. If you use jitter in an arealight, for each ray traced, the individual point sources in the light are moved a small
http://library.thinkquest.org/3285/language/light.html (3 of 8) [9/12/2001 3:17:36 PM]

The Online POV-Ray Tutorial: Lights

random amount. This creates smooth shadows that don't have bands of different intensity. This feature can be used to create nice, smooth shadows without gargantuan area light that take years to render. However, jitter is one of the few completely random features of POV-Ray (like crand) and will not be the same in two traces of the same scene. For this reason, using jitter in animations is probably a bad idea.

Light Source
The light_source declaration allows you to declare various types of lights for your scenes. Light sources are what give your objects three dimensionality. It's possible to "light" a scene completely with ambient lighting, but this produces objects which look unexciting and rather two dimensional. Well placed light sources, in combination with good surface finishes well make your objects appear extremely lifelike. Four types of light sources can be defined. The most basic is the point source. This is a geometric point from which light rays eminate. Its only properties are its color and its position. The second type of light is a spotlight. Spotlights are basically point sources which only cast their light in certain directions. The third type of light is an area light. These lights are no longer simgle points, but rather arrays of lights which can be used to make more realistic shadows. The fourth type is a spot area light. This is just a directional area light. But anyway, here's the general form for a light source. light_source { /* these two are required */ <location> color color-spec /* optional area light specifiers */ area_light <side-1>, <side-2>, len-1, len-2 adaptive adapt level jitter /* optional spotlight specifiers */ spotlight point_at <target> radius hotspot radius falloff falloff radius tightness tightness /* misc. optional specifiers */ looks_like { object { obj } } } The two required components of a light source are its location and its color. All light sources must have
http://library.thinkquest.org/3285/language/light.html (4 of 8) [9/12/2001 3:17:36 PM]

The Online POV-Ray Tutorial: Lights

these defined. The location is a standard three component <x, y, z> vector. The color parameter is used to define the color of the light source (go figure). The usage of color is covered elsewhere. The spotlight specifiers are used to turn the light into a spotlight. Spotlights can be used to emphasize parts of a scene, or just to light things selectively. The area light specifiers change the light from a zero dimensional object into a one or two dimensional object. They can be used to create objects that have soft-edged shadows, instead of the hard, well defined edges produced by point lights. They can be used in conjunction with spotlights to confine the soft shadow calculations to a certain area of the scene. The looks_like parameter is just sort of weird. It can be used to assign a "shape" to the light. THe object specified is automatically translated to the location of the light source and has the no shadow keyword set. The source for the various sample scenes shown in this section will give numerous examples of the different types of light sources.

Looks Like
The looks_like parameter can be used to assign a shape to a light source. Normally, individual light sources are just invisible points which radiate light. This applies to area lights, too, as they are just collections of points sources. Any object may put in the looks_like field. Note that the object will be automatically translated to the location of the light source. Also, the object is automatically set to not cast a shadow (see no_shadow). If this were not done, the light source object would not let any of the light that was on the inside out. This would be bad. If you want the associated object to cast a shadow, you can include the light source in a union. Here's an example of "looks_like". light_source { <50, 50, -50> color White looks_like { sphere { <0, 0, 0>, 0.5 pigment { color rgb <0.8, 0.8, 1> } } } } Note how the sphere is created at the origin. Again, this is because it will be automatically translated to the light_source's location. Declaring the sphere's center to be at <50, 50, -50> would result in the sphere being moved again (and ending up at <100, 100, -100>). For more information on declaring light sources, see the light source section.

http://library.thinkquest.org/3285/language/light.html (5 of 8) [9/12/2001 3:17:36 PM]

The Online POV-Ray Tutorial: Lights

Point At
The point_at keyword is a required specifier for spotlights. It declares the point at which you wish the light source to point (it's similar to look_at for cameras). This parameter is used to orient the light; all in all, it's pretty intuitive. Enjoy some sample images. The first pointed at <0, 0, 0>, the second at <0, 10, 0>.

For information on declaring light sources, see the light source section.

Radius
Radius is used to specify the size of the central highlight in a spotlight. It must be specified for all spotlights. The best way to think of a spotlight is as a cone of light originating from the light source. The parameter for radius is a float specifying the angle (in degrees) between the central axis of the cone, and the edge of the cone which defines the hot spot. This is similar to the parameter for falloff. The value for radius should always be less than the value for falloff. Here are some sample images for varying radii. The first has a radius of 0.75, the second 1.5, and the third 2.5.

For more information on declaring light sources, see the light source section.

http://library.thinkquest.org/3285/language/light.html (6 of 8) [9/12/2001 3:17:36 PM]

The Online POV-Ray Tutorial: Lights

Spotlight
Spotlights allow you to specify directed lights. The default type of light source is a point that radiates light in all directions. A spotlight is a point that radiates light only in specified directions. You can turn any light into a spotlight by specifying the keyword "spotlight" in its declaration. Anyway, the following is the general syntax for a spotlight. light_source { <location color color spec spotlight point_at <target> radius radius falloff falloff radius [tightness tightness] } All of the above parameters have to be specified except for tightness, which is optional. A spotlight basically can be considered to be two coaxial cones of light. The inner cone is fully lit by the point source at the location. Its angular radius is specified by the "radius" keyword. The outer cone is the region in which light falls off from fully lit (at the radius angle) to unlit (at the angle specified for "falloff"). The tightness keyword can be used to control how the light falls off in the angles between radius and falloff radius. Although the POV-Ray authors say that your radius may be up to 180, in my experience, POV-Ray won't render any light beyond the 90-degree mark. Anyway, here's an example of a spotlight.

Note how only the regions around the "point_at" point are lit. The region is elliptical because the light is not shining straight down at the "point_at" point. For more information on declaring light sources, see the light source section.

http://library.thinkquest.org/3285/language/light.html (7 of 8) [9/12/2001 3:17:36 PM]

The Online POV-Ray Tutorial: Lights

Tightness
Tightness is an optional modifier for spotlights. It controls how the light falls off the zero at the edge of the falloff radius. It also controls (to a much lesser extent) the falling off of light in the central hot spot. The default tightness is 10. Values can range to nearly zero (but zero itself is bad) for a very soft-edged spotlight, and up to 100 for a very tight edged spotlight. Here are some variations on tightness, rendered with "tightness 1", "tightness 10", and "tightness 100" respectively.

For more information on declaring light sources, see the light source section.

Reference Index

Top of Document

Beginning of the Tutorial

The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team

http://library.thinkquest.org/3285/language/light.html (8 of 8) [9/12/2001 3:17:36 PM]

0. 0>. 0. 0.5.thinkquest.5. <0.5> scale 3 } } light_source { Light } camera { location <-2. 100.pov [9/12/2001 3:17:40 PM] . 0> } http://library.thinkquest. 0.org/3285/language/src/light.707 #declare Light = light_source { <100. 0>. 1> } union { torus { 5.org/3285/language/src/light. 0.5 rotate <90. 1> } } plane { y. 0.5.5 } pigment { color rgb <0. 0 pigment { checker color rgb <0.75> color rgb <0. 16. 5. 1.http://library. 0> } cylinder { <0. 0.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0.75. 0. 10. -8> look_at <0. -200> color rgb <1. 0.

1> } } plane { y. -8> look_at <0. 0.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0.5 rotate <90.707 #declare Light = light_source { <100. 8 adaptive 2 jitter } union { torus { 5. 0> } http://library. 16.5 } pigment { color rgb <0. 0>.75.pov [9/12/2001 3:17:41 PM] . <30*sqrt2_2.thinkquest. 0. 8.5.thinkquest. 0. 0. 0.5. 0>.org/3285/language/src/light1. 0> } cylinder { <0. <0. 100. 5. 0. 1> area_light <0.75> color rgb <0. 0. 30. 0. 0>. 0. 30*sqrt2_2>. 10. -200> color rgb <1.http://library. 0.5> scale 3 } } light_source { Light } camera { location <-2.5.org/3285/language/src/light1. 0 pigment { checker color rgb <0. 1.

thinkquest. 0> radius 1. 1> spotlight point_at <0.5 rotate <90. 100. 1> } } plane { y. 0. 0. 0>. 0> } cylinder { <0. 0.org/3285/language/src/light2.75. 5.707 #declare Light = light_source { <100.pov [9/12/2001 3:17:42 PM] .75> color rgb <0. 0.5. <0.org/3285/language/src/light2. 16. 0 pigment { checker color rgb <0.5.5. 0>.5 } pigment { color rgb <0. 0> } http://library.5 falloff 1.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0. 10.thinkquest.5> scale 3 } } light_source { Light } camera { location <-2. 0. 0. -8> look_at <0. 0. 0. 0.http://library. 1.5 } union { torus { 5. -200> color rgb <1. 0.

0.5 falloff 2 } union { torus { 5. 10. 0. 0. 1> spotlight point_at <0. 0. 0.75> color rgb <0. 5.org/3285/language/src/light3. 0 pigment { checker color rgb <0.5. -8> look_at <0. 0. 0>. 0> radius 1.5 rotate <90.5> scale 3 } } light_source { Light } camera { location <-2. 100. 0.pov [9/12/2001 3:17:45 PM] .5. 0>.707 #declare Light = light_source { <100.thinkquest.http://library.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0. 0> } cylinder { <0. 1.thinkquest.5.5 } pigment { color rgb <0. 1> } } plane { y. 0> } http://library. 0.75. -200> color rgb <1. <0. 0. 0.org/3285/language/src/light3. 16.

0. 1> spotlight point_at <0. 0> } cylinder { <0. 0. 16. 0.5 falloff 3 } union { torus { 5.5 } pigment { color rgb <0. 0 pigment { checker color rgb <0. 0. 1> } } plane { y. 0. 0> radius 1.thinkquest. 10.thinkquest.5. 0. 0. 0>.5 rotate <90.75> color rgb <0. 0. -200> color rgb <1.5. 1.org/3285/language/src/light4. 0> } http://library.75. <0.pov [9/12/2001 3:17:50 PM] . 0.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0.5. 0.http://library.707 #declare Light = light_source { <100. -8> look_at <0. 100. 5.org/3285/language/src/light4.5> scale 3 } } light_source { Light } camera { location <-2. 0>.

For comparison. Its parameter is a float value in the range 0.thinkquest. This light cannot be efficiently modelled by raytracing due to the "backward" nature of tracing rays. Ambient light is light in a scene that comes from no specific source.0 to 1.The Online POV-Ray Tutorial: Finish Reference The Online POV-Ray Tutorial Finish Reference The topics covered in this section are the following q Ambient q q q q q q q q q q q q Brilliance Crand Diffuse Finish Ior Metallic Phong Phong Size Reflection Refraction Roughness Specular Here's the basic test scene used to render the examples. this one uses only the default finishes.org/3285/language/finish. All images in this page are links to the scene file that generated them. Ambient Them ambient finish controls how much of the color of a surface comes from ambient lighting. It's used to adequately model light that bounces off of objects. POV-Ray cheats by http://library.0 (typically).html (1 of 9) [9/12/2001 3:18:47 PM] .

the second with brillance 5.6. and the third with brilliance 0. the less the surface is illuminated. The default value is 1. Higher brilliance values make the light illuminate less at flat angles. This can make the object appear more polished or metallic. see the finish section. The way diffuse lighting works is by calculating the angle between the surface and the incoming light ray. the second is rendered with ambient 0.The Online POV-Ray Tutorial: Finish Reference instead just mixing in a little bit of white to every pigment. The flatter this angle is.thinkquest. The default value is 0. Higher values can make an object appear to glow (although it will not actually emit any light).html (2 of 9) [9/12/2001 3:18:47 PM] .0 means that objects that are not directly lighted will be completely black. http://library. The first is the default.org/3285/language/finish.0. The images below show basically how ambient lighting works. Low values mean that objects which are not directly lit will retain some of their color. For more information about declaring finishes. The first image below was rendered with the default. giving the surface a somewhat softer and less smooth feel. For more information about declaring finishes.2. Brilliance takes a float parameter which modifies how diffuse light bounces off an object. see the finish section. Values that are less than one cause the light to illuminate more at low angles. A value of 0. Brilliance Brilliance modifies the behavior of diffuse lighting. The ambient value of an object controls how much white is mixed in.1.

0 (very well lit). see the finish section.0 (no light from light sources) to 1. it looks the same on large objects as on small. It illuminates objects by striking them directly. for example). which means that you should not use crand in animations.0 to 1. Diffuse light is basically light that comes from a light source and diffuses in all directions. crand is one of the few completely random features in POV-Ray.1 thrown in. Crand takes a float parameter from 0. the second has diffuse 0.1). Usually you shouldn't need more than very low values (such as 0. It also changes when you change the resolution of the image. Crand has some interesting features which can make it somewhat intractable.0.0.The Online POV-Ray Tutorial: Finish Reference Crand Crand can be used to simulate very rough surfaces like concrete and sand which have grainy surfaces. though. Anyway. because it's applied to pixels and not to objects.org/3285/language/finish. Crand works by randomly darkening pixels of the object to create a grainy shadow effect. Here are a few sample images for your viewing (and understanding) pleasure. Finally. The default value is 0. The first is the default. The default is 0. First off.thinkquest. The diffuse keyword takes a float parameter which expresses how much of an object's color comes from direct (diffuse) lighting. This angle effect can be modified to some extent by the brilliance keyword. Diffuse The diffuse lighting model is the main way objects are lit. Any object which does not have a direct.3. By default most of the coloring of an object comes from diffuse lighting.9. The value can range from 0. unblocked line to a light source will not be lit by diffuse lighting and will have to be lit by other models (ambient. and the third has diffuse 0. the first image is again the default.6. http://library. while the second has crand 0. Light that directly lights a surface does so as a function of the angle at which it hits the surface. Higher values result in your objects turning into random pixel messes.html (3 of 9) [9/12/2001 3:18:47 PM] . unless you want your objects to look like static. For more information about declaring finishes. A surface which has the light source directly overhead will appear brighter than a surface which is lit from a very low angle.

Specifying a finish for an object allows you to make the object mirrored. respectively). diffuse. appear to glow. the above effects can be created through use of reflection. or any number of other things (if you're wondering. conveniently. while with transparent objects. But moving along. an extra ray must be traced to determine the color that is being filtered.html (4 of 9) [9/12/2001 3:18:47 PM] . see the finish section which. the general format for a finish declaration goes something like this finish { ambient ambient lighting brilliance brilliance crand crand amount diffuse diffuse lighting ior index of refraction metallic phong phong highlighting phong_size phong size reflection reflected light refraction refract toggle roughness roughness specular specular highlighting } All of the parameters for the finish specifiers are float values (except for metallic which takes no parameter). Much higher. Finish The finish statement is used to define how objects interact with light. and your colors will appear dark. Much lower. appear polished. But here are some general things to keep in mind. is next.thinkquest. Reflection requires an extra ray to be traced to determine the reflected color. and reflection should be about 1.0. The individual sections have more specific information about each type of finish. and ambient. and your colors will saturate and look flat. q The sum of the values of ambient. any object with a nonzero filter) will increase your rendering time. q Objects with reflection and refraction (actually. phong or specular.The Online POV-Ray Tutorial: Finish Reference For more information on declaring finishes. http://library.org/3285/language/finish.

The first was rendered with phong highlighting without metallic.The Online POV-Ray Tutorial: Finish Reference You usually don't need both phong and specular highlights. and the second is with metallic. phong and specular highlights are not both used on the same object. This is done by comparing the angle you're looking at a surface to the angle at which the light is striking the surface. q Ior This value controls the index of refraction for transparent objects which refract. See either of those topics for information on highlights. All the of the example finish images were rendered using delcared finishes. The following sample images will almost undoubtedly explain this better than I have. It basically means that the highlight on an object should be modified by the object's surface color. Metallic The metallic keyword is a modifier for the phong and specular highlights. q The argument to refraction should be 1 or 0 only. Phong takes a float parameter which expresses how bright the highlight should be. Phong The phong keyword creates a highlight on an object that is the color of the light source. the color of the light is mixed into the color of the object. If these angles are opposite and approximately equal. As finishes aren't based on absolute locations. Metallic takes no parameter. This keyword will have no effect if there isn't either phong or specular highlighting on an object. This highlight is similar to the one created with specular. and not just determined solely from the color of the light source.html (5 of 9) [9/12/2001 3:18:47 PM] .org/3285/language/finish. For more information on declaring finishes. Finishes can be declared like just about anything else. transforming them doesn't make sense. Typically. See refraction. either it's there or it's not. A value of 1.thinkquest.0 (the max) causes a complete saturation of the light's color http://library. see the finish section.

html (6 of 9) [9/12/2001 3:18:47 PM] . http://library. Higher values make the highlight tighter.9". Low values spread the highlight out a lot and make the surface appear dull. If you're wondering. Typical values range from 1 (pretty dull) to 250 (very shiny). Lesser values cause less complete saturations. Phong Size The phong_size parameter is a modifier for the phong finish. The size of the highlight can be controlled with the phong_size parameter. The default is 40. All have "phong 0. It takes a float parameter (greater than zero) which defines how large the phong highlight will be. second image: phong 0. this lighting model was named for the person who devised it. see the finish section. For that. For more information on declaring finishes. "phong_size 4".org/3285/language/finish. The images below were rendered with "phong_size 40" (default). For more information on declaring finishes. This parameter has a similar function to the roughness parameter for specular. see the reflection keyword.9 Note that this finish does not actually make the object relfective. see the finish section. These images will show exatly what phong highlights look like. Note that the phong_size parameter is ignored if there isn't a phong finish. creating a surface which looks very polished. Note that there is no highlight on the box because none of the faces are oriented to reflect the light into the camera.thinkquest. First image: no highlights. respectively. and "phong_size 180".The Online POV-Ray Tutorial: Finish Reference at the center of the highlight.

But anyway. Another thing to keep in mind about reflecting objects is that they will take longer to render. Even for surfaces that are glass. try modifying the max_trace_level. You need http://library. another ray has to be traced to determine what the first surface reflects. you also need to specify "ambient 0" and "diffuse 0" in your finish statement. This will turn off all other coloring for the object. Normally you don't need high reflection values on objects that aren't suppose to be mirrors.0" does not make an object transparent. A more appropriate way to reduce the brightness of refracted light is to change the "filter" value in the colors specified in the pigment statement. Note how even with this small amount of reflectance.org/3285/language/finish. A value of 0 turns off reflection for the object. This can really add up if you have a lot of reflective objects. see the finish section. If you start having problems with reflective surfaces being rendered as black. The first scene has no reflection. This keyword takes a float parameter (between 0 and 1) which describes how much reflected color to mix in.1 is sufficient to make it look realistic. As light does not go through opaque things. Values in between will darken the refracted light in ways that do not correspond to any physical property. but the POV-Ray authors strongly recommend against it. transparent objects look like colored air. Reflection tends to like quite nice with a some phong or specular thrown in. the objects appear very reflective. Without refraction. For more information on declaring finishes. To get an absolutely perfect reflector. It is legal to specify in between values. In their words. the second has reflection 0.thinkquest.html (7 of 9) [9/12/2001 3:18:47 PM] . Refraction Refraction only has meaning on objects that have at least a little bit of transparency. You should also be aware that specifying "refraction 1.The Online POV-Ray Tutorial: Finish Reference Reflection The reflection finish gives an object a mirrored or partially mirrored surface.3. The refraction keyword takes one of two parameters either 0 (disable refraction) or 1 (enable refraction). This object will then reflect other objects in the scene. For every ray that strikes a reflective object. Refraction is the bending of light rays as they pass into a more dense or less dense medium. they don't refract. a value of 1 gives the object a perfectly mirrored surface (almost). here's an example of reflection. a reflection value of 0. Many POV-Ray scenes were created with intermediate refraction values before this "bug" was discovered so the "feature" has been maintained.

The index of refraction describes how much light bends when it passes into and out of an object. the filter value of the objects was set to 1.html (8 of 9) [9/12/2001 3:18:47 PM] . 0 is a very bad number for roughness. very large highlight.org/3285/language/finish.33" (water). You can change the ior of a refracting object with the "ior" keyword. see the finish section. and "ior 1. This is because the default ior (index of refraction) is the same as the surrounding empty space.0005 (polished glass).thinkquest. and the third has "ior 2. Empty space is arbitrarily defined to have "ior 1.0" alone does not change the way your object looks. Some examples of indices of refraction are "ior 1.75". Now. For more information on declaring finishes. tight highlight. The default roughness is 0. All use "specular 0. Here are some roughness examples.0. http://library. specifying "refraction 1.000292" (air) "ior 1. Roughness The roughness parameter controls the size of the highlight produced by the specular keyword.The Online POV-Ray Tutorial: Finish Reference to use filter in your pigment to make an object transmit light.0. Roughness is to specular as phong_size is to phong. the third "roughness 0.0".05. For more information on declaring finishes.5". Ior values are positive.5" (glass). It will still look amazingly like colored air.0" (the default in POV). the second uses "roughness 0. the second has "ior 1.001". The first uses the default roughness.0 (sand paper) to 0. For the following example images. High values give very a very soft. see the finish section. and typically greater than 1. Typical values range from 1. The first image has no refraction.9". Small values give a very small.

0 (default) creates no highlight. The size of the highlight can be controlled (to some extent) with the roughness parameter.0 creates a highlight which is completely saturated to the color of the light_source.9) looks like.org/3285/language/finish.The Online POV-Ray Tutorial: Finish Reference Specular The specular finish is similar to phong.0 and 1. For more information on declaring finishes.thinkquest. 0. see the finish section. while 1. but this one is more accurate as far as physical laws are concerned. Here's what specular (0. It produces a highlight on the object where the reflection of the light source would be if the object were reflective. This keyword takes a parameter between 0. Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.0 which describes how much specular highlighting to use on an object.html (9 of 9) [9/12/2001 3:18:47 PM] .

1> } finish { Fin } } plane { y. 1> } } plane { -z. 0. 1> } finish { ambient 0. 1> } camera { location <2.thinkquest.5 } } light_source { <100. 1 pigment { color rgb <1.pov [9/12/2001 3:18:51 PM] . <-0. 0> } finish { Fin } } box { <-2. -1 pigment { checker color rgb <1. -1.http://library. -1>. 0. 1> pigment { color rgb <1. 1. 1> color rgb <0. 0.org/3285/language/src/fin. 1.5.thinkquest. 0> } http://library.5.org/3285/language/src/fin. 0. 0>. 1> color rgb <0. -100> color rgb <1.5. 1. 1. 0. 2. 1. 500. -5> look_at <0.pov #declare Fin = finish { // just default } sphere { <1. -4 pigment { checker color rgb <1.

0. 1> } } plane { -z. 1> } camera { location <2.pov [9/12/2001 3:18:53 PM] .thinkquest. 1> color rgb <0. 1> } finish { Fin } } plane { y. -4 pigment { checker color rgb <1. 0. 1.5. 1. <-0. 1. 0>. 2. 0.5. 1> color rgb <0. -1. 500.thinkquest. 1 pigment { color rgb <1.http://library.org/3285/language/src/fin1. 0> } finish { Fin } } box { <-2. 1> pigment { color rgb <1.5 } } light_source { <100. 0> } http://library. 1. 1. 0.pov #declare Fin = finish { ambient 0. -100> color rgb <1.6 } sphere { <1. -1>. 0. -5> look_at <0. 1> } finish { ambient 0.org/3285/language/src/fin1. -1 pigment { checker color rgb <1.5.

5. 0. 1. 0.http://library. 0. -4 pigment { checker color rgb <1. 0>. -1.5.thinkquest. 0> } finish { Fin } } box { <-2. 1> } finish { Fin } } plane { y. 1> color rgb <0. 1 pigment { color rgb <1.5 } } light_source { <100. -5> look_at <0. 2. 500. -1 pigment { checker color rgb <1. 1> } camera { location <2.5. -1>. 0> } http://library.org/3285/language/src/fin2. <-0. 1.pov [9/12/2001 3:18:57 PM] .org/3285/language/src/fin2. 1. 0. -100> color rgb <1. 1> } } plane { -z. 1. 1> } finish { ambient 0. 1> color rgb <0. 1> pigment { color rgb <1.thinkquest.pov #declare Fin = finish { brilliance 5 } sphere { <1. 1. 0.

org/3285/language/src/fin3. 1> pigment { color rgb <1. 1 pigment { color rgb <1.pov #declare Fin = finish { brilliance 0. -1 pigment { checker color rgb <1.thinkquest. 2. <-0. 1> color rgb <0. 1> } finish { Fin } } plane { y.http://library. -1. 1> } camera { location <2.org/3285/language/src/fin3. 0> } finish { Fin } } box { <-2.5. 0. 500. -5> look_at <0. 0>. -100> color rgb <1. 1.5. 1.thinkquest.2 } sphere { <1. -4 pigment { checker color rgb <1.5. 0> } http://library. 0. 1> color rgb <0.pov [9/12/2001 3:18:58 PM] . -1>. 1.5 } } light_source { <100. 1> } } plane { -z. 1. 0. 0. 1. 1> } finish { ambient 0. 0.

-1. 2. 1> } camera { location <2. 1> } finish { ambient 0. -4 pigment { checker color rgb <1. -5> look_at <0. 0> } finish { Fin } } box { <-2.5 } } light_source { <100.1 } sphere { <1. 1 pigment { color rgb <1. 0>. 1.pov [9/12/2001 3:19:01 PM] .thinkquest. 1> } } plane { -z. 0. 1. 1> } finish { Fin } } plane { y. -1>.thinkquest. 1.5. 0. <-0.pov #declare Fin = finish { crand 0.5. 1. 0. 1> pigment { color rgb <1.5. 0. -1 pigment { checker color rgb <1. 0> } http://library. -100> color rgb <1. 1. 1> color rgb <0.org/3285/language/src/fin4. 0.http://library. 500. 1> color rgb <0.org/3285/language/src/fin4.

5 } } light_source { <100. 1.org/3285/language/src/fin5. 0. <-0. -4 pigment { checker color rgb <1. -1. 0> } finish { Fin } } box { <-2.5.pov [9/12/2001 3:19:06 PM] . 1> } } plane { -z. 1. 2. 1> } finish { ambient 0. -5> look_at <0. 1> pigment { color rgb <1. 1> } finish { Fin } } plane { y. 1 pigment { color rgb <1.5. 1. 0. 0> } http://library. 0. 1. -1>. -100> color rgb <1. 0. 1> color rgb <0.pov #declare Fin = finish { diffuse 0. 1> } camera { location <2.5. 500. 1> color rgb <0.http://library. 0.org/3285/language/src/fin5. 0>. 1.thinkquest. -1 pigment { checker color rgb <1.3 } sphere { <1.thinkquest.

-1.5. -1 pigment { checker color rgb <1. 0> } http://library. 1> } finish { Fin } } plane { y. <-0. 1> pigment { color rgb <1. 0.pov #declare Fin = finish { diffuse 0. -100> color rgb <1. -4 pigment { checker color rgb <1. 1> } camera { location <2.9 } sphere { <1. 1. 2. 0.5 } } light_source { <100. 0.5. 0. 1.org/3285/language/src/fin6.thinkquest. 1.org/3285/language/src/fin6. -1>. 1> } } plane { -z.pov [9/12/2001 3:19:10 PM] . 1> } finish { ambient 0. 1. -5> look_at <0.thinkquest. 0> } finish { Fin } } box { <-2. 1 pigment { color rgb <1. 500. 0. 1> color rgb <0.http://library. 1. 0>. 1> color rgb <0.5.

These include q Background q q q q q q q q q q q q q q Clock Comment Declare Default Fog Include Max Intersections Max Trace Level Rotate Scale Transformations Translate Version X. and Z Background The background statement allows you to change the background color of the image. This effect sometimes be exactly what you need. Also. Here are two example http://library. the background will look positively flat. Y. background { color color-spec } color-spec is any solid color. but it also requires no extra effort from the POV-Ray to change the background color. object transformations.html (1 of 13) [9/12/2001 3:19:25 PM] .The Online POV-Ray Tutorial: Language Stuff The Online POV-Ray Tutorial POV-Ray Language Things This section covers POV-Ray directives. All in all. This must be a solid color. Any rays which do not strike any objects are colored with the background color. fancy pigments and textures are not allowed. The syntax for specifying the background is as follows. Objects do not cast shadows on the background. other times it'll just make your scene look strange.org/3285/language/language. whether declared with a name or defined with rgb. and various miscellaneous features.thinkquest.

Clock "clock" is a float whose value is controlled by the +K command-line parameter.6. to get your frames. 0>. 1 rotate clock*y } Then you could render this scene with +K0.7 } This will make your sphere look somewhat flat. include the following statements in the sky sphere's finish. 0. it depends on the texture). experiment with it until you get something you like.The Online POV-Ray Tutorial: Language Stuff background statements. As always. If you don't want objects to cast shadows on your sky sphere. but that may be the effect you want from your sky. finish { diffuse 0 ambient 0. This is much more convenient than modifying your scene file for each frame. Note that the texture will doubtless have to scaled up (by a factor oy maybe 5000. 0.3. too. you might try this sphere { <5.html (2 of 13) [9/12/2001 3:19:25 PM] .thinkquest.7> } Note that you should only have one background statement in your scene file.org/3285/language/language. +K30. 0. For example to make a simple animation of a sphere orbiting the origin. +K15. If you want a textured background. The value of clock is 0 if no +K argument is given to POV-Ray. background { color Red } background { color rgb <0. http://library. You can use it to create simple animations with ease (although it won't help you with complex stuff)." This is a large sphere (radius of maybe 10000) on which you place a texture. etc. try using a "sky sphere.

Here are some examples of comments. If there's some object that's generating an error. in some versions of POV-Ray.The Online POV-Ray Tutorial: Language Stuff Comment Comments are used to describe what you were thinking in English (or whatever language you speak). 10 pigment { color Red } rotate 45*y } // rotate sphere into position That code segment demonstrates both kinds of comments.org/3285/language/language. Commenting a scene makes it much easier to return in a week and modify it. 0. Comments in POV-Ray follow the C++ syntax. http://library. Note that you can include //'s in /**/ comments without a problem. Thus the "boogaboogabooga" is (unsuccessfully) parsed by POV-Ray. any characters after it (on that line) will be ignored. Then. but you don't know what it is. /* following these line. By putting the characters "//" on a line. so the previous example may not apply to you. 0>. you know that the code you just commented out was causing it. This kind of comment can stretch as many lines as it needs to. the first */ encountered ends the comment. any and all characters will be ignored until POV-Ray sees a "*/" to end the comment. Comments are also useful for when you're debugging a scene. there will be a sphere declaration just so you know */ sphere { <1000. This kind of comment ends when the line does. If the error goes away. Nothing's worse then having a scene that you can't do anything with because you can't figure out what you meant.html (3 of 13) [9/12/2001 3:19:25 PM] . But including other /**/ comments inside a /**/ comment may or may not work. you are allowed to nest comments. Take for example /* outer comment /* inner comment */ boogaboogabooga */ With this segment. it won't end until a "*/" is read. you can go through and comment out blocks of code. You can also start a comment with "/*". which promptly generates an error. However.thinkquest.

Declares are incredibly useful for creating several duplicates of a very complex object. Note that declare does not create a macro.6 #declare Blue = color rgb <0.html (4 of 13) [9/12/2001 3:19:25 PM] . 0. you need to enclose the name in texture statement. that identifier can be used anywhere in the scene after the declaration. as with everything else in POV-Ray are case sensitive. or to declare pigments. To use. One thing to keep in mind about declared objects is that any texture statements inside the #declare will override any applied to the object outside the #declare.thinkquest. finishes. For example #declare Complex_Object = union { /* pages and pages of object code is omitted */ } object { Complex_Object } object { Complex_Object translate <5. 0> } Once an indentifier is declared. the following segment #declare Ack = 2 #declare Moo = 0. for example. 1. for example. 0.The Online POV-Ray Tutorial: Language Stuff #declare The declare directive is used to create object definitions without actually creating the objects. Take. a declared texture. and to keep them from conflicting with reserved words. You can also use declared things in other #declare statements. objects. 0> #declare SomewhatBumpy = normal { bumps Moo } #declare Spheres = union { sphere { http://library. It can be used with floats and vectors to declare constants. 0. Note that declared names. The POV-Ray authors recommend that your declared names should have some upper case letters in them to distiguish them from built in things.org/3285/language/language. or anything else in POV-Ray. textures. 1> #declare Green = color rgb <0. 0> } object { Complex_Object translate <-5.

because the pigment carries an implied texture.html (5 of 13) [9/12/2001 3:19:25 PM] . flat black) or a default normal (normally flat). As another example. 0>. if you want to remove all the ambient lighting from everything in a scene. so they won't be duplicated here. as noted above) are covered in a great deal of depth in the POV-Ray documentation. 0. In some cases.thinkquest. You can also specify a default pigment (normally solid. #default The #default directive is used to modify the default texture for all the objects in a scene. For example. you could go to every object and add finish { ambient 0 } But this gets tedious for large scenes. The methods for declaring all the various types of things that you can declare (almost anything. Note that the normal in the object statement won't apply to the green sphere. it really does make more sense to just use the number. 0>. if you http://library. 0. This will produce a smooth green sphere and a bumpy blue one. Ack } } object { Spheres pigment { color Blue } normal { SomewhatBumpy } } Note that #declares can be used to improve readability (as with Green and Blue) and to degrade readability (as with Ack and Moo).org/3285/language/language. you could just put the statement #default { finish { ambient 0 } } This tells POV-Ray to automatically include "ambient 0" in every object. Ack pigment { color Green } } sphere { <1.The Online POV-Ray Tutorial: Language Stuff <-1. Instead. This implied texture includes a normal statement which won't be overridden.

org/3285/language/language.3679 0. 0> } normal { dents 1. well. you could do #default { pigment { color rgb <1.html (6 of 13) [9/12/2001 3:19:25 PM] .exp(-1) 1 . the second with some rather surreal bright blue fog thrown in. the first without fog. Computing fog is computationally cheap and can add a great deal of realism to a scene. dist is a float specifying the distance at which the color will be 63% the fog color. at a depth of 3 * dist the color will be 95% fog. To compare. you get 1 . http://library. Note that this function will never actually reach 100% fog color. Any filter component for the color will be ignored by POV-Ray.. The other 37% of the color comes from the pigment of the object.0 } } The #default directive is basically just a time saver.) to the power of its argument. Fog The fog statement allows you to add fog of any color and density to your scene. The basic form for declaring fog is fog { color color-spec distance dist } color-spec is any solid color. So when depth and dist are the same. and dist is the value specified above. and then mixing in the fog's color based on that distance (higher distance = more fog color). However.0. fog density = 1 .The Online POV-Ray Tutorial: Language Stuff wanted every object in a scene to be heavily dented and red (unless you specified otherwise in the object declaration).exp(-depth / dist) The exp function raises e (2. It saves you from having to type or block copy the same thing over and over and over and . 0.6321 which corresponds to 63% fog color. here are two scenes. depth is the distance to the intersection. you get the idea. The value of the color being mixed with the fog at this point doesn't really matter.. .718281828459. POV-Ray models fog by calculating the distance to an intersection. The equation for calculating fog density is as below.thinkquest. . The value you specify for the fog distance should depend on the extent of your scene.

but this is not required.inc". there's an include.org/3285/language/language. Note that when you include a file with declares in it. The syntax is pretty simple. This is the best way to use the standard POV-Ray libraries. and you want to group and use these objects as one in another scene. POV-Ray will generate an error. #include "filename" filename is the name of the file you want to include. if you go more than ten levels deep with nested includes. To get access to them you just need to put #include "colors. These data structures are used to store information about object intersections while rendering http://library. colors.The Online POV-Ray Tutorial: Language Stuff #include The #include directive is used to include other scene files in the current one. The effect is exactly as if you had typed the contents of the file in at that location.inc" } It is legal for include files to include other files. the names which are declared are only accessible to things below the #include in your scene. If. If it is. The convention is to name files which are intended to be #included with the extension ".inc" at the top of your file.inc. For example. #max_intersections The #max_intersections directive controls memory allocation for an internal data structure called "I-Stacks". The quotes are necessary. for example. though. you could do union { #include "objects. you have a file with a large number of objects in it. which contains a great many color declarations. This shouldn't be a limitation.thinkquest.html (7 of 13) [9/12/2001 3:19:25 PM] . Another thing you can do is easily group objects together. you need to rethink how you're putting your scene together.

or a texture (or any component of a texture). another ray needs to be traced to determine what color is being transmitted. for example #max_trace_level 10 Note that there is no upper limit on the max trace level. If. This is done by specifying. if you are rendering a particularly complex scene. Note also that the http://library. in the POV-Ray status report (after the render) you see "I-Stack Overflows" listed with the statistics. The trace level goes up from there. If that ray intersects another reflective surface. and so on. Whenever a ray strikes a surface with a nonzero filter value. This thing can be an object. #max_trace_level The #max_trace_level directive controls how patient POV-Ray will be when rendering reflective or transmissive surfaces. these stacks can overflow. Of course. if you get reflective or transmissive surfaces which appear black when they shouldn't be. The basic format for a rotation is rotate <x angle. The same holds with transmissive surfaces. However. Any float value is valid for each of these. Note that when you rotate an object. This means that if any ray running at trace level 5 intersects a reflective or transmissive surface. The default value is 64. another ray needs to be traced to determine what's being reflected.thinkquest. including zero. If that intersects a reflective surface. but POV-Ray might crash if it runs out of memory while tracing reflective surfaces. resulting in scene errors. you just need to increase the value upward until all the "I-Stack Overflows" disappear. y angle. The POV-Ray authors recommend #max_intersections 200 if you start to have problems. you probably need to up the max trace level. Thus. you may need to go even higher if this doesn't fix your problem. Really.The Online POV-Ray Tutorial: Language Stuff a scene. Each of the components are floats which specify the angle (in degrees) to rotate around the corresponding axis. So anything which is not centered on the axis around which you are rotating will appear to orbit that axis. z angle> The argument to rotate is a vector of rotation angles. a third ray (now at trace level 2) needs to traced. a camera. a light. This new ray is at trace level 1. The default #max_trace_level is 5. Rotate Rotate is a transformation which can be used to both change the orientation of a thing in space.html (8 of 13) [9/12/2001 3:19:25 PM] . you always rotate it around the axis.org/3285/language/language. you need to increase the value of this parameter. The first ray sent out for each pixel is at trace level 0. POV-Ray will give up and just return the color black.

hold your left hand with the thumb sticking out in the positive direction of that axis. then 90 degrees around the y-axis. 2. values less than one will squish the object. The first shows a cone pointing in the +y direction. To determine which way is the positive direction around an axis. the order of the rotations for a rotate statement is around x-axis. If you try. All scaling is with respect to the corresponding axis (nonuniform) or the origin (uniform). camera. The object is then scaled by that factor in all dimensions. and z directions respectively. POV-Ray wil generate a warning and reset the offending component to 1. and negative values will reverse the object. sphere { <0. see the transformations section. Thus the following object delcarations are the same. For proof if this. You can scale objects uniformly. For more information about general transformations. light. or texture. Scale The scale transformation is used to change the size of objects. y-scl. Values greater than one for any of these values (uniform or nonuniform) will stretch the object. This makes a difference. The second has the cone transformed by rotating first -90 degrees around the x-axis. y. z-scl> The first form is for uniform scaling. Scaling on object by zero in any dimension is not legal. see the three scenes below. Also.thinkquest. The third has these two transformations reversed. then around y-axis. 0>. The direction your fingers curl when you close your hand is the direction of positive rotation. The parameter here is a three-coordinate vector specifying the scale factor in the x.org/3285/language/language.The Online POV-Ray Tutorial: Language Stuff coordinate system in POV-Ray is left-handed. It takes a float which specifies the factor by which to scale the object.html (9 of 13) [9/12/2001 3:19:25 PM] . The two general forms for a scale is scale scl scale <x-scl. The second form is for nonuniform scaling of objects. then around z-axis. 1 scale 2 } http://library. As with any other transformation. this can be used with any object. You can also mirror-reverse objects. or nonuniformly if you wish.

The Online POV-Ray Tutorial: Language Stuff sphere { <0. However. it's often easier to use somewhat more complex transformations to acheive certain effects.html (10 of 13) [9/12/2001 3:19:25 PM] . and z vectors in a scale statement. Transformations can be applied to just about anything. however. Transformations The term "transformation" refers to rotatations. For more information about transformations in general. However. Hence. the following two scenes look the same. depend on its location relative to other objects). The zeros in that will annoy POV-Ray. see the transformations section. 0. and the second by rotating them into those positions. y. cameras. Conveniently. If you have an object somewhere and you scale it and it disappears. and normals. and scales. it's most likely because it wasn't at the origin when it was scaled. the first was generated by specifying object locations explicitly. 0>. This will often generate scale-by-zero warnings. 4 scale 5*x } This will generate a warning. The transformations will be applied to the object in the order they are listed. because the value of "x" is <1. and a translation (in that order). For example. this is the next section.org/3285/language/language. pigments. 4. you not only double its radius. Any number of transformations may be applied to an object (from here on I'll use the term "object" to refer to any of those things I listed above).thinkquest. you also double the center's distance from the origin. 0>. 0>. http://library. including objects. Take. 2 } When you scale the first sphere. That's just something to keep in mind. Note that any position and orientation of an object can be achieved with a scale. lights. It doesn't make sense to transform finishes as the finish of an object doesn't depend on its absolute location in space (it does. 0. a rotation. the value of 5*x is <5. Another thing to keep in mind is the use of the x. This can generate problems when working with objects that are not at origin. for example. 0>. 0. translations. the following object sphere { <0.

White_Marble is declared in "textures. 1 rotate 90*z pigment { White_Marble } } sphere { <0. Textures. the behavior of the texture is fairly intuitive.The Online POV-Ray Tutorial: Language Stuff Both show cylinders at the corners of an equilateral triangle. in the first sphere. while the second one didn't (at least not as much). The following two objects will not look the same. The order of transformations does matter. Also. and the third after a rotation and a scale. here's a simple scene.org/3285/language/language. particularly with translations. 4. Note the rather striking differences in the second two scenes. 0> 1 pigment { White_Marble } rotate 90*z } This is because. in the second scene it's more obvious from the source exactly what's going on in the scene with those cylinders. and then the pigment is applied to the object's http://library. and Transformations When transforming an textured object. Just remember that an object is modifed in the order that things appear in its declaration. 4. the first one required some thought to position the cylinders. sphere { <0. However. the object is rotated. the second shows it after a scale and a rotation. Objects. The first shows the object untransformed. 0>.inc".html (11 of 13) [9/12/2001 3:19:25 PM] . As an example.thinkquest.

The order in which the translations from one vector are applied doesn't matter. and z direction. it can come in handy if you get some old POV-Ray code from somewhere. y-dist. and z are built in vectors for convenience. They're useful for specifying transformations. In the second. respectively. the following pairs of statements are equivalent. and <0. For a perhaps more basic description of transformations. Y.0" and it corresponds to the version expected at this point in the file. negative. Translate Translate is a transformation which modifies the position of an object. however.0" (without the quotes). Currently. and then the object (and pigment) are rotated. first the object is covered with the pigment.html (12 of 13) [9/12/2001 3:19:25 PM] .thinkquest.The Online POV-Ray Tutorial: Language Stuff surface. 1>. the valid arguments for this directive are "1. 0. then transform the pigment the same way. and Z x. The components in the vectors are floats.0. 0> http://library. The value of this variable is either "1. see the Tutorial. Their values are <1. for example). 0. 0>. 1. 0> translate 5*x rotate <0. X. The basic form for translate is translate <x-dist. 80. Along with the #version directive is the version variable. Most of time you won't be using this directive. 0>. so you don't have to worry about explicitly specifying it.0" or "2. respectively. for example.0" and "2. You can use it to put any object anywhere in space. <0. z-dist> The argument is a three component vector specifying the distance to move the object in the x direction.org/3285/language/language. The default value is 2. and any value (positive. This would transform the sphere. Version and #version The #version directive is used for backwards compatibility with POV-Ray 1. or zero) is legal. The same rules hold for all the other transformations.0. y direction. 0. The #version directive must appear outside of any and all other things (like object declarations. To make the first sphere look like the second. translate <5. This default can be changed with the +MV command-line parameter. you could add a "rotate 90*z" transformation to the pigment of the first sphere. and then apply the pigment to the sphere's surface. y.

thinkquest.html (13 of 13) [9/12/2001 3:19:25 PM] . 6. 0> translate 4*x + 6*y Reference Index Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/language/language.The Online POV-Ray Tutorial: Language Stuff rotate 80*y translate <4.

75.50 color [0.00 color [0. 0. 0>] <0.org/3285/language/pigment.66 color rgb rgb rgb rgb <0.html (1 of 16) [9/12/2001 3:21:07 PM] . 0. 0. 0>] <0.The Online POV-Ray Tutorial: Pigment Reference The Online POV-Ray Tutorial Pigment Reference Topics covered in this section q Agate q q q q q q q q q q q q q q q q q q q q q q q Bozo Checker Color (Colour) Color (Colour) Map Frequency Gradient Granite Hexagon Image Map Lambda Leopard Mandel Marble Octaves Omega Onion Phase Pigment Quick Color (Colour) Radial Spotted Turbulence Wood Note: all the sample images in this scene were rendered with the following color map (unless otherwise specified). 0.thinkquest. 0>] <0.75. color_map { [0.75.33 color [0. 0.75.75>] http://library.

The pigment basically works by assigning random colors to integer points in space and interpolating the colors between those points. This parameter takes a positive float value.The Online POV-Ray Tutorial: Pigment Reference [1. Its color map indexing function uses the colors from 0 to 1 without reversing. The look-up function for the color map uses the colors from 0.thinkquest. http://library. two points that are "close" tend to have colors that are fairly similar while points that are "distant" tend to have colors that are random with respect to each other. which always is turbulent). the pigment looks something like this Another thing to note about agate is the fact that the turbulence keyword has no effect on this pigment. As a result.75. . The notion of "close" and "distant" depends on the scaling of the pigment. For more information on declaring pigments. It basically creates a series of "splotches" on the object. In general. This results in the ends of the color map having more weight than the center. except for its color look-up function and the fact that it is always very turbulent. It's similar to the marble pigment. Bozo The bozo pigment is a very cool and very useful pattern.00 color rgb <0. . to some extent.0 to 1. The bozo pigment uses the same coloring function as spotted. but instead of indexing the colors linearly it uses a sine wave. very turbulent pattern. 0.html (2 of 16) [9/12/2001 3:21:07 PM] .0 like marble.0 and back down to 0. Agate The agate pigment is a very swirly.org/3285/language/pigment. with the "agate_turb" keyword. Agate is always turbulent. but spotted is unaffected by turbulence. The amount of turbulence can be controlled. Also. all the pigments were rendered without any turbulence (except for agate. Here's what a bozo texture might look like . see the pigment section. 0>] } This color map has very high contrast so the details of each pigment can be easily seen.

so here's the general template for using checker.html (3 of 16) [9/12/2001 3:21:07 PM] .The Online POV-Ray Tutorial: Pigment Reference For more information on declaring pigments. pigment { checker color color-a color color-b } color-a and color-b are any two colors.org/3285/language/pigment. This may produce undesirable color patterns as seen on the front face of the cube in the image. you specify the two colors that are checkered.thinkquest. checker responds to the turbulence modifier. For example. http://library. the pigment pigment { checker color Red color Blue } would come out looking something like this One thing to notice about the checker pigment is that it is automatically offset a little bit in each direction to prevent problems with coincident surfaces. The pigment can be scaled nonuniformly to produce rectangular blocks of color as well. The checker pigment doesn't support color maps. This differs from the standard pigment declaration. see the pigment section. Like most other pigments. The pigment creates a space filling pattern of colored unit cubes with the given colors. Checker The checker pigment creates cubes of color in space.

0.inc. where 0. 1> color rgbf <1.0 makes them opaque.8. They can be accessed through the include directive. A great number of (very cool) prefined color names can be found in colors. color name is the name of a declared color. 1> color rgbf <0.8. Any components which have not been specified can be specified with these keywords. 0. 1. an rgb color vector is specified for the color. These keywords can also be used to modify existing colors. Here are a few examples color color color color rgb rgb rgb rgb <1. the fourth method of specifying colors is a more verbose variation of color specification three. 0> 0. green.0 and 1. 1.html (4 of 16) [9/12/2001 3:21:07 PM] .7. <0. the first three components are the same as above. 0. color vec in this example is a four component vector. also between 0.9> // // // // white black pink greenish blue The third color style is similar to the second style. For example color rgbf <1. <1. and fourth float.7> 0.0.0 and 1. 1> 0. all floats between 0. For example. The vector has three components. It is also used in both the hexagon and checker pigments.The Online POV-Ray Tutorial: Pigment Reference Color The color pigment is used to assign monochromatic. One must be specified or POV-Ray will whine at you). In the second style.4> // perfectly transparent // like red cellophane // like frosted glass Note that a declaration like "color rgbf <0. <0. Any components that are not specified will be assumed to be 0. and 0.0.thinkquest. 0. The general form for this pigment is as follows: pigment { color color def } where color def is a color defined in one of the following ways color color color color color name rgb <color vec> rgbf <color vec> red rval green gval blue bval filter fval In the first style. flat colors to objects.6. blue. 1>" will produce a filter that is perfectly black (and hence perfectly opaque). 1. Finally.0 is a surface that is fully transparent. 0. 0. and filter) is followed by a float (between 0 and 1) that specifies the corresponding component of that color. less than 1. Each keyword (red. these two declarations are the same http://library.org/3285/language/pigment.0 makes colors translucent. Note that a color that filters passes through colors in proportion to each color component. 0.8.0 represents no saturation of that color and 1.0 represents full saturation of that color. 0. Note that these keywords may appear in any order and are all optional (except for the first one. specifying the amount of transparency. 0. 1. except a filter value is specified to make the color partially transparent.

Here are some example color maps color_map { [0. and back to red http://library. and frankly. The general format for declaring color maps is like this color_map { [cp0 color color spec [cp1 color color spec [cp2 color color spec /* there can be up to 20 } 0] 1] 2] colors in the map */ cp0 through cpn are floats in the range 0 to 1 that specify the location of a control point in the color map. 0> } Note how the surface have no detail except for the sphere. 0.0 color Red] [0.5> For more examples of these kinds of color declarations see the standard POV-Ray file colors.5 color rgbf <1. Here's a sample image that was rendered with the pigment pigment { color rgb <0.The Online POV-Ray Tutorial: Pigment Reference color Red filter 0. which has a bit of shading. For each control point.org/3285/language/pigment. Color maps give you the power to specify blends of color over the range of a pigment. POV-Ray uses linear interpolation. 0. 0. 0. Color Map Color maps are what give pigments life. but the value of each control point should be greater than or equal to the previous one.inc.75. a color is specified. The default color map is a blend of grays from black to white. then blends through green. this is dull.33 color Green] [0.67 color Blue] [1. This is partially because of the flat pigment and partially because of the location of the light source.html (5 of 16) [9/12/2001 3:21:07 PM] .0 color Red] } // // // // starts at red.thinkquest. blue. To get the color of a point in between control points. Color maps must contain between 2 and 20 control points.

the second was rendered with "frequency 5". There are a number of examples of color maps in the POV-Ray include file textures. at 0. the filter values will be interpolated too.0 will be that color q If two colors are specified to have the same control point. all the colors between that control point and 1. there will be a sudden change between colors at that point.0 range.0 to 1. all the colors between zero and that control point will be that color q Similarly. there is a sharp change to blue // which is the color of the remainder of the map color_map { [0.5 color White filter 1] [1. 0 is a bad number. For example.0 to 0.0 color Blue] } Some things to keep in mind about color maps q If the first control point is greater than 0. Values greater than 1 compress the map.5 are Yellow Yellow] Yellow] Blue] Blue] // then.5 color Blue] } // same as above.html (6 of 16) [9/12/2001 3:21:07 PM] . The color at that point will be the color that is specified latest q If two control points have colors with different filter values. producing colors with intermediate transparency.0 color } // all colors from 0. but harder to understand color_map { // filters blend too [0.0.org/3285/language/pigment.5 color [1. Frequency The frequency modifier controls how many times the color map is used over the 0.thinkquest. The modifier takes a float which defines how the color map is stretched. Negative values will reverse it and (potentially) stretch it. All three images use the radial pigment pattern.5 color Yellow] [0. http://library.5. if the last control point is less than 1.inc.0 color [0. The first was rendered with the default "frequency 1". Here are two sample images. and the third was rendered with "frequency -1". values less than 1 stretch it.The Online POV-Ray Tutorial: Pigment Reference color_map { [0. the statement "frequency 2" will cause the color map to repeat twice over the range that would've repeated once.5 color [0.0 color Red] [0.

The Online POV-Ray Tutorial: Pigment Reference See pigment for information about the use of frequency.html (7 of 16) [9/12/2001 3:21:07 PM] . you'll end up with pockets of color from one end of the color map surrounded by rivers of colors from the other end. as long as it is nonzero. To control the width of the bands of color. Gradient uses indexes the color map from 0 to 1 without reversing. The orientation of those planes is controlled with gradient's parameter. while the second was translated to remove this "feature. while marble bounces back and forth from 0 to 1 and back to 0 again. 1>" The first image shows the color map reversal at the origin. the first is rendered with "gradient x" and the second is rendered with "gradient <1. The gradient pigment is very similar to the marble pigment. To get rid of this potentially undesirable boundary. Gradient The gradient pigment creats parallel planes of color. see the include file stones. much better examples of the use of this pigment (with layered textures). Note that the magnitude of the vector is unimportant. For much. Typically. see the pigment section. The sample color map used here doesn't really do it justice. This effect can be simulated with gradient with the proper color map and scaling. The main difference is the color map look up functions. use the frequency keyword. 1. http://library. With the proper color map it can look very convincingly like real granite. Here are two sample gradient patterns." For more information about declaring pigments.inc. much. you can translate the pigment along its normal vector until the boundary is off the object.org/3285/language/pigment. Granite The granite pigment creates a sort of bozo-like pattern. The said parameter is an 3 component vector which descibes the normal of the planes of color (they all have the same normal as they are parallel).thinkquest. Another thing to note about the gradient pattern is that the color map reverses at 0.

without reversing. 0). 0. For more information on declaring pigments. 0. For this pigment.html (8 of 16) [9/12/2001 3:21:07 PM] . The pixels of the original image are turned into infinitely long boxes that are parallel to the z-axis. 0 to 1.The Online POV-Ray Tutorial: Pigment Reference Granite uses the color map from 0 to 1. etc. and produces haxagonal "pillars" of color parallel to the y-axis. Image Map Image mapping a very powerful technique for producing specific color patterns on the surface of an object.5 } The pigment was scaled to give more detail about how the pigment works. and they are used to create a hexagonal pattern on the objects. three colors are specified. although it doesn't have any by default. see the pigment section. 0> scale 0. The hexagon pattern is projected onto the x-z plane.thinkquest.75. Hexagon The hexagon pigment is similar to the checker pigment. (1. 0.75> color rgb <0. For more information about declaring pigments. 1). 0. Rendered with the following pigment pigment { hexagon color rgb <0.org/3285/language/pigment. Granite responds to turbulence. 0> color rgb <0.75. The default mapping method is to project the image onto the x-y plane in such a way that it fits into the square (0. It basically works by reading an image file and then projecting that image onto the object. see the pigment section. Note that larger images http://library.

you can change it (to some extent) with the map_type modifier. They include the aforementioned once and map_type as well as a few others. you can scale. while Bilinear does a better job of picking intermediate colors. Filter can be used to modify specific colors. This number can be either 4 (for the Normalized Distance algorithm) or 2 (for the Bilinear algorithm).org/3285/language/pigment. . By default. But onward now. The modifiers following the file type are optional. but rather image maps with better resolution. rotate.gif" interpolate 4 } } The last modifier accepted by image maps is filter values. This can be changed with the once keyword. The first image is the image that was mapped. or dump.thinkquest. and the second is the resulting scene. image maps are all opaque. Here we have an example of an image being mapped onto a box. POV-Ray takes the location of the ray intersection and assigns a pixel value to it. or to assign a filter value to the entire image map. Probably the best way to explain filter is through examples so here are a few http://library. to the syntax for image maps image_map { type "filename" modifiers . When the image map is scaled up a great deal or is of poor resolution initally. This eliminates (for the most part) blockiness. The filter keyword can be used to change this. Normalized Distance is the faster algorithm. this can result in image maps that appear blocky or otherwise generally ugly. Here's an example of using the interpolate keyword pigment { image_map { gif "foobar. If you don't like the default projection style mapping. but at the expense of tracing time. If you don't like the normal position of the image map. tga. By default. One of these others is the interpolate keyword. and translate it to your heart's content. the image map is repeated infinitely in the x and y directions. This is followed by the filename (in quotes) which specifies the image file to be mapped. The interpolate keyword is followed by a number specifying the type of interpolation to be used. iff. } type is one of gif.html (9 of 16) [9/12/2001 3:21:07 PM] . Interpolation performs smoothing on the image as it is mapped. By default. POV-Ray averages the values of surrounding pixels to determine intermediate values.The Online POV-Ray Tutorial: Pigment Reference do not produce larger image maps. When interpolation is turned on. .

0 produce very straight steps. which can make for some very interesting effects. Values of 1. Leopard The leopard pigment is similar to the bozo pigment. Leopard uses the color map values from 0 to 1. see the pigment section. 0.gif" filter 0. The default lambda is 2. See the section on color for an explanation of color filtering. Lambda Lambda (besides being a greek letter) is a modifier for turbulence. It takes a float parameter that must be greater than or equal to 1. Image maps also respond to turbulence. except for its regularness.GIF file) being 50% transparent. 0 to 1 without reversing. The lambda parameter basically controls how random each step of turbulence is (see turbulence for a description). The color specified by palette entry 2 becomes 100% transparent.org/3285/language/pigment. For more information about declaring pigments.4 } image_map { gif "gurple.thinkquest. 0. The pigment is generated by basically setting the center of each unit cube in the space to the color at one end of the color map. The color with palette entry 7 becomes 40% transparent (which should not be surprising at this point). The colors inside the cube are then blended between the two. Here's an example of a leopard pigment http://library.0 filter 7.8 } The first image map maps the image with the color specified by palette entry 0 (in the . while greater values produce steps with a greater randomness. Image maps and color maps do not mix.gif" filter all 0.html (10 of 16) [9/12/2001 3:21:07 PM] . 1.0.The Online POV-Ray Tutorial: Pigment Reference image_map { gif "zordo.5 filter 2. and points on the edge of the cube to the color at the other end. Note that specifying a lambda value only makes sense if you have turbulence.

Now we have an example of a mandel texture rendered with "mandel 50" For more information on declaring textures. that parameter is the number of iterations to compute when generating the pigment. except for its color map look up function. Where gradient uses the colors from 0 to 1. As usual. Mandel one of the few pigments which take a parameter.5 to x=1.html (11 of 16) [9/12/2001 3:21:08 PM] . the marble pigment doesn't take a "normal" parameter. rotated. By default. while the second has turbulence 0. if you want the pattern to vary from the default y-z plane orientation. http://library. see the pigment section.8 or 0. marble has no turbulence and is consequently rather boring. see the pigment section. can create very realistic looking stone textures. see the pigment section. in combination with a good color map.thinkquest.The Online POV-Ray Tutorial: Pigment Reference The leopard pigment responds to turbulence.5 and then back down to color 0 again in the range x=0. identical except for the turbulence. Mandel The mandel pigment creates a pattern that looks like the famous Mandelbrot set. the pigment can be scaled. 0 to 1 without reversing. For more information about declaring pigments. and it is said that very turbulent leopard pigments look like bozo pigments to some extent. the marble pigment blends from colors 0 to 1 in the range x=0 to x=0.8. The first image has no turbulence. A turbulence value of 0. you'll need to rotate the pigment. Marble The marble pigment is quite similar to the gradient x pigment. the set is mapped onto the x-y plane in the standard range. The number of interations for each point to escape is used to color it according to the given color map. By default.9.org/3285/language/pigment. Also. Here are two sample images of marble pigments. and translated to fulfill your fondest Mandelbrot set dreams. For more information on declaring pigments.

For a description of turbulence.The Online POV-Ray Tutorial: Pigment Reference Octaves The octaves keyword is modifier for turbulence. For a more in depth description of turbulence. It will change the rendering time. The default value is 6.0.0. The default value is 0. as the more steps there are to calculate. an octaves value much higher than 6 won't change the scene much. the longer POV-Ray will have to spend on each ray. Onion The onion pigment creates concentric spheres of color centered at the origin. without reversing. Normally omega values are between 0. Phase The phase keyword is used to offset the color map It takes a float parameter between 0. Note that specifying the number of octaves only makes sense if you have turbulence. see the turbulence section (go figure). which means that each step is half as long as the previous. The parameter is the number of steps that should be taken by the turbulence function.html (12 of 16) [9/12/2001 3:21:08 PM] . Omega Omega is yet another turbulence modifier. When generating turbulence.5. each step is omega times as long as the previous one. It uses the color map entries from 0 to 1.0 and 1. Here's a sample of the onion texture Note that the sphere is entirely one color. Note that specifying an omega only makes sense if you have turbulence.0 and 1. For more information on declaring pigments. It controls the number of steps taken by the turbulence function when it is generating turbulence. It can range from 1 to 10. Using a low number of octaves can produce a sort of wavy pattern on the surface. This is because the pigment is centered at the enter of the sphere and so each point one the sphere lines up with the same color in the color map. It controls the size of each step in the turbulence function.org/3285/language/pigment. The phase adjustment is always applied before any frequency adjustments. As the length of each step decreases exponentially. though. regardless of their order in the pigment http://library.thinkquest. 0 to 1. see (naturally enough) turbulence. see the pigment section.

See their individual sections for more specific information on each (as well as sample images). . http://library. hexagon. with an effectively infinite number of ways to al ter them to your needs. The color map and the turbulence are optional. translations. granite.The Online POV-Ray Tutorial: Pigment Reference declaration. then the color map. And if there still isn't something you want. The second type of modifier is the color map. Pigments are what give the life to raytraced images.org/3285/language/pigment. which just happens to be the next section. but must specified after the last pigment modifier. . The two color map modifiers are frequency. and finally the turbulence.thinkquest. The first part.html (13 of 16) [9/12/2001 3:21:08 PM] . gradient. mandel. or wood. onion. you can also image mapping and even material mapping (image mapping with entire textures instead of just colors). checker. A pigment consists of three major parts. which shifts the colors in the map. leopard. and phase. POV-Ray supports a very wide array of pigment types. and scales) may follow the pigment declaration. . see pigment. first the pigment type. bozo. Pigment The pigment statement is how pigments (colors or patterns of colors) are assigned to objects. marble. pigment type is one of the following: agate. Note that adjusting the phase of a gradient pattern is the same as translating the pigment and adjusting the phase of a radial pigment is the same as rotating the pigment around the y-axis. The specification of a color map is covered in some detail above. By modifying the phase of a pigment you can create interesting effects in animations. Anyway. For more information on the usage of phase. which stretches or compresses the color map. the general format for specifying a pigment is like this . pigment { // One of these is required pigment type color color /* OR */ image_map { /* image map specifications */ } // all the following are optional color_map { /* color map entries */ } frequency frequency lambda lambda val octaves number of octaves omega omega val phase phase quick_color color turbulence turbulence val or vec /* any transformations go here */ } /* OR */ Any number of transformations (rotations.

It can also make some pigments look weird. and omega can be used to tweak the turbulence to achieve the exact effect you're looking for. There are a number of pigments which will look fine without turbulence (such as bozo). At +Q6 and above the normal pigment declaration is used. There's not much more to say about it. There are some more samples over with the frequency section. and some which look rather lame without turbulence (such as marble) and even some which don't even respond to turbulence (such as spotted). You can have a pigment and a quick color assigned to the same object. any objects which are not already solid colors will be grayscaled. and otherwise just color the sphere Aquamarine. Turbulence is the "most optional" of the three parts. Radial The radial pigment takes the color map and wraps it clockwise around the y-axis. starting in the positive x direction. so here's a sample image which probably explains it better.org/3285/language/pigment. You can override this by explicitly specifying a quick color. octaves. The method for specifying quick colors is the same as for specifying normal colors. The only time POV-Ray uses quick colors is when you set the rendering quality to +Q5 or below. The modifiers lambda.thinkquest.The Online POV-Ray Tutorial: Pigment Reference The third part of the pigment is the turbulence specification. For example sphere { gradient x color_map { [0. Turbulence is basically used to mix up a pigment a little (or a lot). You can use the quick_color modifier to distinguish two objects in a quick rendering.0 color Yellow] } turbulence 0. For more information on declaring pigments.0 color Red] [1.8 quick_color Aquamarine } will instruct POV-Ray to create a turbulent gradient pigment at +Q6 and above. Note that giving an object a solid color pigment will automatically set the quick color to the same color. When rendering a +Q5 and below. Quick Color Quick colors are used only when debugging scenes. see http://library. This can add life to a pigment. though.html (14 of 16) [9/12/2001 3:21:08 PM] .

"use that color over there.The Online POV-Ray Tutorial: Pigment Reference the pigment section.0 inclusive. In essence. Turbulence works by taking a number of semi-random steps and using the color at the destination point. whether individual floats or vector components. Turbulence Turbulence is used to mix up a pigment to some extent. should be between 0. Here's an example of what turbulence does. it constructs a pointer which says.html (15 of 16) [9/12/2001 3:21:08 PM] . In a normal pigment." The "random" number generator used to http://library. For more information on declaring pigments.8 // stir up the pigment equally in all directions turbulence <0.0 and 1. Spotted The spotted pigment is identical to the bozo pigment.thinkquest. see the pigment section. 0. to be exact).8. Both images use a marble pigment. See the bozo section for more information on it.9. except it doesn't respond to turbulence. low numbers mean only a little turbulence. 0.org/3285/language/pigment. but only the second was rendered with turbulence (turbulence 0. The way POV-Ray implements turbulence is quite interesting. High numbers mean lots of turbulence. The turbulence key word can take either a float or a three component vector as a parameter. a lot in // the y direction and a little in the z // direction turbulence x // major turbulence only in the x direction All of the numbers. The following image was rendered with the spotted pigment. POV-Ray simples determines the color of the pixel at each point on the surface of the object and colors the object with that.3> // no turbulence in the x direction. For example turbulence 0.

The rate at which the step length falls off is determined by the omega value. Increasing it will have only a marginal effect.9. For more information about declaring pigments. Omegas are typically less than 1. Higher lambdas increase the randomness of the direction of each step. so rendering a scene file with turbulence will always result in the same image (good for creating animations).1.0 cause each of the steps to be in approximately the same direction. Then it picks yet another direction and moves not-quite-not-quite-as-far in that direction.2) tend to smooth the pigment out a lot.org/3285/language/pigment.html (16 of 16) [9/12/2001 3:21:08 PM] . while points that are distant tend to end up with random colors (with respect to each other). This controls the "randomness" of each step. High values or omega (0. This is because the length of each step falls off exponentially. To create pigments that acutally look like wood. octaves.8. 2) can create interesting effects. Turbulence works by first selecting a direction and moving so far that way. 0. The default number of octaves is 6. 0. Each subsequent step in the turbulence is omega times as long as the previous one. whatever) tend to make the turbulence more random. Lambda should be greater than or equal to 1. Here. and omega) make a little more sense. Here's a more in depth description of the turbulence function which will make its modifiers (lambda. stick with earth tones. Hence large amounts of turbulence create very large steps. Lambdas that are close to 1. Decreasing the number or octaves (to. and add a small amount of turbulence. The default value is 2. It uses a function called DNoise to generate these random steps. Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. while low values (say. points that are near each other initially tend to end up with similar colors. Wood The wood pigment creates concentric cylinders of color centered around the z-axis.thinkquest. looking very un-wood-like is a sample image. rotate the pigment around the x-axis a few degrees. The overall magnitude of these steps is controlled by the parameter given to turbulence. The total number of steps taken is controlled by the octaves parameter.The Online POV-Ray Tutorial: Pigment Reference produce these steps is a function of original point. Then it picks a new direction and moves not-quite-as-far in that direction. The third modifier for turbulence is the lambda parameter. The "random" number generator is also deterministic. The default omega value is 0. say.0.5. Hence. see the pigment section.0.0. 0. This is a reasonable number and will do fine for most textures.

33 color rgb <1.25>] [0.5.org/3285/language/src/pig1. 0.25.50 color rgb <0. 0. -5> look_at <0. -1. 1.25. 1. <-0. 1> pigment { Pigm translate <-1.5.5.5.25.25. 0.00 color rgb <1. 1. 0.pov #declare Pigm = pigment { agate color_map { [0. 0.thinkquest. 0> } } light_source { <150. 0. -1>.thinkquest.25>] [0.5. 2. 0> } http://library.pov [9/12/2001 3:21:09 PM] . 1>] [1.25>] [0. 200.org/3285/language/src/pig1.http://library. 1 pigment { Pigm translate <1. -500> color rgb <1.25. 1> } camera { location <2.00 color rgb <1. 0. 0>. 0.66 color rgb <0. 1.25>] } } sphere { <1. 0. 0. 0> } } box { <-2. 0.

50 color rgb <0. 0.25>] } } sphere { <1.org/3285/language/src/pig2.thinkquest. 1. 0. 0> } } light_source { <150. 1>] [1. 0. 1 pigment { Pigm translate <1. 0.pov [9/12/2001 3:21:14 PM] . 1> pigment { Pigm translate <-1. 0> } http://library.pov #declare Pigm = pigment { bozo color_map { [0.5.25. 0. 0. -1.org/3285/language/src/pig2.http://library. -1>.25.25. 0>. 0.25>] [0.25. 1. -5> look_at <0.00 color rgb <1. 200. 0> } } box { <-2. 1.5. -500> color rgb <1.00 color rgb <1.66 color rgb <0. 0. 0.5. 0. 0.25.thinkquest. 1.5. 1> } camera { location <2. 2.5. <-0.25>] [0.25>] [0.33 color rgb <1.

0> } } box { <-2.25. 1> } camera { location <2.5.pov [9/12/2001 3:21:15 PM] .http://library.5. 0.org/3285/language/src/pig13. 0.5. -500> color rgb <1. 0.25. <-0. 1> pigment { Pigm translate <-1. 0. 1 pigment { Pigm translate <1.25.thinkquest. 0> } } light_source { <150. 1> } sphere { <1. 0> } http://library. 2. -5> look_at <0. 1. 0.pov #declare Pigm = pigment { checker color rgb <1. 0>.5. -1>.thinkquest.org/3285/language/src/pig13. -1.5.25> color rgb <0. 1. 0. 0. 200.

0.pov [9/12/2001 3:21:17 PM] .pov #declare Pigm = pigment { color rgb <1. 0. 1 pigment { Pigm translate <1. 0. <-0.5.25> } sphere { <1. 0. -1>. -1. 1. -500> color rgb <1. 0> } } box { <-2. 2. 1.25. 200. -5> look_at <0.org/3285/language/src/pig12. 0>.org/3285/language/src/pig12.thinkquest.5. 0> } http://library. 0> } } light_source { <150.http://library.thinkquest.5. 1> pigment { Pigm translate <-1.5.5. 0. 0. 1> } camera { location <2.

0.25. 1> pigment { Pigm translate <-1.5.25>] } } sphere { <1.http://library.5. 1.33 color rgb <1. -5> look_at <0. 0.00 color rgb <1.5. 0. 1. 1>] [1. 0. -1>.pov [9/12/2001 3:21:25 PM] . -500> color rgb <1.5.25>] [0. <-0.org/3285/language/src/pig7. 200. 0. 0.25. 2. 1. 0> } http://library.25. 0.50 color rgb <0.pov #declare Pigm = pigment { radial color_map { [0.25. 1. 0.25. 0> } } box { <-2. 1 pigment { Pigm translate <1. 0.5.66 color rgb <0. 1> } camera { location <2. -1.thinkquest.25>] [0. 0.org/3285/language/src/pig7.thinkquest. 0.00 color rgb <1. 0> } } light_source { <150. 0>.25>] [0.

33 color rgb <1.25>] [0. 0. 0. <-0. 0. 1.5. 0.org/3285/language/src/pig15.00 color rgb <1. 0>. 0. 1. 0> } http://library. 0. -500> color rgb <1. 1> pigment { Pigm translate <-1. -1>.http://library. 0. -1.25. 0. 1> } camera { location <2.25.5.thinkquest.25.pov #declare Pigm = pigment { radial color_map { [0. 2.25>] [0. 200. 0> } } light_source { <150.25.00 color rgb <1. 1. 1. 0.thinkquest. 1 pigment { Pigm translate <1.org/3285/language/src/pig15.5.66 color rgb <0.50 color rgb <0. -5> look_at <0.25>] [0.25>] } frequency 5 } sphere { <1.5. 0> } } box { <-2. 1>] [1. 0.pov [9/12/2001 3:21:27 PM] . 0.25.5.

0> } } light_source { <150.25. 0.25. 0.5. 0> } } box { <-2.pov [9/12/2001 3:21:28 PM] . 2.http://library. 1> } camera { location <2.5. 1> pigment { Pigm translate <-1. 0. 0>. -1>.25>] [0.33 color rgb <1. 0.5.00 color rgb <1.25. 0. 0.5. -500> color rgb <1.org/3285/language/src/pig16.25>] [0.org/3285/language/src/pig16. 1. 1>] [1.25>] [0.thinkquest. 1.25. 0. 1.thinkquest. 0. -5> look_at <0.25>] } frequency -1 } sphere { <1.66 color rgb <0.5. 0. <-0.50 color rgb <0. 0.25. -1. 200.pov #declare Pigm = pigment { radial color_map { [0.00 color rgb <1. 1 pigment { Pigm translate <1. 0. 0> } http://library. 1.

25. 0.5. 0.25. 0. 1> pigment { Pigm translate <-1. -5> look_at <0. 0> } http://library.25>] } } sphere { <1. 0.25>] [0. 0.25.5.5.25>] [0.25>] [0.5. 1>] [1.org/3285/language/src/pig10. <-0.33 color rgb <1. 0. 1. 0.pov [9/12/2001 3:21:30 PM] . 1. 0. 2. -1>.5. 200. 0> } } light_source { <150. 0> } } box { <-2. 1 pigment { Pigm translate <1. 1> } camera { location <2.00 color rgb <1. 0.50 color rgb <0.http://library.00 color rgb <1. 1. 1.thinkquest. 0.25.66 color rgb <0. 0. 0>.25.pov #declare Pigm = pigment { gradient x color_map { [0. -500> color rgb <1.thinkquest.org/3285/language/src/pig10. -1.

0. 0. 10> } sphere { <1. 1> } camera { location <2.org/3285/language/src/pig11.00 color rgb <1. 0. 1. 0.25. -1. 0>.pov [9/12/2001 3:21:31 PM] . 10.thinkquest.25. -5> look_at <0.66 color rgb <0. 1. <-0. 1> pigment { Pigm translate <-1. 2.thinkquest.5.pov #declare Pigm = pigment { gradient <1.50 color rgb <0. 0.25>] [0. -500> color rgb <1. 1.25.25>] [0.00 color rgb <1. 0> } } box { <-2.25. 0> } } light_source { <150. 0.org/3285/language/src/pig11. 1 pigment { Pigm translate <1. 0. 200. 0> } http://library.5.http://library. 0.5. 0. 0. 0.5. 1>] [1.25>] [0. 1.5. 1> color_map { [0.25.33 color rgb <1.25>] } translate <10. -1>. 1.

type is one of gif. you specify any mapping modifiers (like once or map_type). and so on. and the palette index of black is 4. iff. This is then followed by filename. For example. After the file.html (1 of 5) [9/12/2001 3:22:00 PM] . Interpolation is supported for material maps. if a particular pixel is black. The basic syntax for a material map is like this texture { material_map { type "filename" /* modifiers */ texture { /* texture 0 */ } texture { /* texture 1 */ } /* as many textures as you need */ } /* any transformations */ } Here. Color 0 in the palette gets texture 0 in the list mapped onto it. If there are not enough textures in the list to assign a texture to a particular number. This specifies the type of image file being read. not between colors. except you're wrapping patterns of textures around an object instead of patterns of solid colors. for example. Anyway. When material mapping rgb images. http://library. the indexing will wrap around back to the first texture. or dump.org/3285/language/texture. Color 1 in the palette gets texture 1. the texture selected at a point is based on the palette index. for the indexed color type of image (gifs). This kind of thing is useful for creating inlaid floors. For example. the value of the red byte for each pixel is used as the texture index. tga. it will get mapped back to texture 0. in quotes. then texture 4 will be used to color that point. q Material Map q q Texture Tiles Material Map Material maps are basically image maps. but it interpolates between textures.thinkquest. if you list three textures.The Online POV-Ray Tutorial: Texture The Online POV-Ray Tutorial Texture The topics in this section are texture declarations which don't fit into any other category. and have a Color 3 in your material map. and so will probably not have the desired effect.

Texture The texture statement is used to give an object a surface texture.thinkquest. finish. a finish. Any floating pigment. Any of these can be left to the default.The Online POV-Ray Tutorial: Texture If you specify a material map. any and all texture declarations (pigment. POV-Ray considers the following statements to be identical.gif" texture { Text1 } texture { Text2 } texture { Text3 } texture { Text4 } } finish { ambient 0 } } If you want to do something like this. They cannot appear outside in the "main" texture declaration. Here's an example of a material map. or normal) must appear in textures in the texture list. For example. or finish statement in an object is assumed to be enclosed in a texture block. Usually finishes and normals are left until the fine-tuning stages of scene production. 0>. 5 http://library. 0. the rendered scene is the second. the following is illegal. and a normal. sphere { <0. if you use the first form. you must manually add the "ambient 0" to each texture statement in the list. 0>.org/3285/language/texture. 0. POV-Ray assumes you mean the second. For example. In fact. 5 pigment { color Green } } sphere { <0.html (2 of 5) [9/12/2001 3:22:00 PM] . The map is the first image. normal. texture { material_map { gif "inlaid. anyway. Surface textures consist of a pigment.

As an example. Presumably the upper textures have transparent parts to let the lower ones show through. Usually this isn't very complex as everything else will be on top of it. http://library. you cover an object with several overlapping textures.thinkquest. In the first image. a top layer */ Top_Layer } } You may have as many textures in a layered texture declaration as you need. but you can do whatever you want. there's just a base for the texture. object { Something_To_Put_Layered_Textures_On texture { /* the first texture listed goes on the bottom */ Bottom_Layer } texture { /* a middle layer which is draped over the first */ Middle_Layer } texture { /* and finally. layered textures are used to create some exceedingly realistic looking stone textures.org/3285/language/texture. Next some violent orange bands were added on top (using agate).html (3 of 5) [9/12/2001 3:22:00 PM] . see the standard include file stones. For a number of really awesome examples of layered textures. but it's up to your imagination. here's a layered texture being constructed from the bottom up. Here it's just a simple bozo. This is down by specifying multiple textures for an object. With layered textures.The Online POV-Ray Tutorial: Texture texture { pigment { color Green } } } Most of the different texture components are covered in their own sections.inc. This texture was sort of designed to look like a molten planet or a dying star. It might look something like this. Here. Layered textures allow you to vary the built in textures styles in an almost infinite number of ways. A very powerful technique in object texturing is that of layered textures.

here's an example of a tiled texture. Anyway. When used on a plane.thinkquest. A tiled texture may be used as one of the textures in another tiled texture to create a double-tiled texture (but you'll have to scale the inner one down or it'll overlap exactly with the outer one). Tiles Tiles are to textures what checker is to colors. Anyway. you can do a lot more.org/3285/language/texture. the general form for a tiled texture is like this texture { tiles { texture { Text1 } tile2 texture { Text2 } } } The keyword tile2 is a separator and must occur between the two texture declarations. Any transformations of the texture must appear either inside the individual textures (which are to be tiled) or outside the tiles block altogether. http://library. Although this particular texture may not be the best or most realistic texture.The Online POV-Ray Tutorial: Texture Finally. The tiles texture uses two textures and creates alternating "blocks" of those textures.html (4 of 5) [9/12/2001 3:22:00 PM] . With some creative rotation. this typically looks like squares of texture. it's much more interesting than a standard one-layer texture. too. some random splotches of yellow were put on top (this was done with granite).

thinkquest.html (5 of 5) [9/12/2001 3:22:00 PM] .The Online POV-Ray Tutorial: Texture Here's a tiled texture with one of those aforementioned creative rotations. Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/language/texture.

Bounding objects do not affect the way the scene looks. although bounding will show the most speed improvement when used with complex CSG or polynomial objects. These modifiers include the following. object { Really_Complex_Chair bounded_by { box { http://library. Things that cannot be automatically bounded are infinite objects. Note that POV-Ray has a limited ability to do automatic bounding. Specifying a bounding object for another object tells POV-Ray the latter is entirely contained by the former. any object may be used to bound another.The Online POV-Ray Tutorial: Modifiers The Online POV-Ray Tutorial Modifiers The things in this file are used to modify the default behavior of certain objects. q Bounded By q q q q q q Clipped By Map Type No Shadow Once Open Sturm Bounded By The only effect of bounding is to speed the rendering of a scene.org/3285/language/modifiers. differences.html (1 of 6) [9/12/2001 3:22:26 PM] . Really_Complex_Chair is presumed to be defined somewhere above this in the scene file. or merges. Unions can also be bounded fairly efficently. however. Any object (except light sources) can be bounded. POV-Ray then skips the potentially lengthy ray intersection tests with the interior object. If the ray does not intersect the bounding object. Here's an example of the use of bounded_by. Boxes and spheres make wonderful bounding objects as they are highly optimized. then POV-Ray assumes that it does not intersect the interior object either. When rendering. If the ray does intersect the bounding object. POV-Ray first does any ray tests against the presumably simpler bounding object. Most finite objects can be automatically bounded with a reasonable amount of efficiency.thinkquest. POV-Ray then performs tests to see if the ray also intersects the interior object. intersections.

Here's an example of a cube with two clipping spheres. sometimes things will just get weird. and any object (except for light sources again) can be used to clip. Note that you can specify multiple objects to clip with in one clipped_by statement. 0>. 0. The result will be that the object is clipped first with first object. Only the portions of the cube that are on the inside of the sphere are retained.html (2 of 6) [9/12/2001 3:22:26 PM] .thinkquest. and the result of that is clipped with the third. . >4. then the result is clipped with the second. use clipped_by or CSG. sometimes parts that stick out will be trimmed away. http://library. The notions of "inside" and "outside" in the clipping object can be switched with the inverse keyword. you can do something like this .org/3285/language/modifiers. 8. here is a cube that is clipped with a sphere. For example.The Online POV-Ray Tutorial: Modifiers <-4. 3 } } bounded_by { clipped_by } } Clipped By The clipped_by statement allows you slice away parts of objects to reveal a hollow interior. If you have an object which you clipped. object { Some_Object_Or_Other clipped_by { sphere { <0. It is similar to intersection except it leaves holes where parts of the object were clipped away. etc. . 2. Doing so will have undefined results. Sometimes the object will render ok. and want to use the same object to bound that you used to clip. If you want to slice away part of an object. -4>. 4> } } } Objects should never extend outside their bounds. Any object (except light sources) can be clipped.

and the image is mapped around the y-axis in a clockwise sense. bump maps.5 } } clipped_by { bounded_by } } Map Type The map_type keyword is only applicable to image maps.org/3285/language/modifiers. The image shows a great deal of distortion around the poles of the mapping (the y-axis by default). 1. This is a planar mapping in which the image is projected along the z axis onto the x-y plane. the right edge of the image ends up in the +x direction. The parameter for map_type is an integer which tells what kind of mapping to use. 0. map_type 1 A sperical mapping.thinkquest. The default is "map_type 0". 0. It is used to modify how the image is projected onto the surface in the mapping.html (3 of 6) [9/12/2001 3:22:26 PM] . you can do something like this (presumably This_Is_An_Object is declared elsewhere) object { This_Is_An_Object bounded_by { cylinder { <0. The image is mapped around the y-axis like wrapping paper. The right edge of the image ends up in the +x direction and is mapped clockwise around the y-axis. and want to use that same second object to clip the first. map_type 2 A cylindrical mapping. <0. and material maps. Each pixel in the image is transformed into a three dimensional wedge shape which radiates from the origin. 0>. The image is rescaled to fit into the unit square in the x-y plane. The image is mapped Mercator-style around the origin. The image is still rescaled in the y-direction to be one unit tall and repeats infinitely up the y-axis. 0>. As with the spherical mapping. Each pixel in the image is transformed into a http://library.The Online POV-Ray Tutorial: Modifiers If you've bounded an object with a second object. Other mappings are as follows. The top and bottom edges of the image are compressed down to points on the y-axis. It also repeats infinitely in the x and y directions. map_type 0 The planar mapping as described above.

respectively. For example. 0>. 0. one that was created with the torus primitive and then left alone). 4 pigment { image_map { gif "earth. 1. Experiment with it.org/3285/language/modifiers. Each map type is projected onto its corresponding shape. The following images show map types 0. and 5. Note that for types 1.html (4 of 6) [9/12/2001 3:22:26 PM] . The image will fit around an untransformed torus (i.thinkquest. 2.The Online POV-Ray Tutorial: Modifiers pie-slice shape which radiates from the y-axis.e. This type of mapping is the most difficult to describe. map_type 5 A toroidal mapping.gif" map_type 1 } } } http://library. if you wanted to make a globe. Map types 3 and 4 are reserved for future use. 2. the pigment was rotated to give a better view of what exactly was going on. and 5. you might try something like this sphere { <0.

you wanted to create a single image stamped into a mirror you might try box { <-1. The no_shadow keyword takes no parameter. -1.org/3285/language/modifiers. Once The once keyword is only applicable to image maps. <2. or it's not (in which case the object will cast a shadow like normal). with bump maps. and material maps. primarily those which simulate objects which "produce" light. By default. Adding the "once" keyword to a mapping specification will remove all the duplications of the image except the one in the (0.The Online POV-Ray Tutorial: Modifiers No Shadow The no_shadow keyword is applicable to any object (not light sources or cameras). The following images show the effect of no_shadow. 0). 1> } finish { reflection 1 ambient 0 diffuse 0 } normal { bump_map { gif "stamp.thinkquest. This is primarily useful for special effects. everywhere else becomes flat. (1. If. everywhere else becomes transparent. When included in an object. that object will not cast a shadow on anything else. for example. 1) unit square. 2> pigment { color rgb <1. the second has a sphere with the no_shadow keyword. 1.gif" once http://library. -1>. with material maps. bump maps.html (5 of 6) [9/12/2001 3:22:26 PM] . The first image is normal. it's either there. The once keyword takes no parameter. Laser beams are a good example. the image which is mapped is repeated infinitely in the x and y directions (this varies with the map type). With image maps. 2. everywhere else becomes texture 0.

Otherwise they will have the circular ends in place (default).The Online POV-Ray Tutorial: Modifiers } } } Open THe open keyword controls the existence of endcaps on cylinders and cones. Sturm Sturm is only applicable to blobs and polynomial objects (including tori). translate. However. This keyword takes no parameter. or scale the object by a very small amount. then cones and cylinders will be rendered as hollow tubes. Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/language/modifiers. in certain cases they will render incorrectly.html (6 of 6) [9/12/2001 3:22:26 PM] . It is not legal anywhere else.thinkquest. These objects require extremely accurate calculations to render. If it is specified. the first without open and the second with. Normally they will look ok with POV-Ray's default root-solver. Another possible fix is to rotate. you can specify the keyword "sturm" inside the object's declaration to tell POV-Ray to use its more accurate (but slower) Sturmian Root Solver. In these cases. Here are two sample scenes.

Difference A difference is used to take an object and carve shapes out of it. The concept of the "inside" and "outside" of an object can be altered with the inverse keyword. Somewhat more specifically. The following topics are covered in this section.The Online POV-Ray Tutorial: CSG Reference The Online POV-Ray Tutorial CSG Reference CSG (Constructive Solid Geometry) is used to combine simple objects to form potentially very complex ones. http://library. There's no limit on the number of objects that can appear in a CSG object. any parts of the first object that are "inside" any of the other objects are trimmed away. Here's what it looks line when group the cylinder and the box together in a difference statement.org/3285/language/csg.thinkquest. Any object (just about) can appear in a CSG object. and all subsequent objects are used to carve away sections from the first object. but POV-Ray will complain a little if you don't have at least two objects in a CSG object. including other CSG objects. Specifying a difference is no different from specifying any other CSG object (see union) The first object specified is the object you're carving from. q Difference q q q q Intersection Inverse Merge Union This small collect of objects will do nicely in assisting if our exaplanation of the wonders of CSG. CSG allows you to merge objects into one and carve away parts of objects with other objects.html (1 of 6) [9/12/2001 3:22:40 PM] . Difference is the only CSG object in which the order of the objects is important.

intersection throws out regions that are outside of subsequent objects. or you could remove all the textures on the individual objects. difference. here's what results if we group our unsuspecting test objects together in an intersection.thinkquest. is probably the most powerful CSG directive for creating new and interesting objects. The result is a cylinder with sort of "squared off" ends. Instead of carving away points that are inside the objects (like difference). When you do a difference operation. Admittedly. This is to make it more obvious what the difference did. note that this is a different viewing angle from the initial sample scene. Intersection The intersection of two or more objects is composed of all the points that are inside all the objects. Also notice how the different parts of the now scarred cube are different colors. the surface is colored based on which object acutally "created" that surface. but intersection. and just put one inside the difference. But anyway. You can think of intersection as (sort of) the opposite of a difference. Anywhere that is green is on the boundary of the cylinder and anything that is red is on the boundary of the box. POV-Ray's concept of "inside" and "outside" can be changed by adding the keyword inverse to an object.The Online POV-Ray Tutorial: CSG Reference First off. See union for more detailed information on declaring CSG objects. If you wanted the entire surface to be all one color. So the hole through the center of the box is green because it was made with the green cylinder. You can see which object was defining each boundary by the color of the result. The order of the objects listed in the declaration is not important.org/3285/language/csg. http://library. This is because the box object was the first one listed in the difference (see the source).html (2 of 6) [9/12/2001 3:22:40 PM] . That volume corresponds to the space which is contained inside both of those objects. Note that the scene is a cube with some interesting sections taken out of it. you could either change each individual texture to the same. along with its close relative. this particular thing isn't too useful.

The reason they look the same is the second and third object in the second scene were inverted (don't just trust me. Remember how difference and intersection work. Inverse The inverse keyword can be added to any finite. One (the first) uses a difference. infinite. But by flipping the insides and outsides in the intersection. too. They render to the same image.thinkquest. so only regions outside the box and inside the cylinder remain. check out these two images. Difference carves away insides. It can also be used in clipping objects. see for yourself).html (3 of 6) [9/12/2001 3:22:40 PM] . the box is inverted. In this intersection. or CSG object. The only difference between between these two scenes is in the source. It basically reverses the regions that POV-Ray considers to be the inside and outside of the object. See the difference (no pun intended)? If you did. difference is implemented in POV-Ray as an intersection with the second through nth objects inverted. This only really matters in CSG differences and intersections. it.The Online POV-Ray Tutorial: CSG Reference See union for more detailed information on declaring CSG objects. while the other (the second) uses an intersection. http://library.org/3285/language/csg. and intersection carves away outsides. is effectively carving away outsides. In fact. Here's an image which should make inverse more understandable. then there's something wrong. For an example of the use of inverse.

except for their pigments. 0>. the outline of the cylinder is clearly visible inside the box. and sometimes it won't. One very important thing to keep in mind when creating merge objects is that coincident surfaces (surfaces which touch exactly at more than just a point or a line) will cause very strange errors in your object. It basically serves the same purpose. 6. and things will be generally very twisted. Using merge to join these objects will solve these problems. the objects are the same. Actually. however. In the second." merge { cylinder { http://library. In unions. Note how in the first image.The Online POV-Ray Tutorial: CSG Reference Merge Merge is very similar to union. 0 } texture { SomeTexture } } Note how the top of the cylinder and the bottom of the cone are the same. A finish was added to make the objects look like glass. <0. For example. as internal surfaces aren't visible anyway. merge { cylinder { <0.html (4 of 6) [9/12/2001 3:22:40 PM] .thinkquest. However. 0. and this can cause unwanted artifacts. 3 } cone { <0. 3. This doesn't matter in opaque objects. 0>. 0>. Here's our sample scene again. substantially modified. 0>. Note that this will not always render incorrectly. Sections of the object will be randomly invisible. the second shows them merged. differs from union in that any surfaces which are inside the object are removed. it joins a group of objects together into one for whatever purpose. continuous unit. 3. 3.org/3285/language/csg. internal surfaces of transparent objects will be visible. This is bad. The first image shows the objects unioned. Sometimes it'll come out ok. The combined objects are now acutally a single. this object is gone. Merge. C programmers will understand when we say that "the results will be undefined. doing the following is bad. <0. but hopefully still recognizable. it is very important in objects that have transparency. though.

thinkquest. Union Union is used to combine groups of objects together into one logical object. and so can only be used in unions. translations. or merge. For example. and won't impact the appearance of the object appreciably. <0. 0. 3 } cone { <0. so you don't have to deal with a bunch of little objects.The Online POV-Ray Tutorial: CSG Reference <0. There are restrictions on objects in the other types of CSG. Unions are wonderful for creating coherent objects. and scales. 0 } texture { SomeTexture } } Now the two objects overlap a bit. 0>. can be used in a union. 0>. infinite. though. See union for more detailed information on declaring CSG objects. http://library. if you want a difference. not the others. though. */ } Of course. you can transform them by transforming the union instead of having to transform all the individual objects. you can create an object with a great many components and group them all together into a union. 0>. After that. intersection. 3. You can use clipping to simulate these operations on flat objects. is that a texture for a specific object in a CSG will override any texture specified for the CSG object itself. This object can then be textured and transformed as a whole. Here is the sample scene with the objects joined together in a union. 2. though. 0>. <0. rotations. The basic form for a union (or any CSG) is as follows union { object { obj 1 } object { obj 2 } /* you can have as many objects as you wish */ object { obj n } /* here go any textures. One thing to remember when texturing CSG objects. This is just enough to fix the problem.org/3285/language/csg. Objects like triangles don't have insides.99. Any object used in an intersection. Any object. or CSG. merge. or difference must have a clearly defined inside. 6. 3. whether finite. you should change the "union" above to the appropriate identifier.html (5 of 6) [9/12/2001 3:22:40 PM] . You can also easily texture the objects as one.

org/3285/language/csg.html (6 of 6) [9/12/2001 3:22:40 PM] .The Online POV-Ray Tutorial: CSG Reference Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.thinkquest.

5.5>. -3 pigment { checker color White color Black } } plane { -z.org/3285/language/src/csg.5. <-1. <1. -1. -300> color rgb <1. -4> look_at <0. 0> } http://library. 0. 1.org/3285/language/src/csg. 1. -1. 1> } camera { location <-2.5.pov #include "colors.5.pov [9/12/2001 3:23:11 PM] . -1.thinkquest.http://library.inc" box { <-1. 1.thinkquest. -1>. -3 pigment { checker color White color Black } } light_source { <-400. 200. 3. 1> pigment { color Red } } cylinder { <1.5>.5 pigment { color Green } } plane { y. 1. 0.

5.org/3285/language/src/csg1. -3 pigment { checker color White color Black } } plane { -z.thinkquest. -1>. 3. <-1. 0. 1> pigment { color Red } } cylinder { <1.org/3285/language/src/csg1. 1.5.pov [9/12/2001 3:23:13 PM] . -1.5 pigment { color Green } } } plane { y. <1.5. -4> look_at <0. 1. -1. 200.5. -3 pigment { checker color White color Black } } light_source { <-400. 1.http://library. 1> } camera { location <2. -300> color rgb <1.inc" difference { box { <-1. 0> } http://library.pov #include "colors.5>. 1. 0.5>.thinkquest. -1.

1> } camera { location <-2. -1. -3 pigment { checker color White color Black } } plane { -z.http://library. 0. 200.org/3285/language/src/csg2.5>.thinkquest.5. 0.thinkquest. <1.pov [9/12/2001 3:23:19 PM] .5. -1>. 1.inc" intersection { box { <-1. <-1.5. -300> color rgb <1. 1> pigment { color Red } } cylinder { <1. 1. -4> look_at <0.5>.pov #include "colors. -1. -3 pigment { checker color White color Black } } light_source { <-400.5. 1. 0> } http://library. 1. -1.org/3285/language/src/csg2. 3.5 pigment { color Green } } } plane { y.

5.5>.thinkquest.org/3285/language/src/csg3. -3 pigment { checker color White color Black } } plane { -z.5 inverse pigment { color Green } } } plane { y. 3.thinkquest.org/3285/language/src/csg3. <-1. 1. -1. 1. <1. -1.http://library.5>. 1. -4> look_at <0. 0.pov [9/12/2001 3:23:22 PM] . 1> pigment { color Red } } cylinder { <1. 0> } http://library.5. -3 pigment { checker color White color Black } } light_source { <-400.pov #include "colors.5.inc" intersection { box { <-1. 200. 0.5. 1. -1>. -1. -300> color rgb <1. 1> } camera { location <2.

-1. 1. 3.thinkquest. <1.org/3285/language/src/csg4.5>.5>.5. -3 pigment { checker color White color Black } } light_source { <-400. -1>.http://library. 1.inc" intersection { box { <-1. 0> } http://library. <-1. 1> } camera { location <-2. -1.5.5. 0. 0. -1. -4> look_at <0. -3 pigment { checker color White color Black } } plane { -z. 1> inverse pigment { color Red } } cylinder { <1. 1. 1.5.org/3285/language/src/csg4. 200.pov #include "colors.pov [9/12/2001 3:23:24 PM] . -300> color rgb <1.5 pigment { color Green } } } plane { y.thinkquest.

0.thinkquest.5. 0> } http://library. 1.inc" union { box { <-1. 1. -1. <-1.5 } } plane { y.org/3285/language/src/csg5. 1.pov [9/12/2001 3:23:26 PM] . 0. 1> } camera { location <-2. 1> } cylinder { <1.pov #include "colors.thinkquest.5. 1.http://library.5 } pigment { color rgbf <1. 0. 0. 0. -1. <1. 200. -1>.5>. -300> color rgb <1.8.8> } finish { refraction 1 ior 1. -1.5.8. -3 pigment { checker color White color Black scale 3 } } plane { -z. -4> look_at <0.5.org/3285/language/src/csg5.0. 3.5>. -3 pigment { checker color White color Black scale 3} } light_source { <-400.

1> } cylinder { <1. 0. <-1.5>.5 } } plane { y. 0. -3 pigment { checker color White color Black scale 3} } light_source { <-400.org/3285/language/src/csg6. -300> color rgb <1. -1. 0. -1.http://library. 1. 200. -3 pigment { checker color White color Black scale 3 } } plane { -z. 0.pov [9/12/2001 3:23:27 PM] .5>.inc" merge { box { <-1.5. 1. 1.thinkquest.pov #include "colors. <1. -4> look_at <0. -1>.8.thinkquest.8> } finish { refraction 1 ior 1.8. 1.5.5 } pigment { color rgbf <1.5.5. -1. 0. 3.org/3285/language/src/csg6. 1> } camera { location <-2. 0> } http://library.0.

and v_steps) may appear in any order. <c14>. If you like pain you can create them yourself. four of which specify the corners and are necessarily on the surface. <c7>. <c15>.The Online POV-Ray Tutorial: Finite Objects The Online POV-Ray Tutorial Finite Object Reference The following topics are covered in this section q Bicubic Patch q q q q q q q q q q Blob Box Cone Cylinder Height Field Object Smooth Triangle Sphere Torus Triangle Bicubic Patch This primitive creates Bezier style bicubic patch (sorry about the flurry of large words). <c2>. <c5>. Here's the syntax for a bicubic patch: bicubic_patch { type type flatness flatness u_steps u_steps v_steps v_steps <c1>. <c8>. <c9>. <c12>. } <c4>. They're more the kind of thing that would be generated by a modeller of some sort. though.html (1 of 13) [9/12/2001 3:24:08 PM] .thinkquest. u_steps. <c16> The four parameters (type. but are rather used to stretch it into the proper shape. A bicubic patch is a smooth surface defined by sixteen points.org/3285/language/fobject. but must appear http://library. <c6>. <c11>. <c3>. flatness. <c10>. and twelve others which are probably not on the surface. <c13>. POV-Ray renders bicubic patches as meshes of triangles. Bicubic patches are really meant to be created by people.

flatness is a float which should be between 0 and 1 inclusive. Van Dam Addison-Wesley 1983 ISBN 0-201-14468-9 It covers a great deal of material with a good amount of depth. despite the "fundamentals" in the title. the slower the patch will render. Note that when dealing with bicubic patches this book assumes a familiarity with matrices. POV-Ray will always divide the patch into the maximum number of subpatches. The u_steps and v_steps keywords specify the maximum number of subpatches to divide the patch into. how to create them. here's an example of a bicubic patch. If this value is 0. u_steps and v_steps are floats and shouldn't have any fractional part. If you want to learn more about bicubic patches (how they are generated. D. This will cause the object to render much faster. Foley and A. how they work. If type is 0 then POV-Ray just stores the control points in memory. The lower this value is. they don't have a clearly defined inside.html (2 of 13) [9/12/2001 3:24:08 PM] . They also suggest 5 as a maximum value for either parameter. the more subdivisions POV-Ray will make (up to the u_steps or v_steps).org/3285/language/fobject. The maximum number of subpatches can be calculated with the expression max = 2 ^ u_steps * 2 ^ v_steps As a result. type specfies how POV-Ray should store the patch in memory. If type is 1. then POV-Ray will preprocess the patch and store the resulting object(s) in memory. and all the mathematics behind them) a book that we recommend is Fundamentals of Interactive Computer Graphics J.thinkquest. it's a bad idea to make u_steps or v_steps very large.The Online POV-Ray Tutorial: Finite Objects before the control points are specified. but at the expense of memory. Although it's not particularly useful. As bicubic patches are made of triangles. http://library. Note that the lower this value is. The POV-Ray authors recommend that "u_steps 3" and "v_steps 3" will cause most patches to render well. The flatness keyword is used to determine if a subpatch needs to be divided into smaller ones. This is quite memory efficient. and so can't be used in CSG (except for union) or inside a clipped_by statement. but also very slow.

Their syntax is as follows: blob { threshold threshold component strength1. 0. the greater the effect this particular component will have. 0> 1. The radius of each component describes its field of effect. z> of the center point of that component. 0.5. component strength3.5. 0> color Red } http://library. <0. This can be positive or negative. 0> 1. a negative strength will repel the surface away from this component. 0.The Online POV-Ray Tutorial: Finite Objects Blob Blobs are quite peculiar. component strength2. The basically consist of a bunch of spheres which attract or repel each other to form a surface. As described above. the surface is drawn. blob { threshold component component component pigment { } 0.html (3 of 13) [9/12/2001 3:24:08 PM] . 0. component strength4.5. A positive strength will cause the surface to stretch towards this component.5. The blob equations are set up so that the field strength of each component is equal to strength at the center of the component and falls off to zero at a distance of radius from the center of that component.5. They aren't really meant to be precise objects. Each <center> vector gives the <x.5. The larger the value.25 1. <center4> components as you have memory and time */ Blobs basically work by creating fields around each of the components by adding the strength values from each components according to a specified function. <0. <center2> radius3. but rather objects that give a sort of "organic" feel to a scene. The strength of each component tells how strong the field around this component is.thinkquest. /* you can have as many } radius1. here are a few examples.5. 0. It is a float which should be greater than zero. <center3> radius4. 0. threshold tells where in space to draw the surface.5. <center1> radius2. As blobs are difficult to visualize.org/3285/language/fobject. Wherever this value is equal to the threshold. <-0. y.

The Online POV-Ray Tutorial: Finite Objects blob { threshold component component component pigment { } 0.5. 0.5. 0> 1. <-0.5.org/3285/language/fobject. 0. Note that components in different blob objects will not affect each other.5. but I have never had problems with this. 0> color Red } Blobs can be used in CSG.5.5. 0. <0. This will cause POV-Ray to use a more accurate (but slower) root solver. The POV-Ray documentation states that all the elements of <corner-1> should be less than the corresponding elements of <corner-2>.5. <corner-2> } where <corner-1> and <corner-2> are vectors specifying the <x. the keyword sturm may be added into the declaration. Here's an example of a http://library. z> of opposite corners of the box.5. 0> -1. Conversely. 0.25 1. Box The box primitive creates a rectangular prism (fancy term for a box) with faces parallel to the coordinate planes. y.html (4 of 13) [9/12/2001 3:24:08 PM] .thinkquest. Its syntax is a follows: box { <corner-1>. 0. <0. the outside is anywhere that field strength is less than the threshold. If a blob renders improperly. the inside of a blob is anywhere the field strength is greater than the threshold. 0.

-1. Its syntax: cone { <center-1>.The Online POV-Ray Tutorial: Finite Objects box: box { <-1. 0 pigment { color Blue } } http://library. Both radius-1 and radius-2 can be positive. It is similar to the cylinder.html (5 of 13) [9/12/2001 3:24:08 PM] . the object looks like a cone with the tip cut off. but two radii are specified instead of just one. 0>. radius-1 and radius-2 specify the radius of the cone at <center-1> and <center-1> respectively.org/3285/language/fobject. An example cone: cone { <0. the object looks like two cones with their tips touching. If both radii are the same sign. Boxes are highly optimized objects and thus make wonderful bounding volumes. though). Here are some sample boxes. radius-1.thinkquest. 3. 3. radius-2 [open] } <center-1> and <center-1> are <x. 1. -1>. z> vectors for the centers of the two ends of the cone. Cone The cone primitive creates a creates a cone with the given characteristics. 1> pigment { color Green } } This creates a green cube two units on a side centered at the origin. If the radii are opposite signs. 0. 0>. <1. If one radius is zero. the objects looks like a standard cone shape. negative. y. both of which just happen to be cubes (not all boxes have to be cubes. <0. or zero. <center-2>.

The syntax of the primitive is the following: cylinder { <center-1>. Cylinder The cylinder primitive creates a circular cylinder with the given characteristics. 1.The Online POV-Ray Tutorial: Finite Objects This will create a cone that is three units tall and six units in diameter at the base. http://library. The following example scene contains three cylinders.html (6 of 13) [9/12/2001 3:24:08 PM] . z> of the centers of the ends of the cylinder. 0. 0. radius specifies the radius of the cylinder. An example cylinder declaration: cylinder { <0.thinkquest. The following scene contains some other examples of cones. Note that the sides of the cylinder will always be perpendicular to the ends. 0>. The keyword open may be included in the object definition to make POV-Ray render the cone without endcaps. y. radius [open] } <center-1> and <center-2> are vectors specifying the <x. <center-2>. <0. 0>.org/3285/language/fobject.5 pigment { color Yellow } } This will create a circular cylinder that has the same height as diameter.

html (7 of 13) [9/12/2001 3:24:08 PM] . http://library. 0. <normal>. what's the point?). The syntax for a disc: disc { <center>. hole radius should be smaller than radius (otherwise. Optionally. Here's an example use of a disc: disc { <0. 0. 1 pigment { color Green } } This will create a sort of monochromatic version of Saturn. radius is a float which gives the radius of the disc. z> vector specifying the center of the disc. 0>. <0. 1. 0>. If present. 2.org/3285/language/fobject.The Online POV-Ray Tutorial: Finite Objects Including the keyword open will cause POV-Ray to render the cylinder without endcaps (as a tube).5 pigment { color Green } } sphere { <0. <normal> is a vector perpendicular to the plane of the disc. radius [. 1.thinkquest. Here's how that would look. the float hole radius may be specified which will create a circular hole of that radius in the center of the disc. hole radius] } <center> is an <x. y. Disc The disc primitive creates an infinitely thin circular disc with an optional hole in the center. -1>.

0> and the upper-right ends up at <1. The general form for specifying a height field is height_field { type "filename" [smooth] [water_level height] /* transformations */ } type specifies the type of the file being read.org/3285/language/fobject. 1>. pot. Consequently. 1. the PC program Fractint can produce pot files. 0. this does not produce taller height fields. but rather ones with better resolution. The lower-left corner of the image ends up at <0. The image is always rescaled to fit into that unit box. Thus with gifs. Pot files work the same. With tgas a sixteen bit number (so you get http://library. you can get 256 distinct height levels in the height field. As with resolution. According to the POV-Ray authors. 0.thinkquest. and is one of gif. they can't be used in CSG (except in union) or inside a clipped_by. The color with palette entry 0 gets the lowest height in the height field. 0> an <1. while the color with palette entry 255 gets the hightest height in the field.html (8 of 13) [9/12/2001 3:24:08 PM] . larger images do not produce larger height fields. the height of a given pixel is based on its palette index. The image is mapped onto the x-z plane with the value of the pixel determining the y value of the field. The second is the rendered height field.000 (or so) colors. Thus. but rather ones with better vertical resolution. This is then followed by the name of the source image (in quotes). Height mapping is done slightly differently with tga files. 0. you'll get a height field which fits into the unit box with vertices at <0. Height Field Height fields are an easy way to create mountains in your scenes. The lowest possible value of the height field ends up at y=0. Here's an example of a height field.The Online POV-Ray Tutorial: Finite Objects Note that discs are two dimensional objects and so have no inside or outside. white=255). except they support upto 32. With just these declarations. The first image is the source for the height field (black=0. They basically work by reading an image file and then turning that image into a mesh of triangles. The height of each point in the mesh is determined by the value of the corresponding pixel in the image. while the highest gets y=1. or tga. 1>. For gifs.

Object The object primitive is not typically used to create single objects. This keyword is used to cut off the bottom part of a height field. unless you want to get a super-close-up view. While this may be exactly the effect you're looking for with mountains. Normally. Generating these kinds of height fields is pretty much beyond the scope of most paint programs. The water_level keyword takes a float parameter between 0. It is primarily used only to create objects that have been declared with a declare directive.536 distinct height levels anyway. Fractal mountains tend to look fine with 256 divisions. You can include the optional keyword "smooth" in the height field. For example. 1. sometimes it is undesirable.0 and 1. rolling surface. Another keyword that you can include is "water_level". making for a speedier render. This is useful for mountains which you plan to partially submerge in water.536 height levels) is stored for each pixel using that pixel's red and green bytes.732 pigment { color Red } } Is the same as http://library.0 which specifies where to slice. the least significant in the green.5" added in.5 would cut off the bottom half of the field. In fact. an object primitive is implied around any primitive that creates an object. however.org/3285/language/fobject. is the same height field as above with "water_level 0. 1. so you should never need a value greater than 1.0 to the heighest. POV-Ray generates height fields out of normal. flat triangles. This gives the height field a rough.0 corresponds to the lowest level in the field.html (9 of 13) [9/12/2001 3:24:08 PM] .thinkquest. for example. sphere { <1. 0. This slicing is applied before any transformations are applied.The Online POV-Ray Tutorial: Finite Objects 65. but it's pretty rare that you'll actually need 65. 0. 1>. POV-Ray will automatically calculate surface normals to make the height field into a smooth. smooth height fields require much more memory to deal with than do normal height fields. jagged look. The most significant byte is stored in the red. This will cause POV-Ray to use smooth triangles instead of flat ones for mesh. Parts of the height field which are below the "water_level" will not be turned into triangles. 1. Here.

They're more the type of thing a modeller would produce to approximate a smooth surface. This can be used to great effect when approximating smooth surfaces. Any type of object. Smooth triangles aren't really designed to be used extensively by people. 0>. To create http://library. they just alter the way POV-Ray shades it. or CSG. <normal-3> } The three vertices specify the corners of the triangle.thinkquest. 5.732 pigment { color Red } } } The object primitive is more commonly used in this sort of fashion #declare BlueSphere = sphere { <0.html (10 of 13) [9/12/2001 3:24:08 PM] . <normal-2> <vertex-3>. The corresponding normal vector is then used in shading the surface. Smooth Triangle Smooth triangles are triangular patches with normal vectors specified for each of the vertices. 1.org/3285/language/fobject. whether finite. Here's the syntax anyway: smooth_triangle { <vertex-1>. 1. These vectors are used to bend the triangle into a curved shape. 1 pigment { color Blue } } object { BlueSphere } object { BlueSphere scale 2 translate <0. this is a very simple example. Note that the normal vectors don't acutally cause the triangle to be deformed. <normal-1> <vertex-2>. infinite. 0. can appear in an object statement. as it would require a much larger number of flat triangles to acheive the same results. 1>. 5> } Of course.The Online POV-Ray Tutorial: Finite Objects object { sphere { <1.

thinkquest. spheres are highly optimized objects in POV-Ray. Anyway. y. here are some sample spheres. For example. Also. Torus The torus primitive will create a torus (doughnut shape) at the origin. 5 pigment { color Blue } } will create a blue sphere of radius 5 that is centered at <10. but you can use nonuniform scaling to create ellipsoidal objects. 10. this primitive is basically an easier way of creating this cool and useful shape. 10>. sphere { <10. A torus is a quartic shape. The syntax is the following: sphere { <center>.html (11 of 13) [9/12/2001 3:24:08 PM] . The torus syntax is as follows: torus { http://library. 10>. radius } where <center> is a vector specifying <x. and thus make spectacular bounding volumes. They therefore cannot be used in CSG (other than in union) or inside a clipped_by statement. 10. This primitive can only create spheres.org/3285/language/fobject. Smooth triangles are perfectly two-dimensional so they have no inside or outside.The Online POV-Ray Tutorial: Finite Objects a smooth smooth_triangle mesh. Sphere The sphere primitive creates a sphere of a given radius and center. z> of the center of the sphere and radius is a float specifying the sphere's radius. the normals for shared vertices in any triangles should be the same.

Triangles are moderately useful to human beings. <corner-3> } where each <corner> is an <x. If you're interested. the object is known as an icosahedron.The Online POV-Ray Tutorial: Finite Objects major radius. http://library. y.thinkquest.html (12 of 13) [9/12/2001 3:24:09 PM] . you'll need to rotate it.org/3285/language/fobject. thus POV-Ray can optimize its rendering. As with the other two dimensional objects. The advantage to using this form over the quartic definition is that this form is known by POV-Ray to be finite. <corner-2>. and nor can they be used inside a clipped_by. z> vector specifying the locations of the three corners. triangles have no inside or outside and so can't be used in CSG. with the exception of union. The object in the following scene is composed entirely of triangles. Triangle Triangles are the familiar three cornered polygons we all learned about in school. Here's the syntax for the triangle: triangle { <corner-1>. only they don't have normal information for the vertices. minor radius } The major radius and minor radius are defined as shown below This primitive always creates a torus with a major axis in the x-z plane. but they're much more useful to modelling programs. If you want one with a different orientation. They are similar to smooth triangles.

org/3285/language/fobject.thinkquest.html (13 of 13) [9/12/2001 3:24:09 PM] .The Online POV-Ray Tutorial: Finite Objects Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.

6. <1.thinkquest. 1>. <2. 3>. 6. <3.4> } light_source { <-1. <1. 5. 0. -3> look_at <1.5. <0. 1>. <0.4. 1. 0>.5> } http://library.http://library. 0. <2. 3>. 3. 0. 0. 0. <0. 1> } camera { location <2. 2>. -6.pov bicubic_patch type 1 u_steps 3 v_steps 3 <0. 0. 1>. <3. 1. 2>. 3>. 0. -6.pov [9/12/2001 3:24:10 PM] . } { <1.5. 0. 0. 2>. <1. 0>. 3> pigment { color rgb <1. 0.org/3285/language/src/fobj3. 0>. 1. 0. 0. <2. <2.thinkquest. 0. 0. 0>. 2>. <3.org/3285/language/src/fobj3. <3. 1>. 0.5> color rgb <1.

5.org/3285/language/src/fobj8. -1. 0. 0> } http://library.org/3285/language/src/fobj8. 1.thinkquest. 1> } camera { location <0. <-1. <1.http://library.thinkquest. -1>.264*x translate <2. 1. 1> pigment { color rgb <1. 0> } } box { <-1. 1. 0> } rotate 45*y rotate -35.pov box { <-3. 1.pov [9/12/2001 3:24:12 PM] . 1> pigment { color rgb <0. -1>. 0> } light_source { <10. 1. -80> color rgb <1. -1. 50. -6> look_at <0. 0. 1.

7. 0.25. 0.pov [9/12/2001 3:24:13 PM] .org/3285/language/src/fobj4.5. 0. 1> } camera { location <0. 1. 0. 1.5 pigment { color rgb <0. <-1. 0> } } cone { <-1.http://library. 0.pov cone { <0.7.125 pigment { color rgb <0. 10.5.25. <1.5> look_at <0. 0>. 0. 0> } } cone { <1. 0>. 0>. 0.7. 0. 0. 0. 0. 0> } http://library. -50> color rgb <1.thinkquest.thinkquest. 0 pigment { color rgb <0.org/3285/language/src/fobj4. <0. 0>. 0.7. 0.5.7> } } light_source { <20. -2. 0.5. 0>. 0>. 0. 1.

pov [9/12/2001 3:24:14 PM] . <0. 0.thinkquest. 0> } } cylinder { <0. -1>. 50. <0. -3> look_at <0. 0>. 0.pov cylinder { <-1. 0. 0> } } cylinder { <0. 0>.thinkquest. 1> } camera { location <0.5. <1. 0.25. 0>.org/3285/language/src/fobj5. 0. 0>.125 pigment { color rgb <0.org/3285/language/src/fobj5. 1> } } light_source { <50. -1.125 pigment { color rgb <1. 1>. 0> } http://library.125 pigment { color rgb <0.http://library. 0. 0. 0. 0. 1. -50> color rgb <1. 1. 0. 1. 0.

0. 0>.thinkquest. 0. 1. -50> color rgb <1. 0> } } sphere { <0.5 pigment { color rgb <0. 1. 2. 1. -1>.pov disc { <0. 0> } http://library. 10. 1> } camera { location <0. 0>. -4> look_at <0.http://library. 1 pigment { color rgb <0.org/3285/language/src/fobj6. 1. <0.pov [9/12/2001 3:24:15 PM] . 0.org/3285/language/src/fobj6. 1. 0.thinkquest. 0> } } light_source { <20.

0. 2 pigment { checker color rgb <0.org/3285/language/src/fobj1. 1. 1.4> scale 1/4 } } light_source { <-1. 0. 0.75.5. 0> } http://library.1> color rgb <0.thinkquest.http://library.5.4. 2. -1> look_at <0. 1> } camera { location <-1.thinkquest. 0>. 1. 1. -0. 0> color rgb <1.gif" pigment { color rgb <1. y.5. -0.1. 0. -0.pov [9/12/2001 3:24:16 PM] .5> } disc { <0. 1> } translate <-0.org/3285/language/src/fobj1.pov height_field { gif "fract001.

0.5. 2. 0.75.1> color rgb <0.thinkquest.4> scale 1/4 } } light_source { <-1. 1. 1> } camera { location <-1.5> } disc { <0.thinkquest. 0. y.gif" water_level 0. -1> look_at <0.1. 2 pigment { checker color rgb <0. 0.5 pigment { color rgb <1. -0.org/3285/language/src/fobj2. 0> color rgb <1.5. -0.5. 1. 1.pov [9/12/2001 3:24:17 PM] .4. 0> } http://library. 1.pov height_field { gif "fract001.org/3285/language/src/fobj2.http://library. -0. 0>. 1> } translate <-0.

0. 0.http://library. 0>.25 pigment { color rgb <0. 0> } http://library. 0>. 0. 1. 0. -3> look_at <0. 0.5.org/3285/language/src/fobj7.2.pov sphere { <0. -1>. 1.thinkquest. 0> } } sphere { <1. -. 1> } camera { location <0. 1 pigment { color rgb <1. 50.2> } } sphere { <0. 0. -50> color rgb <1. 1.3 pigment { color rgb <1.thinkquest. 0.org/3285/language/src/fobj7. 0> } } light_source { <50.5. 1.pov [9/12/2001 3:24:19 PM] .6.

<0.5000> } triangle { <0.7006. <0. -0. <0.5000>. 0.0000.0000>.0000.5000> } triangle { <-0.8660. 0. 0. 0.8660.0000. -0.8236.8660.8660. 0. -0.thinkquest. <0.5000>. 0.7006.0000.5000> } triangle { <0.2676.0000. 0.8660. 0.0000.5000> } triangle { <0.2676. -0.5090.2676.8236.0000>.5090. 1> } camera { location <0.5000> } triangle { <0.0000.2676.2676.8236.7006.5000> } triangle { <-0.8236. -0. 0.2676. 1.7006.7006.5090.5000>. 0.0000>. 0. -0.5090. -0. 0.5090.8236.5000> } triangle { <0.5000>.5000>.thinkquest. -0.8236. 0. <-0.0000. <-0.5000>.5090. <-0.5090. 0. <-0.5000> } triangle { <0.0000.8236.5000>. 0> } } light_source { <50. -0. 0> } http://library.75.0000. 0.7006. -0.7006.5000> } triangle { <-0. -0. 0.2676. -0. 0. 0. -0. 0. <0. -0. <-0.0000.5000>.5000>. <-0.0000. 0.2676. 0. -0.2676.5000> } triangle { <0. <-0. -0. 0.0000.5000>. -1.2676.5090. <0. <-0. 1.5000> } triangle { <0.8236.5090. 0.0000>.7006.8660. -0. -0. -0.8236.5090.5000>.5000> } triangle { <-0.5000> } triangle { <0. 0. <-0.7006.5000>.0000. <-0. 0. -0. -0. <0. <-0.8236.8236.7006.2676. <-0.5000>.2676. 0. <0. 0.pov [9/12/2001 3:24:22 PM] .8660.5000>. 0.0000>.0000. 0. <-0.5000>.0000>.8236.5000>.8236. 0.http://library.8236.5090.org/3285/language/src/fobj9. <0. 0. 1. -0.pov union { triangle { <0.5000>.0000. <0. 0. 0. -0.0000.5000>. 0.7006.5090.5000> } triangle { <0. -0. -0.8660.7006.5090.7006.5090. 0. 0.0000. -50> color rgb <1.0000.5000> } pigment { color rgb <0. <0. 0. -0.org/3285/language/src/fobj9. <0. 0. 0.5000>.0000. 0. 0. <-0. 0.5000>. <0.0000.2676. -0. -0.0000>.5000>. 0. <0. 0. 0.8236.5000>. -0.0000>.5000>.0000.5000>. -2. <-0.0000>.0000. 1. <-0.5000>. 1.5000>. <-0. -0. -1. -0. 0.8660. 0.2676. <-0. 0. 0. 0.5000>. 0.2676.2676.7006. 50. 0. 0.7006.75. -0.5> look_at <0.5000> } triangle { <0.8236.0000.5000> } triangle { <-0. -0. -0.0000. -0.0000. 0. -0. <0.5000>. 0.5090. -0. -1.5090. <0.8236. <-0.0000. 0.2676. 0.5000> } triangle { <0. -0.2676. -0.7006.8236.0000.0000.5090. <0.0000.5000> } triangle { <0.7006. <0.5000>.7006. 0. 0. -1.8236.5090. 0.0000>. 1.5090. 0. 0.5000> } triangle { <0. 0.8236.7006. <-0. -0.7006.2676. -1. 0. -0.5000>.5090. <0. -0. -0. <0.8660. 0. 0. 0.2676. -0. -0. 1.

This document contains information on the syntax.html (1 of 2) [9/12/2001 3:24:29 PM] . etc. Camera POV-Ray camera modifiers. difference.thinkquest. Infinite Objects Infinite POV-Ray primitives (those including a component which may potentially extend to infinity) CSG (Constructive Solid Geometry) CSG object manipulations (union. transformations and other miscellaneous features. Top of Document Beginning of the Tutorial http://library.org/3285/language/index. Normal POV-Ray directives that can quickly simulate common 3D attributes such as bumps. Texture Special surface color/patterns modifiers. Pigment Object surface color/pattern modifiers. Select a topic from below: General POV-Ray Language and Scene Wide Modifiers POV-Ray directives. Lights POV-Ray light source types and attributes. Finish POV-Ray directives that modify the way light interacts with object surfaces. Finite Objects Finite POV-Ray primitives (those containing well-defined bounds). merge.The Online POV-Ray Tutorial: POV-Ray Language Reference The Online POV-Ray Tutorial POV-Ray Language Reference Welcome to the POV-Ray Language Reference.) Object Modifiers Directives used to modify the default behaviour of certain objects. usage and purpose of every POV-Ray keyword and feature.

The Online POV-Ray Tutorial: POV-Ray Language Reference The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.html (2 of 2) [9/12/2001 3:24:29 PM] .org/3285/language/index.thinkquest.

org/3285/language/iobject. 3. 0. 0. 3. . 0. the keyword sturm may be added to the definition to tell POV to use its more accurate (but unfortunately slower) Sturmian root solver. 0.html (1 of 5) [9/12/2001 3:24:34 PM] . a2. If you have a cubic that dessn't seem to be rendering correctly. 0. For a better definition of polynomials see poly or just about any algebra text.thinkquest. 0> } Cubics are useful shapes as they can be used to smoothly join two curves together. in first term 2 + 2 > 3 cubic cubic (but rather pointless) Note also that the exponents in each terms are non-negative integers. 0. 0.z + 3 x^2 y + 3 x y^2 + y^3 . 0.x y^2 . . Also. a1.y z^3 cubic cubic not cubic.The Online POV-Ray Tutorial: Infinite Objects The Online POV-Ray Tutorial Infinite Object Reference The following topic are covered in this section q Cubic q q q q Plane Poly Quadric Quartic Cubic A cubic is a third order poly. 0. 1. a19> } a0 through a19 are all floats. 0. 0. . sometimes the problem can be fixed http://library. The following are examples of equations (some cubic. Calculations for cubics (as well as any type of poly) must be very accurate or the surface will appear strangely deformed. 0. some not). The syntax for a cubic is as follows: cubic { <a0. See the section on tips and tricks for more information on this technique. They are the coefficients for the general cubic equation in three variables: a0 x^3 a6 x y a12 y^2 a18 z + + + + a1 x^2 y a7 x z^2 a13 y z^2 a19 = 0 + + + a2 x^2 z a8 x z a14 y z + + + a3 x^2 a9 x a15 y + + + a4 x y^2 a10 y^3 a16 z^3 + + + a5 x y z a11 y^2 z a17 z^2 + + + The second equation above would be defined by cubic { <1. x x^3 x^2 y z 3 y^3 + 3 y^2 .6 x^2 . 0. 0. 0. This means that the sum of the exponents of the variables in each term is less than or equal to three.

so they will not be optimized with automatic bounds. and fourth order polynomials (quadric.thinkquest. z> vector that describes the plane by giving a normal to its surface. Plane The plane primitive creates an infinite. It may be positive. or translating the object by some small amount. and can be used to position the plane anywhere in space. the plane goes through the origin. The syntax of plane is as follows: plane { <normal>. Cubics (like all polys) can be used in CSG as they have a defined inside and outside. scaling.html (2 of 5) [9/12/2001 3:24:34 PM] . There is no http://library. This is changed with the offset value. Note that cubics are considered infinite objects by POV. 3 } This plane is parallel to the x-z coordinate plane. The inside is defined to be all points where the equation is less than zero. The primitive can also be represented by plane { <a. d } which would represent the equation a x + b y + c z = d This is important because it defines the "inside" and "outside" of a plane for use in CSG. and quartic respectively). third. By default. Points where the equation equals zero are on the surface. 1. The outside is all points where the equation is greater than zero. Poly The poly primitive can be used to define up to seventh order polynomials in three variables. y. c>. cubic. 1>.The Online POV-Ray Tutorial: Infinite Objects by rotating.org/3285/language/iobject. offset } <normal> is an <x. Note that there are already primitives to define second. Planes are acutally a very simple (first order) poly. negative. By this definition. It extents infinitely in both the x and z directions. b. flat plane of any orientation and any location. or zero. 0 } This plane is diagonal and goes through the origin. plane { <1. Here are some examples of planes: plane { y. the normal vector always points to the "outside" of the plane. It is a float that translates the plane along its normal vector.

html (3 of 5) [9/12/2001 3:24:34 PM] . . The POV-Ray authors also recommend The CRC Handbook of Mathematical Curves and Surfaces David von Seggern CRC Press 1990 as a good resource for finding cool surface equations. they can be found in shapesq. Another concern with high order polys is the extreme accuracy required to render them accurately. This is not well covered in the POV-Ray documentation.org/3285/language/iobject. The number of coefficients in the equation m is defined by the equation m = (order + 1) * (order + 2) * (order + 3) / 6 Note that n = m . . a1. The cumbersomeness (cumbersomity?) of high order polys is the main limitation on their usefulness.thinkquest. This is definitely not something that one would want to type by hand. order should be an integer between 2 and 7 inclusive.x -> 0 for z : order . the general syntax for poly is like this: poly { order. POV comes with a number of predefined poly shapes. <a0.y -> 0 print "x^". x. The following pseudocode segment will print out the terms in order: for x : order -> 0 for y : order . If you have a poly that seems to rendering incorrectly.The Online POV-Ray Tutorial: Infinite Objects difference between defining one of these with the poly primitive or with its specialized primitive. " z^". you can include the keyword sturm in the object definition. The other concern when defining polys is the order of the coefficients. the generic fifth order equation (all 56 terms) is a0 a6 a12 a17 a23 a28 a34 a40 a46 a53 x^5 + a1 x^4 y + a2 x^4 z + a3 x^4 + a4 x^3 y^2 + a5 x^3 y z + x^3 y + a7 x^3 z^2 + a8 x^3 z + a9 x^3 + a10 x^2 y^3 + a11 x^2 y^2 z + x^2 y^2 + a13 x^2 y z^2 + a14 x^2 y z + a15 x^2 y + a16 x^2 z^3 + x^2 z^2 + a18 x^2 z + a19 x^2 + a20 x y^4 + a21 x y^3 z + a22 x y^3 + x y^2 z^2 + a24 x y^2 z + a25 x y^2 + a26 x y z^3 + a27 x y z^2 + x y z + a29 x y + a30 x z^4 + a31 x z^3 + a32 x z^2 + a33 x z + x + a35 y^5 + a36 y^4 z + a37 y^4 + a38 y^3 z^2 + a39 y^3 z + y^3 + a41 y^2 z^3 + a42 y^2 z^2 + a43 y^2 z + a44 y^2 + a45 y z^4 + y z^3 + a47 y z^2 + a48 y z + a49 y + a50 z^5 + a51 z^4 + a52 z^3 + z^2 + a54 z + a55 = 0 Ugh. z As an example of this. The inside of the poly is defined to be all points with values http://library. a polynomial is an expression that consists of But anyway. All polys can be used in CSG and clipped_by constructs. a0 through an are the coefficients for the generic polynomial equation of order order. but after some experimentation the pattern was determined. Very quickly.x . " y^". y. This relationship can make defining seventh order polynomials by hand a real pain (they have 120 coefficients). an> } order is a float which defines the order of the polynomial. This will tell POV to use its more accurate (but somewhat slower) Sturmian root solver. .1.inc.

org/3285/language/iobject. Conversely.thinkquest. There are actually quite a large number of useful shapes that can be generated with quadrics. -6>. 0 } // an infinite cone opening in the x direction // a sphere of radius 3 centered at <3. Note also that quadrics and quartics are different (quartics are fourth order polys). 0>. Note that many of these shapes already have primitives associated with them. 1. -6. 1>. 18 } quadric { <1. This http://library. 3. h. 1>. f>. 0>.html (4 of 5) [9/12/2001 3:24:34 PM] . 0. cones. spheres. c>. Note also that POV considers all polys of any order to be infinite objects (regardless of whether or not they actually are) and so it does not automatically bound them. It is usually better to use the sphere primitive to create a sphere than to use a quadric statement. 3> // a rotated cone Well. 0. i>. <0. 0.The Online POV-Ray Tutorial: Infinite Objects (when plugged into the equation) is less than zero. <0. you get the idea. The syntax for a quadric is as follows: quadric { <a. e. and hyperboloids. <d. the outside is all points with values greater than zero. It can be used to create simple shapes like cylinders. because POV has special optimizations for spheres that would not take effect with the quadric definition. 0. 0. <g. <0. 0>. 0 } quadric { <1. -1>. -1. All points with values of zero are on the surface of the object. 0. 0>. <-2. j } a through j are all floats and correspond to the following second order poly equation: ax^2 + by^2 + cz^2 + dxy + exz + fyz + gx + hy + iz + j = 0 Some examples of quadrics: quadric { <1. 0>. b. <0. Quadric A quadric is a second order poly. <-6.

Note the two letter (but very important) difference between quartic and quadric.thinkquest.The Online POV-Ray Tutorial: Infinite Objects is nice because quadrics are easy to define and are fairly efficient to render. As with all polys.html (5 of 5) [9/12/2001 3:24:34 PM] . if you have one that's rendering incorrectly. a1. A common and useful example of a quartic shape is the torus (or doughnut) shape. Quadrics have a clearly defined inside and outside. you should probably use the torus primitive to declare a torus. so it won't be repeated here. . Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. and so can be used in CSG. Although quadric surfaces will rarely cause problems. a34> } Each of a0 through a34 is a float.org/3285/language/iobject. Quartic Quartics are fourth order poly objects. you can throw in the keyword sturm to tell POV to use its slow but accurate Sturmian root solver. They are considered to be infinite and so are not automatically bounded. The syntax for a quartic is as follows: quartic { <a0. accuracy is a factor in rendering quadrics. The correspondence of these numbers to terms in the generic quartic equation is covered with the discussion of poly. For concerns of efficiency and ease of use. . The POV-Ray documentation contains a discussion of the quartic primitive. .

or go on a month's vacation (if it's a really complex scene). Although this seems like it will take more time. We personally like the one we've used in the examples in this tutorial. Generate high quality output for the final scene. It certainly can't hurt anything. Being Artistic Developing POV-Ray Scenes q q q Develop a good coding style. submit it to the Texture Library or the Object Library for others to see! Don't start out with a modeller. Not even the fastest computers will be fast enough for you once you really get going. You may be able to find the objects.The Online POV-Ray Tutorial: Tips and Tricks The Online POV-Ray Tutorial Tips and Tricks We've provided a list of useful tips and tricks to help you in learning and using POV-Ray.otherwise. you won't learn some of the most important things and you'll be very stuck down the road. Experimenting with objects.. the chances of you getting lost are a lot greater than if you render a quick image in between each step. Developing POV-Ray Scenes 2. so they're worth looking at. If you rotate the camera. Low-quality images generate faster. just be consistent! Be prepared to spend some time. POV-Ray will usually give you a warning in this case. We came up with most of these as a side-effect of frequent POV-Ray use on our part (when we really should have been doing other things. The best way to find "missing" objects (objects that you put in the source code but that aren't appearing on-screen) is to pull the camera far back. textures. Make small changes. add three more objects. use them.thinkquest. Quick index: 1. If you ever go back and work on a scene you made a month ago. (A coding style is the way you format the source code in the file -where you place the tabs and such).org/3285/tips. This tutorial can't teach you everything. and render frequently. Only start using extra tools once you have a firm understanding of POV-Ray and have had plenty of experience just using the text editor -. but sometimes it'll just go ahead and color the object q q q q http://library. but you should feel free to develop one you like. Ray-tracing is a slow process.html (1 of 3) [9/12/2001 3:24:50 PM] ..You can save yourself some time when developing a scene by generating low-quality output (see the +Q switch and the +A switch documentation in the Command Line Reference. And hey. better yet. and change the lighting all in one go. Experiment. you will have actually saved yourself time that would have otherwise been spent debugging scenes where many changes have been made. DOS users. multitask! (Sorry. if you make anything interesting. and everything else about POV-Ray is the best way to learn. Another possibility is that the object has no texture. Make yourself a cup of coffee. like homework). or. you're stuck with waiting). this can be invaluable. Zoom way back if you've lost an object.

or just plain boring. if your light source color is <2. scenes tend to come out looking a little surrealistic. it will be twice as bright (this trick can save you a lot of time). turn off all the diffuse lighting. How something appears is more important than how it is.thinkquest. Avoid infinite ground planes. For example. and it's not very computationally expensive. and find just the right configuration for each scene you create. Use it to your advantage.2. If you just want a sky that's a single color. If something is mathematically correct but doesn't look like it. a sky sphere is very effective. Use a sky sphere. Really.html (2 of 3) [9/12/2001 3:24:50 PM] . Try it. Use your light sources wisely. You also need to add "ambient 0. Top of Document Main Page http://library. To keep things from casting a shadow on the sky sphere. Experiment. Because of the way ray-tracers work. too bright. your scene will feel unbalanced. use only ambient lighting on the sphere. if applicable. This is related to the above tip.. The automatic bounding algorithm won't even touch really complex objects (like intersections or polynomial objects). if you have an infinite cone (for example). you can just use the background directive. Try maximizing this effect. A scene needs to look right..0". things only need to look right. Remember. Don't agonize about perfecting things the viewer is never going to be able to see. Of course. Being Artistic q q q q q q q Surrealism is easy. too dark. Bound complex objects.The Online POV-Ray Tutorial: Tips and Tricks q q black. Try adding some fog. This is a sphere of a very large radius (the edge is maybe 1000 times further than any object in the scene).org/3285/tips.the ends justify the means! Concentrate on what can be seen. By far the best objects for bounding are boxes and spheres.2>. Be aware of the defaults. which you can texture to give a sky-like appearance. Just a little bit of fog can make your scene look a lot more three-dimensional.0" in an object's finish statement will not make that object a perfect reflector. Unless you can find a way to populate this space with something. You can use the default directive to change the default behavior of an object. Planes which stretch or appear to stretch off to infinity will give your scene an empty feeling. it'll be difficult to find an object which contains it. putting "reflection 1.especially if you're working with glass or mirror-like objects. Bad lighting can make your image seem flat and two-dimensional. See bounded_by. As stated above. POV-Ray is only able to do so much with automatic bounds. but only when we're not trying to be artistic. that doesn't help you much. You can really speed up rendering by specifying a bounding object for these. Sometimes default values for things can mess up a scene. we've broken this rule many times throughout the Tutorial. Of course. In scenes where you're going to have a visible "sky". Lighting can make and break a scene -. This is art -.0" and "diffuse 0.

The Online POV-Ray Tutorial: Tips and Tricks The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.html (3 of 3) [9/12/2001 3:24:50 PM] .org/3285/tips.thinkquest.

With the toggles.html (1 of 11) [9/12/2001 3:27:16 PM] .org/3285/language/cmdln. Valid command line parameters are listed below. specifying a "+" before the letter turns the option on. With specifiers. Here. a value for a parameter is specified. while specifying a "-" before it will turn it off. and MB. POV-Ray checks command line parameters in a non-case-sensitive fashion. J.thinkquest. Some options are toggles.pov" for example. A Controls anti-aliasing (edge smoothing) of the image B Controls the size of the output buffer C Used to continue a incomplete render of an image D Controls display of the image during rendering E or ER Sets the ending row for partial renders EC Sets the ending column for partial renders F Sets to format of the output image H Specifies the height of the image (in pixels) I Specifies the name of the scene file being rendered J http://library. Any command line parameter which is not preceded by a "+" or a "-" is assumed to be the name of a command file from which further options will be read. for example. This means. The argument for the specifier follows the parameter without a space. that +a is the same as +A. some are specifiers. "-Ifoo. either "+" or "-" can be used before the letter.The Online POV-Ray Tutorial: Command Line Parameters The Online POV-Ray Tutorial Command Line Parameter Reference This section covers the various command-line parameters which POV-Ray will accept. Examples of toggles are A.

html (2 of 11) [9/12/2001 3:27:16 PM] .thinkquest.The Online POV-Ray Tutorial: Command Line Parameters Controls jitter during anti-aliasing K Specifies a value for the clock variable L Specify a path to search for files in MB Controls POV-Ray's use of automatic bounding MS Controls the size of POV-Ray's internal symbol table MV Used to modify the default value of the version parameter O Specifies a filename to render the scene to P Controls whether POV-Ray waits for a keypress after rendering Q Controls the rendering quality R Controls the number of extra rays used for anti-aliasing S or SR Sets the starting row for partial renders SC Sets the starting column for partial renders V Controls the display of verbose statistics while rendering W Specifies the width of the output image (in pixels) X Controls whether or not POV-Ray can be interrupted once started (only available in certain versions) http://library.org/3285/language/cmdln.

Thus. the difference will be 0.3. The first has no anti-aliasing.3. Setting the threshold to 0. You can introduce a random jitter into the supersampling rays with the J parameter. "-A" turns it off.6. and if they are too different. 0. 0. For example. "+A1. if you have two colors <0. or right before you go to bed for the night. It's not uncommon for anti-aliasing to double or triple the rendering time of a scene. The following scenes and zoom-ins should should make anti-aliasing more clear. it's a good idea to only use this option for final images. POV-Ray shoots extra rays into the scene (it supersamples the pixel) and colors the pixel with the averaged value.9>. If the distance between two colors is greater than the threshold (0. The default is "-A". "+A" turns on anti-aliasing. For example.3 + 0. then the pixels will be anti-aliased. The "distance" between two colors is determined by summing the absolute values of the differences of each color component (phew!).5" will only anti-alias if the distance between two colors is greater than 1. Anti-aliasing works by determining how different two adjacent pixels are.0. 0.1). This threshold can be changed by specifying a float with the "+A".thinkquest.The Online POV-Ray Tutorial: Command Line Parameters A: anti-aliasing The "A" parameter is a toggle that controls anti-aliasing of the rendered image. Note that because anti-aliasing requires extra rays to be traced.5.5 (0. The number of rays used to supersample a pixel can be controlled with the R parameter. the second was rendered with "+A -J". The maximum threshold is 3.8> and <0.1 + 0.org/3285/language/cmdln.0 will make POV-Ray anti-alias every pixel.html (3 of 11) [9/12/2001 3:27:16 PM] . which effectively turns off anti-aliasing. http://library.2. it drastically increases the amount of time to render the scene. 0.3 by default).

and EC to render a rectangular portion of an image. This parameter can be used in concert with E. and SC to specify a rectangular region of the image to render. Note that "-B" cannot be used to turn off the output buffer. if your image is 256 pixels wide. and you need to do something else with the computer for a while. SC. C: continue interrupted render This is a toggle which can be used to get POV-Ray to continue work on a partially completed render. You can interrupt the trace (see the X parameter). This is useful for when you have a trace which is taking a particularly long time to render. EC: ending column The EC parameter is used set the ending column for a partial image render.html (4 of 11) [9/12/2001 3:27:16 PM] .The Online POV-Ray Tutorial: Command Line Parameters B: buffer size The value of this parameter controls how many pixels POV-Ray should calculate between disk writes. "+E192" and "+E0. The parameter for D is system dependent. If it is a float. If the value for the parameter is an integer.625" have the same effect. By default. and display-while-render is not supported across all platforms. This is useful for debugging a scene when you are only interested in a part of it. There should be system specific documentation with POV-Ray that details this parameter for your particular system. POV-Ray will write to the disk after every line is calculated. The POV-Ray authors recommend +B30 as a good value for speeding up small renders. it specifies a fraction of the image to render. POV-Ray interprets it to be a fraction the image width.75" will have the same effect. This is useful in concert with some or all of S.0 and 1. S. If their parameter is an integer. http://library. For example.org/3285/language/cmdln. For example.thinkquest. if your image is 256 pixels high (see the H parameter).0. E and ER are functionally equivalent. The default value of this toggle is "-C" (start anew). "-EC160" and "-EC0. POV-Ray interprets it to be the absolute number of the stopping column. E: ending row The E and ER parameters are used to tell POV-Ray to stop tracing after a certain row. it specifies the row number on which to stop. do what you need to do. D: display image The D parameter controls whether or not POV-Ray displays the image as it renders it. and then restart with "+C". If the value is a number betweem 0.

http://library. POV-Ray will randomly perturb the extra rays it uses to do the anti-aliasing.0. If you wanted to render the file "shmoo.767 (inclusive).0 aren't recommended because they cause supersampling rays to be jittered outside the pixel. it's a good idea to have the ratio of H and W be the same as the ratio of the up and right vectors in the camera.thinkquest.0 and 1.pov". When "+J" is specified (this is the default when +A is given). "+FD". Of these. For example. If no I parameter is specified.pov".pov". with. Values greater than 1. It's a good idea to have F or D enabled (or both). The default is 1. To avoid weird distortion effects. input files have the extension ". otherwise you'll just spend a lot of time doing nothing. I: input file The I parameter is used to specify the file from which POV-Ray will read the scene description. and "+FR". and raw data output. specifying "-H768" will render an image that is 768 pixels high. the second. This parameter can take any value between 1 and 32. you would specify "-Ishmoo. Dumps. it will default to 100. POV-Ray will try to read from "object.html (5 of 11) [9/12/2001 3:27:16 PM] . These can be specified using the "+FT". Although it's difficult to tell the difference. J: jitter The J toggle controls the use of jitter when anti-aliasing an image.pov". H: image height The H parameter is used to specify the height of the output image in pixels. but this is not required.The Online POV-Ray Tutorial: Command Line Parameters F: output file type The F parameter is used to control the file output format. you'll notice that the zoom-in on the second image is a bit different from the zoom-in of the first.org/3285/language/cmdln.0 which controls how much jittering will be done. You can disable file output by specifying "-F". Truevision Targas. As this parameter is not a toggle. By convention. The first image below was anti-aliased without jittering. both "+" and "-" work equally well in specifying it. If not specified. This serves to break up edges and prevent annoying moire patterns along anti-aliased edges. the Targas are probably the most useful and widely supported. J can also take a parameter between 0. Three file output types are supported.

you could tell POV-Ray to search those two directories when appropriate by giving the parameters "-Linclude -Limages". bump maps. L: library paths The L parameter is used to specify search paths for the various features of POV-Ray.5". image maps. These search directories are used for including files. For example. When searching for an external file.thinkquest. For example. you could try "+J0. to set the value of the clock variable to "3. http://library. you would give the parameter "+K3.14159". K: clock The K parameter is used to specify a value for the clock variable.The Online POV-Ray Tutorial: Command Line Parameters To set the jitter to something lower. the value of the clock variable will be zero. POV-Ray will first look in the current directory.14159". you had your include files in the subdirectory "include" and your image maps in a subdirectory "images". You can use this to specify up to ten different search directories. If not specified. This is useful for creating simple animations. or for images used in height fields. "-J" will turn off pixel jittering.html (6 of 11) [9/12/2001 3:27:16 PM] . but won't help too much with more complex stuff. and then any directories given with the L parameter.org/3285/language/cmdln. and material maps. It takes any floating point number as a parameter.

These are very efficient bounding objects.tga". it will be overwritten.org/3285/language/cmdln. If not specified. for scenes which aren't very complex.html (7 of 11) [9/12/2001 3:27:16 PM] . you need to either decrease the number of declares in your scene.0 syntax. you would issue the parameter "+MB50".0. it will default to "-Odata.tga" will work just as well. Inside the scene file you can change the version with the #version directive. the overhead involved in computing the slabs outweights any benefits. The default is 2. To increase the size of the symbol table to 2000 symbols.thinkquest. give the parameter "-MS2000". and this can cause the symbol table to fill up more quickly than you would expect.tga". MS: control symbol table size This parameter is used to control the size of POV-Ray's internal symbol table. POV-Ray will divide them up and group them with these bounding slabs. and can speed a render greatly. you can use this parameter to get POV-Ray to recognize it. which is the syntax covered in this tutorial.0 and 2. http://library. By default it is 25. O: set output filename The O parameter is used to tell POV-Ray what file to output to when file output is enabled.The Online POV-Ray Tutorial: Command Line Parameters MB: control automatic bounding This parameter is used to control POV-Ray's use of things called bounding slabs.tga". you would give the parameter "-Oshmoo. Space in this table is allocated for everything that is declared in a scene file. "+Oshmoo. "+MS2000" will work just as well. MV: set version The MV parameter is used to tell POV-Ray what version scene files it's reading. Note that the standard include files tend to have a great number of declared identifiers. and this is a good limit.0. "-MB" will turn off the use of bounding slabs. for example. However. The value of the MB parameter is used to set the object threshold for the use of bounding slabs. If. If you get a "Too many symbols" error message. Note that there have been some changes to the language which will not be fixed with this parameter. you wanted to send the output to "shmoo. If you wanted to turn the threshold up to 50. 1. Two values can be specified for this parameter. The default symbol table will hold 1000 symbols. If the file you specify already exists. if you want to render a scene which uses v1. or increase the size of the symbol table (the latter being the easier of the two). However. When a scene reaches a predetermined complexity (defined by the number of objects in the scene).

Rendering lower quality images is useful for debugging a scene. and 9. resulting a quicker and quicker and render.org/3285/language/cmdln. The default value is "-P" (don't wait for keypress). respectively. The following images are of the same scene. "+P" is useful for pausing when you're displaying an image. http://library. rendered at quality settings 1. +Q8. Lower quality settings will disable mroe and more features. +Q7 Stops using quick colors. +Q6. quick render) to 9 (high quality. 7. +Q2. +Q9 Enables reflection and transparency calculations (including refraction). No shadows. +Q4 Enables shadow calculations. +Q0. no shading.html (8 of 11) [9/12/2001 3:27:16 PM] . no transmission. and instead colors objects based on their assigned textures. The following list summarizes the effects of the different quality settings. no reflections. and area lights are rendered as point lights. 5. no refraction. +Q3 Enables diffuse lighting and shading of objects. +Q1 Use quick colors (or gray scale) to color objects. 3. Q: set rendering quality The Q parameter is used to tell POV-Ray what quality you want to render the image at. The default value is 9 (highest) quality. +Q5 Enables area lights.The Online POV-Ray Tutorial: Command Line Parameters P: wait for keypress The P parameter is a toggle which tells POV-Ray whether or not to wait for a keypress after it's done rendering. Ambient light only.thinkquest. This parameter can take a value from 0 (low quality. not-as-quick render).

setting it much beyond 5 or 6 is a bad idea unless you're going on vacation for a week. the default value is sufficient to make a scene look nice.The Online POV-Ray Tutorial: Command Line Parameters R: number of supersampling rays The R parameter is used to control how many rays POV-Ray will supersample with when it is anti-aliasing. You shouldn't need to use high values of R. respectively.html (9 of 11) [9/12/2001 3:27:16 PM] . the second normal size image has softer. which means that POV-Ray will use a 3x3 grid of rays. The default value is 3.thinkquest.GIFs). The following two images show the difference between "+R3" (default) and "+R5". Giving the parameter "+R5" will tell POV-Ray to use a 5x5 grid. Note that since the number of extra rays increases with the square of this number. These softer edges are even more apparent when the image is still in 24-bit color (as opposed to the 8-bits supported by . better looking edges. Normally. http://library.org/3285/language/cmdln. when anti-aliasing. Although the two zoomed-in images don't look to different.

The image width can be anywhere from 1 to 32. SC: starting column The SC parameter is used to specify the starting column for partial image renders.0. If the value given for this parameter is an integer. X: allow interrupt In certain versions (the DOS version.25" will have the same effect. To avoid weird image distortion. For example. As an example. if your image is 256 pixels high. "-X" will make it so that the only way to stop the trace is to reboot the computer. The default value is "-V". to set the width of the image to 1024 pixels. it is assumed to be the absolute column number on which to begin. then "-SC32" and "-SC0. E. POV-Ray assumes you're giving a line number. and will start rendering at the specified row. This is only useful when you aren't displaying the image. for example) the "+X" option will allow you to halt the rendering by hitting a key. "-X" is useful for when you're starting a long trace and you don't want anyone to accidently stop it. "+W1024" will work just as well.0 and 1.thinkquest. Note that "+S" will work just as well in both these cases.767 pixels. while "-V" turns that reporing off. If it is a number betweem 0. "+V" gives a report of how much of the image has rendered. SC. then the arguments "-S64" and "-S0. W: image width The W parameter is used to specify the width of the rendered image.The Online POV-Ray Tutorial: Command Line Parameters S: starting row The S or SR parameter is used to specify a starting row for a partial image render. If the value is instead between 0.0. V: verbose The V parameter allows you to control the verbose reporting of statistics while rendering. it's a good idea to make the ratio between the W and H values the same as the ratio between the right and up vectors in the camera. If the value given for this parameter is an integer. If you don't specify a width. This parameter is useful in conjunction with E. If you do http://library.125" are the same. it is interpreted to be a fraction of the total image width. and EC to render a rectangular portion of an image. This parameter is useful to use with S.html (10 of 11) [9/12/2001 3:27:17 PM] . you would give "-W1024". if your image is 256 pixels wide.0 and 1. For example.org/3285/language/cmdln. and EC for specifying a rectangular portion of the image to render. POV-Ray interprets it as a fraction of the image height. it will default to 100 pixels.

org/3285/language/cmdln. Reference Index Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. you can restart it later with the C option.The Online POV-Ray Tutorial: Command Line Parameters stop an trace (when in +X mode).thinkquest.html (11 of 11) [9/12/2001 3:27:17 PM] .

pov [9/12/2001 3:27:18 PM] . <1. -1>. -2 pigment { checker color rgb <1.org/3285/language/src/cmdln2. 1> } camera { location <1. 1.thinkquest. 0> rotate <55. 0> } light_source { <-1. 0> } rotate y*10 } box { <-1. 0. 4. 1. 45. 4. -1.5685. 0> } http://library.7095.http://library. -1> color rgb <1. 0. 0. 1. -1> look_at <0. 0. 1> color rgb <0.pov plane { y. 1> pigment { color rgb <0. 0.7785> } rotate <0.org/3285/language/src/cmdln2.thinkquest.

and consequently everything in the scene is always in focus. The camera is probably the sinlge most important element of a scene. Camera The camera defines what you exactly you see when you render an image. q Camera q q q q q q Direction Location Look At Right Sky Up The following predominantly blue scene will be used to demonstrate the effects of the various camera modifiers. There can only be one camera per scene. The general form for declaring a camera is something like this camera { location <loc> sky <sky vector> up <up vector> right <right vector> http://library. Without a camera. The default settings usually take care of the rest.html (1 of 6) [9/12/2001 3:28:11 PM] . All you usually need to worry about with a camera is where it is and where it's pointing.org/3285/language/camera. there is no image (although it may just be all black without a few other things). It is not a "lens" camera.thinkquest.The Online POV-Ray Tutorial: Camera The Online POV-Ray Tutorial Camera The following topics are covered in this section. The POV-Ray camera is a very simple type of camera.

the only really important ordering is that "look_at" should appear after "direction" if they are both present. 1>". Direction and look_at are used to point the camera at a specific point in the scene. The first uses "direction <0. components that appear should do so in this order. Modifying this value can be used to roll the camera around its central axis.org/3285/language/camera. 0. It takes an <x.The Online POV-Ray Tutorial: Camera direction <direction vector> look_at <target> /* translations. The default value of direction is <0. 1>. right.html (2 of 6) [9/12/2001 3:28:11 PM] . The other specifiers can be used for fine tuning a scene and producing special effects. Most of the time. 0. Location is pretty self evident. and putting them in the wrong order may result in your camera not doing exactly what you expect. the third "direction <0. z> vector of the location. it tells POV-Ray where in space to locate the camera. Sky is used to tell the camera which way is up. to orient the camera (but this is more commonly done with look_at. you'll only need to use "location" and "look_at" to define your camera. 0. and scales */ } When declaring a camera. Here are some sample images with different direction vectors. It can also be used to implement a telephoto lens or. Up. After the camera is declared. 0. Actually. This is because some later components modify previous ones. the second "direction <0. 2>". Decreasing the magnitude of the direction vector "compresses" the viewing pyramid and gives the effect of a wide-angle camera.5>". 0. Any transformation applied to object modify the location of the camera and (potentially) the direction it's pointing. rotations. y. it can be transformed like any other object. and the fourth "direction <0. http://library.thinkquest. 4>". Direction is more typically used with up and right to define field of view then to position the camera. Direction The direction vector is primarily used in conjunction with up and right to define the field of view. and direction are used to modify the field of view and aspect ratio of the image. though. 0. less commonly. Increasing the magnitude of the direction vector "stretches" the viewing pyramid and creates a telephoto sort of effect.

It takes an <x. when you specify a look_at point. here's our sample scene with various look_at points.The Online POV-Ray Tutorial: Camera The direction vector should always be perpendicular to the up and right vectors.thinkquest. It is by far the easiest way to get the camera to point at the thing you want it to point at. and the POV-Ray will rotate the camera around so it still points at the same place. This parameter must always be specified. Look At The look_at parameter controls the orientation of the camera. Anyway. the look_at specifier should appear after the location specifier. while if you instead specify a direction. Also.org/3285/language/camera. z> vector which tells the location of the camera. but this becomes tedious when you're not looking directly along an axis. y. For more information on declaring cameras. For more information on declaring cameras.html (3 of 6) [9/12/2001 3:28:11 PM] . One thing to keep in mind when using look_at is that the location and look_at points should never be set http://library. This is because the direction vector resets the direction that camera points. see the camera section. changing the location will not modify the rotation of the camera. You can also specify a camera direction with the direction vector. Note that if you have specified an look_at point. Note that if look_at is specified with direction. moving the location will also rotate the camera (maybe). see the camera section. you can move the camera around and modify the parameters to your heart's delight. Location The location keyword tells POV-Ray where to position the camera.

and make the image appear "stretched" in the left-right direction. If you want an "overhead" view. 0>". or rotate the entire scene so it just appears like you're looking straight down (but are actually looking along. Right The right vector controls the width of the view. Increasing the magnitude of the right vector will make the viewing pyramid wider. 0>". 0>" but rendered at 120x120 instead of 160x120. For more information on declaring cameras. 0. The first image below was rendered with "right <4/3. say. Conversely. 0. the second with "right <1. and the third also with "right <1. This is a diagram of the viewing pyramid as it would look from above.org/3285/language/camera. A right vector with a magnitude of zero is bad. Aspect ratios are covered in more depth in the up section. The angular width of the viewing pyramid can be found with the following equation.The Online POV-Ray Tutorial: Camera so that the camera is looking directly down (parallel to the y-axis). and consequently make the image appear "squished" in the left-right direction. 0. Making the value of the right vector negative will reverse the image left to right. The vertical bars mean the magnitude (length) of the named vector.thinkquest. http://library. decreasing the magnitude of the right vector will make the viewing pyramid thinner. the z-axis). either offset the camera some small amount in the x or z direction. see the camera section.html (4 of 6) [9/12/2001 3:28:11 PM] . width = 2 * atan(|right| / |direction|) This diagram may help make the relationship of the right and direction vectors more clear. It is used in conjunction with the up vector to define the aspect ratio of the image.

see the camera section. must appear before the look_at point is specified. This vector has no effect if look_at is not specified. http://library. 1.The Online POV-Ray Tutorial: Camera For more information on declaring cameras. By modifiying this value.thinkquest. you can roll the camera around its central axis. The combination of the up and direction vectors defines the angular height of the viewing pyramid. The vertical bars mean to take the magnitude (length) of the named vector. height = 2 * atan(|up| / |direction|) This diagram may clarify the relationship between the up and direction vectors. 0>". 0>". This can be found with the following equation. if specified. and the second with "sky <0.html (5 of 6) [9/12/2001 3:28:11 PM] . This is not to be confused with the up vector which defines the aspect ratio. the aspect ratio of the image. Sky The vector tells the camera which way is up. in conjunction with the right vector. The sky vector. 0>. see the camera section.org/3285/language/camera. Up The up vector is used to define the height of the viewing pyramid and. The first image below is rendered with "sky <2. For more information on declaring cameras. This is a diagram of the viewing pyramid as it would look from the side. 1. -1. The default sky vector is <0.

0>" (also default) defines the aspect ratio of the rendered image to be (4/3) / (1) = 4/3. 640x480. 0. Resolutions like 800x600. even though it would seem like it should be 8/5. 0>".thinkquest. Modifying the value of the up vector independently of the right and direction has the same stretch/squish effect as with the right vector. To prevent your image from looking distorted. This is the standard aspect ratio for most computer screens. This is because this resolution does not use square pixels. and 1024x768 all have 4/3 aspect ratios.html (6 of 6) [9/12/2001 3:28:11 PM] .The Online POV-Ray Tutorial: Camera The default value of the up vector is "up <0. Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/language/camera. together with the value "right <4/3. 1. This. it's a good idea to make the camera's aspect ratio the same as the image's aspect ratio. only this stretch/squish is in the vertical direction. 320x200 also has a 4/3 aspect ratio.

2. 2.3. <-2. 0> } disc { <0. -10> look_at <0.5 } cylinder { <-2. 2.3. 0>. -2>.5 } cylinder { <2. 2. 4. 2>. <-2. -2>. -50> color rgb <1.thinkquest.7> } } union { cylinder { <0.thinkquest.org/3285/language/src/camera.pov [9/12/2001 3:28:17 PM] . 0. 2. 0>.5 } cylinder { <2.5 } pigment { color rgb <0. 2>. 0. 2>. 1> } } light_source { <20.5 } cylinder { <-2. 2 2>. 0. 0. y. 50. 0. 1> color rgb <0. 1. 0>.http://library. -2>. 0. 0. 5 pigment { checker color rgb <0. 0.pov #declare Cam = camera { location <0. <2. <2. 0. -2>.org/3285/language/src/camera. 0. 0. 0. 0. 1> } camera { Cam } http://library. 0. 0. <0.

1> } camera { Cam } http://library. 0. 0. 0. 0.3. 0. <0. 2. 0> } disc { <0. 0. 0. 1> } } light_source { <20. 2. y. 0>. 0.5 } cylinder { <2. <-2.org/3285/language/src/camera1. 2>.thinkquest. -50> color rgb <1.3. 2>. 4.pov [9/12/2001 3:28:28 PM] . 1> color rgb <0.org/3285/language/src/camera1.5 } cylinder { <2.pov #declare Cam = camera { location <0.5 } cylinder { <-2. 0. 0>. 5 pigment { checker color rgb <0. 0. 0. 0.http://library. 0>. 50. 0. <2. <-2.5 } cylinder { <-2. 2. 0. -2>. 0. -2>. -2>. 2.5 } pigment { color rgb <0. 2>. 2 2>.thinkquest. <2. 2. -2>. -10> direction <0.7> } } union { cylinder { <0.5> look_at <0. 0. 0. 1.

2. 0. 0.7> } } union { cylinder { <0.5 } cylinder { <-2. <2. 2>. 1> color rgb <0. -50> color rgb <1. 2>.pov [9/12/2001 3:28:29 PM] .3.thinkquest. 0. y. 1.5 } cylinder { <2. 0. 4. 0. 0.org/3285/language/src/camera2. 0>. 2 2>.5 } pigment { color rgb <0. 1> } } light_source { <20. 0>. <-2. 0> } disc { <0. 0. 2. 5 pigment { checker color rgb <0. 2. 2.thinkquest. 0. 0. 2>. 0. 50. 0. -2>. <0. 0. 2> look_at <0. 1> } http://library. 0. -10> direction <0. 0.org/3285/language/src/camera2. 0>. -2>. 0.5 } cylinder { <2.pov camera { location <0. 0. <2.http://library. -2>. -2>.5 } cylinder { <-2. <-2.3. 2.

0. 1> } } light_source { <20. -2>. 0>. 0. 0. <2. 2.org/3285/language/src/camera3. <2. 50. 2>. -50> color rgb <1. 2. 1.5 } cylinder { <2. 5 pigment { checker color rgb <0. -10> direction <0. y. 0.3.5 } pigment { color rgb <0. -2>. 0.org/3285/language/src/camera3. <-2. 0. -2>. 0>. 0. 4> look_at <0. 0> } disc { <0. 1> color rgb <0. -2>. 0.7> } } union { cylinder { <0. 0. 0.pov [9/12/2001 3:28:31 PM] . 0. 0>. 0. <-2.thinkquest.thinkquest. 0. 0. 2>.3.pov camera { location <0. 2>. 2.http://library. 4. 1> } http://library. 2 2>.5 } cylinder { <2. 0. 0. 2. <0. 2.5 } cylinder { <-2.5 } cylinder { <-2.

4. 0.5 } cylinder { <2. 2. 2 2>. 2. -2>.5 } pigment { color rgb <0. 2. y. 2>. 1> } } light_source { <20. <-2. <-2.5 } cylinder { <-2. 0. 0. 0. 0>. -50> color rgb <1. 0. 2. 5 pigment { checker color rgb <0.org/3285/language/src/camera4.org/3285/language/src/camera4. 0. 1> } camera { Cam } http://library. <2.thinkquest. 0. 2>. -2>. <0. 0. 0>.http://library. 1. 0. 0. 0> } disc { <0.pov [9/12/2001 3:28:32 PM] .thinkquest. 2>. 50. 0.5 } cylinder { <2.3. 1> color rgb <0. <2. -10> look_at <0. 0. 0.7> } } union { cylinder { <0.5 } cylinder { <-2. -2>. 0.pov #declare Cam = camera { location <0. -2>. -4. 0>.3. 0.

thinkquest. 1> color rgb <0. 0. y.5 } cylinder { <-2. 2>. 2. -2>. 0. <-2. 0.3. 0. 2. 0. 0.pov [9/12/2001 3:28:39 PM] . 50. 0. -2>. 2 2>. 0. 2. 0>. 2.5 } cylinder { <2. 0.7> } } union { cylinder { <0. <0. 1> } } light_source { <20. <2. 0. 1. 0. -2>. -50> color rgb <1. 0>.5 } cylinder { <2. 0. -10> look_at <-4. 4. 5 pigment { checker color rgb <0. 0> } disc { <0.http://library. 2>.3. 0. 0>. 2>. 0. <-2. 0. -2>. <2.pov #declare Cam = camera { location <0.5 } pigment { color rgb <0.thinkquest. 0.org/3285/language/src/camera5.5 } cylinder { <-2. 1> } camera { Cam } http://library.org/3285/language/src/camera5.

<2. -50> color rgb <1. 0>. -2>. 2>. 0. 0. 1> } } light_source { <20.5 } cylinder { <2. 0. 0. 0. 0. 2>. 4. 0. 2. -10> look_at <4. 1.3. -2>. 2. 1> color rgb <0.5 } cylinder { <2.5 } pigment { color rgb <0. 0. 4.pov [9/12/2001 3:28:41 PM] . 0. 0>. y. 2>. 0.thinkquest.5 } cylinder { <-2. <0.thinkquest. 0. 0.7> } } union { cylinder { <0. 0>. 2. 1> } camera { Cam } http://library.http://library.3. <-2. 2 2>.org/3285/language/src/camera6.pov #declare Cam = camera { location <0.5 } cylinder { <-2. 50. -2>. 2. -2>. 0. 0. <2. 0> } disc { <0. 5 pigment { checker color rgb <0. 0.org/3285/language/src/camera6. <-2.

org/3285/language/src/camera7. 2>. 0. 0>.5 } pigment { color rgb <0.5 } cylinder { <2.5 } cylinder { <-2. 1> } } light_source { <20. y. 2 2>.3. 50. -2>. 4. 5 pigment { checker color rgb <0. 0. 0. 0. <2. 2. <-2. -10> right <1. 0. 0>. -2>. -2>. 0> } disc { <0. 0. 1> color rgb <0. 0>. 0> look_at <0. 0. <0. 0. 2. 2. <-2. 0.org/3285/language/src/camera7. 2. 0.http://library.5 } cylinder { <2.7> } } union { cylinder { <0. 0. -2>. 0.pov #declare Cam = camera { location <0.pov [9/12/2001 3:28:45 PM] . 1. 2. -50> color rgb <1.5 } cylinder { <-2.3. 0. 1> } camera { Cam } http://library.thinkquest. <2. 2>. 0. 2>. 0.thinkquest. 0.

0>. 1> color rgb <0. 0. 0>.5 } pigment { color rgb <0. -2>. 0. -10> sky <2. 2>. 0. 1. 2. <-2. 0> } disc { <0.7> } } union { cylinder { <0.thinkquest. 0. 1> } } light_source { <20. <2. 0.pov [9/12/2001 3:29:16 PM] . 0. 4. 0. y. 1> } camera { Cam } http://library.5 } cylinder { <2.pov #declare Cam = camera { location <0. -50> color rgb <1. -2>.org/3285/language/src/camera9. 0. 5 pigment { checker color rgb <0. 2. 2>.5 } cylinder { <-2. 2>. -2>. 0. <-2. 50. 2. <0. 0.http://library. 0.thinkquest. 2. 2 2>.3. 0>. 0> look_at <0. 0. <2.5 } cylinder { <-2.5 } cylinder { <2. 1. 2. 0. 0.3. 0.org/3285/language/src/camera9. -2>.

0>.5 } cylinder { <-2.3. 4.thinkquest.5 } cylinder { <2. -2>. 1> color rgb <0.pov #declare Cam = camera { location <0. 0. -2>. 2. 2.pov [9/12/2001 3:29:24 PM] . -2>. y. 5 pigment { checker color rgb <0. <-2. 0. 0> } disc { <0.5 } cylinder { <2. 2>.org/3285/language/src/camera10. 0. 2. 0. 0>. <2.5 } cylinder { <-2.http://library. -10> sky <0. 0. 2. 0. 0> look_at <0. -1. 0. 0>. 1> } } light_source { <20. <0. 2>. 2 2>. 50. 1. 2>. 0.5 } pigment { color rgb <0. -2>.thinkquest. -50> color rgb <1.org/3285/language/src/camera10. 0. 1> } camera { Cam } http://library. 0. 2. <-2. 0.3. 0. 0. 0. <2.7> } } union { cylinder { <0. 0.

Here's the general syntax for a bump map. They allow you to map a set of normals around an object. normal { bump_map { type "filename" [bump_size size] http://library. The intensity of the pixel value at each point in the input file for the bump map determines the "height" of the corresponding point. q Bump Map q q q q q q Bumps Dents Normal Ripples Waves Wrinkles The following scene is used for examples of the different normal modifiers.org/3285/language/normal. Right now it contains a Featureless Red Sphere. This can be changed with the "use_index" keyword (see below).The Online POV-Ray Tutorial: Normal Reference The Online POV-Ray Tutorial Normal Reference The following topics are covered in this section. It doesn't actually have any effect in this scene. Some phong was added to make the effects of the normal modifiers more apparent.thinkquest. The "bumps 0" statement was added just to keep POV from complaining.html (1 of 6) [9/12/2001 3:30:25 PM] . Bump Map Bump maps are sort of a cross between an image map and a height field.

you can make use of the map_type keyword.0 (Mountainous) that describes the depth of the bumps. as long as you don't want 0. The result is really pretty cool. (1.thinkquest. tga. The image will be mapped onto the x-y plane and rescaled to fit into the range (0. To chnage this default mapping mode.0 (Flat) to 1. With low resolution bump maps. Large numbers give you big depths. Negative numbers make the highs into lows and the lows into highs. the relative height of each point on the mapped surface is determined by the intensity (gray scale value) of the corresponding pixel. As is usual with such things. it uses a similar pattern to the bozo pigment. This can be either 2 (Bilinear) or 4 (Normalized Distance). The "use_color" keyword may be included to specifically state that a bump map uses the default behavior. POV-Ray takes each surface intersection and assigns it a pixel value in the bump map. The parameter for interpolation tells POV-Ray what kind of interpolation to use. In fact.org/3285/language/normal. you can either get speed or quality. It should be gif. Bilinear interpolation is better. but rather bumps maps with better resolution. Normally (ha!). By default. The bump_size parameter is used to control the apparent depth of the bumps generated by the bump map. Larger images do not produce larger bump maps. Bumps The bumps normal creates a random bumpy pattern on the object. If you would rather have the bump map height based on the palette index of the corresponding color (as with height fields) you can include the optional keyword "use_index". It will not usually have any effect. This creates a surface which looks like it has the image embossed into it. small numbers give you little wrinkles. the surface will look blocky. 0 is bad. http://library. type specifies the type of the file that is the source for the bump map. By default. but Normalized Distance is faster. The following image was rendered with "bumps 1. this can be altered with the once keyword. iff. or dump. the bump map is repeated infinitely in the x and y directions. in double quotes. This image will mapped onto the object.The Online POV-Ray Tutorial: Normal Reference [interpolate mode] [use_color] [use_index] [once] [map_type map mode] } } Any specifiers in square brackets ([]) are optional. This can be any number you want. 1). The bumps normal takes a float parameter from 0. Interpolation smooths the bump map by averaging surrounding pixel values. 0).html (2 of 6) [9/12/2001 3:30:25 PM] .0". This is followed by the full name of the file (filename). By default. no interpolation is used. Interpolation is good for smoothing out jagged or low resolution bump maps.

0 (Brand New) to 1. For more information on declaring normals. The surface appears to have dents (naturally enough) beaten into it. The normal was scaled to get it to fit nicely onto the sphere.5 to 1. Since much of the way we perceive objects is based on how they reflect light. it does not modify their depths. Note that this only changes the spacing of the bumps. so the normal was scaled down to make it fit. Here's what happens if we take the Featureless Red Sphere and beat it up a bit with "dents 1.html (3 of 6) [9/12/2001 3:30:25 PM] . So POV-Ray gives you the ability to modify the way light reflects off of the surface.The Online POV-Ray Tutorial: Normal Reference By default the bumps are pretty large (about 0. see the normal section. it is possible to trick the eye into thinking a surface is bumpy by just modify the surface normal vectors. it does not modify their apparent depth.org/3285/language/normal. Trying to model such a thing mathematically (whether with height fields or csg) would be excrutiatingly painful. For more information on declaring normals. Although not 100% http://library.0 (Survived a Hail Storm) which specifies the depth of the dents. Dents The dents normal basically makes the object look like someone attacked it with a sledgehammer. see the normal section.0 units across).thinkquest. Note that scaling only changes the spacing of the dents. This is what the "normal" modifier does. Dents takes a float parameter from 0.0". Say you wanted to create a lake with ripples moding across the surface. Normal The normal component of a texture allows you to create effects on the surface of an object.

As an example. http://library. it's "close enough" for most purposes. Normals are fun to play with. The frequency keyword controls the density of the ripples or waves. You should note. waves. Incrementing phase from 0. though.0 to 1. Note the ripples have been translated to put their center on the top of the sphere. here's how to specify a normal modifier for an object (really it's quite simple). dents. They should be added last. They can turn an object that looks great into an object that looks absolutely spectacular.0 (Violent).The Online POV-Ray Tutorial: Normal Reference realistic. But anyway. here's a standard ripples normal and another with "turbulence 0. in the "fine tuning" section of scene production. Transformations that are applied to normals only modify the locations of the normal components.thinkquest.0 will bring the normal back to where it started from. One modifier that is supported for normals is turbulence.0 (Flat) and 1. Only certain normal modifiers respond to the keywords "frequency" and "phase". or wrinkles.html (4 of 6) [9/12/2001 3:30:25 PM] .7". it just makes it look different. that specifying a normal modifier for an object does not actually change the location of the surface. the modifiers. scales. while phase controls their location. and easy to specify. and then transformations. and translations go here */ } Normals have three parts. and that is one of bumps. A normal can only have one type. ripples. the type. They each take a depth parameter between 0. Each type is covered with an examples in its own section. Turbulence can really create some wacky normals.org/3285/language/normal. These are the ripples and waves. normal { type depth /* OR */ bump_map { /* bump map specifiers */ } /* modifiers go here */ /* any rotations. they do not change the depths of the normals. You can create some pretty wacky effects (in animations) by translating bumps or dents perpendicular to the surface of the object. Turbulence is covered in depth in the pigment section and will not be covered again here.

http://library. The appearance of these ripples can be modified to some extent with the frequency and phase modifiers.html (5 of 6) [9/12/2001 3:30:25 PM] .0 to 1. smooth ripples which originate from 10 random locations inside the box with corners <0.0 (Becalmed) to 1. <1. Compare the look of ripples to that of waves. even ripples. The waves normal takes the standard 0. scaled a bit and translated so they will appear on the surface of the previously Featureless Red Sphere.0 parameter. Waves Waves are similar to ripples. Here's what "waves 1. For more information on declaring normals. it creates more rough and tumble waves. 0.thinkquest.0 (Tsunami) parameter.org/3285/language/normal. Here's how ripples look. For more information on declaring normals. see the normal section. see the normal section. so the ripple effect is smooth at a significant distance from the center. 1>.0" looks like (scaled to some extent to get it to look good).The Online POV-Ray Tutorial: Normal Reference Ripples The ripples normal creates evenly space. 1. except instead of creating smooth. Ripples takes the standard 0. 0>. Theoretically these look more like deep ocean waves. All the waves have the same frequency. The appearance of the waves can be modified to some extent with the frequency and phase modifiers.

For more information on declaring normals.html (6 of 6) [9/12/2001 3:30:25 PM] . Reference Index Top of Document Beginning of the Tutorial The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. Here's how a wrinkled by otherwise Featureless Red Sphere might look. but it is also one of the slowest to compute.The Online POV-Ray Tutorial: Normal Reference Wrinkles Wrinkles is one of the neatest surface normals.thinkquest. see the normal section.org/3285/language/normal. This normal specifier basically makes the object look like it had been wadded up and then stretched back out again. It basically works repeatedly denting the surface with smaller and smaller dents.

org/3285/language/src/norm.8 } normal { Norm } } plane { y. -2 pigment { checker color rgb <1. 4.pov [9/12/2001 3:30:26 PM] . 1 pigment { color rgb <1. 1> } camera { location <0.org/3285/language/src/norm. 200. 1> color rgb <0.thinkquest. 0. -200> color rgb <1. 0> } rotate y*30 } light_source { <200. 0>.http://library. 0> } http://library. 1. 0. 1. 0. -1> look_at <0. 0> } finish { phong 0. 0.thinkquest.pov #declare Norm = normal { bumps 0 /* no normal in this one */ } sphere { <0.

8 } normal { Norm } } plane { y. 0> } rotate y*30 } light_source { <200. 0>. 1 pigment { color rgb <1. 0.org/3285/language/src/norm1.pov [9/12/2001 3:30:36 PM] .0 scale 1/4 } sphere { <0. 0. 1> } camera { location <0. 0. 0> } http://library. -1> look_at <0. 1. 200. 4.thinkquest. 0. 1.pov #declare Norm = normal { bumps 1. 1> color rgb <0.http://library. -200> color rgb <1.thinkquest.org/3285/language/src/norm1. 0> } finish { phong 0. -2 pigment { checker color rgb <1.

0> } http://library. 0. 0> } finish { phong 0. -2 pigment { checker color rgb <1. -200> color rgb <1. 0.http://library. 0>.org/3285/language/src/norm2. 200. 4.thinkquest. 1 pigment { color rgb <1. 0.pov #declare Norm = normal { dents 1.thinkquest.org/3285/language/src/norm2. 1. 1> color rgb <0. 1.8 } normal { Norm } } plane { y. 0> } rotate y*30 } light_source { <200. 0. 1> } camera { location <0. -1> look_at <0.0 scale 1/4 } sphere { <0.pov [9/12/2001 3:30:37 PM] .

org/3285/language/src/norm4. -200> color rgb <1. 0> } http://library. 1> } camera { location <0. 0. 1 pigment { color rgb <1.pov #declare Norm = normal { ripples 1. 0> } sphere { <0. 200.http://library. 0.8 } normal { Norm } } plane { y.org/3285/language/src/norm4.pov [9/12/2001 3:30:41 PM] . 1. 1. 1. -2 pigment { checker color rgb <1. 0.thinkquest.0 scale 1/4 translate <0. 4. 0> } rotate y*30 } light_source { <200.thinkquest. 1> color rgb <0. 0>. 0> } finish { phong 0. -1> look_at <0. 0.

-2 pigment { checker color rgb <1. 0>. 0. 0> } http://library.thinkquest. -200> color rgb <1. 4. 0. 0> } sphere { <0. 200. 0.7 scale 1/4 translate <0. 1> color rgb <0.org/3285/language/src/norm3. -1> look_at <0.http://library.8 } normal { Norm } } plane { y.0 turbulence 0. 1 pigment { color rgb <1.thinkquest.org/3285/language/src/norm3. 1.pov [9/12/2001 3:30:46 PM] . 0> } rotate y*30 } light_source { <200. 1.pov #declare Norm = normal { ripples 1. 0. 1> } camera { location <0. 1. 0> } finish { phong 0.

1 pigment { color rgb <1. -1> look_at <0. 0. -2 pigment { checker color rgb <1.org/3285/language/src/norm5. 1. 0> } finish { phong 0.pov [9/12/2001 3:30:47 PM] . 0.pov #declare Norm = normal { waves 1. 0. 0> } sphere { <0.thinkquest.http://library. 4. 1> color rgb <0. 0> } rotate y*30 } light_source { <200. 1. 0> } http://library. 1. 0>. -200> color rgb <1. 0. 200.8 } normal { Norm } } plane { y.org/3285/language/src/norm5. 1> } camera { location <0.thinkquest.0 scale 1/4 translate <0.

-1> look_at <0. 0> } http://library. 1 pigment { color rgb <1. 0> } finish { phong 0. -200> color rgb <1.pov [9/12/2001 3:30:49 PM] . 1.8 } normal { Norm } } plane { y. 1.pov #declare Norm = normal { wrinkles 1. 0> } rotate y*30 } light_source { <200.0 scale 1/4 } sphere { <0.org/3285/language/src/norm6.org/3285/language/src/norm6. 1> color rgb <0. 0. -2 pigment { checker color rgb <1.thinkquest. 0. 1> } camera { location <0. 0. 0. 0>. 200. 4.http://library.thinkquest.

(E-mail) (Home Page) (Picture) q Grant Emery.html [9/12/2001 3:30:51 PM] . Alexandria.thinkquest. (E-mail) (Home Page) (Picture) William Morgan. creators of the Online POV-Ray Tutorial. Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. you can contact the team as a whole. Alaska. Anchorage.org/3285/about.The Online POV-Ray Tutorial: About The Online POV-Ray Tutorial About The Online POV-Ray Tutorial ThinkQuest Team. Va. from Thomas Jefferson High School for Science and Technology. from Thomas Jefferson High School for Science and Technology. from Some High School. is: q Owen Aftreth. VA (E-mail) (Home Page) (Picture) q Or. Please read about the Tutorial's design. Alexandria.

gif [9/12/2001 3:30:55 PM] .thinkquest.http://library.thinkquest.gif http://library.org/3285/images/owen.org/3285/images/owen.

thinkquest.gif http://library.gif [9/12/2001 3:31:36 PM] .http://library.org/3285/images/grant.org/3285/images/grant.thinkquest.

org/3285/images/william.org/3285/images/william.thinkquest.http://library.jpg http://library.jpg [9/12/2001 3:31:45 PM] .thinkquest.

8> quick_color rgb <0. 0> } light_source { <50. 0> } finish { refraction 1 ior 1. 0> } } sphere { <-1.0 color rgb <1.0 color rgb <0. 2.264. 0> translate <1. <1. 1. 1.5. 1.thinkquest. 0.5. 2. 0. 1. 1 pigment { color rgbf <0.8. 0>.8 } } box { <-1. 0.8. 1. 1. 1.http://library.7 pigment { checker color rgb <1. 1. -1. y.org/3285/language/src/cmdln1.pov [9/12/2001 3:31:47 PM] . 1>] } turbulence 1 quick_color rgb <0.25 } rotate <0. 0.3.thinkquest. 0>] [1. 50. 0> rotate <-35. -1>. 0> } http://library.5.org/3285/language/src/cmdln1. 0>. 0.5.5 phong 0. 0. 45. 0> color rgb <1. -50> color rgb <1. 0> quick_color rgb <1. 1> } camera { location <0.pov disc { <0. 1> pigment { marble color_map { [0. 1> } finish { reflection 0. 0. 1.8. -5> look_at <0.

0 is highly recommended Agate: Sort of a "Moss Agate" clear with green veining Dying Star: A fiery maelstrom of reds and oranges. Top of Document Main Page http://library. If you have a texture of your own that you would like to contribute to the library. uses pigment_map->POV3.org/3285/gather/texture_lib.thinkquest.html [9/12/2001 3:31:50 PM] .The Online POV-Ray Tutorial: Texture Library The Online POV-Ray Tutorial Texture Library This is a list of POV-Ray textures that you can include in any scenes you create yourself. Some are provided with the POV-Ray package. please do so! Author & User-Contributed textures: q q q q model: T_DRFantasy: green-pink-violet veins. and some have been contributed by other users of the Tutorial.

Anything deemed inappropriate will be removed from the library. Contribute this texture Reset submission form Main Page http://library. perhaps describing a style or material that the texture resembles. it would help if it were in some way meaningful for the texture you are contributing. (Doesn't resemble?) If your texture needs further explanation. Thanks! Note: we check submissions frequently for "appropriateness". The short description. preferably as a POV-Ray comment.html [9/12/2001 3:31:51 PM] . User-Contribution Form for POV-Ray Textures Texture Title: Short Description: Texture Source: It's probably most efficient to just cut-and-paste the source into this window. while not required.thinkquest. if entered. please describe it in whatever detail you feel is necessary within the source itself. but feel free to just type it in if you want. should be a terse description of the texture itself.org/3285/Contribute_Texture.User Contribution The Online POV-Ray Tutorial Texture Library . would be helpful and. Please only upload POV-Ray source to this library.The Online POV-Ray Tutorial: Texture Library .User Contribution The texture title is required may be anything you wish.

org/3285/gather/textures/model.thinkquest.The Online POV-Ray Tutorial: Texture - The Online POV-Ray Tutorial POV-Ray Texture: model Texture Library Main Page http://library.html [9/12/2001 3:31:55 PM] .

.0 color rgb [1.15>] http://library.. 0.0 color rgb } frequency 2.thinkquest.3. 0.0 color rgb } frequency 2.0 color rgb [1.0. 0. always interested in other textures!!! */ #declare T_DRFantasy = texture { pigment { bozo pigment_map { [ 0. 0.0 marble color_map { [0. 0.3 marble color_map { [0.0 turbulence 1. 0.0 ] [ 1.0.0 ] [ 0.2.0. 0.0.0 is highly recommended /* T_DRFantasy: Uses pigment_map{}: POV-Ray version 3.0.2>] <0. 0. uses pigment_map->POV3. 0.org/3285/gather/textures/TDRFantasy.6.0 <0. 0.0>] <0.html (1 of 2) [9/12/2001 3:32:06 PM] .1.0 turbulence 1.0.0>] <0.0 color rgb } frequency 2.0 is recommended I don´t know any material that looks like this.The Online POV-Ray Tutorial: Texture - The Online POV-Ray Tutorial POV-Ray Texture: T_DRFantasy green-pink-violet veins.0 marble color_map { [0.0>] <0. 0.ruhr-uni-bochum. If you like the texture or if you have any suggestions for the name of it. 0.Rozic@rz.0 color rgb [1. please e-mail me: Darko.0.de .5>] <0.0 turbulence 1.0.

05 diffuse 0.4 roughness 0.1 } finish { ambient 0.05 specular 0. 100> scale 0.6 reflection 0.The Online POV-Ray Tutorial: Texture - ] } turbulence 0.org/3285/gather/textures/TDRFantasy.4 metallic } } Texture Library Main Page http://library.5 rotate <20.thinkquest. 59.html (2 of 2) [9/12/2001 3:32:06 PM] .

0 color rgbft color rgbft } <0.1. <0..0.html [9/12/2001 3:32:16 PM] ..0.2.75> 0. 0.0.1. 1.8. <0..8 color rgbft color rgbft [0.6. 0.1.25>] 0.thinkquest.org/3285/gather/textures/Agate.. <0.3.8 color_map { Agate_Map } } Texture Library Main Page http://library..0.1. 0.1> 0.2. 0.0>] #declare Agate = pigment { marble turbulence 1. 0.The Online POV-Ray Tutorial: Texture - The Online POV-Ray Tutorial POV-Ray Texture: Agate Sort of a "Moss Agate" clear with green veining #declare Agate_Map = color_map { [0.0. 0.4.0.6.6.

0>] } turbulence 1.The Online POV-Ray Tutorial: Texture - The Online POV-Ray Tutorial POV-Ray Texture: Dying Star A fiery maelstrom of reds and oranges #declare DyingStar = texture { pigment { bozo color_map { [0. 1.5 color rgbf <0.0 color rgbf <1. 0>] } turbulence 0. 1>] [1.0 color rgb <0.0 color rgb <1.0 color rgb <0. 1. 1. 0. 1. 0.75 color rgb <0. 0.org/3285/gather/textures/DyingStar.0 color rgb <1. 1. 1. 1>] [0. 0>] [0. 1.html (1 of 2) [9/12/2001 3:32:19 PM] . 1>] } } } http://library.0 scale 1.5.5.0 color rgbf <1. 1.5. 0. 0>] [1.5 } } texture { pigment { granite color_map { [0.5 color rgbf <1. 0>] [1. 1>] [0. 0.2. 1>] [0.6.thinkquest.2 color rgbf <1. 0.3 scale 1/2 } } texture { pigment { agate color_map { [0. 1.3.

thinkquest.org/3285/gather/textures/DyingStar.html (2 of 2) [9/12/2001 3:32:19 PM] .The Online POV-Ray Tutorial: Texture - Texture Library Main Page http://library.

link thickness. please do so! Author & User-Contributed objects: q q triangular pyramid: Chain: This is an include file that creates a "Chain" object at the origin.The Online POV-Ray Tutorial: Object Library The Online POV-Ray Tutorial Object Library This is a list of POV-Ray objects that you can include in any scenes you create yourself.thinkquest. and some are objects contributed by other users of the Tutorial. link length. You specify the texture.org/3285/gather/object_lib. stretching along the +z axis. and number of links you want in your chain. (Which is from where all the really good stuff is going to come!) If you have an object of your own that you would like to contribute to the library. Some of them are provided in POV-Ray sample scenes. and it does the rest! mesilla: Eye: Source for the eyeball seen in the title image Top of Document Main Page q q http://library.html [9/12/2001 3:32:29 PM] . some are objects we have provided.

please describe it in whatever detail you feel is necessary within the object source itself. should be a terse description of the object itself. if your object needs further explanation. but you can just type here if you want.User Contribution The Online POV-Ray Tutorial Object Library . intersection." Thanks! Note: we check submissions frequently for their "appropriateness".The Online POV-Ray Tutorial: Object Library .html [9/12/2001 3:32:30 PM] . however. Anything deemed inappropriate will be removed from the library. User-Contribution Form for POV-Ray Objects Object Title: Short Description: Object Source: It's probably most efficient to cut-and-paste the source into this window. beginning with "#declare objectname = . it would help if it were in some way meaningful for the object you are contributing. you will need to enter the entire declaration. The short description. or difference. you need not define a camera or light sources for your object... if entered. Contribute this object Reset submission form Main Page http://library. while not required.thinkquest.User Contribution The object title is required may be anything you wish. Within your code.org/3285/Contribute_Object. Please only upload POV-Ray source to the library. would be helpful and. If your object is either a union. preferably as a POV-Ray comment.

all rights reserved http://www. Search The Library Search Raza Featured Sites! This month's featured entries are: Summer Fun Sites! Check them out! Any Match Tomorrow's Teachers ThinkQuest Junior Privacy Policy | Disclaimer | Terms of Use © 1995-2001.org/library/ [9/12/2001 3:32:47 PM] . 05:57:48 AM EST The ThinkQuest Library of Entries The ThinkQuest Library of Entries is the collection of educational web sites designed by participants in the ThinkQuest Contests.ThinkQuest Library of Entries ThinkQuest Participant ThinkQuest Library of Entries News See the ThinkQuest Junior 2001 Winners! Competitions My ThinkQuest Communities Calendar Library of Entries Featured Entries Browse or Search Advanced Search Winners IC 2000 Winners ScienceQuest Sites Policies Initiatives Help/Contact Resources Press Room About ThinkQuest About This WebSite Home ThinkQuest Exact Match Wed. ThinkQuest Inc. These sites have been organized to help you find what you need with an easy to use Index of Categories or search by keyword below.thinkquest. Teachers and learners can explore a multitude of topics. 12-Sep-2001.

html [9/12/2001 3:32:50 PM] .The Online POV-Ray Tutorial: Object - The Online POV-Ray Tutorial POV-Ray Object: triangular pyramid Object Library Main Page http://library.thinkquest.org/3285/gather/objects/triangularpyramid.

corresponds to length of individual link.05 /* HalfBoxP1 = bottom near left point of box used to cut torus in half HalfBoxP2 = top far right point of box used to cut torius in half -. major radius of torus. texture for the links of the chain. instances of the object and translate/rotate it however you like. stretching along the +z axis. MajR = [FLOAT].0. // Objects #declare WholeR = MajR + (2 * MinR) + 0.html (1 of 3) [9/12/2001 3:32:58 PM] . Brown Questions/comments: DrDave@POBoxes. minor radius of torus. After those are declared. add this line: #include "chain.The Online POV-Ray Tutorial: Object - The Online POV-Ray Tutorial POV-Ray Object: Chain This is an include file that creates a "Chain" object at the origin. declare the following: ChainTex = [texture].0&gt. 1997 /* INSTRUCTIONS: In your .05) #declare HalfBoxP2 = Origin + (x*WholeR) + (y*MinR + 0.inc" An object called Chain will be declared starting at the origin with the first link in the xz plane and extending NLinks along +z. and number of links you want in your chain.(x*WholeR) . link length. */ // Main Declaration Section #declare Origin = &lt.(y*MinR + 0. link thickness. MinR texture {ChainTex} } // Object used to cut torus in half before adding extenders to create a link.pov scene file. corresponds to thickness of a link. number of links you want the chain to contain.thinkquest. MinR = [FLOAT]. You specify the texture. NLinks = [INT].V.com April 25.0. and it does the rest! // // // // Chain Object Include File David J.05) + (z*WholeR) #declare Ring = torus { MajR.0. You can then add http://library.org/3285/gather/objects/Chain.05 is added length to ensure that cutting box extends past torus -*/ #declare HalfBoxP1 = Origin .

THEN translate.1 // Initialize the Chain // Correct for initializaton link #declare Count = 1 #while (Count &lt. MinR texture {ChainTex} } /* HalfRing: the original torus cut in half.The Online POV-Ray Tutorial: Object - #declare HalfBox = box { HalfBoxP1. ExtTrans: the +/.01 #declare HalfRing = difference { object { Ring } object { HalfBox } } // Definition of one completed chain link: #declare Link = merge { object {HalfRing} object {Extender translate ExtTrans+(-0. HalfBoxP2 texture {ChainTex} } /* Extender: the cylinder used to make the chain links oblong.org/3285/gather/objects/Chain. The chain will extend in the +z direction. Flip: flips the 1st HalfRing over about the x axis to line it up right.01*z)} object {Extender translate -ExtTrans+(-0.x translation factor to line the extender up with the HalfRing.(MinR*2)) * Count #declare LinkRot = z * Count * 90 #declare Chain = union { http://library.01*z)} object {HalfRing rotate Flip translate HalfTrans} } /* Now create a procedure to generate a chain of NLinks length.html (2 of 3) [9/12/2001 3:32:58 PM] .thinkquest. Created at origin and extends along the +z axis. or it'll all get screwed up! */ #declare Flip = x*180 #declare HalfTrans = z*MajR-0. MajR*z. to be translated later. */ #declare ExtTrans = x * MajR #declare Extender = cylinder {Origin.= NLinks) #declare LinkTrans = z * ((3*MajR) . HalfTrans: the +z translation to put the flipped HalfRing on to close the Link. Note: Flip first. */ #declare Chain = Link #declare NLinks = NLinks .

The Online POV-Ray Tutorial: Object - object{Chain} object {Link rotate LinkRot translate LinkTrans } } #declare Count = Count + 1 #end Object Library Main Page http://library.html (3 of 3) [9/12/2001 3:32:58 PM] .org/3285/gather/objects/Chain.thinkquest.

} plane {y..8&gt. &lt.05&gt. 0&gt. rotate -90*x } #declare Cajon = union { object {Cajon} object {Tirador translate &lt.. -1. 16 (los tiradores sobresalen un poco mas) */ #declare Tabla = difference { superellipsoid {&lt. 1. 23 Y: 0.. 6&gt.. 2. .05&gt.22. .} plane {y.2&gt.23.} object {Tirador translate &lt. 0&gt.2&gt. 0&gt. 1. -15&gt.html (1 of 2) [9/12/2001 3:33:01 PM] . 0&gt. 0&gt. 6.org/3285/gather/objects/mesilla.8 } #declare Cajon = difference { superellipsoid {&lt. 15.05. -13.25.25} cone {&lt. 0.05. 16&gt.4 Z: -18. 0. 0.0.-22.. 0..The Online POV-Ray Tutorial: Object - The Online POV-Ray Tutorial POV-Ray Object: mesilla /* X: -23.. 6.} } #declare Pata = cone {&lt.-12.12. .25.20. &lt.8*y scale &lt.8} translate -0.0.thinkquest.8} translate -0. &lt.. 1.25.0.0.25. -13.0.8*y scale &lt. 45. texture {T_Wood10 scale 10 rotate 89*y} } http://library.35} #declare Mesilla = union { box {&lt. 0} rotate -90*x scale . 2. 0. -1. 0. -15. } #declare Tirador = union { sphere {&lt.

-12.8&gt. 14. 20. -16.2.0. 15.-18. 15. -16. texture {T_Wood10 scale 10 rotate 89*y} } object {Cajon translate &lt. 11&gt.html (2 of 2) [9/12/2001 3:33:01 PM] . -16.8&gt. &lt.} object {Tirador translate &lt. 11&gt.2.22. texture {T_Wood10 scale 10 rotate 89*y} } box {&lt. texture {T_Wood10 scale 10 } 7.22. -15.-22. 13. -11&gt. 0&gt. -16.18.. 15&gt.-22.0. -15&gt. 7.org/3285/gather/objects/mesilla. &lt.-12. 15.} -7. 0&gt.thinkquest.0.0. -20. texture {T_Wood10} } object {Tirador translate &lt. texture {T_Wood10 scale 6 rotate 89*y} } object {Pata translate &lt. texture {T_Wood10 scale 6 rotate 89*y} } object {Pata translate &lt.2&gt. 7..2&gt. -13. rotate 89*y translate &lt. -15. -16.0. rotate 89*y translate &lt. } Object Library Main Page http://library.-18.2. 29. texture {T_Wood10 scale 6 rotate 89*y} } object {Pata translate &lt. 0&gt.0. -16. -15. texture {T_Wood10 scale 10 rotate 89*y} } object {Tabla rotate 180*z translate &lt. 13.8&gt. texture {T_Wood10 scale 10 translate &lt. -11&gt. -15&gt.} } object {Tabla translate &lt.18. texture {T_Wood10 scale 10 } object {Cajon translate &lt. texture {T_Wood10 scale 6 rotate 89*y} } translate &lt.2.0. texture {T_Wood10} } object {Pata translate &lt.The Online POV-Ray Tutorial: Object - box {&lt. 0&gt.2. 0&gt. 0&gt.0.

0 color White] } scale 2 } } } Object Library Main Page http://library.thinkquest.The Online POV-Ray Tutorial: Object - The Online POV-Ray Tutorial POV-Ray Object: Eye Source for the eyeball seen in the title image #declare Eyeball = sphere { <0.225 color Clear] [0.org/3285/gather/objects/Eye. 0> } } texture { pigment { wood color_map { [0. 1 texture { pigment { granite color_map { [0.html [9/12/2001 3:33:03 PM] .225 color Black] [0.2 rotate <90. 0.0 color LightBlue] } scale 1/3 turbulence 0.45 color Clear] [0. 0.5 color SteelBlue] [1. 0>.0 color Black] [0.45 color White] [1.0 color LightBlue] [0.

The values in the text fields correspond to the components in a POV-Ray color vector. you need a better display. the resulting POV-Ray color vector would be <0. enter the values in the text field (from 0.org/3285/color_tool.0. Note that the more colors your terminal can display. a green component of 0. For example. and a blue component of 0.5.75.5. if you have found a color you like with a red component of 0. 0. Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.0) or slide the scrollbars. 0>. If the square on the left stays black. the more accurate the Color Tool will be. you may not get an accurate reading.html [9/12/2001 3:33:11 PM] .The Online POV-Ray Tutorial: Color Tool The Online POV-Ray Tutorial Color Tool To find the color you need.0 to 1.thinkquest.75. If your terminal cannot display many colors.

Rendered by Grant Emery. Beware.The Online POV-Ray Tutorial: Example Scenes The Online POV-Ray Tutorial Example Scenes Here we have some example scenes and their source. All scenes here were rendered by the authors. (Source) http://library. The title image for the Tutorial. some of the images are rather large.html (1 of 2) [9/12/2001 3:33:43 PM] . so you can see how different things were done. (Source) "The Last Outpost" by Grant Emery.org/3285/scenes_lib.thinkquest. (Source) A landscape inspired by The Martian Chronicles (Ray Bradbury). Rendered by William Morgan.

(Source) Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.html (2 of 2) [9/12/2001 3:33:43 PM] .The Online POV-Ray Tutorial: Example Scenes "On Display" by Grant Emery. (Source) "Columns" by Grant Emery.org/3285/scenes_lib.thinkquest.

http://library.jpg [9/12/2001 3:34:46 PM] .thinkquest.org/3285/scenes/title.org/3285/scenes/title.thinkquest.jpg http://library.

1.org/3285/scenes/title. 0>.5.0 color White] } scale 2 } } } http://library. 1 texture { pigment { granite color_map { [0/2 color LightBlue] [1/2 color SteelBlue] [2/2 color LightBlue] } scale 1/3 turbulence 0. 1/6. 0> } } texture { pigment { wood color_map { [0. 1> rotate <-90. -1.thinkquest. 2. -0.5. 0. 0.org/3285/scenes/title. 0.2 rotate <90.225 color Clear] [0.inc" #include "textures. 4 pigment { checker color rgb <1.5> } /* the floor */ disc { <0.5. 0> scale 1.45 color Clear] [0. 0. 0. 0> scale 1/2 } } #declare Eyeball = sphere { <0.225 color Black] [0. y.http://library.2 rotate <7.inc" #include "stones.inc" /* the letters */ height_field { gif "c:\temp\titleimg.2 } scale 1/4 } translate <-0.gif" water_level 0.thinkquest.pov #include "colors.45 color White] [1.01 texture { Stone13 finish { phong 0. 1> color rgb <0.0 color Black] [0. 0.pov (1 of 3) [9/12/2001 3:34:47 PM] .5> scale <358/191. 0>.

1>] [0.org/3285/scenes/title. 0. 0> } finish { diffuse 0 ambient 0. 0> translate <0.5.6.3. -0.25 color rgbf <1.thinkquest.5> http://library. 1>] [0. 0.0 color rgb <1. 0. 0> rotate <-55. 1>] } scale 20000 } finish { diffuse 0 ambient 0. -0.25> texture { Silver2 } rotate <0. 0.thinkquest. 1.9 } } } light_source { <50. 1. 0.http://library.01.pov (2 of 3) [9/12/2001 3:34:47 PM] .7. 0. 1. 0.9. 1.25.1 color rgb <1. -500> color rgb <1. <0.0 color rgb <1. -2> look_at <0. 10000 texture { pigment { radial color_map { [0. 1>] [1.5 color rgb <0. 0. 1>] [1. 0> } /* the reflective box in the upper right */ box { <-0. -45. -0.5> } camera { location <0. 1.9 } } texture { pigment { wood color_map { [0. 0>. 150. 1. 1. 1.5.7. 45. 0> } /* sky sphere with sunrise texture */ sphere { <0.25.org/3285/scenes/title.pov object { Eyeball scale 1/3 rotate <45.25>.0 color rgb <1.25. 0> translate <-0.25. 1>] [0.7. 1. 1>] } frequency 12 rotate <90. -0. 1. 0.0 color rgbf <1.

org/3285/scenes/title.pov (3 of 3) [9/12/2001 3:34:47 PM] .thinkquest.org/3285/scenes/title.pov } http://library.http://library.thinkquest.

jpg http://library.thinkquest.org/3285/scenes/mars3.org/3285/scenes/mars3.jpg [9/12/2001 3:35:21 PM] .thinkquest.http://library.

5 } } camera { http://library.247.501.185 .3> } normal { dents . -42. .http://library.5> #declare MountainT = texture { pigment { bozo turbulence . -12. 200.31.-75> camerapos = <10.org/3285/scenes/mars.pov (1 of 3) [9/12/2001 3:35:22 PM] . .thinkquest. . 100.thinkquest.25 color_map { [0.32. 50> moonpos = <-450.5. 1 color Brown color MarsRed ] } } normal { bumps 1 } finish { crand .5.5. . 1> Black = color rgb <0.501 color Gray color Gray] [.05 } } #declare PlainsT = texture { MountainT normal { bumps 1 } normal { dents 1 } scale 1/5 } #declare SkyT = texture { pigment { granite turbulence 1 color_map { [0. .pov #include "ruins.5 } normal { bumps .01.165.01 color Black color Black] } } finish { ambient 1 } } #declare MoonT = texture { pigment { color rgb <. .3.org/3285/scenes/mars. .01 color White color White] [. 1. . 0. 1.185> White = color rgb <1. . -130> Brown = color rgb <.inc" #declare landsize = 200 #declare landheight = 100 #declare #declare #declare #declare #declare #declare #declare #declare #declare lightpos = <-250.5 color Black color Black] [. . 0> Gray = color rgb <. 800> ruinspos = <0.165> MarsRed = color rgb <.

thinkquest.http://library. 0>.08 scale <landsize.<0. 0> radius 5 falloff 10 tightness 10 } /*light_source { lightpos . . -landsize/2> texture { MountainT scale 10 } } // sky sphere { <0. 1.pot" smooth water_level . 0>.05> distance 1000 }*/ light_source { lightpos color White } light_source { lightpos + <1. 0> } // moon sphere { moonpos.05. 100 texture { MoonT scale 10 } no_shadow } http://library. 1.thinkquest. 0. 0. 1. 1000 texture { SkyT scale 250 } no_shadow } // plains disc { <0.pov location camerapos look_at camerapos * <0. 0.org/3285/scenes/mars.pov (2 of 3) [9/12/2001 3:35:22 PM] . 180 texture { PlainsT scale 10 } translate <0. 0> radius 5 falloff 10 tightness 10 }*/ // mountain range height_field { pot "marsmnt. 0.<20. <0.<20. 0> color White spotlight point_at moonpos . -42. 0. 0> color White } light_source { lightpos . 0>. landheight. 0. 1.05.<1. 0> color White } light_source { lightpos + <0. 0> } /*fog { color rgb <. 0> color White spotlight point_at moonpos .org/3285/scenes/mars. . landsize> translate <-landsize/2. -landheight/2.

<0.25 translate ruinspos } //light_source { camerapos + <0.pov // ruins object { Ruins scale .http://library. 0> color White } //light_source { camerapos .thinkquest. 1. 0> color White } http://library.org/3285/scenes/mars. 1.org/3285/scenes/mars.pov (3 of 3) [9/12/2001 3:35:22 PM] .thinkquest.

org/3285/scenes/outpost.jpg [9/12/2001 3:38:46 PM] .thinkquest.org/3285/scenes/outpost.jpg http://library.http://library.thinkquest.

0. 0. 1>] [0.6>] } scale 0. 100> } plane { // water y.25> } } #declare mnt_txtr_2 = texture { pigment { bozo color_map { [0.1 scale <0. 0.thinkquest.8>*/ } normal { ripples 0. 1. 0> translate <1.3 color rgbf <1. 0.01 } } #declare sky_col = color rgb <159/255. 0.thinkquest.6. 0>] [1. 1. 36> island_size = 25 island_top = island_cen + (sea_level + island_size/2 + 2) * y dish_cen = island_top + 10 * y #declare mnt_txtr_1 = texture { pigment { gradient y color_map { [0.8 } } height_field { gif "fract002.0 color rgb <0. -90. 1.0. 0. 0.0 color rgb <0. 2.gif" // water_level 0. 0. 0> scale <100.0 color rgb <0.0 color rgbf <1. 1. 55/255> #declare sky_tex = texture { pigment { bozo color_map { [0. 0.4>] [1.8.0 color sky_col] [0.35 color rgbf <1. 0. mnt_size. 0>] } } finish { ambient 0. sea_level pigment { color rgb <0.org/3285/scenes/outpost.pov (1 of 5) [9/12/2001 3:38:48 PM] .6.25. 0>] } turbulence 0.196078.pov #declare #declare #declare #declare #declare #declare mnt_size = 75 sea_level = mnt_size / 4 island_cen = <39.5. 0. 0. 0.5> /*rgb <0. 127/255.25 texture { mnt_txtr_2 } texture { mnt_txtr_1 } rotate <0. 1. 0.5.org/3285/scenes/outpost. 1.5 translate island_cen http://library. 1>] [0.http://library.75 color rgb <0.

100. 1. dish_cen. 0. 1.org/3285/scenes/outpost.thinkquest. 1> } } #declare build_base_txt = texture { pigment { color rgb <0.pov" object { fl_island scale island_size translate island_top texture { mnt_txtr_2 } } cylinder { island_top.5 } } #include "dish.7. 0> } finish { specular 0. 0.pov } finish { reflection 1.thinkquest.7> } finish { specular 0. 0. 0>. 0.5 } } */ #include "fl_islan. 0. <0. 100> } } bounded_by { clipped_by } } /*#include "claw. 0. 0. -30> translate dish_cen pigment { color rgb <1.7. 1> } finish { reflection 0. <100.http://library.pov (2 of 5) [9/12/2001 3:38:48 PM] .8 } } #declare win_txt = texture { pigment { color rgb <1.pov" object { claw_set scale 5 translate island_cen + island_top * y pigment { color rgb <0. 1.pov" object { dish rotate <0.5 pigment { color rgb <0.4.5 texture { material_map { gif "winmap.org/3285/scenes/outpost. 0.gif" map_type 2 texture { build_base_txt } texture { win_txt } } http://library. 0.0 } clipped_by { box { <0. 0>. 180. 0>.7> } finish { specular 0.5 } } #declare building = cylinder { <0.

6> translate <0.http://library. 1. 0. 2. 2 } } sphere { <0. 0. 0. 2. 0> } translate island_top } union { intersection { object { building scale <6. 0> rotate 60*y translate island_top } union { intersection { object { building scale <6.pov (3 of 5) [9/12/2001 3:38:48 PM] .thinkquest. 0>. 4.org/3285/scenes/outpost. 0. 4.5 texture { build_base_txt } scale <6.thinkquest. 6> translate <0. 4. 0. 2. 0> texture { build_base_txt } } translate <3. 6> } sphere { <0.5 scale <6. 0. 0>.pov } } union { object { building scale <6. 0> texture { build_base_txt } } translate <3. 0. 6> } plane { y. 4.5 scale <6. 0. 6> } plane { y. 6> translate <0. 0>. 0> rotate 120*y translate island_top } http://library. 1 texture { build_base_txt } } } sphere { <0. 2.org/3285/scenes/outpost.

0. 50. 0> translate <8. 1> } } } union { cylinder { <0. 0.thinkquest.5.pov (4 of 5) [9/12/2001 3:38:48 PM] .500000. 1.000000.000000. 0. 0 <0. <1. 0. 0. 0. 0.000000.000000. 0>. 2500.8.196> } finish { specular 0. 0. 6. 0.000000. 0. -500> color rgb <1.org/3285/scenes/outpost. 0.000000. 0. 0. 5500>.000000. 0.http://library. 0. 5. -1>. 0. 1> } camera { location <15. 0>.75.org/3285/scenes/outpost.75.000000.500000. 0.pov /* the flag and flagpole */ #declare flag = object { cubic { <-0. 2500 open texture { sky_tex scale 200 } no_shadow } /*fog { color rgb <0. -0.obsolete if fog is used. 0. 0. 0. 0.000000. <0. 0. 6. 0. 0. 45.2.000000.8 } } object { flag pigment { hexagon color d_col color d_col_2 color d_col_2 rotate <90.9. 0. 0>. but looks cool anyway <3500.498.000000.8 } } sphere { <0. 0> scale 0.000000.000000. 0. 0> rotate <0.000000.91.5> distance 60 } */ light_source { <-3000. 0. 0. 0. -5> http://library.1 pigment { color rgb <0.2 pigment { color rgb <0. 0. 1.000000.5 } translate <1.5. 10. 0.2.thinkquest.000000. 0. 0>.98> } finish { specular 0.25. 0> translate island_top } cone { // sky -.000000. 0> } rotate <0.000000> } clipped_by { box { <-1.

org/3285/scenes/outpost.org/3285/scenes/outpost.thinkquest.http://library. 50> look_at <40. 30.thinkquest.pov (5 of 5) [9/12/2001 3:38:48 PM] . 35. 50> http://library.pov // } look_at <65.

jpg [9/12/2001 3:40:00 PM] .thinkquest.http://library.jpg http://library.org/3285/scenes/froo.thinkquest.org/3285/scenes/froo.

5 + 4 * 5/6.5/22.inc" #default { finish { ambient 0. 3 + 5/22. 0>. 0. 0. 0> } } http://library.5> } cylinder { <-4. 2.thinkquest.inc" #include "textures.5> } object { groove translate <-2. -2. -2. 1 } plane { x .5. 0. } sphere { <0. 5/22 5/22 #declare groove_bunch = union { object { groove translate <-2. 3 + 5/22. 0. 0>.5 + 3 * 5/6. 0. -2. 0.z.5 + 2 * 5/6.5> } object { groove translate <-2. 0 } plane { -x . 3. 2. 9 . } cylinder { <0. -3.5> } object { groove translate <-2.5/22.pov #include "colors. 0.org/3285/scenes/froo.5. -2.z. <3. -3. -3. 0>.org/3285/scenes/froo.pov (1 of 11) [9/12/2001 3:40:04 PM] . 9 . -2.5>.inc" #include "stones. } } { 5/22 <0.5> } object { groove translate <-2.3 } } #declare groove = union sphere { <0.5 + 5 * 5/6. 90.5> } } #declare pedestal_end_4 = difference { box { <-3. 0>.5. 0 } texture { Rosewood scale 2 rotate <0. 2.5> } object { groove translate <-2.5 + 5/6. <4.5>.http://library.thinkquest. -2.5>.

180.org/3285/scenes/froo. 2.5. 12. 0. 0> translate <0.5. 2. 10. 0> } object { groove_bunch rotate <0.5> } } } #declare pedestal = union { difference { object { pedestal_end rotate <180. -2. 0. 90.5.5> } object { groove_bunch } object { groove_bunch rotate <0.5>.5. 0> } box { <-2. 2.http://library. 13. 0.5.5.5. 0> scale 2 } } object { pedestal_end } bounded_by { box { <-3. 0> } object { pedestal_end_4 rotate <0. 0> } texture { Rosewood rotate <90. 14.5> http://library.5>. <3. <2. 0> } bounded_by { box { <-3. -3.5.thinkquest. 0> } object { groove_bunch rotate <0. <2. 2. 270. 180. <3. 0.org/3285/scenes/froo. -2.5> } } difference { box { <-2. 3.5>.pov (2 of 11) [9/12/2001 3:40:04 PM] . 0> } object { pedestal_end_4 rotate <0. 3.pov #declare pedestal_end = union { object { pedestal_end_4 } object { pedestal_end_4 rotate <0.5>. 90. 11. -3.thinkquest. 270.

75. 2. 6.0 translate <3.4>.4> } } difference { box { <-2.5 // Glass } translate <0.1 refraction 1 ior 1.00 color rgb <0. 0.4.org/3285/scenes/froo. 11.00 color rgb <0. 2.4.4. 4. 2.25> } } } union { object { pedestal } object { case pigment { color rgbf <1. 0. 2.4. -2.66 color rgb <0.5> } box { <-2. 0.4.4. 5. 1> } finish { reflection 0.http://library. -1.5>.75>] [1. 0>] [0.4. -2.4>. 0.4>.pov } } } #declare case = union { difference { box { <-2. -1.75. 1. 0>] [0. 3> } box { <-2.5. 5.5. 2.5.75. -2.pov (3 of 11) [9/12/2001 3:40:04 PM] . 0.thinkquest.5>.gif" http://library. 0.4.9. <2. 0.50 color rgb <0. 0>] [0.4> } box { <-2.33 color rgb <0.4>. -2. 4. -2. 0>] } scale 3 turbulence 1. 0.4> } pigment { color rgb <0.org/3285/scenes/froo. 0.5. <2.75. <3. -1. 12. 1. <2. 12. -3>. 2> // random location } /* image_map { gif "pedestal. 0> } box { <-2. -1. 4.5> } box { <-3.75.4> pigment { gradient y color_map { [0. 2. 0.9. <2. <2.9.thinkquest. 4. <2. -2.

thinkquest. 0.5.5 green 0.1 blue 0.5. -2> } /*#include "tjsym.org/3285/scenes/froo.0. 0. 0> translate <-2.http://library.5/2 rotate <0.pov" object { dodeca scale 3.gif" texture { // White Marble pigment { White_Marble } finish { reflection 0. 14. 0.1 green 0. 0. -2> pigment { color Gray80 } } */ /*#include "dodeca.3 } } translate <-2.5 http://library. 0.5 blue 0. 0 texture { material_map { gif "matmap.5 green 0.5.pov (4 of 11) [9/12/2001 3:40:04 PM] .org/3285/scenes/froo.5> scale 5 } */ finish { brilliance 0. 90> translate <-2.5/2 // rotate <90.5. 1.5 blue 0. 0> translate <-0.8.8 color red 0. -2> texture { Stone13 } } */ #include "icosa.pov" object { icosa scale 3.1 color red 0.thinkquest.01 color red 0. -0.5] [0.5/30 translate <-2. 14. 14.1 } } texture { // Black Marble pigment { marble turbulence 1 color_map { [0.pov interpolate 2 } rotate <90. 0. -2> texture { Stone9 } } plane { // the floor y.pov" object { tjsym scale 3.

8 blue 0. 0>. 0>. 1 } plane { y.thinkquest.org/3285/scenes/froo. 1.5 phong_size 80 metallic } } } scale 10 rotate <90.gif" interpolate 2 } scale 10 } } #declare wall = union { plane { -z. 1 } } quadric { <0.org/3285/scenes/froo.thinkquest.8] } rotate <0. 0. 0.pov (5 of 11) [9/12/2001 3:40:04 PM] . 0> } } object { wall pigment { color White } translate <0. 0> } finish { reflection 0. <0. 30> } http://library.2 diffuse 0. 1. <0. 0.1 } } texture { // Gold pigment { color BrightGold } finish { ambient 0.pov color red 0. 0> } } #declare wall_texture = texture { pigment { image_map { gif "wp_flor7.5 brilliance 6 phong 0. 0 texture { wall_texture } } intersection { plane { -z. 1>. -1 translate <0.7 reflection 0.http://library. 0. 90.8 green 0.

0. 0.000000. 0. -1 } plane { z. 0> translate <-4. 0.000000. 0.thinkquest. 0.pov object { wall pigment { color White } rotate <0.000000.25. 1 } bounded_by { box { <-0. 0>.000000. -4. -5> } cylinder { <-2. 0. 1.222222.000000.thinkquest. <0.5.http://library. 2. 0. 2.000000. 0. 0. 2>. -1.5.25 } plane { y.75. -1> } box { <-0. 0>. <0. -1.75. 0.25 } plane { -x.25. -1>. <0.5.pov (6 of 11) [9/12/2001 3:40:04 PM] . 1 } cylinder { <-0. 0. 2>. 0. 0> translate <-30. -90.000000.000000. 0. -2> } /* intersection { cubic { <0.5. 0.org/3285/scenes/froo.25. 0>. <0. 0. 0. 0.000000. 0. -3>.org/3285/scenes/froo. 0. -4. 0.000000.25.25.25.5. <0.000000. <2.25.75 http://library. 0. 1. 0. -5>. <2.25.25. -4> } } } #declare shelf_top = intersection { union { box { <-2. -3. <0. -1.000000. -5>. -1 } } */ cylinder { <-0.25. <0. -4> } box { <-0. 0> } #declare shelf_support = difference { union { box { <-0. 0> inverse } plane { x.25. -3. -2.5.000000> rotate <90.25. -1>. -1. 0>.000000.5. 0.000000. -3>. 1 } } cylinder { <-0. 0. 0. -1.000000.000000. -1.000000.000000. 0. -1>. 0.

0>.75 } sphere { <-2. -5>. <3.5.5 } plane { x + y.5.75 } } plane { y.pov (7 of 11) [9/12/2001 3:40:04 PM] .5. 0 } plane { -(-x + y). 30> } object { shelf translate <8. -5>.25. -10.thinkquest.75. 0. 0.5. 0>.75.5. 0>. <2. 0.org/3285/scenes/froo. 10. 0.thinkquest. 0.pov } cylinder { <-2. 0>.75. 0. -5>. 0.http://library. 0.75.5. 8. 0.5. <-5. 8. 0. 0> texture { Rosewood } } } object { shelf translate <-10.org/3285/scenes/froo. 0. 0 } } #declare picture = union { object { http://library.75.75> } } } #declare shelf = union { object { shelf_top texture { Rosewood scale 2 } } object { shelf_support translate <1. 0. 0. -5>. <-2.5 } bounded_by { box { <-3.75 } sphere { <2. -5.75 } cylinder { <2. 0.5.25. 0.75. 0>.5. 0. 0> texture { Rosewood } } object { shelf_support translate <-1. 30> } #declare frame_4 = intersection { cylinder { <-5.

10> } union { sphere { // the pot for the plant <0.tga" interpolate 2 } scale 10 translate <-5. 0.org/3285/scenes/froo. 2 } } } translate <-10. 0. 270> } box { <-5. -90. 0>. <5. 0.01> pigment { image_map { // gif "aliens.5 } } scale <3/2.25. 0. 1.75.pov frame_4 } object { frame_4 rotate <0. 0. 2> } } texture { Copper_Texture normal { wrinkles 0. 90> } object { frame_4 rotate <0.5 } } } plane { y.5 pigment { color DarkBrown } clipped_by { sphere { <0. <2.org/3285/scenes/froo. -5. 0>.75.http://library. -0. 0>. 0. 0. 5. 0> } finish { ambient 0.thinkquest. -2>. 27. 9. -5. 1> texture { Silver_Texture } } object { picture rotate <0.pov (8 of 11) [9/12/2001 3:40:04 PM] .5> } http://library. 10.thinkquest. 180> } object { frame_4 rotate <0. 2 clipped_by { box { <-2. -0.gif" tga "d:froo. 0> scale 4/5 translate <-30.

-2. 0. <0. <0.3 } cylinder { <0. <0.pov" object { narfcrys scale 0. 10.5>. -1.5.5. -2.5> } #declare lamp_fixture = union { cylinder { <0. 0. -2.75 open texture { Gold_Texture } } union { cylinder { <0. -1.5>. 8. <0. -1. -2.5>. 0>.org/3285/scenes/froo. 1.pov" object { narftree scale 0. 27.pov (9 of 11) [9/12/2001 3:40:04 PM] .5>. 0.5> color rgb <2. 0>. -2. 0. <0.5>.5>. 0>.02 translate <-10. -1. -0.3 rotate <0.http://library.5>.org/3285/scenes/froo. -2. 27. 8. 0.75 open texture { Gold_Texture } } cylinder { <0. 0. 0.25 clipped_by { cylinder { <0.1>. 0. -2. 2> spotlight point_at <8. 0.5. 1. 2.75 } pigment { color Black } finish { Shiny } } } object { lamp_fixture translate <8. 0. 30.pov #include "narftree.5> radius 22 falloff 26. 20. 1. 27. <0. 0> translate <8.5>. 0. 26. 0.5>. 30> } light_source { <8. 1.75 open pigment { color Black } finish { Shiny } } cylinder { <0.75 inverse } } } cylinder { <0. -2.5> } #include "narfcrys.5>. -2.thinkquest.thinkquest. 20.5.56505 http://library. -0. 0. <0.

5.56505 } object { lamp_fixture rotate <0. 2. 1. 30. 0> translate <-30.5.5> radius 22 falloff 26. 20.http://library. -10> color Gray60 spotlight point_at <-2. 6> color Gray60 spotlight point_at <-2. 10> color rgb <1.56505 } // four spotlights centered at <-2. 30.pov } object { lamp_fixture translate <-10. 10. 30. 2> spotlight point_at <-10. 10. 6> color Gray60 spotlight point_at <-2. -2> radius 13 falloff 22 } light_source { <-10.thinkquest.org/3285/scenes/froo.5.org/3285/scenes/froo. -90. -10> color Gray60 spotlight point_at <-2. 10> } light_source { <-27. 30.5> color rgb <2. -2> light_source { <6. 12. 30.thinkquest. -2> radius 13 falloff 22 } light_source { <6. 30> } light_source { <-10. 27. 12.pov (10 of 11) [9/12/2001 3:40:04 PM] . 12. 27.5. 20. 10> radius 22 falloff 26. -2> radius 13 falloff 22 http://library. -2> radius 13 falloff 22 } light_source { <-10.5> spotlight point_at <-27. 20. 1. 12. 20.

0> location <10. 8. 30> // location <8. -20> color rgb <1. 27. 11.9.thinkquest. 15.pov } //light_source { <40. 27.org/3285/scenes/froo.5> } // all-illuminating http://library.5> // look_at <7.org/3285/scenes/froo. 0> // location <-10. 20> // look_at <-10.pov (11 of 11) [9/12/2001 3:40:04 PM] . 15. 19. -18> look_at <0. 1> } camera { // location <15. 20.http://library. -15> // look_at <0. 1. 11. 11. 40.thinkquest.

jpg http://library.org/3285/scenes/rcolumn2.thinkquest.thinkquest.jpg [9/12/2001 3:41:04 PM] .http://library.org/3285/scenes/rcolumn2.

75. <0.org/3285/scenes/rcolumns2.5.5. 0.25. 0. 2. 2.5.5> rotate y * -30 } object { Fluting translate <0. 0>. 0>. 1.0.5. 0>. 0>.5. -0.5> } object { Fluting translate <0.125 translate <0. <0.125 translate <0.inc" #include "textures.5 } difference { cylinder { <0.http://library.5> rotate y * -60 } object { Fluting http://library.0.0625 } sphere { <0. -0.0. 2. <0. -1.thinkquest. 0>.0. 1. 0.pov #include "colors. -1.0625 } } #declare Column = difference { // the column union { difference { // top of the column cylinder { <0.0.25.625.pov (1 of 4) [9/12/2001 3:41:06 PM] . 0>.org/3285/scenes/rcolumns2. 0>. 0>. 0.5.inc" #include "stones. 0> } } cylinder { // main cylinder of the column <0.625. 1. 0>.0625 } cylinder { <0. 0. 1.0.625 } torus { 0. 0> } } } union { // the vertical spaces in the main cylinder object { Fluting translate <0. 1.thinkquest.625 } torus { 0.<0.inc" #declare Fluting = union { // use with difference to flute the column sphere { <0. 2. 0>. 0.25. -0.

pov translate <0. 0>. rotate y * -240 } object { Fluting translate <0. rotate y * -150 } object { Fluting translate <0.5> -0.org/3285/scenes/rcolumns2. 1.5> -0. rotate y * -180 } object { Fluting translate <0. 1.5> rotate y * -90 } object { Fluting translate <0. -0.75.5. 1. 1.5.thinkquest. <0. 2.5> -0. 0. rotate y * -330 } } bounded_by { cylinder { <0.5.5.5> -0.5.pov (2 of 4) [9/12/2001 3:41:06 PM] .5.org/3285/scenes/rcolumns2. rotate y * -120 } object { Fluting translate <0.5.625 } } } object { Column texture { White_Marble finish { phong 1.5> -0. rotate y * -210 } object { Fluting translate <0.5> -0. 1.5> http://library. 1.5.0.5> -0.5.http://library. 1. rotate y * -270 } object { Fluting translate <0.thinkquest. rotate y * -300 } object { Fluting translate <0. 0>.0 phong_size 90 } } } sphere { -0. 1. 1.

25 } http://library.25.0 phong_size 90 } } } box { <-0. 1.25> rotate <45.25>. -0.pov (3 of 4) [9/12/2001 3:41:06 PM] . 0.25.5. 3.org/3285/scenes/rcolumns2. 0. 0.3 } } object { Column translate <-2. 0>. 1> translate <0.pov <0. 2.25. 35. 3. 0> } } plane { y.5 scale <1. <0.5 texture { Stone21 } finish { reflection 0. 0>.0 phong_size 90 } } } */ union { sphere { <0.25. 0. 0> texture { Stone18 translate <1. 0. 1 } bounded_by { cylinder { <0. 0>.org/3285/scenes/rcolumns2. 0.thinkquest. 0> texture { Stone9 } } object { Column translate <2. 0> texture { White_Marble finish { phong 1.25> finish { phong 1.5. 0. 0>. 2. 0.0.2> translate <-2.25. 0. 1.5.0. 1. 3. 0. 0.5 } } translate <2. -0. 0>. 1.5 } torus { 0.0 phong_size 90 } } } /*intersection { difference { cylinder { <0. 0>.http://library. 0> texture { White_Marble finish { phong 1.thinkquest. <0. <0.

org/3285/scenes/rcolumns2.25. -5> look_at <0. -3 } plane { -x . 6. 0> radius 25 falloff 35 tightness 5 } light_source { <-3. 1. 0.thinkquest.25.083333.pov cone { <0. -0.25. 1. 6.75.25.3 } } } // the floor and the walls union { plane { y.http://library.235702 <0. -0. <0. 2.z. 0>. -2> color rgb <1. 1. 0 } bounded_by { box { <-0.25. 0> texture { Stone18 finish { reflection 0.5.25> spotlight point_at <0.pov (4 of 4) [9/12/2001 3:41:06 PM] . 3.25> } } translate <2.25.z. 0>. 2. 0 texture { Sapphire_Agate } } plane { x . -2> color rgb <1.25. -0.25> spotlight point_at <0.thinkquest. 1. -3 } texture { Polished_Chrome // finish { phong 0 diffuse 0 metallic } } } camera { location <0. 0. 0.75.25>. 0> radius 25 falloff 35 tightness 5 } http://library. 0> } light_source { <3.org/3285/scenes/rcolumns2.75. 3. -0. 2.

Win95/NT) Breeze Designer. where you can get the official binaries for many platforms.raytracing FAQ A novices guide to getting started with POV-Ray POV-Ray's pseudo-FTP site. draws from a base of over 7000 files in 200 different file areas q q q Main Page http://library. a freeware modeller for Win95/NT/32s Texture Magic.org/3285/resource_lib.html [9/12/2001 3:41:12 PM] .thinkquest.0 documentation in HTML format An online request form from The Tackle Box BBS for users to personally request any obscure or hard-to-find POV-Ray/raytracing related files from the SysOp of that BBS.The Online POV-Ray Tutorial: Object Library The Online POV-Ray Tutorial POV-Ray Resources Links for Beginners q q q The comp. and countless other POV-Ray utilities/related programs POV-Ray Related Files q q q q q POVAFX. another shareware modeller for POV-Ray (DOS only) SCED. an interactive texture editor for Win95/NT POVLAB.rendering. a great place to see all manner of spectacular raytraced images. a constraint-based scene designer for Unix/XWindows Other Online Resources q q The Official POV-Ray Site The Internet Raytracing Competition. an unofficial version of POV-Ray with simple atmospheric effects (MSDOS.graphics. And most of them include the source! A great online texture library The POV-Ray 2.

We advise that users interested in the new features of POV-Ray 3. POV-Ray 3.thinkquest. including ground fog. Unfortunately.html [9/12/2001 3:41:15 PM] . we were not able to document all of the additions in time. focal blur.0 consult its documentation after having gone through the Path of Learning.0. and iterative functions.2. POV-Ray 3. and everything found in here will work with POV-Ray 3. Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.0 contains many exciting new features.The Online POV-Ray Tutorial: POV-Ray Update The Online POV-Ray Tutorial POV-Ray Update During the creation of this Web page.org/3285/update.0 was released. The Tutorial covers POV-Ray 2.

you should be well on your way to creating some exciting pictures before you're far along this tutorial. you will learn what ray-tracing is. or sculpt) that may take years to master. In more precise terms. is not a speedy process). One of the most important advantages of computer-based ray-tracing over more "orthodox" art forms is that it removes the need for technical skills (such as the ability to paint. Later on in the tutorial you will learn how to use the POV-Ray software to create scenes of your own. Certain types of scenes are difficult or impossible to create with ray-tracing software. you will find that ray-tracing is good at generating mathematically simple objects. Usually. what POV-Ray is. How does ray-tracing work? 3. and can open exciting possibilities as a new method of creating visual art. and usually in some human-readable format) is converted. how it works. with the help of your computer. ray-tracing is the process of mathematically generating near-photorealistic images from a given description of a scene via geometrical modeling of light rays. and poor (slower or more difficult to describe) at generating more complex objects. What is POV-Ray? 4. by the computer. What is ray-tracing? 2. is usually done by computer (and even then. and how POV-Ray relates to the rest of the ray-tracing world. like a human face. ray-tracing is not a magical technique that makes all art easy. There are several ways of getting around these barriers. such as those composed of spheres. like all forms of art. http://library. as such. Ray-tracing can require millions and even billions of complex mathematical calculations and. into an actual image of the scene.The Online POV-Ray Tutorial: Introduction to POV-Ray and Ray-tracing The Online POV-Ray Tutorial Introduction to POV-Ray and Ray-tracing (Show Jump Points) (Hide Jump Points) In this section. In most cases. Of course. draw. without having to spend years learning difficult skills. a file containing the description of a scene (in terms that the ray-tracing software can understand. This leaves the user to be as creative as possible. This is a good section if you've never experimented with (or even heard of) ray-tracing before. does have certain inherent limitations. cones and cubes.html (1 of 4) [9/12/2001 3:41:25 PM] .org/3285/tutorial/intro. and places the burden on the computer. How do I set up POV-Ray? What is ray-tracing? Ray-tracing is a method of creating visual art in which a description of an object or scene is mathematically converted into a picture. in the computer-based ray-tracing procedure. but ray-tracing. In fact.thinkquest. Quick index: 1. Ray-tracing can generate very beautiful and complex scenes.

or even surrealistic. Yes.thinkquest. http://library. in fact. in the true spirit of the Internet. the software traces imaginary light rays backwards from where their endpoint lies (a pixel on your computer screen) to their initial point (some light source in the scene). a side-effect many artists can exploit to their benefit. that's right. until the entire image has been created. How does ray-tracing work? We won't go into all the gory details. every object in the scene is mathematically perfect. the process of ray-tracing can take a very long time. and high quality. images produced by ray-tracing tend to look slightly odd. because it knows that it will end up on your screen. an internal model of the scene is generated. it's free! If you're a programmer interested in POV-Ray. cheap price. Then. all objects are in focus. with your computer screen included as the receiving "eye" in the model.html (2 of 4) [9/12/2001 3:41:25 PM] . you will most likely find yourself waiting around impatiently for your scene to finish rendering once you've begun to ray-trace in earnest. What is POV-Ray? POV-Ray is a high-quality.org/3285/tutorial/intro. "less perfect" scenes. and because the light rays can undergo so many contortions. the POV-Ray Team (the people responsible for POV-Ray) has managed to create a commercial-quality product and. is for efficiency's sake -. considered a mark of a "true ray-tracing artist" to be able to create more realistic. don't care about it (because you'll never see it). or undergo various other contortions.The Online POV-Ray Tutorial: Introduction to POV-Ray and Ray-tracing Because ray-tracing is based on math. This step is repeated. Although there are several methods of ray-tracing. and all shadows are crisp and well-defined. As a consequence. It is. depending on the size and complexity of the image and the processing power of your computer. For example. you can also pick up a copy of the source code without charge. Because the ray-tracing software must trace one ray of light for each pixel in the output image. (When was the last time you saw a mathematically perfect pear?) Because of this. the software can assure that every light ray it calculates is one you care about. POV-Ray is perhaps one of the most commonly used ray-tracing software to date. the light rays can be reflected by mirrors. distribute it widely and without charge. beginning at the computer screen. as the user. ray-traced scenes have some distinct characteristics. but having a general understanding of what's going on behind the scenes (so to speak) can be helpful when you start ray-tracing your own images. Despite not generating any direct income from their POV-Ray software. The reason the software traces the light rays backwards.if a light ray doesn't end up on your screen. freely available ray-tracing software package that is available for PC. Unless you have an extraordinarily fast computer. interestingly enough. all of which result in a single pixel of the final image. one of the most common (and the one the POV-Ray software package uses) works something like this: First. instead of starting at the light source. In their journey. pixel by pixel. refracted by glass. By tracing the light rays backwards. POV-Ray is no toy. because of its relative ease of use. in a simple ray-traced scene. Macintosh and UNIX platforms. then you.

the authors of the Tutorial. but does not have much in the way of interface. How do I set up POV-Ray? The latest version of POV-Ray can always be found at ftp. What this means is that POV-Ray will take a file as input and generate an output file. At the end of the Path. Various attributes of the object (its color.thinkquest. Ok. when appropriate.org/3285/tutorial/intro. POV-Ray also comes with documentation and example scenes. and. What type of object you want (one of POV-Ray's simple objects or one you've created yourself). this is highly operating-system-dependant. but we recommend you only start using those tools once you have a firm grasp of the POV-Ray language. Once you have POV-Ray. how you set it up is highly dependant on your operating system. Instead the Path will guide you as you learn about each section. written in the POV-Ray language (which you will learn later in the tutorial). We. which is why we decided to create this Web page.The Online POV-Ray Tutorial: Introduction to POV-Ray and Ray-tracing POV-Ray is one of the most popular ray-tracing programs to date. etc). Describing scenes to POV-Ray is fairly simple. if you can't set it up yourself. which you can then view. We're not about to teach you how to use your own computer. we're ready to start learning the real stuff now! http://library. think that POV-Ray is one of the greatest things to come out of the Internet (gee. You give POV-Ray a file containing a description of every object in the scene. Otherwise. Each object's description consists of: 1.html (3 of 4) [9/12/2001 3:41:25 PM] . refer you to more complete sources of information. these make excellent references if you're stuck or need to know more. POV-Ray takes this file and generates a picture. There are modellers available for POV-Ray that will do that kind of visualization for you. you will give POV-Ray the name of your input file. At any rate. you'll get stuck down the road. is it a little obvious?). on most operating systems. the name of your output file. ask a local computer guru to help. how it reflects light.povray. As we mentioned above. and 2. You will also need some form of image viewer and/or converter in order to display the output files that POV-Ray creates. POV-Ray is what is known as a "rendering engine".org. you should be well on your way to being a certified POV-Ray blackbelt. and a whole bunch of other options via the command line. Such a task would be tremendous (although the Language Reference has come very close). if you choose. You will have to download the correct version for your computer (there are versions available for most operating systems) and to set it up. again. POV-Ray doesn't have much of an interface. The Path of Learning is not meant to cover every single detail of the POV-Ray language.

thinkquest.org/3285/tutorial/intro.The Online POV-Ray Tutorial: Introduction to POV-Ray and Ray-tracing Top of Document Main Page Step 2: POV-Ray Basics The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.html (4 of 4) [9/12/2001 3:41:25 PM] .

by the computer. This leaves the user to be as creative as possible. a file containing the description of a scene (in terms that the ray-tracing software can understand. with the help of your computer. This is a good section if you've never experimented with (or even heard of) ray-tracing before. how it works. How does ray-tracing work? 3. and can open exciting possibilities as a new method of creating visual art. What is POV-Ray? 4. in the computer-based ray-tracing procedure. and places the burden on the computer. and usually in some human-readable format) is converted. without having to spend years learning difficult skills. into an actual image of the scene. Usually. What is ray-tracing? 2. is not a speedy process). One of the most important advantages of computer-based ray-tracing over more "orthodox" art forms is that it removes the need for technical skills (such as the ability to paint. In fact. Ray-tracing can require millions and even billions of complex mathematical calculations and. Of course. Ray-tracing can generate very beautiful and complex scenes. you will learn what ray-tracing is. Certain Texture Library Object Library Scene Library Resource Library Color Tool Normal Tool Finish Tool Note: this frame is resizeable http://library. In more precise terms.The Online POV-Ray Tutorial: The Path of Learning Jump Points Main Page The Online POV-Ray Tutorial Introduction to POV-Ray and Ray-tracing (Show Jump Points) (Hide Jump Points) In this section. or sculpt) that may take years to master. as such. ray-tracing is not a magical technique that makes all art easy. How do I set up POV-Ray? Language Reference Glossary / Index What is ray-tracing? Ray-tracing is a method of creating visual art in which a description of an object or scene is mathematically converted into a picture. what POV-Ray is. Later on in the tutorial you will learn how to use the POV-Ray software to create scenes of your own. ray-tracing is the process of mathematically generating near-photorealistic images from a given description of a scene via geometrical modeling of light rays. is usually done by computer (and even then. you should be well on your way to creating some exciting pictures before you're far along this tutorial. and how POV-Ray relates to the rest of the ray-tracing world.org/3285/tutorial/intro_frames. Introduction Basics Simple Scenes Advanced Conclusion Quick index: 1. draw.html (1 of 4) [9/12/2001 3:41:54 PM] .thinkquest.

all objects are in focus. This step is repeated. a side-effect many artists can exploit to their benefit. like a human face. In most cases. refracted by glass. http://library. in fact. Although there are several methods of ray-tracing. For example.The Online POV-Ray Tutorial: The Path of Learning types of scenes are difficult or impossible to create with ray-tracing software. It is. until the entire image has been created. don't care about it (because you'll never see it). Unless you have an extraordinarily fast computer. and all shadows are crisp and well-defined. all of which result in a single pixel of the final image. "less perfect" scenes. beginning at the computer screen. Because the ray-tracing software must trace one ray of light for each pixel in the output image. There are several ways of getting around these barriers. ray-traced scenes have some distinct characteristics. depending on the size and complexity of the image and the processing power of your computer. but ray-tracing. does have certain inherent limitations. an internal model of the scene is generated. In their journey. and poor (slower or more difficult to describe) at generating more complex objects. the light rays can be reflected by mirrors.if a light ray doesn't end up on your screen.thinkquest. you will find that ray-tracing is good at generating mathematically simple objects. one of the most common (and the one the POV-Ray software package uses) works something like this: First. cones and cubes. because it knows that it will end up on your screen. How does ray-tracing work? We won't go into all the gory details. (When was the last time you saw a mathematically perfect pear?) Because of this. in a simple ray-traced scene. images produced by ray-tracing tend to look slightly odd. is for efficiency's sake -. but having a general understanding of what's going on behind the scenes (so to speak) can be helpful when you start ray-tracing your own images. instead of starting at the light source.html (2 of 4) [9/12/2001 3:41:54 PM] . considered a mark of a "true ray-tracing artist" to be able to create more realistic. or even surrealistic. interestingly enough. such as those composed of spheres. then you. By tracing the light rays backwards. you will most likely find yourself waiting around impatiently for your scene to finish rendering once you've begun to ray-trace in earnest. the software can assure that every light ray it calculates is one you care about. The reason the software traces the light rays backwards. Then. Because ray-tracing is based on math. and because the light rays can undergo so many contortions.org/3285/tutorial/intro_frames. with your computer screen included as the receiving "eye" in the model. pixel by pixel. as the user. or undergo various other contortions. like all forms of art. every object in the scene is mathematically perfect. the software traces imaginary light rays backwards from where their endpoint lies (a pixel on your computer screen) to their initial point (some light source in the scene). the process of ray-tracing can take a very long time.

You will have to download the correct version for your computer (there are versions available for most operating systems) and to set it up. What this means is that POV-Ray will take a file as input and generate an output file. but we recommend you only start using those tools once you have a firm grasp of the POV-Ray language.org. How do I set up POV-Ray? The latest version of POV-Ray can always be found at ftp. At any rate. is it a little obvious?). written in the POV-Ray language (which you will learn later in the tutorial). POV-Ray is no toy. you'll get stuck down the road. You give POV-Ray a file containing a description of every object in the scene. POV-Ray is what is known as a "rendering engine". Describing scenes to POV-Ray is fairly simple. because of its relative ease of use. if you choose. and. you should be well on your way to being a certified POV-Ray blackbelt. Macintosh and UNIX platforms. Despite not generating any direct income from their POV-Ray software. At the end of the Path. Otherwise. when appropriate. think that POV-Ray is one of the greatest things to come out of the Internet (gee. What type of object you want (one of POV-Ray's simple objects or one you've created yourself).The Online POV-Ray Tutorial: The Path of Learning What is POV-Ray? POV-Ray is a high-quality. POV-Ray is one of the most popular ray-tracing programs to date. cheap price. but does not have much in the way of interface. Various attributes of the object (its color. the authors of the Tutorial.html (3 of 4) [9/12/2001 3:41:54 PM] . and 2. and high quality. refer you to more complete sources of information. the POV-Ray Team (the people responsible for POV-Ray) has managed to create a commercial-quality product and. distribute it widely and without charge. etc). Each object's description consists of: 1. that's right. Instead the Path will guide you as you learn about each section. Such a task would be tremendous (although the Language Reference has come very close). http://library. it's free! If you're a programmer interested in POV-Ray.org/3285/tutorial/intro_frames. POV-Ray takes this file and generates a picture. how it reflects light. We. There are modellers available for POV-Ray that will do that kind of visualization for you. which is why we decided to create this Web page. POV-Ray is perhaps one of the most commonly used ray-tracing software to date. in the true spirit of the Internet. you can also pick up a copy of the source code without charge.thinkquest. freely available ray-tracing software package that is available for PC. Yes. As a consequence. which you can then view.povray. The Path of Learning is not meant to cover every single detail of the POV-Ray language.

POV-Ray also comes with documentation and example scenes. if you can't set it up yourself.org/3285/tutorial/intro_frames. again. We're not about to teach you how to use your own computer. and a whole bunch of other options via the command line. on most operating systems. You will also need some form of image viewer and/or converter in order to display the output files that POV-Ray creates.thinkquest. we're ready to start learning the real stuff now! Top of Document Main Page Step 2: POV-Ray Basics The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. you will give POV-Ray the name of your input file. this is highly operating-system-dependant. Ok.The Online POV-Ray Tutorial: The Path of Learning Once you have POV-Ray. ask a local computer guru to help. POV-Ray doesn't have much of an interface. As we mentioned above.html (4 of 4) [9/12/2001 3:41:54 PM] . how you set it up is highly dependant on your operating system. these make excellent references if you're stuck or need to know more. the name of your output file.

Negative numbers can also be used: (-6.html (1 of 6) [9/12/2001 3:42:03 PM] . This section will give you the background knowledge you'll need to get started. Quick reference: 1. you need to know a few things: how to describe objects in three dimensions. Including files POV-Ray's Coordinate System The source code file.4) corresponds to the point 6 units left from the origin. The x coordinate corresponds to its position along the horizontal. POV-Ray Source Code 6. but when we look at things other than our computer screen. is really one big list of descriptions of objects. POV-Ray's Coordinate System 2. The point (1. axis.y).org/3285/tutorial/basics. some of POV-Ray's basic notation. You get the idea. A quick graph of a 2D Cartesian plane looks something like this: Any position on this graph can be specified by a set of coordinates. you will already have experience with a simple coordinate system: a two-dimensional (or 2D) Cartesian coordinate system. (0. How to describe color: RGB and RGBF Vectors 4. For example.thinkquest. we notice we can observe three dimensions. Such a method is called a coordinate system. If you have taken elementary algebra. not two: in other words. the file POV-Ray takes as input. Comments in POV-Ray Source Code 7. usually written in the form (x. and three units up from the origin. Now this is all well and good.The Online POV-Ray Tutorial: POV-Ray Basics The Online POV-Ray Tutorial POV-Ray Basics (Show Jump Points) (Hide Jump Points) Before you can start creating scenes in POV-Ray. or x.0) corresponds to the point in the middle of the graph. and other stuff. Normal Vectors 5. and the y coordinate corresponds to its position along the vertical.3) corresponds to the point on the graph one unit right from the origin. and four units up. or y axis. we describe objects not just by how far to the http://library. or the origin. Vectors in POV-Ray 3. The very first thing we need in order to describe objects is a way of telling POV-Ray where things go.

Alternatively. In other words. is called a three-dimensional (or 3D) Cartesian coordinate system. just understand that the labels on the axes may change. and seven units behind the origin. The point (0. Imagine a line from the origin to the point in the coordinate system represented by your vector.-2. The term vector refers to any group of numbers describing a certain thing -. we would say <0. in addition to the x and y coordinates. As you can see. For example. and (1.but don't worry. a third coordinate. or center of the graph. The 3D graph above represents a coordinate system that POV-Ray can use. it looks similar to the 2D graph.7) corresponds to the point one unit to the right of.imagine it shooting out at your face). depending on how you position your camera. we need. the magnitute can be computed as the square root of the sum of the squares of the elements of the vector -. The magnitude of a vector can be thought of as the "length" of the vector. Because of the additional possible direction. to specify the origin in terms that POV-Ray understands.thinkquest. (If you really care about the math. A quick graph looks like this: (You have to use your imagination somewhat: that third axis is not a diagonal but is perpendicular to your computer screen -. The magnitude is the length of this line.y. points in this coordinate system must be described in the form (x.0>.0. The axis we have drawn above is not fixed in POV-Ray -.html (2 of 6) [9/12/2001 3:42:03 PM] . in addition to position vectors. This coordinate is called (surprisingly enough) the z coordinate.0) corresponds to the origin.The Online POV-Ray Tutorial: POV-Ray Basics right (or left) and how high (or low) they are.z).the way the axis looks (in terms of which axes are which) really depends on where you place your camera in POV-Ray. If you have experience with mathematical 3D coordinate systems. for example. except that one additional axis has been added: the z axis. a pad of paper and a pencil can be extremely valuable tools. vectors are surrounded by angle brackets (that's < and >). Visualizing objects and scenes in three dimensions can be tricky. especially in more complex scenes. Often. you probably won't have to know that).org/3285/tutorial/basics. http://library. you will notice that the axes are labelled slightly differently than the system most commonly used in mathematical terms. Vectors in POV-Ray POV-Ray calls the number triples that define positions position vectors. In POV-Ray. For now. two units below. then. but also how close they are in front (or in back) of you. to be able to describe a real scene to POV-Ray.there are color vectors and normal vectors. The coordinate system that POV-Ray uses. We'll get to explaining the camera soon.0. you can take a look at the Resource Library for some graphical tools that may help.

1> acts like red cellophane -.1>. ranging from 0.The Online POV-Ray Tutorial: POV-Ray Basics An important thing to know about is a POV-Ray feature called vector promotion. so can any color. The filter value specifies how transparent the pigment is. As you might guess. a complete combination of all three primary colors.just put in a single number instead of a vector. For example. RGB vectors have an implied filter value of 0. Such a vector is called a RGB vector (for red green blue vector). In a position vector. In describing a position.0 -.0. Vector promotion is done automatically for you by POV-Ray in most cases -. The color white.1. For example.0 means 100% of that color. the individual elements can be any real number at all (actually. is specified by the color vector <1. each element of the vector corresponds to the amount of a primary color -. green and blue. Simply put. In addition to RGB vectors. a normal vector is a vector parallel to a given plane in three dimensions. A filter value of 1. for filter.0. a color specified by a RGB vector will be perfectly opaque. look at the color section of the Language Reference.100% of light is passed through. RGBF vectors can be a little confusing at first. If you were to poke a pencil all the way through it so that the end of the pencil was touching the paper and the pencil was standing straight up (with respect to the paper). each coordinate in the vector corresponds to the position along a particular axis. the RGBF vector <1. but they don't correspond to any physical property (what's greener than green?). you can specify a color in POV-Ray with an RGBF vector.0.0 and 1. promoting the number 2 to a three-dimensional vector would result in the vector <2. Normal Vectors Occasionally you will be called upon to specify a normal vector in POV-Ray. There are a few more ways to do it. the pencil would represent the normal vector to the paper. You can have values higher that 1. For example. but they aren't too difficult once you get the hang of it.red. if you want to read about them.html (3 of 6) [9/12/2001 3:42:03 PM] .2>. is described by the color vector <0. this isn't quite true -there are upper and lower limits set by the hardware constraints of your computer).0 (100% transparent).0 means that all light will be let through. This feature allows you to quickly specify similar vectors.0>.0.the F. Imagine a flat sheet of paper. a RGBF vector is like a RGB vector.0. In the picture below. These are the most commonly-used ways of specifying color.2. the numbers should be between 0. but with one extra element . In a RGB vector. but the light will still be filtered. Try experimenting with the Color Tool to find the color vectors for particular colors -. the color black.thinkquest. http://library. How to describe color: RGB and RGBF Vectors Much as any position within the scene can be specified by a three-element vector. The single number is then promoted to a vector.it will help you get a good "feel" for describing colors in terms of POV-Ray color vectors. A value of 1. Vector promotion is when a single number is substituted in place of a vector.0 (not transparent at all) to 1. one with all elements equal to that number. In describing a color. the normal vector is in red and the plane is in blue. which is actually the absence of all color. but it is filtered by the red pigment.org/3285/tutorial/basics.in other words.

the phrase: one two the phrase one and the phrase one two two http://library. For example. POV-Ray is kind enough to automatically define three normal vectors for you: x (corresponding to <1. Whitespace is the common name for any characters you can't directly see on screen -. POV-Ray doesn't care whether you put one space.thinkquest.0. POV-Ray Source Code Source code is the name for the text you give to POV-Ray. POV-Ray ignores whitespace 3. really) you can substitute those letters. Any time you are asked for a normal vector (or any vector. 0. 1. the normal vector for a plane lying along the y and z axes.org/3285/tutorial/basics. POV-Ray source code is case sensitive 2. Between any two words or symbols in your source code. carriage returns and line feeds (the invisible characters put there when you hit the Enter key).spaces. Ordering is unimportant Case sensitive means that upper and lower-case letters are not treated as the same by POV-Ray. 0>).0>). to POV-Ray. or any other whitespace. the normal vector for a plane lying along the x and z axes. This is because normal vectors are used to specify an orientation. the normal vector for a plane lying along the x and y axes. For example. not a distance. sphere is not the same as Sphere and is not the same as SpHeRe. y (corresponding to <0. a new line. one hundred spaces. There are two things you need to know about POV-Ray source code: 1. two spaces. 1>).The Online POV-Ray Tutorial: POV-Ray Basics Note that the magnitude of normal vectors is not important (as long as it is non-zero). and z (corresponding to <0. tab characters (the invisible characters put there when you press the Tab key). POV-Ray reads the source code file and outputs an image.html (4 of 6) [9/12/2001 3:42:03 PM] .

(POV-Ray also comes with files of textures and even objects. usually to make things clearer to the human reader. for single-line comments. to use the pre-defined colors. you're ready to start creating your first scene. For example: // this is a single-line comment /* this is another comment. see the comments section of the Language Reference. we'll get to those later).. It is used to add information to the source code. This makes your source file much easier to read. the statement does not have to occur at the beginning of the file. You can take advantage of these files by adding the string #include "filename" to the beginning of your file. you would add the string #include "colors. Technically. but the convention is such. Now that you've got that out of the way.The Online POV-Ray Tutorial: POV-Ray Basics are all treated the same by POV-Ray. Including files Including files is a feature of many languages that makes re-using code easier.html (5 of 6) [9/12/2001 3:42:03 PM] . The example statement above tells POV-Ray to look for the file called colors.org/3285/tutorial/basics. For a detailed description of comments. If you have. such as Red. know how to use the provided ones and be happy. For example. This does not hold entirely true for some attributes and CSG operations (both of which we will describe in detail later). it can be as long as you want it to be */ C and C++ programmers will recognized this comment style. Later in the tutorial. in place of a RGB (or RGBF) vector. and textures. Comments in POV-Ray Source Code Comments are another useful part of POV-Ray source code. but in the outer-most level in POV-Ray (the one in which you list the objects in your scene) it doesn't matter. that you can use in your file any time you need a color. many red objects in your scene. which you can use and re-use in your source code.thinkquest. POV-Ray does not care where in the file the objects are -.it makes no difference to the final scene. colors. Ordering means the order in which you declare objects. POV-Ray comes to the rescue with a file full of pre-defined colors. you will learn how to define your own colors (and objects. you will find it cumbersome (and not very readable) to type the correct RGB vector for red every time.inc and to read it before continuing to the rest of your file. or. A comment is a portion of text that POV-Ray will ignore. for example. http://library. For now. and so on) and how to put them in your own text files.inc defines many colors.. (VRML programmers will note that this is a very different approach than VRML's "virtual pen" concept). can be prefixed with a //. and it makes for readability. almost.inc" to the beginning of your file. Comments can be enclosed in /* and */.

org/3285/tutorial/basics.html (6 of 6) [9/12/2001 3:42:03 PM] .The Online POV-Ray Tutorial: POV-Ray Basics Top of Document Main Page Step 1: Introduction to POV-Ray and Ray-tracing Step 3: Creating Simple Scenes The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.thinkquest.

the file POV-Ray takes as input. we notice we can observe three dimensions. and three units up from the origin. Negative numbers can also be used: (-6. (0. Normal Vectors 5. Such a method is called a coordinate system.org/3285/tutorial/basics_frames. some of POV-Ray's basic notation. Including files Language Reference Glossary / Index POV-Ray's Coordinate System The source code file. The point (1. a third coordinate. How to describe color: RGB and RGBF Vectors 4. axis. You get the idea. In other words. This section will give you the background knowledge you'll need to get started. you need to know a few things: how to describe objects in three dimensions. we describe objects not just by how far to the right (or left) and how high (or low) they are.y).thinkquest.4) corresponds to the point 6 units left from the origin. This http://library. or the origin. is really one big list of descriptions of objects.3) corresponds to the point on the graph one unit right from the origin. For example. or x. and the y coordinate corresponds to its position along the vertical. but when we look at things other than our computer screen. and other stuff.The Online POV-Ray Tutorial: The Path of Learning Jump Points Main Page The Online POV-Ray Tutorial POV-Ray Basics (Show Jump Points) (Hide Jump Points) Before you can start creating scenes in POV-Ray. The very first thing we need in order to describe objects is a way of telling POV-Ray where things go.0) corresponds to the point in the middle of the graph.html (1 of 5) [9/12/2001 3:42:40 PM] . not two: in other words. to be able to describe a real scene to POV-Ray. you will already have experience with a simple coordinate system: a two-dimensional (or 2D) Cartesian coordinate system. Comments in POV-Ray Source Code 7. Quick reference: 1. POV-Ray's Coordinate System Introduction Basics Simple Scenes Advanced Conclusion 2. and four units up. but also how close they are in front (or in back) of you. Now this is all well and good. The x coordinate corresponds to its position along the horizontal. or y axis. POV-Ray Source Code 6. A quick graph of a 2D Cartesian plane looks something like this: Texture Library Object Library Scene Library Resource Library Color Tool Normal Tool Finish Tool Note: this frame is resizeable Any position on this graph can be specified by a set of coordinates. we need. usually written in the form (x. in addition to the x and y coordinates. Vectors in POV-Ray 3. If you have taken elementary algebra.

The 3D graph above represents a coordinate system that POV-Ray can use. for example. points in this coordinate system must be described in the form (x. promoting the number 2 to a three-dimensional vector would result in the vector <2. For example. The axis we have drawn above is not fixed in POV-Ray -.7) corresponds to the point one unit to the right of. is called a three-dimensional (or 3D) Cartesian coordinate system. vectors are surrounded by angle brackets (that's < and >). Imagine a line from the origin to the point in the coordinate system represented by your vector. We'll get to explaining the camera soon. Vector promotion is when a single number is substituted in place of a vector. An important thing to know about is a POV-Ray feature called vector promotion.0. A quick graph looks like this: (You have to use your imagination somewhat: that third axis is not a diagonal but is perpendicular to your computer screen -. and (1. If you have experience with mathematical 3D coordinate systems. The single number is then promoted to a vector.2>.thinkquest. a pad of paper and a pencil can be extremely valuable tools. Vectors in POV-Ray POV-Ray calls the number triples that define positions position vectors. As you can see. two units below.org/3285/tutorial/basics_frames.The Online POV-Ray Tutorial: The Path of Learning coordinate is called (surprisingly enough) the z coordinate.the way the axis looks (in terms of which axes are which) really depends on where you place your camera in POV-Ray. depending on how you position your camera. The point (0.there are color vectors and normal vectors.0>.-2. (If you really care about the math.0) corresponds to the origin. one with all elements equal to that number. Alternatively. Visualizing objects and scenes in three dimensions can be tricky.y.z).html (2 of 5) [9/12/2001 3:42:40 PM] . or center of the graph. For now.0. the magnitute can be computed as the square root of the sum of the squares of the elements of the vector -. we would say <0. you can take a look at the Resource Library for some graphical tools that may help.just put in a http://library. and seven units behind the origin. you probably won't have to know that). you will notice that the axes are labelled slightly differently than the system most commonly used in mathematical terms. it looks similar to the 2D graph. except that one additional axis has been added: the z axis. just understand that the labels on the axes may change. The magnitude of a vector can be thought of as the "length" of the vector. especially in more complex scenes. then. Because of the additional possible direction. Often. In POV-Ray. For example.but don't worry. The magnitude is the length of this line.2. The term vector refers to any group of numbers describing a certain thing -. Vector promotion is done automatically for you by POV-Ray in most cases -. in addition to position vectors.imagine it shooting out at your face). to specify the origin in terms that POV-Ray understands. The coordinate system that POV-Ray uses.

ranging from 0. Try experimenting with the Color Tool to find the color vectors for particular colors -.1> acts like red cellophane -.100% of light is passed through.0. which is actually the absence of all color. is described by the color vector <0. green and blue. For example. In the picture below. Normal Vectors Occasionally you will be called upon to specify a normal vector in POV-Ray. so can any color.0. Such a vector is called a RGB vector (for red green blue vector). but it is filtered by the red pigment. These are the most commonly-used ways of specifying color. this isn't quite true -. In describing a color. This feature allows you to quickly specify similar vectors. Imagine a flat sheet of paper. RGB vectors have an implied filter value of 0.0. If you were to poke a pencil all the way through it so that the end of the pencil was touching the paper and the pencil was standing straight up (with respect to the paper).0 means 100% of that color. if you want to read about them. The filter value specifies how transparent the pigment is. the pencil would represent the normal vector to the paper. A filter value of 1. but with one extra element .the F.0.0 (not transparent at all) to 1.there are upper and lower limits set by the hardware constraints of your computer).0 means that all light will be let through. a color specified by a RGB vector will be perfectly opaque. each element of the vector corresponds to the amount of a primary color -. a RGBF vector is like a RGB vector. the RGBF vector <1. the numbers should be between 0.red.html (3 of 5) [9/12/2001 3:42:40 PM] .1. The color white.The Online POV-Ray Tutorial: The Path of Learning single number instead of a vector.it will help you get a good "feel" for describing colors in terms of POV-Ray color vectors. How to describe color: RGB and RGBF Vectors Much as any position within the scene can be specified by a three-element vector. A value of 1. you can specify a color in POV-Ray with an RGBF vector. In a RGB vector. the normal vector is in red and the plane is in blue. You can have values higher that 1.0. look at the color section of the Language Reference.0 and 1. but they don't correspond to any physical property (what's greener than green?). RGBF vectors can be a little confusing at first. a normal vector is a vector parallel to a given plane in three dimensions.1>.in other words. As you might guess. is specified by the color vector <1. For example. In describing a position.0>.org/3285/tutorial/basics_frames. for filter. but they aren't too difficult once you get the hang of it. each coordinate in the vector corresponds to the position along a particular axis. In a position vector. In addition to RGB vectors. the color black. but the light will still be filtered. http://library. the individual elements can be any real number at all (actually. There are a few more ways to do it. Simply put.0 (100% transparent). a complete combination of all three primary colors.0 -.thinkquest.

POV-Ray is kind enough to automatically define three normal vectors for you: x (corresponding to <1. the normal vector for a plane lying along the y and z axes. 0>). Any time you are asked for a normal vector (or any vector. 0. sphere is not the same as Sphere and is not the same as SpHeRe. or any other whitespace.thinkquest. tab characters (the invisible characters put there when you press the Tab key). This does not hold entirely true for some attributes and CSG operations (both of which we will describe in detail later). and z (corresponding to <0. a new line. 1>). the normal vector for a plane lying along the x and z axes. Ordering means the order in which you declare objects. 1. POV-Ray source code is case sensitive 2. POV-Ray reads the source code file and outputs an image. POV-Ray doesn't care whether you put one space. but in the outer-most level in POV-Ray (the one in which you list the objects in your scene) it doesn't matter. two spaces. POV-Ray Source Code Source code is the name for the text you give to POV-Ray.0>).0. not a distance. POV-Ray does not care where in the file the objects are -. Between any two words or symbols in your source code. This is because normal vectors are used to specify an orientation.it makes no difference to the final scene.spaces. carriage returns and line feeds (the invisible characters put there when you hit the Enter key). the normal vector for a plane lying along the x and y axes. really) you can substitute those letters. For example.The Online POV-Ray Tutorial: The Path of Learning Note that the magnitude of normal vectors is not important (as long as it is non-zero). POV-Ray ignores whitespace 3. http://library. y (corresponding to <0. the phrase: one two the phrase one and the phrase two one two are all treated the same by POV-Ray. There are two things you need to know about POV-Ray source code: 1.org/3285/tutorial/basics_frames. Ordering is unimportant Case sensitive means that upper and lower-case letters are not treated as the same by POV-Ray. (VRML programmers will note that this is a very different approach than VRML's "virtual pen" concept).html (4 of 5) [9/12/2001 3:42:40 PM] . one hundred spaces. Whitespace is the common name for any characters you can't directly see on screen -. to POV-Ray. For example.

org/3285/tutorial/basics_frames. the statement does not have to occur at the beginning of the file. we'll get to those later).inc defines many colors. Comments can be enclosed in /* and */.thinkquest. you will learn how to define your own colors (and objects.The Online POV-Ray Tutorial: The Path of Learning Comments in POV-Ray Source Code Comments are another useful part of POV-Ray source code. and textures. it can be as long as you want it to be */ C and C++ programmers will recognized this comment style. You can take advantage of these files by adding the string #include "filename" to the beginning of your file. colors. For example. many red objects in your scene. For a detailed description of comments. and so on) and how to put them in your own text files. It is used to add information to the source code. that you can use in your file any time you need a color. usually to make things clearer to the human reader. This makes your source file much easier to read. you will find it cumbersome (and not very readable) to type the correct RGB vector for red every time. for single-line comments.. Step 1: Introduction to POV-Ray and Ray-tracing Step 3: Creating Simple Scenes Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. see the comments section of the Language Reference. Technically. A comment is a portion of text that POV-Ray will ignore.inc" to the beginning of your file. almost. and it makes for readability. you would add the string #include "colors. For now. Later in the tutorial. but the convention is such. you're ready to start creating your first scene. such as Red. Now that you've got that out of the way. for example. The example statement above tells POV-Ray to look for the file called colors. POV-Ray comes to the rescue with a file full of pre-defined colors. which you can use and re-use in your source code. or. know how to use the provided ones and be happy. Including files Including files is a feature of many languages that makes re-using code easier. can be prefixed with a //. (POV-Ray also comes with files of textures and even objects.inc and to read it before continuing to the rest of your file. to use the pre-defined colors.html (5 of 5) [9/12/2001 3:42:40 PM] . For example: // this is a single-line comment /* this is another comment. If you have. in place of a RGB (or RGBF) vector..

conditionals. describing the scene you have in your mind to POV-Ray is the tricky part. Describing primitives. Normal 10. Quick index: 1.html (1 of 15) [9/12/2001 3:43:37 PM] . you will find POV-Ray very easy -. POV-Ray primitives are usually simple geometric shapes such as spheres. In fact. in general. because you have to speak POV-Ray's language. if you have any experience with programming. Basically. The first example scene 5. cubes. Let there be light! (Light sources) 4.there are no variables. or anything else that can make programming tricky.org/3285/tutorial/simple. take this form in POV-Ray: Object_Name { Object_Parameters Some_Simple_Attribute Some_Other_Simple_Attribute Some_Complex_Attribute { Some_Attribute Some_Other_Attribute } http://library. once you understand it. a POV-Ray source file (the file you make and give to POV-Ray) is just a list of objects and their descriptions. Of course. Pigment 8. loops.thinkquest. The Camera 3.The Online POV-Ray Tutorial: Creating Simple Scenes The Online POV-Ray Tutorial Creating Simple Scenes (Show Jump Points) (Hide Jump Points) The POV-Ray language is fairly easy to use. Including Textures Creating simple objects The building blocks of all POV-Ray objects and scenes are called primitives. Texture 7. Transformations 6. Primitives are objects that POV-Ray already knows about. Finish 9. and all you have to do is describe a few attributes. Creating simple objects 2. and cones.

you need to learn about two things: the camera and light sources. describing primitives in POV-Ray is only a matter of knowing the syntax for the particular primitive you want to describe.for example.-10> http://library. if you had #included the correct file.html (2 of 15) [9/12/2001 3:43:37 PM] .0>. A simple camera in POV-Ray looks like this: camera { location <2. Examples of infinite objects include planes. a plane is both infinitely thin and infinitely wide. The pigment attribute.5. of which color is just one of the many attributes that can go inside it.The Online POV-Ray Tutorial: Creating Simple Scenes } This isn't very enlightening. The phrase pigment { color rgb <1. If you imagine your computer screen as the camera taking a snapshot of the scene you're describing.0. Infinite primitives have components that can potentially stretch to infinity -. quadrics and cubics. however. Examples of finite primitives include spheres. The Camera Before POV-Ray can generate the scene. By now. There are two types of primitives in POV-Ray: finite primitives and infinite primitives. of these. As you might imagine. 0> } } Deciphering what this does isn't too tricky. You could have just as well used color Red. and b) which direction it's pointing. 0. At any rate. and blobs. you'll see POV-Ray needs to know a) where the camera is in the scene. 0>. There are many attributes that the camera object can have. remember?) and with a radius of 5 (in other words.0. which is the color red. by the way. Before you can do that.0.0> } simply means that the sphere's pigment (or color) attribute is described by the rgb vector <1.thinkquest. 0. You can find a complete syntax reference in the finite object and infinite object language references. we will only concentrate on the two most useful: the location and the look_at attributes. is a complex attribute. POV-Ray requires that there be one and only one in each scene. The code defines a sphere with its center at the origin (that's <0. Let's take a look at a short example: sphere { <0. 5 pigment { color rgb <1. cones. the distance from the center of the sphere to any point on the edge of the sphere is exactly 5 units). you're probably itching to make your first scene.0>. Such data is given to POV-Ray through the camera object. it needs to know from where you are looking. torii. A complete reference of all the camera attributes can be found in the Camera Reference.org/3285/tutorial/simple. Finite primitives have well-defined limits. the camera object is a rather important one: in fact.

the longer POV-Ray will take to trace your scene. we need to have a way of providing light. as using colored light can have side effects that are not immediately obvious (for example.1. we're ready to construct our first full scene. with one exception: you may not place the camera directly over the origin and have it looking straight down. Let there be light! (Light sources) If you gave POV-Ray a file containing the camera definition above and the sphere definition before that. their effects can certainly be seen: your scene lights up! Point light sources as known as non-attenuating light sources: the emitted light does not get weaker with distance. You can have as many light sources as you want. now that we can add light. now that we have a way of receiving light. you need to add a light source. This would happen because you'd have no light in your scene. the output image would be a lovely blank picture. including inside of objects (although you may not see very much). position the camera a little to the left or the right -. We will concentrate here on the most simple (and useful): the point light source. this will cause POV-Ray to generate an error. This means that anything with a z coordinate less than -10 will definately be invisible -. If you need that type of setup. There are a few different types of light sources in POV-Ray.your problem will be solved.0. An example of a simple point light source definition in POV-Ray looks like this: light_source { <0. green objects will not show up when exposed to pure red light). It is generally a good idea to use white or gray light.it will be behind the camera! You can put the camera anywhere you want in the scene. and your scene will look (almost) exactly the same.the more you have. A point light source can be thought of as an infinitely small object that emits light.-10> color rgb <1. point light sources cannot be directly seen (so you don't have to worry about them appearing in your scene). Anyways. However.-10> and pointing at the origin.html (3 of 15) [9/12/2001 3:43:37 PM] . Complete information for light sources can be found in the lights section of the Language Reference. This means that you can illuminate your entire scene with one point light source placed far away from the scene.org/3285/tutorial/simple. For complex mathematical reasons. Anyways. http://library.0> } This example defines a camera located at <2.1> } The first vector is a position vector specifying the location of the light source. The second vector specifies the color (and brightness) of the light.10. To add light (thereby enabling you to actually see something).The Online POV-Ray Tutorial: Creating Simple Scenes look_at <0. but they are computationally expensive -.5.thinkquest. Because they are infinitely small.

html (4 of 15) [9/12/2001 3:43:37 PM] .thinkquest.-10. cylinders. 5 pigment { color rgb <1.0>.0.0. spheres. this one is a little boring -. What if we want to put them somewhere else? What if we want to move them around? POV-Ray provides answers to all these questions in the form of transformations.-10> look_at <0.but don't worry. http://library. the camera position camera { location <2. cones.1. we get a complete POV-Ray source code file that looks like this: // This is a simple red sphere // first. torii and planes. But wait! Some of these objects can only be created around the origin (like the torus).The Online POV-Ray Tutorial: Creating Simple Scenes The first example scene Putting together all we have learned to far. the output image looks like this: Finally! Your first image! Of course.0. For now. The objects that you should easily be able to use are boxes.0> } // now. some light light_source { <0. Transformations So now we can create some simple objecs. experiment! It's the best way to learn.5.0> } } After running POV-Ray.1> } // the sphere sphere { <0. Try replacing the sphere with other objects and seeing what happens.0> color rgb <1. we'll get to some fun stuff soon.org/3285/tutorial/simple.

are translations.z>. y. A translation of <-1. in ray-tracing terms. are attributes that change the position. and the ones that POV-Ray supports. like this: A rotation is a transformation that changes the orientation of an object (the way that it's facing). The most common types of transformations. where x. They are specified to POV-Ray by the string rotation <x.y. Point your thumb in the positive direction of the axis you are rotating about (if you're rotating about more than one axis at a time. Translations are easy to visualize. leaving us with a cube looking like this: A quick way to remember which way the objects are going to rotate is by usings the so-called "left hand rule. A rotation of <0.0. the y axis increases upwards and the z axis increases towards us.2> results in the cube being moved left one unit. fingers clenched and thumb out.org/3285/tutorial/simple. and back two.z>. A translation is a transformation that moves an object relative to its current position. like this: Our camera is positioned so that the x axis increases to the right. size or orientation of objects (and of the various attributes of the objects). rotations and scalings.unless you have more than one thumb!) The direction that your fingers curl is the direction an http://library.4. this won't help you -. Rotations are the most complex of the transformations.thinkquest. and z are the number of degrees (not radians) around the respective axis.html (5 of 15) [9/12/2001 3:43:37 PM] . It is specified in POV-Ray by the phrase translate <x. Consider the original cube up above.y." Hold out your left hand.45> rotates the cube 45 degrees around the z axis. up four.The Online POV-Ray Tutorial: Creating Simple Scenes Transformations. Consider a cube sitting on the origin.

it will orbit around the axis (or axes) you are rotating it about.z>.0 or less is invalid. and then rotated it: To get around this. make sure you rotate your object when its centered at the origin. Simply enough. this is what would happen if we translated the cube first. scaling changes the size of the object with respect to its current size.org/3285/tutorial/simple. This causes the object to be scaled in every direction by http://library. The last translation you need to know about is scaling. Another important thing to remember about rotations is that they are always with respect to the coordinate axes -.1>.The Online POV-Ray Tutorial: Creating Simple Scenes object will rotate when the number of degrees is positive. unless your object is located at the origin.4.0 leaves the object the same.y. if we scaled the object with the string scale <1. simply because transformations are always made with respect to the object's current orientation. For example. we would get a result like this: Because of vector promotion (if you don't remember what that is.thinkquest. scaling can also take a single number rather than a vector. Scaling is specified in POV-Ray via the string scale <x. Your picture will end up like this: Transformations are one of the few aspects of POV-Ray in which the order matters.html (6 of 15) [9/12/2001 3:43:37 PM] .in other words. (Negative degrees rotate the opposite direction). Going back to our original cube. and a scale of 0. you can re-read about it). and then translate it. The elements of the vector specify the how much to scale the shape with respect to the coordinate axis: a scale of 1.

For example.0> } This code makes a yellow torus. it should have really looked like this: texture { pigment { color Red } } The reason that POV-Ray is a little loose about the pigment attribute and lets you use it outside of texture is because pigment is so frequently used by itself that it becomes a pain to type out the whole texture statement. The texture attribute contains attributes describing the outward appearance of the object: pigment. For example: torus { 3.2>.highlighting. metallic luster. slightly widened around the x axis.5. Transformations are placed like any other attribute.2. so you are in fact forced to use transformations to get them where you want. Texture We admit it -.2.thinkquest. such as bumps. And to quote G. luckily for you. 11 pigment { color Yellow } scale <1.0>. Either way.The Online POV-Ray Tutorial: Creating Simple Scenes that number. waves. knowing is half the battle. I. Every time you used pigment. shinyness. In fact.org/3285/tutorial/simple. reflectivity. rotated -45 degrees around the x axis and with its center at <0. most parts of the texture { } block you can do the same thing with. The normal attribute describes some three-dimensional features of objects. We'll cover these one by http://library..0> translate <0. and ripples.0.1.2.html (7 of 15) [9/12/2001 3:43:37 PM] . the phrase scale 2 is the same as the phrase scale <2.we lied to you. The pigment attribute. finish and normal. they have the same effect. as you know. The finish attribute describes how the object "interacts with light" -. Joe.1> rotate <-45. you now know how. like this: Note that torus objects are created around the origin.. etc. The pigment attribute is actually a part of a bigger attribute called the texture attribute. describes the color of the object (although it's a lot more complicated than what we've shown you so far).

9 to 1. the second one just contains information about where you want the bands to stop as well as start.25. pigment { color Blue }).thinkquest. Pigment You've seen the use of the color attribute within the pigment attribute (for example.9 color Green] } This defines three bands of color: red from 0. a color_map defines bands of color on a "map" ranging from 0. however. and green from 0.0.25 0.9. 0> color_map { [0.25 color Red] [0.0 0. 1.0 to 1. A more flexibe attribute. blue from 0.0 color Green] } They both do the same thing. Basically. Gradient creates bands of color based on the color map.html (8 of 15) [9/12/2001 3:43:37 PM] . we get this: sphere { <0. 5 pigment { gradient <0.0 color Green] } scale 3 } } http://library. A simple pigment type is called gradient.9 1.0 Let's look at a simple example: color_map { [0. and replacing the color Red with our color map and pigment type.9 color Blue] [0.0. This is done by using of the many pigment types.0 color Red] [0. Using the source code from the first scene we created.25 to 0. The other commonly used format looks like this: color_map { [0.org/3285/tutorial/simple.0 color Red] [0. is color_map. color_maps are used to do a wide variety of things.25 color Blue] [1.25 color Blue] [0.The Online POV-Ray Tutorial: Creating Simple Scenes one.0>. A more complete description that what we've given you so far can be found in the Color section of the Language Reference. The next step is tell POV-Ray what to do with this.0 to 0.

However. More information on gradients can be found in the gradient section of the Language Reference. By itself. which in turn fades into the small red band. which fades into the the large blue band. This is because gradient patterns reverse themselves at the origin. A complete description can be found in the turbulence section of the Language Reference. The scale statement applies to the pigment. However. For example. remember?). you can go back and read about it again). you can translate the texture away from the origin (you can apply all transformations to textures. now let's try something else.0. we get a freakish plasma-like sphere.html (9 of 15) [9/12/2001 3:43:37 PM] . Our sphere now looks like this: A careful examination of this image yields some interesting facts.0.The Online POV-Ray Tutorial: Creating Simple Scenes This source code requires a bit of explaining.5 after the gradient statement.org/3285/tutorial/simple. There are many other pigment types than gradient. you can see a slight bit of green (the rest of it was cut off).0>.inside the pigment { } block). there is a pigment type called marble. Add the phrase turbulence 0. Here's some sample source code: sphere { <0. the next time. The resulting picture looks like this: Whoah! The turbulence keyword. not to the object (look carefully at where it's placed -. it can create some very realistic marble pigments. The red band is abruptly cut off and the cycle repeats itself again. Starting from the top down.thinkquest. the pattern has reversed! The red band is on the top. Values for turbulence range from 0." With this color map. Ok. The vector following the gradient keyword is the normal vector to the orientation of the bands of color (you remember normal vectors.5 pigment { http://library. "mixes stuff up. rather boring and un-marble-like. don't you? Or did you think we were wasting our time telling you stuff you didn't need to know? Admit it! You skipped over that section! Well. as you may have guessed. with a high turbulence. To get around this. we're forgiving.0 to 1.

the smaller in size the phong is (this is a little misleading.0.0 color Gray90] // 90% gray [0.0 color Gray20] // 20% gray } } } This high-turbulence marble pigment generates some very nice-looking marble: Not too shabby. you may want to check out the checker and hexagon pigment patterns. And remember.in other words. yes).0 that specifies how bright the phong is. the sphere looks like this: http://library. strangely enough. Perhaps the most used of the finish attributes is the phong attribute. how metallic they are. huh? Other pigment types include wood.0 and 1. And although technically not pigment types per se.1.html (10 of 15) [9/12/2001 3:43:37 PM] . Here we have a green sphere with a phong highlight of 1. or glare.org/3285/tutorial/simple. A phong is a highlight. the best way to learn is to experiment! Finish Finish describes how the objects interact with light: how much they reflect. All finish attributes are enclosed in a finish { } block.0: sphere { <0. the higher this number.0> } finish { phong 0.0>.8 color Gray60] // 60% gray [1. There is also a phong_size that controlls how "tight" the phong is -. by the phong attribute. as well as the image map pattern (which lets you map an external image to an object).thinkquest. It is specified.The Online POV-Ray Tutorial: Creating Simple Scenes marble turbulence 1 // full turbulence color_map { [0. bozo. and a host of others that can be found in the pigment section of the Language Reference. followed by a number between 0. etc. agate. 5 pigment { color rgb <1. all found in the same section as above.8 } } When lit by two light sources. how they shine.

This causes objects to reflect their surroundings to a certain degree. that specifies how reflective the object is. -10> look_at <0. 5. 0> } plane { // the floor y. Reflection takes one number. 10.org/3285/tutorial/simple.0. 5.inc" camera { location <-2. -10> color White } light_source { <-10. -15> color White } The image this produces is: http://library. A more complete description of phong can be found in the phong section of the Language Reference.The Online POV-Ray Tutorial: Creating Simple Scenes As you can see. the phong adds a nice bit of realistic "shine" whenever a light source directly hits part of the object. Let's take a look at a more complex scene with a reflective object. #include "colors.html (11 of 15) [9/12/2001 3:43:37 PM] . 3. 2 pigment { color White } finish { reflection 0. ranging from 0.9 phong 1 } } light_source { <10.0 to 1. 0>. 0 // along the x-z plane (y is the normal vector) pigment { checker color Black color White } // checkered pattern } sphere { <0. Another finish attribute that can produce stunning effects is the reflection keyword. 5.thinkquest.

1.1. if we wanted to create the crystal ball described above.5.html (12 of 15) [9/12/2001 3:43:37 PM] ..0 ior 1.0 } } Remember your RGBF vectors? A filter value of 1.0. The image generated looks like this: http://library. causing a distortion of everything seen through the object. you will see a distorted view of whatever is behind it.0>. certainly not what we want.The Online POV-Ray Tutorial: Creating Simple Scenes As you can see.0 or 1.2 pigment { color rgbf <1. A more in-depth description of reflectivity can be found in the reflection section of the Reference manual. The refraction keyword takes one value.org/3285/tutorial/simple.0 would mean this was an invisible sphere.8 gives the sphere enough definition to be visible.1 refraction 1.thinkquest. How noticeably it refracts is controlled by the ior keyword (for index of refraction). for refraction off and on. which takes a number greater than 0. The default ior of "empty space" is defined as 1. Our filter value of 0. The final attribute of the finish keyword we will describe here is the refraction keyword. So. we would use something like this: sphere { <0.0. Refraction is what happens when light rays passing through a translucent object get bent. For example.a variant of one of the standard ray-tracing scenes.8> } finish { reflection 0.5 phong 1. Although you can specify values in between. This value should either be 0. this generates a yellowish mirrored sphere floating above an infinite checkerboard -. respectively. it is not recommended as it does not correspond to any known physical property. if you look through a crystal ball.

waves. you can experiment with the Finish Tool. that specifies the relative size of the bumps. here's a http://library. followed by a single number. and the like. It's fun! There are many other finish attributes that you can play with. It does not actually change the object.-3.2> } } } This creates a green cone with a slightly bumpy appearance. The warped look of the checkboard pattern is due to the refraction. and a bit of reflection makes this all the more realistic. ambient. To get a good feel for most of the finish attributes. Here's some source code: cone { <0. generally between 0. Bumps are created with (oddly enough) the bumps keyword. Normal The normal attribute creates some simple 3D features on your objects: bumps.1 texture { normal { bumps 1/2 scale 1/6 } pigment { color rgb <.1 <0. but they are much.5.0 and 1. We've touched on a few. Modify the filter value to make the ball more and less translucent. much faster than actually describing the changes individually would be.0>. for a complete reference. ripples. the bright hightlighting is due to a phong. including metallic. Let's try a bumps example.0.7.1. As such. the effects are not 100% true to real life.The Online POV-Ray Tutorial: Creating Simple Scenes Now we start seeing some of the true power of ray-tracing. like this: Not to difficult.1> (or white) to whatever color you want it tinted. Now.3.org/3285/tutorial/simple.0>..thinkquest. instead. and crand..html (13 of 15) [9/12/2001 3:43:37 PM] . eh? Imagine how difficult it would be to model all those bumps yourself.0. it changes slightly the way light bounces off the object and essentailly fools the eye into believing the object is a little different than it really is. read the finish section of the Language Reference. Tinting the glass would be easy: just change the color of the sphere from <1.

inc before you include textures. can take a few modifiers that give a little more control than we've shown you.5 } } } The number following the ripples keyword specifies.inc uses colors from colors.inc" #include "textures. Including this is the same as before: #include "colors. for example.6 http://library. Using an included texture is easy. Including Textures Much like you learned how to include colors beforehand. You can also experiment with the Normal Tool to get a feeling for the various attributes.The Online POV-Ray Tutorial: Creating Simple Scenes fun one to try -.inc. POV-Ray comes with a file full of some very good textures.1. To make a sphere that uses the Jade textures.9. called textures..inc" Note that you must include colors. can be found in the normal section of the same document.9> } normal { ripples 0. 4. A complete reference can be found in the ripples section of the Language Reference. the relative size of the ripples. 6>.org/3285/tutorial/simple. because textures. The image this produces is: Pretty nifty! The ripples keyword and its close relative. -2 texture { pigment { color rgb <. 5. the waves keyword.html (14 of 15) [9/12/2001 3:43:37 PM] . you would say: sphere { <-2. More normal attributes.thinkquest.inc. again. you can also include textures. such a dents and wrinkles..ripples: plane { y.inc.

You can also look through colors. Top of Document Main Page Step 2: POV-Ray Basics Step 4: Advanced POV-Ray Features The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.inc for a list of the colors in there.thinkquest. you're in good shape.org/3285/tutorial/simple.html (15 of 15) [9/12/2001 3:43:37 PM] . if you've managed this far. Keep it up! The next section gets in to the really fun stuff. Well.The Online POV-Ray Tutorial: Creating Simple Scenes texture { Jade } } Look through the file textures.inc for a list of the textures included.

POV-Ray primitives are usually simple geometric shapes such as spheres. Including Textures Creating simple objects The building blocks of all POV-Ray objects and scenes are called primitives. loops. The first example scene 5. Quick index: 1.there are no variables. Let there be light! (Light sources) 4. 0. take this form in POV-Ray: Object_Name { Object_Parameters Some_Simple_Attribute Some_Other_Simple_Attribute Some_Complex_Attribute { Some_Attribute Some_Other_Attribute } } This isn't very enlightening. Transformations Introduction Basics Simple Scenes Advanced Conclusion Language Reference Glossary / Index 6. Pigment 8. if you have any experience with programming. 0>. Of course. Finish 9. in general. once you understand it. Let's take a look at a short example: sphere { <0. you will find POV-Ray very easy -. 5 pigment { http://library. and cones. Basically. Normal Texture Library Object Library Scene Library Resource Library 10. and all you have to do is describe a few attributes. Color Tool Normal Tool Finish Tool Note: this frame is resizeable Describing primitives. because you have to speak POV-Ray's language. Texture 7.The Online POV-Ray Tutorial: The Path of Learning Jump Points Main Page The Online POV-Ray Tutorial Creating Simple Scenes (Show Jump Points) (Hide Jump Points) The POV-Ray language is fairly easy to use. conditionals. Primitives are objects that POV-Ray already knows about. Creating simple objects 2. The Camera 3. cubes. a POV-Ray source file (the file you make and give to POV-Ray) is just a list of objects and their descriptions. describing the scene you have in your mind to POV-Ray is the tricky part. In fact.html (1 of 13) [9/12/2001 3:44:25 PM] .org/3285/tutorial/simple_frames.thinkquest. or anything else that can make programming tricky.

thinkquest. position the camera a little to the left or the right -.0>. A complete reference of all the camera attributes can be found in the Camera Reference. A simple camera in POV-Ray looks like this: camera { location <2.your problem will be solved. the camera object is a rather important one: in fact.0>. describing primitives in POV-Ray is only a matter of knowing the syntax for the particular primitive you want to describe. of these. which is the color red. This means that anything with a z coordinate less than -10 will definately be invisible -.0.org/3285/tutorial/simple_frames. 0> } } Deciphering what this does isn't too tricky.0. Before you can do that. By now. At any rate.0> } This example defines a camera located at <2. There are many attributes that the camera object can have.for example. 0.5. POV-Ray requires that there be one and only one in each scene. You can find a complete syntax reference in the finite object and infinite object language references. Examples of infinite objects include planes. remember?) and with a radius of 5 (in other words. a plane is both infinitely thin and infinitely wide.html (2 of 13) [9/12/2001 3:44:25 PM] . including inside of objects (although you may not see very much). You could have just as well used color Red. with one exception: you may not place the camera directly over the origin and have it looking straight down. If you need that type of setup. Examples of finite primitives include spheres. For complex mathematical reasons. and b) which direction it's pointing.0.-10> and pointing at the origin. Anyways. we need to have a way of providing light. Such data is given to POV-Ray through the camera object.The Online POV-Ray Tutorial: The Path of Learning color rgb <1. now that we have a way of receiving light. the distance from the center of the sphere to any point on the edge of the sphere is exactly 5 units). The pigment attribute. it needs to know from where you are looking. however. if you had #included the correct file. you need to learn about two things: the camera and light sources. is a complex attribute. http://library. this will cause POV-Ray to generate an error.it will be behind the camera! You can put the camera anywhere you want in the scene. by the way. The code defines a sphere with its center at the origin (that's <0. The phrase pigment { color rgb <1. If you imagine your computer screen as the camera taking a snapshot of the scene you're describing. Infinite primitives have components that can potentially stretch to infinity -.0> } simply means that the sphere's pigment (or color) attribute is described by the rgb vector <1. As you might imagine. you'll see POV-Ray needs to know a) where the camera is in the scene. The Camera Before POV-Ray can generate the scene.0. we will only concentrate on the two most useful: the location and the look_at attributes. cones. Finite primitives have well-defined limits. quadrics and cubics. and your scene will look (almost) exactly the same. of which color is just one of the many attributes that can go inside it. you're probably itching to make your first scene.-10> look_at <0.5. and blobs. torii. There are two types of primitives in POV-Ray: finite primitives and infinite primitives.

green objects will not show up when exposed to pure red light). It is generally a good idea to use white or gray light.-10. The second vector specifies the color (and brightness) of the light.1> } http://library. the longer POV-Ray will take to trace your scene.0> } // now. as using colored light can have side effects that are not immediately obvious (for example. Complete information for light sources can be found in the lights section of the Language Reference. we get a complete POV-Ray source code file that looks like this: // This is a simple red sphere // first.-10> look_at <0. This means that you can illuminate your entire scene with one point light source placed far away from the scene.org/3285/tutorial/simple_frames. Because they are infinitely small.the more you have. We will concentrate here on the most simple (and useful): the point light source.0> color rgb <1. now that we can add light.5.1> } The first vector is a position vector specifying the location of the light source.1. However.10.1. To add light (thereby enabling you to actually see something). An example of a simple point light source definition in POV-Ray looks like this: light_source { <0. A point light source can be thought of as an infinitely small object that emits light. This would happen because you'd have no light in your scene. the output image would be a lovely blank picture.thinkquest. the camera position camera { location <2. point light sources cannot be directly seen (so you don't have to worry about them appearing in your scene). Anyways. There are a few different types of light sources in POV-Ray. The first example scene Putting together all we have learned to far. but they are computationally expensive -.0. we're ready to construct our first full scene. their effects can certainly be seen: your scene lights up! Point light sources as known as non-attenuating light sources: the emitted light does not get weaker with distance.-10> color rgb <1. some light light_source { <0. you need to add a light source.The Online POV-Ray Tutorial: The Path of Learning Let there be light! (Light sources) If you gave POV-Ray a file containing the camera definition above and the sphere definition before that. You can have as many light sources as you want.html (3 of 13) [9/12/2001 3:44:25 PM] .

size or orientation of objects (and of the various attributes of the objects).0> } } After running POV-Ray. Transformations So now we can create some simple objecs. Consider a cube sitting on the origin. A translation of <-1. are translations. in ray-tracing terms. up four. rotations and scalings. torii and planes.0. the y axis increases upwards and the z axis increases towards us.0. cylinders. It is specified in POV-Ray by the phrase translate <x. Try replacing the sphere with other objects and seeing what happens. The objects that you should easily be able to use are boxes.y. we'll get to some fun stuff soon. cones. the output image looks like this: Finally! Your first image! Of course.thinkquest.The Online POV-Ray Tutorial: The Path of Learning // the sphere sphere { <0. But wait! Some of these objects can only be created around the origin (like the torus). A translation is a transformation that moves an object relative to its current position. are attributes that change the position. Transformations.html (4 of 13) [9/12/2001 3:44:25 PM] .but don't worry. experiment! It's the best way to learn. Translations are easy to visualize.2> results in the cube being moved left one unit. For now.0>. spheres. 5 pigment { color rgb <1.org/3285/tutorial/simple_frames. and back two. and the ones that POV-Ray supports. What if we want to put them somewhere else? What if we want to move them around? POV-Ray provides answers to all these questions in the form of transformations. like this: http://library. this one is a little boring -.z>. The most common types of transformations.4. like this: Our camera is positioned so that the x axis increases to the right.

fingers clenched and thumb out. A rotation of <0." Hold out your left hand. and then translate it. this is what would happen if we translated the cube first. Rotations are the most complex of the transformations.0 or less is invalid.45> rotates the cube 45 degrees around the z axis. Scaling is specified in POV-Ray via the string scale <x.y. Consider the original cube up above. simply because transformations are always made with respect to the object's current orientation. They are specified to POV-Ray by the string rotation <x. For example. we would get a result like this: http://library. The elements of the vector specify the how much to scale the shape with respect to the coordinate axis: a scale of 1.y.thinkquest. Going back to our original cube.z>.0 leaves the object the same. Another important thing to remember about rotations is that they are always with respect to the coordinate axes -.4.in other words. if we scaled the object with the string scale <1.The Online POV-Ray Tutorial: The Path of Learning A rotation is a transformation that changes the orientation of an object (the way that it's facing). and then rotated it: To get around this. (Negative degrees rotate the opposite direction). unless your object is located at the origin. make sure you rotate your object when its centered at the origin. this won't help you -. Your picture will end up like this: Transformations are one of the few aspects of POV-Ray in which the order matters.org/3285/tutorial/simple_frames. where x. and a scale of 0. it will orbit around the axis (or axes) you are rotating it about.1>. y. Point your thumb in the positive direction of the axis you are rotating about (if you're rotating about more than one axis at a time.unless you have more than one thumb!) The direction that your fingers curl is the direction an object will rotate when the number of degrees is positive.0. The last translation you need to know about is scaling. scaling changes the size of the object with respect to its current size.z>. and z are the number of degrees (not radians) around the respective axis. leaving us with a cube looking like this: A quick way to remember which way the objects are going to rotate is by usings the so-called "left hand rule. Simply enough.html (5 of 13) [9/12/2001 3:44:25 PM] .

11 pigment { color Yellow } scale <1. And to quote G.5. so you are in fact forced to use transformations to get them where you want.2. the phrase scale 2 is the same as the phrase scale <2.0>. they have the same effect. Transformations are placed like any other attribute.we lied to you. as you know.thinkquest.1. The pigment attribute. you now know how. you can re-read about it). Joe. In fact.0> } This code makes a yellow torus.html (6 of 13) [9/12/2001 3:44:25 PM] . luckily for you. slightly widened around the x axis. For example: torus { 3.org/3285/tutorial/simple_frames.2>.. This causes the object to be scaled in every direction by that number. scaling can also take a single number rather than a vector. The pigment attribute is actually a part of a bigger attribute called the texture attribute.. like this: Note that torus objects are created around the origin. rotated -45 degrees around the x axis and with its center at <0. knowing is half the battle.0> translate <0.0. finish and normal. Texture We admit it -. Every time you used pigment. most parts of the texture { } block you can do the same thing with. Either way.2.2. The texture attribute contains attributes describing the outward appearance of the object: pigment. For example. describes the color of the object (although http://library. I.1> rotate <-45. it should have really looked like this: texture { pigment { color Red } } The reason that POV-Ray is a little loose about the pigment attribute and lets you use it outside of texture is because pigment is so frequently used by itself that it becomes a pain to type out the whole texture statement.The Online POV-Ray Tutorial: The Path of Learning Because of vector promotion (if you don't remember what that is.

1.0 to 0. waves.25 to 0. A more flexibe attribute.The Online POV-Ray Tutorial: The Path of Learning it's a lot more complicated than what we've shown you so far). and green from 0. 5 pigment { gradient <0.9 color Blue] [0. color_maps are used to do a wide variety of things.0 color Green] } scale 3 } } This source code requires a bit of explaining.html (7 of 13) [9/12/2001 3:44:25 PM] . the second one just contains information about where you want the bands to stop as well as start. don't you? Or did you think we were wasting our time telling you stuff you didn't need to know? Admit it! You skipped over that section! Well.0 color Red] [0. Pigment You've seen the use of the color attribute within the pigment attribute (for example. Using the source code from the first scene we created. we're forgiving. you can go back and read about it again). reflectivity. a color_map defines bands of color on a "map" ranging from 0.0 color Red] [0. blue from 0.9 to 1.0 color Green] } They both do the same thing.25 color Red] [0. shinyness.9 1.0. not to the object (look carefully at where it's placed -http://library. The scale statement applies to the pigment.thinkquest. such as bumps. The other commonly used format looks like this: color_map { [0. we get this: sphere { <0. A more complete description that what we've given you so far can be found in the Color section of the Language Reference. is color_map. 0> color_map { [0. Basically. however. The normal attribute describes some three-dimensional features of objects.25 color Blue] [0.25.0 to 1. The vector following the gradient keyword is the normal vector to the orientation of the bands of color (you remember normal vectors. and replacing the color Red with our color map and pigment type. metallic luster.highlighting.25 0. pigment { color Blue }). Gradient creates bands of color based on the color map. This is done by using of the many pigment types.0>. We'll cover these one by one. The finish attribute describes how the object "interacts with light" -.0 0. The next step is tell POV-Ray what to do with this.0 Let's look at a simple example: color_map { [0.9.25 color Blue] [1. etc.0. and ripples. A simple pigment type is called gradient.9 color Green] } This defines three bands of color: red from 0.org/3285/tutorial/simple_frames.

"mixes stuff up.0.html (8 of 13) [9/12/2001 3:44:25 PM] . the next time.The Online POV-Ray Tutorial: The Path of Learning inside the pigment { } block). Ok. The red band is abruptly cut off and the cycle repeats itself again. However. The resulting picture looks like this: Whoah! The turbulence keyword. which fades into the the large blue band. This is because gradient patterns reverse themselves at the origin. Values for turbulence range from 0.5 after the gradient statement.0 color Gray90] // 90% gray [0. you can see a slight bit of green (the rest of it was cut off).org/3285/tutorial/simple_frames. remember?). By itself. However. A complete description can be found in the turbulence section of the Language Reference. Add the phrase turbulence 0. For example. it can create some very realistic marble pigments. you can translate the texture away from the origin (you can apply all transformations to textures.0>.0. as you may have guessed. To get around this. we get a freakish plasma-like sphere. which in turn fades into the small red band. More information on gradients can be found in the gradient section of the Language Reference.0 color Gray20] // 20% gray } } } This high-turbulence marble pigment generates some very nice-looking marble: http://library.5 pigment { marble turbulence 1 // full turbulence color_map { [0.0 to 1. Our sphere now looks like this: A careful examination of this image yields some interesting facts. with a high turbulence." With this color map. there is a pigment type called marble. rather boring and un-marble-like. Starting from the top down.thinkquest.8 color Gray60] // 60% gray [1. now let's try something else. the pattern has reversed! The red band is on the top. Here's some sample source code: sphere { <0. There are many other pigment types than gradient.

the sphere looks like this: As you can see. There is also a phong_size that controlls how "tight" the phong is -. bozo. Another finish attribute that can produce stunning effects is the reflection keyword.0. Perhaps the most used of the finish attributes is the phong attribute. Here we have a green sphere with a phong highlight of 1.0 to 1. that specifies how reflective the object is.0>.0. how they shine. A more complete description of phong can be found in the phong section of the Language Reference. strangely enough. This causes objects to reflect their surroundings to a certain degree. #include "colors. how metallic they are. And remember.thinkquest.inc" http://library.1. yes).0 that specifies how bright the phong is. 5 pigment { color rgb <1. All finish attributes are enclosed in a finish { } block.in other words. as well as the image map pattern (which lets you map an external image to an object). followed by a number between 0. Let's take a look at a more complex scene with a reflective object. you may want to check out the checker and hexagon pigment patterns. all found in the same section as above. the phong adds a nice bit of realistic "shine" whenever a light source directly hits part of the object. A phong is a highlight.8 } } When lit by two light sources. etc. Reflection takes one number.html (9 of 13) [9/12/2001 3:44:25 PM] .0 and 1.The Online POV-Ray Tutorial: The Path of Learning Not too shabby.0> } finish { phong 0. And although technically not pigment types per se.org/3285/tutorial/simple_frames. ranging from 0. and a host of others that can be found in the pigment section of the Language Reference. by the phong attribute. It is specified. agate. or glare. the smaller in size the phong is (this is a little misleading.0: sphere { <0. the best way to learn is to experiment! Finish Finish describes how the objects interact with light: how much they reflect. huh? Other pigment types include wood. the higher this number.

9 phong 1 } } light_source { <10. 5. 10.. A more in-depth description of reflectivity can be found in the reflection section of the Reference manual. This value should either be 0. -10> look_at <0.org/3285/tutorial/simple_frames. The final attribute of the finish keyword we will describe here is the refraction keyword. for refraction off and on. 0>. you will see a distorted view of whatever is behind it.0 http://library. which takes a number greater than 0.0 or 1. respectively. 0 // along the x-z plane (y is the normal vector) pigment { checker color Black color White } // checkered pattern } sphere { <0. So. The refraction keyword takes one value. Refraction is what happens when light rays passing through a translucent object get bent.1 refraction 1.1. Although you can specify values in between.0>.8> } finish { reflection 0. -15> color White } The image this produces is: As you can see. 2 pigment { color White } finish { reflection 0.html (10 of 13) [9/12/2001 3:44:25 PM] .0. 5. this generates a yellowish mirrored sphere floating above an infinite checkerboard -.1. causing a distortion of everything seen through the object.thinkquest. if we wanted to create the crystal ball described above. How noticeably it refracts is controlled by the ior keyword (for index of refraction). it is not recommended as it does not correspond to any known physical property. For example. 0> } plane { // the floor y.2 pigment { color rgbf <1.a variant of one of the standard ray-tracing scenes. The default ior of "empty space" is defined as 1. 3. if you look through a crystal ball.The Online POV-Ray Tutorial: The Path of Learning camera { location <-2. -10> color White } light_source { <-10. 5.5. we would use something like this: sphere { <0.0.

0 } } Remember your RGBF vectors? A filter value of 1. Our filter value of 0. but they are much. We've touched on a few. ripples. Let's try a bumps example.html (11 of 13) [9/12/2001 3:44:25 PM] . and a bit of reflection makes this all the more realistic. that specifies the relative size of the bumps.5.1 texture { normal { bumps 1/2 scale 1/6 } pigment { color rgb <. followed by a single number.8 gives the sphere enough definition to be visible.. instead. The warped look of the checkboard pattern is due to the refraction. read the finish section of the Language Reference. Here's some source code: cone { <0. and crand.5 phong 1.3.1> (or white) to whatever color you want it tinted.thinkquest.0. It does not actually change the object.0 would mean this was an invisible sphere.1 <0. including metallic. To get a good feel for most of the finish attributes. The image generated looks like this: Now we start seeing some of the true power of ray-tracing.2> } } } This creates a green cone with a slightly bumpy appearance. it changes slightly the way light bounces off the object and essentailly fools the eye into believing the object is a little different than it really is.0>. Modify the filter value to make the ball more and less translucent. and the like.org/3285/tutorial/simple_frames.-3. Bumps are created with (oddly enough) the bumps keyword. It's fun! There are many other finish attributes that you can play with.1. Normal The normal attribute creates some simple 3D features on your objects: bumps. much faster than actually describing the changes individually would be. Tinting the glass would be easy: just change the color of the sphere from <1. certainly not what we want.The Online POV-Ray Tutorial: The Path of Learning ior 1. for a complete reference. the effects are not 100% true to real life. like this: http://library. As such. waves.0>.7. ambient.0.0 and 1. generally between 0.. you can experiment with the Finish Tool. the bright hightlighting is due to a phong.

The Online POV-Ray Tutorial: The Path of Learning

Not to difficult, eh? Imagine how difficult it would be to model all those bumps yourself. Now, here's a fun one to try -- ripples: plane { y, -2 texture { pigment { color rgb <.1,.9,.9> } normal { ripples 0.5 } } } The number following the ripples keyword specifies, again, the relative size of the ripples. The image this produces is:

Pretty nifty! The ripples keyword and its close relative, the waves keyword, can take a few modifiers that give a little more control than we've shown you. A complete reference can be found in the ripples section of the Language Reference. More normal attributes, such a dents and wrinkles, can be found in the normal section of the same document. You can also experiment with the Normal Tool to get a feeling for the various attributes.

Including Textures
Much like you learned how to include colors beforehand, you can also include textures. POV-Ray comes with a file full of some very good textures, called textures.inc. Including this is the same as before: #include "colors.inc" #include "textures.inc" Note that you must include colors.inc before you include textures.inc, because textures.inc uses colors from colors.inc. Using an included texture is easy. To make a sphere that uses the Jade textures, for example, you would say:

http://library.thinkquest.org/3285/tutorial/simple_frames.html (12 of 13) [9/12/2001 3:44:25 PM]

The Online POV-Ray Tutorial: The Path of Learning

sphere { <-2, 4, 6>, 5.6 texture { Jade } } Look through the file textures.inc for a list of the textures included. You can also look through colors.inc for a list of the colors in there. Well, if you've managed this far, you're in good shape. Keep it up! The next section gets in to the really fun stuff. Top of Document Main Page Step 2: POV-Ray Basics Step 4: Advanced POV-Ray Features

The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team

http://library.thinkquest.org/3285/tutorial/simple_frames.html (13 of 13) [9/12/2001 3:44:25 PM]

The Online POV-Ray Tutorial: Advanced POV-Ray Features

The Online POV-Ray Tutorial
Advanced POV-Ray Features
(Show Jump Points) (Hide Jump Points) If you've made it this far, you're in good shape! This section covers the features of POV-Ray that are most most complex, but also the most powerful. Once you complete this section, you'll be ready a certified ray-tracing master. Quick Index: 1. #declare 2. CSG 1. Union 2. Difference 3. Intersection 4. Merge 5. Inverse 3. Advanced Objects

#declare
Up until now, creating large numbers of similar objects has been an excersize in cut-and-paste editor features. POV-Ray provides a very powerful, very flexible way to create many similar objects with a statement called #declare. #declare essentially creates a new type of object (or pigment, or texture, or almost anything) that you can use and re-use whenever you like. Take a look at the following code: #declare my_sphere = sphere { <0, 0, 0>, 5 finish { pigment rgbf <.5, .2, .4, .667> } } What this does, essentially, is declare a new type of object called "my_sphere" which you can now use later on in your source code, like this: object { my_sphere translate <-2, 0, 0> } The object statement tells POV-Ray to create an object of type "my_sphere." Theoretically, you can put object statements around every object you use (including primitives, like spheres) but POV-Ray only requires it for #declared objects.

http://library.thinkquest.org/3285/tutorial/advanced.html (1 of 9) [9/12/2001 3:45:14 PM]

The Online POV-Ray Tutorial: Advanced POV-Ray Features

Note that any attributes you place inside the object statement override those in the #declare statement -- in this example, our sphere is moved from its original location at <0,0,0> to <-2,0,0>. This hold true for pigments, finishes, etc. VRML programmers should take note that this #declare differs somewhat from VRML's DFN node. #declare does not create an instance of the object (which DFN does), only the definition. In other words, the above #declare statement would not add any objects to your scene on its own. You need to instantiate the objects (with the object keyword) to do that. Now, why would you want to use #declare? Say, for example, you're making a Greek temple. You would want many pillars in your object, so you would create a pillar object with #declare, like this: #declare pillar = cylinder { <0, -5, 0>, <0, 5, 0> texture { White_Marble } } Then, you would create however many of these you needed, translating to your heart's content. Say, however, that you decide the columns in your temple should be made out of red marble, not white. All you have to do is change the one #declare statement, and all the pillars change! If you had created those pillars without #declare, you'd have to change each one by hande -- a major hassle, especially if you had 40 pillars in your temple. So you can see one immediate benefit to #declare -- updating your scene becomes a lot easier. But wait, there's more! You can also use #declare to create your own colors and textures. In fact, the colors.inc and textures.inc files are basically long lists of #declared colors and textures, respectively. The syntax is intuitive: #declare blue_green_filter = rgbf <0, .5, .5, .5> #declare red_glass = texture { finish { refraction 1.0 reflection 0.1 ior 1.5 } pigment { color rgbf <1, .7, .7, .7> } } As you can most likely guess, these define a new color, called "blue_green_filter" and a new texture, called "red_glass". You would use these like this: sphere { <0, 0, 0>, 1 pigment { blue_green_filter } } cone { <-2, -4, 16>, 5
http://library.thinkquest.org/3285/tutorial/advanced.html (2 of 9) [9/12/2001 3:45:14 PM]

The Online POV-Ray Tutorial: Advanced POV-Ray Features

<0, -3, 1>, 1 texture { red_glass } } Not too difficult! You can use #declare to create custom finish, normal, and pigment statements... you can even use it with vectors and single numbers, like this: #declare PI = 3.1415926545338327950288 This will save you a bit of typing if you reference PI frequently in your scene file! (Please remember that you don't need to put an object statement around anything you #declare other than objects). C and C++ programmers should not be mislead by #delare's superficial similarity to the C/C++ pre-processor macro #define. Their behaviour is quite different. #define actually changes the source code before it gets compiled (why is why it's called a pre-processor macro). POV-Ray does not have a pre-processor, and so #declare, although misleadingly labeled, will not do source-code substitution. At any rate, you can get the complete syntax for object and #declare in the Language Reference. They are both powerful tools, and if you create anything other than very simple scenes, you will find them invaluable.

CSG
CSG stands for Constructive Solid Geometry, a powerful technique in POV-Ray for creating new objects from combinations of other objects. So far, you have been limited to POV-Ray's primitives, which, while nice, aren't always what you need. POV-Ray lets you use the primitives in a much more constructive (har har) way with CSG: you can carve away parts of objects, you can stick objects together, and other exciting stuff. There are five operators in CSG: union, intersection, merge, difference, and inverse. The syntax of all the operators (except inverse) is very simple: it's the operator, followed by a list of two or more objects enclosed by braces, like this: CSG_operator { object_1 object_2 etc. } You actually don't have to put any objects at all between the braces, but it doesn't make sense to have less than two objects (remember, CSG creates new objects from combinations of other objects) and POV-Ray will warn you when you trace the file. The syntax for inverse is even easier: it's just the word "inverse." We'll go over these operators one by one, because they're all important. A complete reference can be found in the CSG Section of the Language Reference.

Union A union is the easiest CSG operator to understand. It simply takes a bunch of objects, and "sticks them together." It doesn't actually move the objects at all, but it creates a common bond between the objects, kind of like they've joined a special club for important primitives. (We'll politely ignore the similarities to certain political parties). The source code to a sample union looks like this:

http://library.thinkquest.org/3285/tutorial/advanced.html (3 of 9) [9/12/2001 3:45:14 PM]

The Online POV-Ray Tutorial: Advanced POV-Ray Features

union { sphere { <0, 1, 2>, 3 } box { <-77, 6, 5>, <2, 3, 55> } sphere { <-2, -3, -4>, 5 } } Now rendering the scene doesn't look any different whether you have the union keyword there or not. So why bother? Two reasons: first, you can assign attributes to the entire union of objects very easily: union { sphere { <0, 1, 2>, 3 } box { <-77, 6, 5>, <2, 3, 55> } sphere { <-2, -3, -4>, 5 } pigment { color Blue } // applies to the entire union } In this case, the attribute pigment { color Blue } is applied to every object in the union. As always, this works with any attribute you care to try: pigment, translations, normal, etc. The second, and perhaps even more useful reason for using unions, is when you combine CSG and the #declare keyword, like this: #define two_spheres = union { sphere { <0, 0, 0>, 3 } sphere { <-1, -5, -1>, 3 } } From now on, you can reference the object two_spheres (which is, amazingly enough, two separate spheres) just as you would any other #declared object: object { two_spheres pigment { color Pink } rotate <0, 180, 0> } Let's go through one more example, to make sure you understand -- this is a very important concept. Say you wanted to ray-trace a car. You'd create the wheels, then an axle, and then use union to stick them together. You could then re-use this wheel and axle combination however many times you wanted (depending on how many sets of wheels your car has). Your code might look something like this: #declare wheels_n_axle = union { object { // left wheel wheel // assuming we have already created a wheel object translate <-3, 0, 0> } object { // axle

http://library.thinkquest.org/3285/tutorial/advanced.html (4 of 9) [9/12/2001 3:45:14 PM]

The Online POV-Ray Tutorial: Advanced POV-Ray Features

axle }

// assuming we have already created an axle object

object { // right wheel wheel // assuming we have already created a wheel object translate <3, 0, 0> } } #declare car = union { object { // front wheels and axle wheel_n_axle translate <0, 0, 5> } object { // rear wheels and axle wheels_n_axle translate <0, 0, -5> } // other car parts go here } Note that the order you place objects in a union is unimportant -- objects within a union don't really care about the other objects. This is different from the objects in a difference -- they are very caring, almost loving, objects, as you will see in the next section. A complete description of the union operator can be found in the CSG Section of the Language Reference. Difference A CSG difference is much like a mathematical difference -- it subtracts objects from one another. More specifically, it takes chunks out of the first object, each chunk being defined by the other objects in the difference statement. For example, say we wanted to make a wall that we would add a door to. The simplest way to do this is with a difference: #declare wall = difference { box { <0, 0, 0>, <10, 10, 1> } // 10x10x1 wall box { <2, 0, -1>, <6, 8, 2> } // minus a doorway texture { Wall_Texture } // assuming we have already created a Wall_Texture } The first cube serves as the wall, and the second cube describes what, exactly, we want to take out from the wall. The two objects without the difference statement look like this:

http://library.thinkquest.org/3285/tutorial/advanced.html (5 of 9) [9/12/2001 3:45:14 PM]

The Online POV-Ray Tutorial: Advanced POV-Ray Features

When we add the difference statement, we get:

Note that we made the doorway cube thicker than the wall. Why? This is because, occasionally, POV-Ray will get confused when you have two objects that overlay exactly the same space. So, we made the doorway cube a little thicker, avoiding a potentially weird image, and at no loss to anything else. One important thing to remember about differences is that all objects are subtracted from the first one. If, for example, we wanted to add a few window holes to the wall above, we could just add a few more cubes at the very end, and voila! Once again, any attributes placed at the end of the difference statement will apply to the entire object. A complete reference for the difference keyword is located in the CSG Section of the Language Reference. Intersection Much as a difference removes the insides of objects, a intersection removes the outsides of objects. The result of using the intersection operator is that the only thing remaining is the parts which all the objects within the operator had in common. Let's say that you want to make a single, colored, sugar-coated chocolate candy that won't melt in your hands (not nameing any names). Furthermore, it must be a mathematically perfect candy. The easiest way to do this in POV-Ray is with an intersection, like this: #include "colors.inc" camera { location <0, 0, -5> look_at <0, 0, 0> } light_source { <10, 10, -10> color White } intersection {
http://library.thinkquest.org/3285/tutorial/advanced.html (6 of 9) [9/12/2001 3:45:14 PM]

Inverse will take your object and reverse what POV-Ray considers to be its "inside" and "outside. to get around this. this won't make a difference to you if your objects aren't opaque. A complete reference for the merge operator can be found in the CSG Section of the Language Reference. like this: Although intersections are a little more difficult to imagine than some of the other CSG operators. Merge Merge is very similar to union. it uses the intersection operator to remove everything that isn't overlapping. But if you have transparent. like this: Then. if the objects actually overlap. 0>. Consider the intersection of a sphere and a box. but it makes a great deal of difference to the wayyour object acts when you use it in CSG. In fact. you'll realize that that's the same as a difference.html (7 of 9) [9/12/2001 3:45:14 PM] . Now.thinkquest. but there are times when it must be used.The Online POV-Ray Tutorial: Advanced POV-Ray Features sphere { <0. 0>. then POV-Ray will take the intersection of the box and an object defined as "the entire universe except this sphere. overlapping objects in your scene. -1. you muts use merge." This will make no difference to the way your object looks. 2 } pigment { color Yellow } } This code takes two spheres that overlap. obviously. If the sphere is inverted (by placing the keyword invert in its definition). the only difference between the two is that. leaving an a remarkably sweet-looking goody. Inverse Inverse is not used very often. they can be a very powerful tool. the original object boundaries will be shown if you use a union (or no CSG at all). You can find a complete reference in the intersection section of the Language Reference. 2 } sphere { <0." If you think about it for a while (probaby a long while). merge will make the interior a smooth. In other http://library. continuous unit. 1.org/3285/tutorial/advanced.

and. or bicubic patches. quadrics and polys). You like pain What we're trying to say here is that we're not about to teach you the math necessary to specify these objects. find a good modelling program (there are many free and shareware ones out there. graphical interface) and run POV-Ray on the file it creates. Instead. Of course.The Online POV-Ray Tutorial: Advanced POV-Ray Features words. The second option you have is to use a modelling program. These objects.1. We have found these objects to be of limited use. try the Resource Library). you'll probably just waste a lot of time. if you want to ray-trace something as complex as a human being.1>. Your object can be described by an n-dimensional polynomial in 3-space. Advanced Objects There are times when POV-Ray's geometric primitives aren't going to be enough for you. don't bother trying to create objects with these by hand. 1 } } In fact. POV-Ray calculates differences using this same method. this: intersection { box { <0.in other words.1> } sphere { <1. 1 inverse } } is the same as this: difference { box { <0.1> } sphere { <1. normally blobs. 2.0.0>. we recommend against it.<1.<1. then don't worry about it.html (8 of 9) [9/12/2001 3:45:14 PM] . quadrics. the go right ahead. But if you don't have the math behind it. In this case.0.1. much like the the mathematical ones above. there are two options left to you: The first is to specify your object in mathematical terms. You know what the heck I'm talking about. create the complex object in there (usually the modelling programs will have a very nice. even CSG won't help you.org/3285/tutorial/advanced. you'll probably sleep better at night. this will only work if 1. cubics. You will save a lot of time and effort. triangles. because unless you really know what you're doing. Obviously. And if you can use them. so much the better. A complete reference to the inverse keyword can be found in the CSG Section of the Language Reference. smooth triangles.1>. and 3.0>. http://library. unless you really know what you're doing. are not generally meant for human consumption -. What a modelling program can do is generate extremely complex objects in POV-Ray by specifying them as a whole bunch of really simple objects. if you'd like to read about the objects involved (namely.1.thinkquest. furthermore.1. Face it.

html (9 of 9) [9/12/2001 3:45:14 PM] .org/3285/tutorial/advanced.The Online POV-Ray Tutorial: Advanced POV-Ray Features Top of Document Main Page Step 3: Creating Simple Scenes Step 5: Conclusion The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.thinkquest.

etc. 0.html (1 of 7) [9/12/2001 3:46:18 PM] . 0. 0> } The object statement tells POV-Ray to create an object of type "my_sphere. like this: object { my_sphere translate <-2. Advanced Objects Language Reference Glossary / Index #declare Up until now. only the definition. like spheres) but POV-Ray only requires it for #declared objects. Merge 5.4. essentially. Intersection 4. You need to instantiate the objects (with the object keyword) to do that. our sphere is moved from its original location at <0. or almost anything) that you can use and re-use whenever you like.5. or texture. . finishes. In other words. you can put object statements around every object you use (including primitives. VRML programmers should take note that this #declare differs somewhat from VRML's DFN node. #declare Introduction Basics Simple Scenes Advanced Conclusion 2. Inverse 3.The Online POV-Ray Tutorial: The Path of Learning Jump Points Main Page The Online POV-Ray Tutorial Advanced POV-Ray Features (Show Jump Points) (Hide Jump Points) If you've made it this far.667> } } What this does. Difference 3. you're in good shape! This section covers the features of POV-Ray that are most most complex. you'll be ready a certified ray-tracing master." Theoretically. Note that any attributes you place inside the object statement override those in the #declare statement -.0. so you would create a pillar object with #declare. CSG 1. the above #declare statement would not add any objects to your scene on its own.0. Quick Index: 1. for example. 5 finish { pigment rgbf <. like this: Texture Library Object Library Scene Library Resource Library Color Tool Normal Tool Finish Tool Note: this frame is resizeable http://library. creating large numbers of similar objects has been an excersize in cut-and-paste editor features. . This hold true for pigments. POV-Ray provides a very powerful.thinkquest.org/3285/tutorial/advanced_frames. but also the most powerful. Take a look at the following code: #declare my_sphere = sphere { <0. . You would want many pillars in your object. 0>. you're making a Greek temple.in this example.0> to <-2. Once you complete this section.0>. #declare essentially creates a new type of object (or pigment. very flexible way to create many similar objects with a statement called #declare. Now. is declare a new type of object called "my_sphere" which you can now use later on in your source code. why would you want to use #declare? Say. Union 2.2. #declare does not create an instance of the object (which DFN does).

. you can get the complete syntax for object and #declare in the Language Reference. you can even use it with vectors and single numbers.7. . All you have to do is change the one #declare statement.thinkquest. http://library. will not do source-code substitution. -4. 0> texture { White_Marble } } Then. . -3.inc and textures. You would use these like this: sphere { <0.inc files are basically long lists of #declared colors and textures. 1 texture { red_glass } } Not too difficult! You can use #declare to create custom finish. especially if you had 40 pillars in your temple. 5 <0. Their behaviour is quite different. 0>. the colors. .5. not white. translating to your heart's content. POV-Ray does not have a pre-processor. C and C++ programmers should not be mislead by #delare's superficial similarity to the C/C++ pre-processor macro #define.The Online POV-Ray Tutorial: The Path of Learning #declare pillar = cylinder { <0. and so #declare. .5> #declare red_glass = texture { finish { refraction 1. and all the pillars change! If you had created those pillars without #declare.5. The syntax is intuitive: #declare blue_green_filter = rgbf <0. 1 pigment { blue_green_filter } } cone { <-2. 0>. you will find them invaluable.7. They are both powerful tools. called "red_glass".html (2 of 7) [9/12/2001 3:46:18 PM] . 16>. that you decide the columns in your temple should be made out of red marble.1415926545338327950288 This will save you a bit of typing if you reference PI frequently in your scene file! (Please remember that you don't need to put an object statement around anything you #declare other than objects). although misleadingly labeled.. 1>. 0. and if you create anything other than very simple scenes. At any rate. In fact. Say. like this: #declare PI = 3. 5. #define actually changes the source code before it gets compiled (why is why it's called a pre-processor macro). these define a new color.7> } } As you can most likely guess. however.1 ior 1.org/3285/tutorial/advanced_frames. respectively. -5. . <0. and pigment statements. But wait. called "blue_green_filter" and a new texture. there's more! You can also use #declare to create your own colors and textures.a major hassle..0 reflection 0. So you can see one immediate benefit to #declare -. you would create however many of these you needed.5 } pigment { color rgbf <1. normal. you'd have to change each one by hande -.updating your scene becomes a lot easier.

Union A union is the easiest CSG operator to understand. you can stick objects together. etc. The source code to a sample union looks like this: union { sphere { <0. There are five operators in CSG: union. (We'll politely ignore the similarities to certain political parties). 3 } box { <-77. 5>. 3.thinkquest. which. like this: CSG_operator { object_1 object_2 etc. 5 } } Now rendering the scene doesn't look any different whether you have the union keyword there or not. So why bother? Two reasons: first. and other exciting stuff." It doesn't actually move the objects at all. while nice. the attribute pigment { color Blue } is applied to every object in the union. difference. a powerful technique in POV-Ray for creating new objects from combinations of other objects. CSG creates new objects from combinations of other objects) and POV-Ray will warn you when you trace the file. kind of like they've joined a special club for important primitives. you can assign attributes to the entire union of objects very easily: union { sphere { <0. A complete reference can be found in the CSG Section of the Language Reference. -4>. merge. 3 } } From now on. 5>. -3. 55> } sphere { <-2. <2. but it doesn't make sense to have less than two objects (remember. -4>. It simply takes a bunch of objects." We'll go over these operators one by one.The Online POV-Ray Tutorial: The Path of Learning CSG CSG stands for Constructive Solid Geometry. 0. and inverse. 2>. 1. So far. <2. 2>. The syntax for inverse is even easier: it's just the word "inverse. } You actually don't have to put any objects at all between the braces. like this: #define two_spheres = union { sphere { <0. is when you combine CSG and the #declare keyword. two separate spheres) just as you would any other #declared object: http://library. intersection. aren't always what you need. followed by a list of two or more objects enclosed by braces. amazingly enough. 3 } sphere { <-1. 3. and perhaps even more useful reason for using unions. 5 } pigment { color Blue } // applies to the entire union } In this case. you can reference the object two_spheres (which is. and "sticks them together. but it creates a common bond between the objects. translations. 6. 6. As always. The syntax of all the operators (except inverse) is very simple: it's the operator. -3.html (3 of 7) [9/12/2001 3:46:18 PM] . because they're all important. 55> } sphere { <-2.org/3285/tutorial/advanced_frames. you have been limited to POV-Ray's primitives. The second. 1. -5. -1>. POV-Ray lets you use the primitives in a much more constructive (har har) way with CSG: you can carve away parts of objects. normal. this works with any attribute you care to try: pigment. 3 } box { <-77. 0>.

-1>. 1> } // 10x10x1 wall box { <2. For example. it takes chunks out of the first object. 0. Difference A CSG difference is much like a mathematical difference -. 0.thinkquest. 0. You could then re-use this wheel and axle combination however many times you wanted (depending on how many sets of wheels your car has). say we wanted to make a wall that we would add a door to. 2> } // minus a doorway texture { Wall_Texture } // assuming we have already created a Wall_Texture http://library.html (4 of 7) [9/12/2001 3:46:18 PM] . 0> } Let's go through one more example. This is different from the objects in a difference -. 0. then an axle.org/3285/tutorial/advanced_frames.they are very caring.objects within a union don't really care about the other objects. -5> } // other car parts go here } Note that the order you place objects in a union is unimportant -. <6. 180. and then use union to stick them together. 0> } } #declare car = union { object { // front wheels and axle wheel_n_axle translate <0. Say you wanted to ray-trace a car. 5> } object { // rear wheels and axle wheels_n_axle translate <0. Your code might look something like this: #declare wheels_n_axle = union { object { // left wheel wheel // assuming we have already created a wheel object translate <-3. 0. each chunk being defined by the other objects in the difference statement. More specifically. to make sure you understand -. 0.The Online POV-Ray Tutorial: The Path of Learning object { two_spheres pigment { color Pink } rotate <0. objects. 8.it subtracts objects from one another. You'd create the wheels. <10. A complete description of the union operator can be found in the CSG Section of the Language Reference. 0> } object { axle } // axle // assuming we have already created an axle object object { // right wheel wheel // assuming we have already created a wheel object translate <3. 0>. almost loving. as you will see in the next section. 10.this is a very important concept. The simplest way to do this is with a difference: #declare wall = difference { box { <0.

sugar-coated chocolate candy that won't melt in your hands (not nameing any names). we get: Note that we made the doorway cube thicker than the wall. -5> look_at <0. we want to take out from the wall. avoiding a potentially weird image.org/3285/tutorial/advanced_frames.html (5 of 7) [9/12/2001 3:46:18 PM] . colored. like this: #include "colors. 10.The Online POV-Ray Tutorial: The Path of Learning } The first cube serves as the wall.inc" camera { location <0. like this: http://library. any attributes placed at the end of the difference statement will apply to the entire object.thinkquest. One important thing to remember about differences is that all objects are subtracted from the first one. 0. Intersection Much as a difference removes the insides of objects. exactly. If. occasionally. 0. A complete reference for the difference keyword is located in the CSG Section of the Language Reference. Furthermore. Let's say that you want to make a single. we made the doorway cube a little thicker. 2 } sphere { <0. The two objects without the difference statement look like this: When we add the difference statement. 0> } light_source { <10. Why? This is because. and voila! Once again. POV-Ray will get confused when you have two objects that overlay exactly the same space. 0>. -1. for example. The easiest way to do this in POV-Ray is with an intersection. 1. 2 } pigment { color Yellow } } This code takes two spheres that overlap. So. -10> color White } intersection { sphere { <0. and at no loss to anything else. it must be a mathematically perfect candy. 0>. we could just add a few more cubes at the very end. a intersection removes the outsides of objects. and the second cube describes what. we wanted to add a few window holes to the wall above. The result of using the intersection operator is that the only thing remaining is the parts which all the objects within the operator had in common.

1>.1. continuous unit. they can be a very powerful tool. like this: Although intersections are a little more difficult to imagine than some of the other CSG operators. 1 } } http://library. 1 inverse } } is the same as this: difference { box { <0. If the sphere is inverted (by placing the keyword invert in its definition). merge will make the interior a smooth. to get around this. Merge Merge is very similar to union.html (6 of 7) [9/12/2001 3:46:18 PM] . But if you have transparent. In fact.1>. then POV-Ray will take the intersection of the box and an object defined as "the entire universe except this sphere. A complete reference for the merge operator can be found in the CSG Section of the Language Reference. the original object boundaries will be shown if you use a union (or no CSG at all)." If you think about it for a while (probaby a long while).1. but it makes a great deal of difference to the wayyour object acts when you use it in CSG.0. You can find a complete reference in the intersection section of the Language Reference.0>. this: intersection { box { <0.org/3285/tutorial/advanced_frames.1. obviously. you'll realize that that's the same as a difference. Inverse Inverse is not used very often. overlapping objects in your scene." This will make no difference to the way your object looks.1.0. you muts use merge. if the objects actually overlap.<1. In other words.thinkquest.1> } sphere { <1. the only difference between the two is that. it uses the intersection operator to remove everything that isn't overlapping.0>.1> } sphere { <1. leaving an a remarkably sweet-looking goody. Now. Consider the intersection of a sphere and a box.The Online POV-Ray Tutorial: The Path of Learning Then. but there are times when it must be used.<1. this won't make a difference to you if your objects aren't opaque. Inverse will take your object and reverse what POV-Ray considers to be its "inside" and "outside.

But if you don't have the math behind it. Of course. POV-Ray calculates differences using this same method. And if you can use them. don't bother trying to create objects with these by hand.The Online POV-Ray Tutorial: The Path of Learning In fact. A complete reference to the inverse keyword can be found in the CSG Section of the Language Reference. Face it. Obviously. You like pain What we're trying to say here is that we're not about to teach you the math necessary to specify these objects. cubics. You know what the heck I'm talking about. we recommend against it. create the complex object in there (usually the modelling programs will have a very nice. if you want to ray-trace something as complex as a human being.org/3285/tutorial/advanced_frames. so much the better. if you'd like to read about the objects involved (namely. Advanced Objects There are times when POV-Ray's geometric primitives aren't going to be enough for you. and 3. there are two options left to you: The first is to specify your object in mathematical terms.thinkquest. and. In this case. find a good modelling program (there are many free and shareware ones out there. quadrics. furthermore. What a modelling program can do is generate extremely complex objects in POV-Ray by specifying them as a whole bunch of really simple objects. much like the the mathematical ones above. graphical interface) and run POV-Ray on the file it creates. then don't worry about it. this will only work if 1. you'll probably sleep better at night. Top of Document Main Page Step 3: Creating Simple Scenes Step 5: Conclusion The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. quadrics and polys). because unless you really know what you're doing. Your object can be described by an n-dimensional polynomial in 3-space. the go right ahead. try the Resource Library). normally blobs. smooth triangles. or bicubic patches. These objects.in other words. You will save a lot of time and effort. unless you really know what you're doing. triangles. you'll probably just waste a lot of time. 2.html (7 of 7) [9/12/2001 3:46:18 PM] . are not generally meant for human consumption -. We have found these objects to be of limited use. Instead. The second option you have is to use a modelling program. even CSG won't help you.

Top of Document Main Page Step 4: Advanced POV-Ray Features The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.thinkquest. Check 'em out and see how the masters do things. Now all you need is experience. We'd just like to take a monute to congratulate you on your new found skills. However.html [9/12/2001 3:46:29 PM] . Congratulations. You've come far from the beginning of the Path of Learning. but that's not as important. Then you will be well on your way to becoming a POV-Ray master yourself. The main thing that distinguishes a good POV-Ray artist from an awesome POV-Ray artist is experience with ray tracing and possibly better hardware.The Online POV-Ray Tutorial: Conclusion The Online POV-Ray Tutorial Conclusion (Show Jump Points) (Hide Jump Points) Well. well. well. Anything that can be done in POV-Ray is now within your grasp. There are a great many ray tracing libraries on the internet and many of them include source.org/3285/tutorial/conclusion. You now know the POV-Ray language. this is just the beginning of your full journey through POV-Ray. This tutorial has helped as much as it can.

This tutorial has helped as much as it can. Check 'em out and see how the masters do things. this is just the beginning of your full journey through POV-Ray. There are a great many ray tracing libraries on the internet and many of them include source. Top of Document Main Page Step 4: Advanced POV-Ray Features Introduction Basics Simple Scenes Advanced Conclusion Language Reference Glossary / Index The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team Texture Library Object Library Scene Library Resource Library Color Tool Normal Tool Finish Tool Note: this frame is resizeable http://library. The main thing that distinguishes a good POV-Ray artist from an awesome POV-Ray artist is experience with ray tracing and possibly better hardware. We'd just like to take a monute to congratulate you on your new found skills.thinkquest. well. Then you will be well on your way to becoming a POV-Ray master yourself. but that's not as important. However. Anything that can be done in POV-Ray is now within your grasp. Congratulations. You've come far from the beginning of the Path of Learning.The Online POV-Ray Tutorial: The Path of Learning Jump Points Main Page The Online POV-Ray Tutorial Conclusion (Show Jump Points) (Hide Jump Points) Well.html [9/12/2001 3:46:58 PM] . You now know the POV-Ray language. Now all you need is experience.org/3285/tutorial/conclusion_frames. well.

The Online POV-Ray Tutorial: Image: Difference Example #1 The Online POV-Ray Tutorial Image: Difference Example #1 A wall without a doorway. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.html [9/12/2001 3:47:02 PM] .thinkquest.org/3285/tutorial/examples/difference1.

http://library.org/3285/tutorial/images/difference1.gif [9/12/2001 3:47:12 PM] .gif http://library.thinkquest.thinkquest.org/3285/tutorial/images/difference1.

thinkquest.gif [9/12/2001 3:48:26 PM] .thinkquest.org/3285/tutorial/images/difference1_big.gif http://library.http://library.org/3285/tutorial/images/difference1_big.

Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.The Online POV-Ray Tutorial: Image: Difference Example #2 The Online POV-Ray Tutorial Image: Difference Example #2 A wall with a doorway.thinkquest.html [9/12/2001 3:48:28 PM] .org/3285/tutorial/examples/difference2.

gif http://library.thinkquest.thinkquest.org/3285/tutorial/images/difference2.gif [9/12/2001 3:48:30 PM] .org/3285/tutorial/images/difference2.http://library.

gif http://library.org/3285/tutorial/images/difference2_big.gif [9/12/2001 3:48:58 PM] .thinkquest.thinkquest.http://library.org/3285/tutorial/images/difference2_big.

http://library. 10.inc" camera { location <-3.pov #include "colors. 10. 5> look_at <5. 5. <6.thinkquest. 8. 10. 0. 0> } plane { y. -1>. 2> } pigment { color Red } } http://library. 10.pov [9/12/2001 3:48:59 PM] . 0 pigment { checker color Black color White } } light_source { <-5. 0>. 0.org/3285/tutorial/examples/src/difference2. <10.org/3285/tutorial/examples/src/difference2. 4> color White } light_source { <-3. 1> } box { <2. 5> color White } difference { box { <0.thinkquest.

org/3285/tutorial/examples/intersection1.The Online POV-Ray Tutorial: Image: Intersection Example #1 The Online POV-Ray Tutorial Image: Intersection Example #1 Two big spheres stuck together. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.thinkquest.html [9/12/2001 3:49:01 PM] .

http://library.thinkquest.org/3285/tutorial/images/intersection1.gif

http://library.thinkquest.org/3285/tutorial/images/intersection1.gif [9/12/2001 3:49:11 PM]

http://library.thinkquest.org/3285/tutorial/images/intersection1_big.gif

http://library.thinkquest.org/3285/tutorial/images/intersection1_big.gif [9/12/2001 3:49:28 PM]

http://library.thinkquest.org/3285/tutorial/examples/src/intersection1.pov

#include "colors.inc" camera { location <0, 0, -5> look_at <0, 0, 0> } light_source { <10, 10, -10> color White } sphere { <0, -1, 0>, 2 pigment { color Yellow } } sphere { <0, 1, 0>, 2 pigment { color Yellow } }

http://library.thinkquest.org/3285/tutorial/examples/src/intersection1.pov [9/12/2001 3:49:31 PM]

The Online POV-Ray Tutorial: Image: Intersection Example #2

The Online POV-Ray Tutorial
Image: Intersection Example #2
The perfect bite-sized candy-coated chocolate treat. Original Image Large Image Source Code

Main Page

The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team

http://library.thinkquest.org/3285/tutorial/examples/intersection2.html [9/12/2001 3:49:32 PM]

http://library.thinkquest.org/3285/tutorial/images/intersection2.gif

http://library.thinkquest.org/3285/tutorial/images/intersection2.gif [9/12/2001 3:49:34 PM]

http://library.thinkquest.org/3285/tutorial/images/intersection2_big.gif

http://library.thinkquest.org/3285/tutorial/images/intersection2_big.gif [9/12/2001 3:49:43 PM]

http://library.thinkquest.org/3285/tutorial/examples/src/intersection2.pov

#include "colors.inc" camera { location <0, 0, -5> look_at <0, 0, 0> } light_source { <10, 10, -10> color White } intersection { sphere { <0, -1, 0>, 2 } sphere { <0, 1, 0>, 2 } pigment { color Yellow } }

http://library.thinkquest.org/3285/tutorial/examples/src/intersection2.pov [9/12/2001 3:49:47 PM]

The Online POV-Ray Tutorial: Image: Example Scene #1

The Online POV-Ray Tutorial
Image: Example Scene #1
The first example scene. A red sphere. Original Image Large Image Source Code

Main Page

The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team

http://library.thinkquest.org/3285/tutorial/examples/demo1.html [9/12/2001 3:49:53 PM]

org/3285/tutorial/images/demo1.gif http://library.gif [9/12/2001 3:49:57 PM] .thinkquest.thinkquest.org/3285/tutorial/images/demo1.http://library.

http://library.org/3285/tutorial/images/demo1_big.thinkquest.org/3285/tutorial/images/demo1_big.gif http://library.gif [9/12/2001 3:50:27 PM] .thinkquest.

0>.org/3285/tutorial/examples/src/demo1.pov [9/12/2001 3:50:28 PM] .thinkquest.0. some light light_source { <0.1.0.5.thinkquest.-10> look_at <0.org/3285/tutorial/examples/src/demo1.http://library. 5 pigment { color rgb <1.0> } } http://library.10.0> } // now.0.1> } // the sphere sphere { <0.pov // A simple red sphere // first.-10> color rgb <1. the camera position camera { location <2.

org/3285/tutorial/examples/transform1.thinkquest.html [9/12/2001 3:50:29 PM] . Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library. un-transformed cube.The Online POV-Ray Tutorial: Image: Transformation Example #1 The Online POV-Ray Tutorial Image: Transformation Example #1 Regular.

thinkquest.gif http://library.gif [9/12/2001 3:50:31 PM] .http://library.org/3285/tutorial/images/transform1.org/3285/tutorial/images/transform1.thinkquest.

thinkquest.gif http://library.org/3285/tutorial/images/transform1_big.gif [9/12/2001 3:50:55 PM] .http://library.org/3285/tutorial/images/transform1_big.thinkquest.

0> } } cylinder { <0. -50. 0. 0. 1> pigment { color rgb <0. 1. 0. 0. -1>.thinkquest. <0. 0.1 pigment { color rgb <0. 1. 1.1 pigment { color rgb <0. 0.1 pigment { color rgb <0. 0. 0>. 0>. 1. 10. 10. -50>. -1.org/3285/tutorial/examples/src/transform1. <0.pov // A plain blue box with x/y/z axes camera { location <5.pov [9/12/2001 3:50:57 PM] . -10> look_at <0. -10> color rgb <1. 50>. -10> color rgb <1. 0> } } cylinder { <0. 1. 0> } } box { <-1.org/3285/tutorial/examples/src/transform1.thinkquest. 0. 0> } cylinder { <-50. 1> } light_source { <10. 0>. 1> } } light_source { <-10. <50. 1> } http://library. 50. 0>. 5.http://library. 0. 1. <1.

thinkquest.The Online POV-Ray Tutorial: Image: Transformation Example #1 The Online POV-Ray Tutorial Image: Transformation Example #2 Translated cube.html [9/12/2001 3:51:05 PM] .org/3285/tutorial/examples/transform2. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.

thinkquest.gif [9/12/2001 3:51:06 PM] .thinkquest.org/3285/tutorial/images/transform2.gif http://library.org/3285/tutorial/images/transform2.http://library.

org/3285/tutorial/images/transform2_big.gif http://library.thinkquest.http://library.org/3285/tutorial/images/transform2_big.thinkquest.gif [9/12/2001 3:51:12 PM] .

pov [9/12/2001 3:51:13 PM] . <0. 0. 0. <1. <50. 0. 0. 0.http://library. -50. 1> } light_source { <10.1 pigment { color rgb <0. 0. 50>. 0. <0. 0. 1. 10. 1> } http://library. -10> color rgb <1. 0> } cylinder { <-50. 0. 0>. 1. 1.org/3285/tutorial/examples/src/transform2. 2> } light_source { <-10. 5. 0>. 0>.1 pigment { color rgb <0. 1> pigment { color rgb <0. 4.pov // A simple translated box with x/y/z axes.thinkquest. 1> } translate <-1. 0> } } cylinder { <0. camera { location <5. 0>. -10> look_at <0.org/3285/tutorial/examples/src/transform2.1 pigment { color rgb <0. -10> color rgb <1. 0> } } box { <-1.thinkquest. -50>. 1. 10. 0> } } cylinder { <0. 1. -1. -1>. 1. 50.

org/3285/tutorial/examples/transform3.The Online POV-Ray Tutorial: Image: Transformation Example #3 The Online POV-Ray Tutorial Image: Transformation Example #3 Rotated cube. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.html [9/12/2001 3:51:16 PM] .thinkquest.

http://library.thinkquest.gif http://library.thinkquest.gif [9/12/2001 3:51:17 PM] .org/3285/tutorial/images/transform3.org/3285/tutorial/images/transform3.

gif [9/12/2001 3:51:47 PM] .thinkquest.http://library.org/3285/tutorial/images/transform3_big.thinkquest.org/3285/tutorial/images/transform3_big.gif http://library.

1 pigment { color rgb <0. 1> } rotate <0. 0>. 1. 1> } light_source { <10. 0. 50>. 10. 0> } } cylinder { <0. 1. 0>. -50>. 1> pigment { color rgb <0. 0> } } cylinder { <0.pov [9/12/2001 3:51:48 PM] . 1.thinkquest. 0> } cylinder { <-50. 1. 0. <50. 0. -10> color rgb <1. 0. <0. 1.1 pigment { color rgb <0. 10. 0> } } box { <-1.org/3285/tutorial/examples/src/transform3.thinkquest. -10> color rgb <1. 0. 0. -1>.pov // A simple rotated box with x/y/z axes. 50. 0>.http://library. <0.org/3285/tutorial/examples/src/transform3. 1. 0. 0>. 45> } light_source { <-10. -1. 1> } http://library. <1. -10> look_at <0. 5. camera { location <5. 0. 0. 0. -50.1 pigment { color rgb <0.

html [9/12/2001 3:51:50 PM] . Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/tutorial/examples/transform4.The Online POV-Ray Tutorial: Image: Transformation Example #4 The Online POV-Ray Tutorial Image: Transformation Example #4 Translated.thinkquest. cube. then rotated.

gif http://library.org/3285/tutorial/images/transform4.http://library.thinkquest.thinkquest.org/3285/tutorial/images/transform4.gif [9/12/2001 3:51:52 PM] .

gif http://library.thinkquest.org/3285/tutorial/images/transform4_big.gif [9/12/2001 3:52:12 PM] .org/3285/tutorial/images/transform4_big.thinkquest.http://library.

1. 0>. -50>. 1> } http://library.org/3285/tutorial/examples/src/transform4. 0. 0. 0> } cylinder { <-50. -10> look_at <0.pov [9/12/2001 3:52:17 PM] . 0. -1. 2> rotate <0. <0. 0> } } cylinder { <0. -50. 1.1 pigment { color rgb <0. 0. 0. <0. 1. 50>. 1. 50.1 pigment { color rgb <0. 0>. 45> } light_source { <-10. 1> } translate <-1. 5.org/3285/tutorial/examples/src/transform4.pov //A simple translated and rotated box with x/y/z axes camera { location <5. 0. 0> } } cylinder { <0. 0. -1>. 0> } } box { <-1.thinkquest. -10> color rgb <1. 10. 1> pigment { color rgb <0. 0.thinkquest. <1. 0>. 0>. 0. 1. 10. 1> } light_source { <10. 0. 4. 1. <50. -10> color rgb <1.http://library.1 pigment { color rgb <0.

then translated. sphere.html [9/12/2001 3:52:24 PM] .The Online POV-Ray Tutorial: Image: Transformation Example #7 The Online POV-Ray Tutorial Image: Transformation Example #7 Rotated.thinkquest.org/3285/tutorial/examples/transform7. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.

http://library.gif [9/12/2001 3:52:25 PM] .thinkquest.org/3285/tutorial/images/transform7.gif http://library.org/3285/tutorial/images/transform7.thinkquest.

http://library.org/3285/tutorial/images/transform7_big.org/3285/tutorial/images/transform7_big.thinkquest.gif [9/12/2001 3:52:34 PM] .gif http://library.thinkquest.

org/3285/tutorial/examples/src/transform7. 0> } } cylinder { <0. -50. 10. 4. -50>.org/3285/tutorial/examples/src/transform7. 0>. 0> } } box { <-1. 1. 1. 45> translate <-1.thinkquest. -10> look_at <0. -10> color rgb <1. <0. 0. 0> } } cylinder { <0.http://library. <0. 0> } cylinder { <-50. 50. 1> } rotate <0. 1. cube. 10. <1. -10> color rgb <1. <50.pov // A rotated. 0. 0. 1. 0>. 5. with x/y/z axes camera { location <5.pov [9/12/2001 3:52:46 PM] . 0.1 pigment { color rgb <0. 1> pigment { color rgb <0. 0.1 pigment { color rgb <0. 0. 50>. 1. 0. 1> } http://library.thinkquest. then translated. 1> } light_source { <10. 0. 1. 0. 2> } light_source { <-10. 0>. -1. 0>. 0. -1>.1 pigment { color rgb <0.

org/3285/tutorial/examples/transform5.thinkquest.The Online POV-Ray Tutorial: Image: Transformation Example #5 The Online POV-Ray Tutorial Image: Transformation Example #5 Scaled cube.html [9/12/2001 3:52:48 PM] . Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.

thinkquest.http://library.gif http://library.thinkquest.org/3285/tutorial/images/transform5.org/3285/tutorial/images/transform5.gif [9/12/2001 3:52:52 PM] .

org/3285/tutorial/images/transform5_big.http://library.org/3285/tutorial/images/transform5_big.thinkquest.gif [9/12/2001 3:54:59 PM] .gif http://library.thinkquest.

0. 0. 50. 0. 0>.org/3285/tutorial/examples/src/transform5. 0> } } cylinder { <0. 0.http://library. 0>. 1> } scale <1. -50>. 1.1 pigment { color rgb <0. <0. 0>. 0. <50. 1.thinkquest. 1> } light_source { <-10. 1. 1. <0. 1> } http://library. -50.pov //A simple scaled box with x/y/z axes camera { location <5. 4. 0> } cylinder { <-50. 10. -10> look_at <0. 0> } } cylinder { <0. 0. <1. -10> color rgb <1. 1> } light_source { <10. 0. 1> pigment { color rgb <0.1 pigment { color rgb <0.1 pigment { color rgb <0. 50>. 1. 0. 0> } } box { <-1. 1.thinkquest. 0>. -10> color rgb <1.pov [9/12/2001 3:55:03 PM] . 5. -1>.org/3285/tutorial/examples/src/transform5. 0. 10. -1.

The Online POV-Ray Tutorial: Image: Transformation Example #6 The Online POV-Ray Tutorial Image: Transformation Example #6 Scaled.thinkquest.org/3285/tutorial/examples/transform6. translated and rotated torus.html [9/12/2001 3:55:04 PM] . Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.

org/3285/tutorial/images/transform6.thinkquest.thinkquest.org/3285/tutorial/images/transform6.http://library.gif http://library.gif [9/12/2001 3:55:06 PM] .

thinkquest.org/3285/tutorial/images/transform6_big.thinkquest.gif [9/12/2001 3:55:29 PM] .org/3285/tutorial/images/transform6_big.gif http://library.http://library.

0.1 pigment { color rgb <0. -50. -10> look_at <0. 1. 0. -10> color rgb <1.http://library. 0> } } // y axis cylinder { <0. 10.pov [9/12/2001 3:55:37 PM] .1 pigment { color rgb <0. 2. 10.inc" torus { 3. 0> } // x axis cylinder { <-50. 0> } } //z axis cylinder { <0. 0. 0>.thinkquest. -10> color rgb <1. <0. 1 pigment { color Yellow } scale <1. 0. 0. 0. 1. <0.1 pigment { color rgb <0. 0. 1> rotate <-45.org/3285/tutorial/examples/src/transform6. 0>. 1. 0.pov // A translated. 1. 50. scaled and rotated torus #include "colors. 0. 1> } http://library. 50>. 0> } camera { location <5. 0>. -50>.5. 1> } light_source { <10. 5. 0> translate <0.thinkquest. 0>.org/3285/tutorial/examples/src/transform6. 1. <50. 0> } } light_source { <-10. 1.

thinkquest.org/3285/tutorial/examples/pigment1.html [9/12/2001 3:55:39 PM] . Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.The Online POV-Ray Tutorial: Image: Pigment Example #1 The Online POV-Ray Tutorial Image: Pigment Example #1 A sphere with a gradient color map.

http://library.thinkquest.thinkquest.org/3285/tutorial/images/pigment1.gif http://library.gif [9/12/2001 3:56:03 PM] .org/3285/tutorial/images/pigment1.

org/3285/tutorial/images/pigment1_big.http://library.gif http://library.thinkquest.gif [9/12/2001 3:56:41 PM] .org/3285/tutorial/images/pigment1_big.thinkquest.

org/3285/tutorial/examples/src/pigment1.5.thinkquest.thinkquest.inc" // first.0 color Green] } scale 3 // make the pigment bigger } } http://library.0>.0.-10> color White } // the sphere sphere { <0. 1.pov [9/12/2001 3:56:42 PM] . the camera position camera { location <2.pov // This is a sphere demonstrating the gradient pigment #include "colors.0. some light light_source { <0. 0> color_map { [0. 5 pigment { gradient <0.0 color Red] [0.http://library.-10> look_at <0.org/3285/tutorial/examples/src/pigment1.-10> color White } light_source { <0.10.25 color Blue] [1.0.0> } // now.

org/3285/tutorial/examples/pigment2.The Online POV-Ray Tutorial: Image: Pigment Example #2 The Online POV-Ray Tutorial Image: Pigment Example #2 A sphere with a gradient color map and some turbulence. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.thinkquest.html [9/12/2001 3:56:44 PM] .

org/3285/tutorial/images/pigment2.thinkquest.http://library.gif [9/12/2001 3:56:47 PM] .gif http://library.org/3285/tutorial/images/pigment2.thinkquest.

http://library.gif http://library.org/3285/tutorial/images/pigment2_big.org/3285/tutorial/images/pigment2_big.thinkquest.gif [9/12/2001 3:58:05 PM] .thinkquest.

some light light_source { <0. 5 pigment { gradient <0.pov [9/12/2001 3:58:09 PM] .-10> color White } // the sphere sphere { <0.0>.-10> look_at <0.0> } // now.25 color Blue] [1.thinkquest.org/3285/tutorial/examples/src/pigment2.org/3285/tutorial/examples/src/pigment2.0 color Red] [0.-10> color White } light_source { <0. 1.5.10.0.http://library. 0> turbulence 0.inc" // first. 0> } } http://library.0. the camera position camera { location <2.5 color_map { [0.0. 10.0 color Green] } scale 3 // make the pigment bigger translate <0.pov // This is a sphere demonstrating the gradient pigment and turbulence #include "colors.thinkquest.

The Online POV-Ray Tutorial: Image: Finish Example #1 The Online POV-Ray Tutorial Image: Finish Example #1 Sphere with phong highlights.html [9/12/2001 3:58:12 PM] . Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/tutorial/examples/finish1.thinkquest.

thinkquest.http://library.org/3285/tutorial/images/finish1.org/3285/tutorial/images/finish1.thinkquest.gif http://library.gif [9/12/2001 3:58:20 PM] .

org/3285/tutorial/images/finish1_big.http://library.org/3285/tutorial/images/finish1_big.thinkquest.gif [9/12/2001 3:58:34 PM] .thinkquest.gif http://library.

org/3285/tutorial/examples/src/finish1.http://library.thinkquest.5.-10> color rgb <1.org/3285/tutorial/examples/src/finish1.1> } // the sphere sphere { <0. 0> color rgb <1. 5 pigment { color rgb <0. some light light_source { <-7.1.pov [9/12/2001 3:58:37 PM] .1.pov // This is a simple red sphere with phong highlights // first.0.0>.1.thinkquest.-10> look_at <0.0> } finish { phong 1 } } http://library. the camera position camera { location <2.1> } light_source { <17. -10.0> } // now.0.10.

html [9/12/2001 3:58:38 PM] .org/3285/tutorial/examples/finish2.thinkquest. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.The Online POV-Ray Tutorial: Image: Finish Example #2 The Online POV-Ray Tutorial Image: Finish Example #2 Yellow mirrorish sphere floating above an infinite checkerboard.

gif [9/12/2001 3:58:45 PM] .gif http://library.thinkquest.http://library.org/3285/tutorial/images/finish2.thinkquest.org/3285/tutorial/images/finish2.

gif [9/12/2001 3:59:41 PM] .thinkquest.thinkquest.org/3285/tutorial/images/finish2_big.gif http://library.org/3285/tutorial/images/finish2_big.http://library.

5.org/3285/tutorial/examples/src/finish2.org/3285/tutorial/examples/src/finish2. 0 // along the x-z plane (y is the normal vector) pigment { checker color Black color White } // checkered pattern } sphere { <0. 3. -10> color White } light_source { <-10.pov [9/12/2001 3:59:42 PM] . -15> color White } http://library.9 phong 1 } } light_source { <10. 0>. 5. 2 pigment { color Yellow } finish { reflection 0. 5.thinkquest. 0> } plane { // the floor y.http://library. 10.inc" camera { location <-2.thinkquest.pov // A yellow mirrorish sphere above a checkerboard #include "colors. -10> look_at <0.

html [9/12/2001 3:59:47 PM] .org/3285/tutorial/examples/finish3. Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.thinkquest.The Online POV-Ray Tutorial: Image: Finish Example #3 The Online POV-Ray Tutorial Image: Finish Example #3 A crystal ball.

thinkquest.org/3285/tutorial/images/finish3.http://library.gif [9/12/2001 4:00:05 PM] .thinkquest.org/3285/tutorial/images/finish3.gif http://library.

thinkquest.gif [9/12/2001 4:01:22 PM] .thinkquest.org/3285/tutorial/images/finish3_big.http://library.org/3285/tutorial/images/finish3_big.gif http://library.

8> } // transparent sphere finish { reflection 0. 0> } plane { // the floor z.1 refraction 1. 5. 1.5 phong 1 } } light_source { <10. 10 // along the x-z plane (y is the normal vector) pigment { checker color Green color Yellow } // checkered pattern } sphere { <0.pov [9/12/2001 4:01:27 PM] . 5.http://library. . -10> color White } http://library. 10. 2 pigment { color rgbf <1.0 ior 1.inc" camera { location <-2. 0>. 5. -5> look_at <0. 1.thinkquest.thinkquest.org/3285/tutorial/examples/src/finish3.pov // A crystal ball #include "colors.org/3285/tutorial/examples/src/finish3.

Viewing "collectively" will show you all the possible images you can view and allow you to select from them. we just chose a range of values so you could get a feel for how the parameter changes the object. select an option from the menu below and press "Select". I want to experiment with highlights and view the images individually Select Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.cgi [9/12/2001 4:01:29 PM] .thinkquest. Viewing "individually" will show you an image and allow you to vary the amount of the finish. To experiment with a parameter. The images we have here do not represent the only allowable values for these parameters.The Online POV-Ray Tutorial: Finish Tool The Online POV-Ray Tutorial Finish Exploration Tool This tool is designed to let you experiment with different values of different finishes.org/3285/cgi-bin/SelectFinish.

Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/tutorial/examples/normal1.thinkquest.html [9/12/2001 4:01:33 PM] .The Online POV-Ray Tutorial: Image: Normal Example #1 The Online POV-Ray Tutorial Image: Normal Example #1 A bumpy cone.

thinkquest.gif [9/12/2001 4:01:41 PM] .gif http://library.org/3285/tutorial/images/normal1.thinkquest.org/3285/tutorial/images/normal1.http://library.

org/3285/tutorial/images/normal1_big.gif http://library.thinkquest.org/3285/tutorial/images/normal1_big.thinkquest.gif [9/12/2001 4:02:04 PM] .http://library.

thinkquest.http://library.org/3285/tutorial/examples/src/normal1.1 texture { normal { bumps 0.2. -3.pov [9/12/2001 4:02:05 PM] .0. 0>.2. some light light_source { <3.-6> look_at <0.5 // add some bumps scale 1/6 } pigment { color rgb <.2.org/3285/tutorial/examples/src/normal1.pov // A bumpy cone // first.7.0> } // now.-6> color rgb <2.5. 3. .2> } // the cone cone { <0. . 0>.thinkquest.2> } } } http://library. 1 <0. the camera position camera { location <2. 0.

The Online POV-Ray Tutorial: Image: Normal Example #2 The Online POV-Ray Tutorial Image: Normal Example #2 A blue plane with ripples.thinkquest.html [9/12/2001 4:02:06 PM] . Original Image Large Image Source Code Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.org/3285/tutorial/examples/normal2.

org/3285/tutorial/images/normal2.thinkquest.http://library.org/3285/tutorial/images/normal2.gif http://library.thinkquest.gif [9/12/2001 4:02:13 PM] .

org/3285/tutorial/images/normal2_big.gif http://library.thinkquest.http://library.thinkquest.gif [9/12/2001 4:05:12 PM] .org/3285/tutorial/images/normal2_big.

org/3285/tutorial/examples/src/normal2.thinkquest.-6> look_at <0.2. .0> } // now. .pov [9/12/2001 4:05:13 PM] .2.9> } normal { ripples 0.5.1.http://library.0.-6> color rgb <2.pov // A plane with ripples // first. -2 texture { pigment { color rgb <. the camera position camera { location <-4.thinkquest.9. some light light_source { <3.2> } plane { y.5 } } } http://library.org/3285/tutorial/examples/src/normal2.

thinkquest. we just chose a range of values so you could get a feel for how the parameter changes the object.The Online POV-Ray Tutorial: Normal Tool The Online POV-Ray Tutorial Normal Exploration Tool This tool is designed to let you experiment with different values of different normals. To experiment with a parameter. Viewing "collectively" will show you all the possible images you can view and allow you to select from them. select an option from the menu below and press "Select".cgi [9/12/2001 4:05:15 PM] .org/3285/cgi-bin/SelectNormal. Viewing "individually" will show you an image and allow you to vary the amount of the normal modifier. The images we have here do not represent the only allowable values for these parameters. I want to experiment with bumps and view the images individually Select Top of Document Main Page The Online POV-Ray Tutorial © 1996 The Online POV-Ray Tutorial ThinkQuest Team http://library.

1> } camera { location <-2.5.org/3285/language/src/csg7.thinkquest.pov [9/12/2001 4:05:46 PM] . 1> pigment { color Red } } cylinder { <1. -1.pov #include "colors.inc" union { box { <-1. 0> } http://library. <1. -300> color rgb <1.http://library.5 pigment { color Green } } } plane { y.thinkquest.5.5>. -3 pigment { checker color White color Black } } plane { -z. 1. -1. -1. -1>. 0. 200.org/3285/language/src/csg7.5>. <-1. 3.5. 1. 1. 1. 0. -3 pigment { checker color White color Black } } light_source { <-400.5. -4> look_at <0.

1> } camera { location <2.pov box { <-1. 1>. 40.pov [9/12/2001 4:06:23 PM] . -1.thinkquest. 0> } } light_source { <40. 0> } http://library. <1. 0.6 } } pigment { color rgb <1. 1.thinkquest. -1>.org/3285/language/src/modifie1. 1. -50> color rgb <1. 2. 2. 1. 1> clipped_by { sphere { <-1.org/3285/language/src/modifie1. -5> look_at <0.http://library. -1.

1.pov [9/12/2001 4:06:24 PM] . 1>. 0> } } light_source { <40. -50> color rgb <1. 2. -1>.thinkquest. 1> } camera { location <2. <1. 2. 0. -5> look_at <0.6 } } pigment { color rgb <1.org/3285/language/src/modifie2. 40. -1>. 0> } http://library.http://library. -1.6 } sphere { <1. -1. 1. 1> clipped_by { sphere { <-1. 2. 1.org/3285/language/src/modifie2.pov box { <-1. 1.thinkquest.

thinkquest.org/3285/language/src/pig19. -50> color rgb <1. -2> look_at <0.5> } http://library. 0.5. <1.5. 1> } camera { location <1. 0.http://library.5.5.gif" } } } plane { -z. 0>. 1. 1> pigment { image_map { gif ". 0. 1. 1.org/3285/language/src/pig19./gfx/mmap.pov box { <0.pov [9/12/2001 4:06:27 PM] . 0> rotate 45*z } } light_source { <50. 1. -10 pigment { checker color rgb <1.thinkquest. 0.. 1> color rgb <0. 30.

. 1> } camera { location <1.5> } http://library. -10 pigment { checker color rgb <1. 0> rotate 45*z } } light_source { <50. 0.5.5 pigment { image_map { gif ".5. -50> color rgb <1. 1. -2> look_at <0. 1.thinkquest.gif" map_type 1 } rotate y*-90 } translate <0. 0. 0>.pov sphere { <0.pov [9/12/2001 4:06:32 PM] .5> } plane { -z. 0. 1. 30.5. 0.5.http://library. 1> color rgb <0. 0.5.thinkquest. 0.5. 0./gfx/mmap.org/3285/language/src/modifie7.org/3285/language/src/modifie7.

pov cylinder { <0. 1> color rgb <0.5.org/3285/language/src/modifie8.thinkquest.http://library./gfx/mmap.thinkquest.org/3285/language/src/modifie8.gif" map_type 2 } rotate y*-90 } translate <0.. 0.5> } http://library.5. 0. 0. 0.5> } plane { -z. 1. 1> } camera { location <1.5.pov [9/12/2001 4:06:33 PM] . -10 pigment { checker color rgb <1. 0. 1. 0. <0. 0> rotate 45*z } } light_source { <50. 30. 0. 1.5.5.5. -50> color rgb <1. 0>. -2> look_at <0.5 pigment { image_map { gif ". 1. 0>.

5> } http://library. 0.gif" map_type 5 } rotate y*-90 } translate <0./gfx/mmap. 0. 0.5. 0. 0.thinkquest.75.5> } plane { -z. 1> color rgb <0.pov torus { 0.pov [9/12/2001 4:06:34 PM] . 1. 1. 1> } camera { location <1.org/3285/language/src/modifie9.org/3285/language/src/modifie9.5.5..thinkquest.5.5.http://library.25 pigment { image_map { gif ". 1. 0. -10 pigment { checker color rgb <1.5. 30. -2> look_at <0. 0> rotate 45*z } } light_source { <50. -50> color rgb <1.

http://library.thinkquest.org/3285/language/src/modifie5.pov

sphere { <0, 0, 0>, 1 pigment { color rgb <1, 0, 0> } } disc { <0, -2, 0>, y, 4 pigment { checker color rgb <1, 1, 1> color rgb <0, 0, 0> } } light_source { <10, 50, -10> color rgb <1, 1, 1> } camera { location <0, 1, -4> look_at <0, -1, 0> }

http://library.thinkquest.org/3285/language/src/modifie5.pov [9/12/2001 4:06:35 PM]

http://library.thinkquest.org/3285/language/src/modifie6.pov

sphere { <0, 0, 0>, 1 no_shadow pigment { color rgb <1, 0, 0> } } disc { <0, -2, 0>, y, 4 pigment { checker color rgb <1, 1, 1> color rgb <0, 0, 0> } } light_source { <10, 50, -10> color rgb <1, 1, 1> } camera { location <0, 1, -4> look_at <0, -1, 0> }

http://library.thinkquest.org/3285/language/src/modifie6.pov [9/12/2001 4:06:36 PM]

http://library.thinkquest.org/3285/language/src/modifie3.pov

cylinder { <0, 0, -2>, <0, 0, 2>, 0.5 pigment { color rgb <1, 0, 0> } rotate <-6, 6, 0> } light_source { <0, 4, -20> color rgb <1, 1, 1> } camera { location <0, 0, -4> look_at <0, 0, 0> }

http://library.thinkquest.org/3285/language/src/modifie3.pov [9/12/2001 4:06:43 PM]

http://library.thinkquest.org/3285/language/src/modifie4.pov

cylinder { <0, 0, -2>, <0, 0, 2>, 0.5 open pigment { color rgb <1, 0, 0> } rotate <-6, 6, 0> } light_source { <0, 4, -20> color rgb <1, 1, 1> } camera { location <0, 0, -4> look_at <0, 0, 0> }

http://library.thinkquest.org/3285/language/src/modifie4.pov [9/12/2001 4:06:44 PM]

http://library.thinkquest.org/3285/language/src/texture1.pov

box { <0, 0, 0>, <1, 0.99, 1> texture { material_map { gif "mmap.gif" texture { pigment { mandel 100 color_map { [0.00 color rgb <0.2, 0, 0.2>] [0.10 color rgb <1, 0, 1>] [0.60 color rgb <1, 1, 1>] [1.00 color rgb <1, 1, 1>] [1.00 color rgb <0, 0, 0>] } scale 1/4 rotate <0, 0, -45> translate <0.5, 0.5, 0> } } texture { pigment { mandel 100 color_map { [0.00 color rgb <0, 0.2, 0.2>] [0.10 color rgb <0, 1, 1>] [0.60 color rgb <1, 1, 1>] [1.00 color rgb <1, 1, 1>] [1.00 color rgb <0, 1, 1>] } scale 1/4 rotate <0, 0, -45> translate <0.5, 0.5, 0> } } texture { pigment { marble color_map { [0 color rgb <0, 0, 0>] [1 color rgb <1, 1, 1>] } turbulence 1.0 scale 1/6 } } texture { pigment { color rgb <1, 1, 1> } finish { reflection 0.8 diffuse 0.2 ambient 0 } normal { bumps 0.1 scale 1/2 } } } }

http://library.thinkquest.org/3285/language/src/texture1.pov (1 of 2) [9/12/2001 4:06:51 PM]

http://library.thinkquest.org/3285/language/src/texture1.pov

scale 4 } disc { <0, 0, 0>, y, 15 pigment { checker color rgb <0, 0, 0> color rgb <1, 1, 1> } rotate 30 * y } light_source { <50, 50, -100> color rgb <1, 1, 1> } camera { location <2, 2, -5> look_at <2, 2, 0> }

http://library.thinkquest.org/3285/language/src/texture1.pov (2 of 2) [9/12/2001 4:06:51 PM]

http://library.thinkquest.org/3285/language/src/texture2.pov

#default { finish { ambient 0 diffuse 1 } } sphere { <0, 0, 0>, 2 texture { pigment { bozo color_map { [0.0 color rgb <0.3, 0, 0>] [1.0 color rgb <0.6, 0.2, 0>] } turbulence 0.3 scale 1/2 } } } light_source { <50, 35, -50> color rgb <1, 1, 1> } camera { location <0, 0, -6> look_at <0, 0, 0> }

http://library.thinkquest.org/3285/language/src/texture2.pov [9/12/2001 4:06:56 PM]

http://library.thinkquest.org/3285/language/src/texture3.pov

#default { finish { ambient 0 diffuse 1 } } sphere { <0, 0, 0>, 2 texture { pigment { bozo color_map { [0.0 color rgb <0.3, 0, 0>] [1.0 color rgb <0.6, 0.2, 0>] } turbulence 0.3 scale 1/2 } } texture { pigment { agate color_map { [0.0 color rgbf <1, 1, 1, 1>] [0.5 color rgbf <1, 1, 1, 1>] [0.5 color rgbf <0.5, 0, 0, 1>] [0.75 color rgb <0.5, 0, 0>] [1.0 color rgb <1, 0.5, 0>] } turbulence 1.0 scale 1.5 } } } light_source { <50, 35, -50> color rgb <1, 1, 1> } camera { location <0, 0, -6> look_at <0, 0, 0> }

http://library.thinkquest.org/3285/language/src/texture3.pov [9/12/2001 4:06:57 PM]

0 color rgb <1.5 color rgbf <1. 0.5. 0. 1. 1>] [0. 0>.2. 1> } camera { location <0. 1. 1>] } } } } light_source { <50.0 color rgbf <1. 0.0 color rgbf <1.org/3285/language/src/texture4.0 color rgb <0.6.0 color rgb <0.3 scale 1/2 } } texture { pigment { agate color_map { [0.pov [9/12/2001 4:06:59 PM] . 0>] } turbulence 0. 0>] } turbulence 1.thinkquest.0 color rgb <1.0 scale 1. 1. -50> color rgb <1. 2 texture { pigment { bozo color_map { [0. 0. 0.5 color rgbf <0. 1>] [0. 1.5. 1>] [1. -6> look_at <0.org/3285/language/src/texture4.3. 1. 0. 1.2 color rgbf <1.thinkquest. 1.5. 0. 35. 1.5 } } texture { pigment { granite color_map { [0. 1. 0.pov #default { finish { ambient 0 diffuse 1 } } sphere { <0.http://library. 0>] [1. 1. 1>] [0.75 color rgb <0. 0. 0>] [1. 0> } http://library. 0>] [0.

0 texture { tiles { texture { pigment { marble color_map { [0. 1.http://library.thinkquest. 0>] } turbulence 0.org/3285/language/src/texture5.25>] [1.25.0 color rgb <0.0 color rgb <1. 1. 0.75 color rgb <0. 1> } camera { location <0. -6> look_at <0.pov [9/12/2001 4:07:04 PM] . 0.75. -6> color rgb <1.75>] [1. 0. 0. 90> } } } } light_source { <5.org/3285/language/src/texture5. 0. 0.8 } finish { phong 0. 0.75. 0.0 color rgb <1.7 } rotate <0. 1>] [0. 1.8 } finish { phong 0.25. 0.thinkquest. 0>] [0.0 color rgb <0.7 } } tile2 texture { pigment { marble color_map { [0. 0> } http://library.pov plane { -z. 1>] } turbulence 0. 0.75 color rgb <0.

0. 0> } http://library. 1> } camera { location <6.org/3285/language/src/texture6. 0. 0.pov [9/12/2001 4:07:05 PM] . 0. 0.org/3285/language/src/texture6.0 color rgb <1. 1.thinkquest.http://library. 0 rotate <-55.25>] [1.75 color rgb <0. 1>] [0. 1/2.75 color rgb <0. 0>] } turbulence 0.25. 0.7 } rotate <0.7 } } tile2 texture { pigment { marble color_map { [0.8 } finish { phong 0. -6> look_at <0.25.thinkquest.75>] [1. 0.8 } finish { phong 0. 0>] [0. 0> texture { tiles { texture { pigment { marble color_map { [0. 50. -50> color rgb <1.75.0 color rgb <0. 0. 0.pov plane { y. 1>] } turbulence 0.0 color rgb <1. 1.75. -45. 1.0 color rgb <0. 90> } } } scale 3 } light_source { <50. 0> translate <0.

5. 200.pov #declare Pigm = pigment { granite color_map { [0. 0. 0. -1.25>] } } sphere { <1.00 color rgb <1.org/3285/language/src/pig18. 0. 0. -500> color rgb <1. 0.5.pov [9/12/2001 4:07:13 PM] . 0.25>] [0. 1.25.25>] [0.25.25.thinkquest. <-0. 1. -1>.http://library. 1. 1> } camera { location <2.25. 1 pigment { Pigm translate <1. 1>] [1.25>] [0. 1. 0. 0> } } light_source { <150. 0. 0> } } box { <-2.5. 0.66 color rgb <0. 0. -5> look_at <0.00 color rgb <1. 0>.thinkquest.25. 0. 1> pigment { Pigm translate <-1. 2.5.33 color rgb <1.org/3285/language/src/pig18.5.50 color rgb <0. 0> } http://library.

-1. 1> } camera { location <2. 1.5. 0.25.25. 1. 0> } } box { <-2.org/3285/language/src/pig14. 0.5. 0>.25> scale 0. <-0.5. 0. 0. 1. 1 pigment { Pigm translate <1. 0> } } light_source { <150. 1> color rgb <0.25.org/3285/language/src/pig14.pov #declare Pigm = pigment { hexagon color rgb <1. 0.pov [9/12/2001 4:07:14 PM] .http://library. 0> } http://library.thinkquest.thinkquest.25. -1>.25> color rgb <0. -500> color rgb <1.5. 0. -5> look_at <0.5 } sphere { <1. 0. 2. 200. 0.5. 1> pigment { Pigm translate <-1.

pov #declare Pigm = pigment { leopard color_map { [0.pov [9/12/2001 4:07:22 PM] . 0. -500> color rgb <1.25>] [0. 1>] [1. 1> pigment { Pigm translate <-1.5.5. 1 pigment { Pigm translate <1.50 color rgb <0. 0. -1. 2. 1. -5> look_at <0.66 color rgb <0.25.00 color rgb <1.00 color rgb <1. <-0. 0.25. 0.thinkquest. 1.thinkquest. 0. 0. 200.5.33 color rgb <1. 1. 1> } camera { location <2. 0>.http://library.25. 0.5. 0.25>] [0. 0.25.org/3285/language/src/pig3. 0.25>] [0.org/3285/language/src/pig3.25>] } scale 1/5 } sphere { <1. 0> } } box { <-2. 1.25. 0.5. -1>. 0> } } light_source { <150. 0> } http://library.

5.25.thinkquest.org/3285/language/src/pig4. 0>.5. 1. -500> color rgb <1.33 color rgb <1. 0. 0. -5> look_at <0. 1. 0.25. 0. 0.50 color rgb <0.25>] } } sphere { <1. 0> } } light_source { <150.http://library. 200.pov #declare Pigm = pigment { mandel 50 color_map { [0. 0.5. 2. 1 pigment { Pigm translate <1. 1> pigment { Pigm translate <-1.25>] [0. <-0.00 color rgb <1. 1.00 color rgb <1. 0. 1. 0. -1>. 0. 0.25.25. 0.org/3285/language/src/pig4. 0> } } box { <-2.pov [9/12/2001 4:07:23 PM] . -1.25.thinkquest. 0> } http://library. 1> } camera { location <2.66 color rgb <0.5.25>] [0. 1>] [1.25>] [0.5.

25. -1. 1>] [1.25. 1.25>] [0. 2.5.pov #declare Pigm = pigment { marble color_map { [0. 0.25>] } } sphere { <1. 1 pigment { Pigm translate <1. 0. 0.25>] [0.00 color rgb <1. <-0.25. 0. 0> } } box { <-2. 0>. 0.25.pov [9/12/2001 4:07:25 PM] . 1. 1. 1. 0. 0> } } light_source { <150. 1> } camera { location <2. 1> pigment { Pigm translate <-1.33 color rgb <1.org/3285/language/src/pig5. 0> } http://library.25. 0. -500> color rgb <1.org/3285/language/src/pig5.thinkquest.00 color rgb <1.5.50 color rgb <0.66 color rgb <0. 0.5.25>] [0. -5> look_at <0.5. 200. 0. 0.http://library. -1>.thinkquest. 0.5.

5.5. <-0.25. 1> pigment { Pigm translate <-1. -500> color rgb <1.25>] [0. 0. -5> look_at <0. 0.25.org/3285/language/src/pig17. 1>] [1.pov [9/12/2001 4:07:26 PM] .thinkquest.25. 0.org/3285/language/src/pig17.25>] [0.50 color rgb <0.5.25>] } turbulence 0.00 color rgb <1. 0>.5. 0. 1.pov #declare Pigm = pigment { marble color_map { [0.thinkquest. 0. 1. -1>. 0> } http://library. -1. 1.00 color rgb <1. 1 pigment { Pigm translate <1.25.33 color rgb <1. 1. 0> } } box { <-2. 0.25.http://library. 200. 1> } camera { location <2.25>] [0. 0> } } light_source { <150. 0. 2. 0. 0. 0.66 color rgb <0. 0.5.8 } sphere { <1.

25. 0.25.00 color rgb <1.5.5. 0>. 0. 0> } } light_source { <150.00 color rgb <1.pov [9/12/2001 4:07:36 PM] . 0.25>] [0. 0.thinkquest. 1> } camera { location <2. 0. 1>] [1.25>] [0. -500> color rgb <1. 0> } http://library. <-0. 0.25>] [0.http://library.org/3285/language/src/pig6. 1.5. 0. -1>. 1.50 color rgb <0.org/3285/language/src/pig6. 0.25.25.pov #declare Pigm = pigment { onion color_map { [0.66 color rgb <0. 0.thinkquest.33 color rgb <1. 2. 1 pigment { Pigm translate <1.5.25>] } } sphere { <1. 0. 200. 1. 1.25. 0> } } box { <-2.5. -1. -5> look_at <0. 1> pigment { Pigm translate <-1. 0.

pov [9/12/2001 4:07:43 PM] . -500> color rgb <1.5. 0. 0> } } light_source { <150. 1> } camera { location <2.5. 0. 0. -1>. 200. 1.5.5.25>] [0.org/3285/language/src/pig8. 0. 0. 0. -1. 1> pigment { Pigm translate <-1.00 color rgb <1. 0.thinkquest. 0>. 0> } } box { <-2. 0.thinkquest. 0> } http://library.25.5.66 color rgb <0. 1 pigment { Pigm translate <1.25>] [0.25.25.http://library. 0.org/3285/language/src/pig8. 0.25. -5> look_at <0.25>] } } sphere { <1. 1.00 color rgb <1. 2. 0. 1>] [1.50 color rgb <0. 1.pov #declare Pigm = pigment { spotted color_map { [0.33 color rgb <1. 1.25>] [0.25. <-0.

1> } camera { location <2.00 color rgb <1.25>] [0. 0> } http://library. 1> pigment { Pigm translate <-1. 0. 1 pigment { Pigm translate <1. 1>] [1. 1. -1.thinkquest. 200. 0> } } light_source { <150. 0.33 color rgb <1. -1>. 0.50 color rgb <0. <-0. 2.25>] [0. 1.pov #declare Pigm = pigment { wood color_map { [0.pov [9/12/2001 4:07:48 PM] .5. 0. 0.org/3285/language/src/pig9. 1. -500> color rgb <1.25.5. 0.25>] } } sphere { <1.5. 0> } } box { <-2. 1.00 color rgb <1.25.25>] [0.25.org/3285/language/src/pig9. 0>. 0. 0.25.66 color rgb <0. 0.http://library.5. 0.25. -5> look_at <0.5. 0.thinkquest.

0>.pov [9/12/2001 4:08:00 PM] . 1> color rgb <0. 0 } cone { <0. 1 <0. 0>. 0> } http://library. 0 } cone { <4.org/3285/language/src/languag1. 0>. 0. 0. 0 pigment { checker color rgb <1. 7. 0>. 3. 3. 1 <0. 0 } cone { <0.org/3285/language/src/languag1. 200. 1 <0. -4>. 4>. 0.http://library. 1> } camera { location <2. 0. 0>.thinkquest. 0> } } union { cone { <0. 1. 0. 4>.thinkquest. -500> color rgb <1.pov plane { y. 1. 0>. -2> look_at <0. 1 <-4. 0> } } light_source { <-100. 0 } cone { <-4. 3. 0 } pigment { color rgb <1. 1 <4. 4. 0. 3. 0. 1. -4>.

0. -2> look_at <0.thinkquest. 0 pigment { checker color rgb <1. 1.thinkquest. 200. 0 } cone { <-4.pov plane { y. 1. 0>. 1 <-4. 1 <4. 0> } } fog { color rgb <0. 4>. 0> } } union { cone { <0. 0>. 0. 0. 1 <0. 7. 0 } pigment { color rgb <1. 0 } cone { <0.pov [9/12/2001 4:08:04 PM] . 3.http://library. 0>. 3. 4. -4>. 0>. 0>. 1. -4>. 1 <0. 0> } http://library. 4>. 3.org/3285/language/src/languag2. 0. 1> } camera { location <2.org/3285/language/src/languag2. 0. 1 <0. 0>. 0. 0. 1> color rgb <0. -500> color rgb <1. 1> distance 12 } light_source { <-100. 0 } cone { <0. 3. 0. 0 } cone { <4.

2. 2. -8> look_at <0. 0> color rgb <1. 0>. 0 pigment { hexagon color rgb <1.pov cone { <0.4. -50> color rgb <1. 1.org/3285/language/src/languag3.org/3285/language/src/languag3. 0. 0> color rgb <1. 50. 1> } camera { location <0. 0. 0> } http://library. 0. 0> scale 1/6 } } light_source { <50. 1. <0.http://library.thinkquest.thinkquest. 0>. 4. 1.pov [9/12/2001 4:08:05 PM] .7.

0. 2. 0> color rgb <1. 0> } light_source { <50. -50> color rgb <1. 0.pov [9/12/2001 4:08:08 PM] . 4. -8> look_at <0.org/3285/language/src/languag4. 2. 0>.4.http://library.org/3285/language/src/languag4. 90. 1. 1. 1> } camera { location <0. 50. 0.thinkquest. <0. 0> } http://library. 0>. 0> scale 1/6 } rotate <-90. 0> color rgb <1. 1. 0 pigment { hexagon color rgb <1.thinkquest.7.pov cone { <0.

4. <0. -8> look_at <0. 1> } camera { location <0. 1.http://library. 4. 0. 50. 1. 0. 0> color rgb <1.pov [9/12/2001 4:08:10 PM] .thinkquest. 0> scale 1/6 } rotate 90*y rotate -90*x } light_source { <50.7. 1. 0. -50> color rgb <1. 2.pov cone { <0. 0> } http://library. 0>. 0 pigment { hexagon color rgb <1.org/3285/language/src/languag5. 2. 0> color rgb <1. 0>.org/3285/language/src/languag5.thinkquest.

pov [9/12/2001 4:08:11 PM] . 0.866025>. 0> } http://library. 0.866025>. 3.25 } cylinder { <-0.5. 0>.25 } cylinder { <-0. -50> color rgb <1. 1. 1. 1> color rgb <0. 0. <1. 0.org/3285/language/src/languag9.866025>. 0>. 0. 1> } } disc { <0.org/3285/language/src/languag9.25 } pigment { color rgb <0.pov union { cylinder { <1. 0. 50. 1.866025>. 0>. 0.http://library. 1. <-0.thinkquest. 0. -0.5.5> look_at <0.5. <-0. -0. 0> } } light_source { <50. 1> } camera { location <1.thinkquest. 0.5. -1. 3 pigment { checker color rgb <1. 1.5. y. 0. 1. 0.

0>. 1.25 rotate 240*y } pigment { color rgb <0.thinkquest. 0. -1. 1. 0. 0.25 rotate 120*y } cylinder { <1. 0. 1. -50> color rgb <1. 50. <1. 0. y. 0.pov union { cylinder { <1.5. 1. 0. 0>.org/3285/language/src/langua10. <1.thinkquest. 0.org/3285/language/src/langua10. 0>. 0>. 1> color rgb <0. 3 pigment { checker color rgb <1.25 } cylinder { <1. <1. 0> } http://library. 1> } camera { location <1. 0>. 1. 1. 0> } } light_source { <50. 1> } } disc { <0. 3. 0>.5> look_at <0. 0>.pov [9/12/2001 4:08:12 PM] .http://library. 0.

6.org/3285/language/src/languag6.pov box { <0. 0. 1. 1.6. 1.25. 1. -2> look_at <0.9 } } light_source { <50.2.org/3285/language/src/languag6.http://library. 1.thinkquest.0> scale 1/3.thinkquest. 0> } http://library.25. -50> color rgb <1. 0.5>. 0. 1> } camera { location <1. <1. -0.2. 0. 50. 0.pov [9/12/2001 4:08:22 PM] .0> color rgb <0.5> pigment { checker color rgb <0.

6.0> scale 1/3. <1.5> pigment { checker color rgb <0.9 } scale <1. 1.thinkquest.25.5>.25. 0> } http://library. -2> look_at <0.http://library. -50> color rgb <1.org/3285/language/src/languag7. 0.pov [9/12/2001 4:08:23 PM] . 0. 1> rotate 45*z } light_source { <50. 0.2.org/3285/language/src/languag7.2. -0. 0. 0. 1> } camera { location <1. 1. 1. 1.pov box { <0.thinkquest. 1/3.0> color rgb <0. 1.6. 50.

thinkquest. 0. 1> } camera { location <1.http://library. 1. 1/3. 0. 1.2.0> color rgb <0.0> scale 1/3.2.pov box { <0. 0> } http://library.thinkquest.pov [9/12/2001 4:08:24 PM] . 1. 1.9 } rotate 45*z scale <1. 1> } light_source { <50.5>.6.25. -50> color rgb <1. 50. <1.org/3285/language/src/languag8.org/3285/language/src/languag8. -0. 0. 0. 1. -2> look_at <0.5> pigment { checker color rgb <0.6.25. 0.

1> color rgb <0.5.org/3285/language/src/fin8. 0. 1. 0.http://library. <-0. 1> } } plane { -z. 1. 1. 0.9 } sphere { <1. 1> } finish { ambient 0.5.thinkquest. 1 pigment { color rgb <1.pov #declare Fin = finish { phong 0. -1.thinkquest. 1. 1.5. -100> color rgb <1. 2. 1> } finish { Fin } } plane { y. 1> color rgb <0. 0> } finish { Fin } } box { <-2.org/3285/language/src/fin8. 500.pov [9/12/2001 4:08:54 PM] . -1 pigment { checker color rgb <1. -5> look_at <0.5 } } light_source { <100. 0. 0>. 0. -4 pigment { checker color rgb <1. 1> } camera { location <2. 0> } http://library. 1> pigment { color rgb <1. -1>.

1. 500. 1> } camera { location <2.5 } } light_source { <100.pov #declare Fin = finish { phong 0. 0. 0. <-0. 0. 1> pigment { color rgb <1.thinkquest. 1> color rgb <0. -100> color rgb <1. 1.pov [9/12/2001 4:08:57 PM] . -5> look_at <0. -1>. 1. -4 pigment { checker color rgb <1.5. 1> } finish { Fin } } plane { y. 1> } } plane { -z. 1> } finish { ambient 0.9 metallic } sphere { <1. 2. -1. 0. 0. 1.5. 1 pigment { color rgb <1. -1 pigment { checker color rgb <1. 0> } http://library. 0>.org/3285/language/src/fin7. 0> } finish { Fin } } box { <-2. 1> color rgb <0.http://library.org/3285/language/src/fin7. 1.5.thinkquest.

5 } } light_source { <100. 1> color rgb <0. 1.5. -1>.5. 1. 2. <-0.http://library. 0> } finish { Fin } } box { <-2.org/3285/language/src/fin9. 1> } finish { Fin } } plane { y. 1> } finish { ambient 0. 0. 1> } camera { location <2. 1> pigment { color rgb <1. -1 pigment { checker color rgb <1. 1. 1.5. 0. 0.thinkquest. 1> } } plane { -z. -1. 0>. 0. 0> } http://library. 0.thinkquest. 500. -100> color rgb <1. 1 pigment { color rgb <1. 1> color rgb <0.pov #declare Fin = finish { phong 0.org/3285/language/src/fin9. 1. -4 pigment { checker color rgb <1.9 phong_size 4 } sphere { <1. -5> look_at <0.pov [9/12/2001 4:08:59 PM] .

1> } finish { Fin } } plane { y.thinkquest. -1. 500. 1. 0. 1> color rgb <0.5.http://library. 0>.9 phong_size 180 } sphere { <1.5 } } light_source { <100.5. 1> pigment { color rgb <1. 1. 0. 1 pigment { color rgb <1. 1. 1> } } plane { -z.5. 1> } camera { location <2.pov [9/12/2001 4:09:04 PM] . -4 pigment { checker color rgb <1. 0> } finish { Fin } } box { <-2.pov #declare Fin = finish { phong 0. 1> } finish { ambient 0. 0. 0> } http://library.org/3285/language/src/fin10.thinkquest. 0. -100> color rgb <1.org/3285/language/src/fin10. 0. 1. <-0. -1 pigment { checker color rgb <1. -1>. 1> color rgb <0. 1. -5> look_at <0. 2.

0> } finish { Fin } } box { <-2.5. -1.http://library. 1> } camera { location <2. 0. 1. -100> color rgb <1. 1> } finish { ambient 0.pov [9/12/2001 4:09:09 PM] . 1. -4 pigment { checker color rgb <1.pov #declare Fin = finish { reflection 0.5. -1 pigment { checker color rgb <1. <-0. 1> } } plane { -z. 0.org/3285/language/src/fin11. 1> pigment { color rgb <1. 1.org/3285/language/src/fin11. 500. 0. 1> color rgb <0. 1.3 } sphere { <1. 1> color rgb <0. 0. -1>. 1 pigment { color rgb <1. 1.5.thinkquest.5 } } light_source { <100. 0.thinkquest. 1> } finish { Fin } } plane { y. 0>. 2. 0> } http://library. -5> look_at <0.

7> } finish { Fin } } plane { y.pov [9/12/2001 4:09:14 PM] . 0. -1 pigment { checker color rgb <1. 1> color rgb <0. 1> } finish { ambient 0.http://library.7> } finish { Fin } } box { <-2. 1. -1. 0>. 0> } http://library.5. -1>. 1. -4 pigment { checker color rgb <1. -5> look_at <0. 0.org/3285/language/src/fin14. 1> pigment { color rgbf <1. 1. 0.thinkquest. 0. 1. 1> } camera { location <2.thinkquest. 1.5. 1> } } plane { -z. 1 pigment { color rgbf <1. 0.5 } } light_source { <100. 1> color rgb <0.pov #declare Fin = finish { refraction 1 ior 1 } sphere { <1. 2. 0. 0. 500.5.org/3285/language/src/fin14. <-0. 1. 0. -100> color rgb <1.

<-0. 1 pigment { color rgbf <1.http://library.pov [9/12/2001 4:09:15 PM] .5 } } light_source { <100. 1. 0. 1> color rgb <0. 1> } finish { ambient 0. 0. -5> look_at <0. -1.org/3285/language/src/fin12.7> } finish { Fin } } plane { y. 1.7> } finish { Fin } } box { <-2. -100> color rgb <1.org/3285/language/src/fin12.5. 1> color rgb <0. 1. -4 pigment { checker color rgb <1.5 } sphere { <1. 1.5.thinkquest.pov #declare Fin = finish { refraction 1 ior 1. 0. 1> } } plane { -z. -1>. -1 pigment { checker color rgb <1. 0. 0. 500. 0.thinkquest. 0>. 0. 0. 1. 1> pigment { color rgbf <1. 0> } http://library.5. 2. 1. 1> } camera { location <2.

5. 1> pigment { color rgbf <1. 0> } http://library. -1.7> } finish { Fin } } box { <-2. 0.org/3285/language/src/fin13. 0.thinkquest.5. 0>. 1> } finish { ambient 0. -5> look_at <0. -4 pigment { checker color rgb <1. 2. 1> } camera { location <2. 1.thinkquest. 0.org/3285/language/src/fin13.5 } } light_source { <100.http://library. 1.pov #declare Fin = finish { refraction 1 ior 2. 1.5. 1. 1> color rgb <0. -1 pigment { checker color rgb <1. 0.7> } finish { Fin } } plane { y. 500. 0. 1. 0.0 } sphere { <1. 0. <-0. -100> color rgb <1. 1> color rgb <0. -1>. 0. 1> } } plane { -z. 1 pigment { color rgbf <1.pov [9/12/2001 4:09:19 PM] . 1.

5.org/3285/language/src/fin17. 0>. 1> color rgb <0.pov [9/12/2001 4:09:24 PM] . -1>. 1.http://library. 0. 1.9 } sphere { <1.5. 0.thinkquest. 0. 1> } finish { ambient 0. 1> color rgb <0. 0.5 } } light_source { <100. 1. 1> } camera { location <2. 500. 0> } finish { Fin } } box { <-2. 1> } finish { Fin } } plane { y. 1> pigment { color rgb <1. -100> color rgb <1. 1. 0. 1 pigment { color rgb <1.org/3285/language/src/fin17. -5> look_at <0. <-0.pov #declare Fin = finish { specular 0. 2. -4 pigment { checker color rgb <1. -1.5.thinkquest. -1 pigment { checker color rgb <1. 1. 0> } http://library. 1> } } plane { -z.

http://library. 0> } finish { Fin } } box { <-2. 1> } } plane { -z. -1 pigment { checker color rgb <1.org/3285/language/src/fin15.org/3285/language/src/fin15. 1> } finish { Fin } } plane { y. 1> pigment { color rgb <1. -5> look_at <0. 2. 0> } http://library. 1> } camera { location <2.5.75 } sphere { <1.pov #declare Fin = finish { specular 0.5. 1 pigment { color rgb <1. -1. 1> color rgb <0. -4 pigment { checker color rgb <1.thinkquest. 0. 1. 0. 0>.5. -1>. 1. -100> color rgb <1. 0. 1. 1.9 roughness 0. 500. 1> color rgb <0.pov [9/12/2001 4:09:26 PM] .5 } } light_source { <100. 1> } finish { ambient 0. 0. 0. <-0. 1.thinkquest.

-1>. 0. -5> look_at <0. -100> color rgb <1.9 roughness 0.http://library. 1. 1> } camera { location <2.5. -1 pigment { checker color rgb <1. 0> } http://library. 1 pigment { color rgb <1. 0. 2. <-0. 500.pov #declare Fin = finish { specular 0.pov [9/12/2001 4:09:34 PM] . 1.thinkquest.org/3285/language/src/fin16. 1> } finish { ambient 0. 0> } finish { Fin } } box { <-2.5. -1. 1> color rgb <0.org/3285/language/src/fin16. 1.5. 1> } finish { Fin } } plane { y. 1> } } plane { -z.001 } sphere { <1. 1. 0>. 1. 0. 1> pigment { color rgb <1. -4 pigment { checker color rgb <1.5 } } light_source { <100. 1> color rgb <0. 0. 0.thinkquest.

5 } union { torus { 5.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0.pov [9/12/2001 4:09:53 PM] . -8> look_at <0.5> scale 3 } } light_source { Light } camera { location <-2.5 } pigment { color rgb <0. 1. 0 pigment { checker color rgb <0. 10.5.5. 0.707 #declare Light = light_source { <100. 0. 0. 0> } cylinder { <0.http://library.75. 0. 1> } } plane { y. <0. 0.org/3285/language/src/light5.thinkquest. 0. 0> radius 1. 10. 1> spotlight point_at <0. 16.5 rotate <90.75> color rgb <0.thinkquest. 0.5 falloff 1. -200> color rgb <1. 0. 0>. 5.5.org/3285/language/src/light5. 0> } http://library. 0. 100. 0>.

75> color rgb <0. 0> } cylinder { <0. 1> } } plane { y. 16. 0.org/3285/language/src/light6. 0.5. -8> look_at <0. 0>. 5.pov [9/12/2001 4:09:56 PM] . 0. <0.75 falloff 0.http://library. -200> color rgb <1. 0 pigment { checker color rgb <0.thinkquest.75.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0. 0.5.5. 0.707 #declare Light = light_source { <100. 0.org/3285/language/src/light6. 0. 100. 0>. 1> spotlight point_at <0. 0> } http://library.thinkquest.75 } union { torus { 5.5 rotate <90. 0. 1. 0> radius 0.5> scale 3 } } light_source { Light } camera { location <-2.5 } pigment { color rgb <0. 10. 0. 0.

5 falloff 2. -8> look_at <0. -200> color rgb <1.5 } union { torus { 5.thinkquest. 1> } } plane { y. 5.5.5. 1.5.pov [9/12/2001 4:10:00 PM] .5 } pigment { color rgb <0.5 rotate <90.org/3285/language/src/light7. 1> spotlight point_at <0. 0.5> scale 3 } } light_source { Light } camera { location <-2.thinkquest. 0. 0. 10. 0>. 0. 0. 0> } cylinder { <0. 0> radius 2.org/3285/language/src/light7. 0.75> color rgb <0. 0. 0. 100. 0. <0.707 #declare Light = light_source { <100.75. 0 pigment { checker color rgb <0. 0>. 0.http://library.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0. 16. 0> } http://library.

0>.http://library.5 falloff 2 tightness 1 } union { torus { 5. 0. 0>. 0> } cylinder { <0. -8> look_at <0.org/3285/language/src/light8. 16. 0. 0> } http://library.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0.5 rotate <90.5.5.thinkquest.pov [9/12/2001 4:10:03 PM] . 1> spotlight point_at <0. 0.5> scale 3 } } light_source { Light } camera { location <-2.org/3285/language/src/light8.5 } pigment { color rgb <0. <0. -200> color rgb <1. 0.75> color rgb <0.707 #declare Light = light_source { <100. 5. 0.5. 100. 0. 0 pigment { checker color rgb <0.thinkquest. 0. 1> } } plane { y. 0.75. 0. 0. 1. 0> radius 1. 10.

0.5 } pigment { color rgb <0. 0.thinkquest.pov [9/12/2001 4:10:05 PM] .707 #declare Light = light_source { <100. 10. 0.5 falloff 2 tightness 100 } union { torus { 5. 16.5. 0.5> scale 3 } } light_source { Light } camera { location <-2. 0>.thinkquest.75. 0. 0 pigment { checker color rgb <0. 1> } } plane { y. 0.5 rotate <90.75> color rgb <0. 1> spotlight point_at <0. 100. 0. 0>. 5. 0> } cylinder { <0.5.org/3285/language/src/light9.5. 0. 0. 0. 0> } http://library.http://library. 0> radius 1. 1.pov #default { texture { finish { ambient 0 diffuse 1 } } } #declare sqrt2_2 = 0. <0. -8> look_at <0.org/3285/language/src/light9. -200> color rgb <1.