The POV-Ray Tutorial Thread


Jan 4, 2004
A shipyard near you
I knew it! No mere mortal could combine Aaglo's production rate and standards with that warped imagination. So what planet *is* he from?
it's a place called pov-planet
Come... join us... don't be afraid...
I am not afraid. I am not afraid. I am not afraid. *walks into the mist and white light never to be seen again*
Alright folks, for all of you out there totally perplexed at just how the blazes aaglo and I can do anything at all in POV-Ray, this thread's for you!:D

The tutorial will, due to certain restrictions, span several posts in this thread (but don't worry, links will guide you through it in sequence). I'll start off with the very first few steps, updates will be based on the questions you ask afterwards. In this way, the tutorial will be developed gradually and will address each issue as they arise in the process of POV-Ray-ing.

This tutorial will obviously be based on my personal unit making process, which requires these tools:
-POV Ray (I use version 3.6)
-Storyboards Builder (SBB)
-Photoshop (though there are other image editors that will do the same stuff, this tutorial will assume you're using Photoshop)
-PEdit Palette Editor

The only tool here that isn't available for free online is Photoshop. Chances are you have a different image editor of some kind on your computer (remember, just not MS Paint!) already.

Let's begin:

-Before you even open the program, go into your POV-Ray folder, open the scenes folder and create a new folder in there, named after the unit you want to make.
-Open your new folder, and create 8 new ones called E, SE, S, SW, W, NW, N and NE. These will contain the individual frames for each direction in your animation (MUCH later on).

POV Ray:
-NOW you can finally open up POV Ray.
-Go to File, New File.
-This file will be your 'Standard' file. It will contain all the stuff that you use very frequently (mostly textures and a few variables).
-Start off your Standard file by typing this into the text field (feel free to copy-paste):

#include ""
#include ""
#include ""
#include ""
#include ""
#include ""

-You're window will look something like this:

-The '#include' tells POV Ray to include the file specified (which must be surrounded by " " and include the file extension, in this case '.inc' for 'include')in the scene.
-These are some standards POV Ray has already made for you, which (later) you'll use to make your own personal textures.
-Go to File, Save. In the browser, go up to the POV Ray folder and open the include folder you find there. Save this file as 'Standard' (or some other name to tell you it holds info common to all your files) in the include folder.
-You'll notice that as soon as you saved, the text turned a different color:

-Since you've saved this file in the 'include' folder, you can now include it in any other POV Ray file you make from now on.

-Now go to File, New File.
-Now you're making the actual unit file!:clap: Before you even type anything, save the file in your POV-Ray/scenes/(your unit name) folder, under the name of your new unit. Keeping the name of the file and folder identical probably will help with organization later (again, much, MUCH later).
-You want your name and some other info about this file, so what I do is type in this:

//By: Orthanc
//June 3,2006
//Unit Number: 1

-You'll notice I've called my file (unit) 'Tutorial':

-Notice this text is green, which means it is a comment and will not be read by the program. We use comments to help navigate through our files (if you need an example of what navigating through a file can be like, scroll through my Ragnarok file:eek: ) Comments are indicated by the '//' before the text. Alternatively, you can wrap a block of text that spans multiple lines into a comment by placing a '/*' at its beginning and a '*/' at its end, observe:

-This is sometimes easier than putting '//' before every single line.
-Making something NOT a comment is as easy as deleting the '//' or BOTH the '/*' and the '*/'
-You've got your name down, if you put in the extra comment for experimenting with adding comments, get rid of it now and let's put your Standard file to use, type in:

#include "Standard.pov"

-So it'll look like:

-Now, your Standard file, and everything it itself contains and includes, is now also included in your new unit file. As far as I know, you can stack included material in this manner infinitely.
-With that in place, you can now set up your environment. Just copy and paste this:

camera {orthographic location <0,82,-124>*.33
up <0,1,0> right <1,0,0>
angle 64
look_at <0,7,0>*.33}

light_source {<5000,15000,-5000> color White }
light_source {<6000,3000,-6000> White shadowless}
light_source {<-6000,3000,-6000> White shadowless}
global_settings { assumed_gamma 1.6 max_trace_level 82 }
background {White}

-It'll look like:

-THIS, is your camera, background and lighting settings. If you place a box in the center of the scene with these settings, it will more or less look like it belongs in the same environment that official Civ 3 units are in.
-The 'background {White}' is your background color, when you're making the animations, you'll switch 'White' with 'Magenta', but we haven't made the model yet, and modelling is easier against a white backdrop I find, your call.
-The 'angle 46' basically adjusts how much of the scene fills the image (ie: 34would make the box fill more of the image and so look bigger, 84 would make it look smaller. Just don't set these much over 100 or below 10)
-The '82' in 'orthographic location <0,82,-124>*.33' adjusts the camera height (12 is about ground level, raising above 82 doesn't actually yeild much difference, -82 will show the underside, which unless you change the positions of your lights, will be very dark). Keep it at 82 when rendering animations, but feel free to adjust it while you're making your model (alternatively, you could rotate the actual model, which is often a better option anyways)
-Keep in mind, these environment settings are for:
A) Viewing the model as you make it
B) The actual in-game animations
C) The units 32 image
-The Civilopedia images use different settings, I'll get to that when its appropriate (got to make the model first!).
-Unless you're making a space unit, the next thing you'll need is some ground. Put below your environment this line:

//plane {y, 0 pigment {color White} finish {ambient .1 diffuse 1}}

-You'll notice two things:
A) I made the ground White, again you'll have to switch it to Magenta for the actual animations
B) I made this a comment, so it won't actually show up yet (remember it's dead easy to change this later)
-Why is it a comment? Again, modelling is easier without the ground, because you can see the underside of the model. Plus, its kinda cool with boats, cause just like real boats you're building it out of the 'water', then 'dropping it in' when you're done.:D
-Alright, now drop in this text a few spaces below:

#declare Tutorial= union {

//Master (Animation) Control

-Obviously, instead of "Tutorial" you'll have your unit's name. This text declares the existence of the object that is your unit. Best way to make things in POV-Ray (and really any other 3D program) is in sections. This is where you'll put all the sections together. We'll have to make the sections first:rolleyes: , then include their objects here (don't worry, I'll get to it).
-Notice the "//Master (Animation) Control" comment. Once you have made all the sections, the transformations (rotate, scale, translate (move)) you'll apply to animate it will go directly below this comment and before the "};".
-This combination of "#declare (name)=" and ";" is how we declare variables in POV-Ray. The "union {" and "}" are entirely optional depending on what this variable is. The "union" thing is more related to creating geometry, so we'll leave that until we've got the setup done.
-Always remember, simply declaring a variable doesn't make it exist in the scene. Drop in this text:

difference {
object {Tutorial}

//Master (Viewing) Control
translate <0,0,0> rotate y*0}

-We're nearly setup now:

-NOW, it does exist in the scene (although the variable doesn't have any contents yet). The "object {Tutorial}" is all that's needed to include the variable we've declared (make sure you declare it ABOVE the spot you're including it, or else you'll be trying to include something that doesn't exist yet:eek: ), kinda like how we included your Standards file.
-The "difference {" and following "translate <0,0,0> rotate y*0}" is there because of what we'll be doing with this object. The comment is the hint for what the "translate <0,0,0>" and "rotate y*0" will do, kinda obvious really, this text moves or rotates the entire model. Again, just hang on until setup's done...
-Which it will be by adding this text AFTER THE "object {Tutorial}", NOT after the "translate <0,0,0> rotate y*0}":

//box {<-100,0,-100>,<100,-100,100> pigment {color Magenta} rotate y*0}


-Another comment, this box, when made not a comment, works with that "difference {" that came before the "object {Tutorial}" to create the 'floor' for your units32 image. It's a "false" floor, in that it hides the part of the unit that is beneath the floor (a must for boats) but doesn't let the unit cast a shadow on it, because what it's really doing is removing the part of the unit that intersects with the box (which is our floor/water). All this hassle because units32 images don't have shadows.

Part 2
Fantastic, Orthanc. Personally I found PovRay to be almost impenetrable so I am filled with admiration for those of you who make good Civ III units with it. I hope this tutorial will inspire many to give it a whirl, since unlike most of the other 3D rendering programs you can use for units, PovRay can be downloaded for free!

When you've done the tutorial you should copy and paste it into a new thread in the Tutorials forum. Thanks again!
It should still be in there, says I.
It shpould not, says I.
Thanks oRthanc, but that camera part I&#180;d already learned a couple of months ago... I remember you sent me the same numbers last November...

Yes I remember Takhisis, but of course, putting it here let's everyone else know about it.

Thanks for the encouragement everyone, once I get through the setup process, we'll get to the real meat of how to actually model. Remember to post questions if you get stuck, it probably means I need to edit something.
Why the low spirits, wease?
Thanks orth! still, I&#180;ll give it a try, once again, with the editor. The first part is almost like this :)
Just wanted to notify Orthanc of the limit for pictures per post. Can't remember how much it is, but there is (or at least was) a limit as I've run into it with the libraries. You may have to rethink the way you're going to organise this tutorial.

Good job btw!
Is that for attached images or linked images? Because mine are links from image shack...
Orthanc said:
Is that for attached images or linked images? Because mine are links from image shack...

Linked. :(

(but do take this with a grain of salt and test it yourself)
Top Bottom