1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

The POV-Ray Tutorial Thread

Discussion in 'Civ3 - Creation & Customization' started by Orthanc, Jun 3, 2006.

  1. Orthanc

    Orthanc Shipwright

    Joined:
    Jan 4, 2004
    Messages:
    1,420
    Location:
    A shipyard near you
    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)
    -FLICster
    -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 "colors.inc"
    #include "finish.inc"
    #include "woods.inc"
    #include "metals.inc"
    #include "golds.inc"
    #include "stones.inc"

    -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:

    //Animations
    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:

    //Tutorial
    #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}

    -Observe:

    -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
     
  2. Plotinus

    Plotinus Philosopher Administrator

    Joined:
    Nov 14, 2003
    Messages:
    16,810
    Location:
    Somerset
    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!
     
  3. thegreats

    thegreats Cat Lord

    Joined:
    Jan 28, 2006
    Messages:
    103
    Location:
    In a hamburger
    I cant wait for the tutorial to be completed, and can someone recommend me a program that can open Poser``.obj´´
     
  4. Stormrage

    Stormrage Ever Present Taskmaster

    Joined:
    Oct 21, 2005
    Messages:
    10,573
    Location:
    behind the scenes
    Thank you, Orthanc! Its very nice of you :)
     
  5. Goldflash

    Goldflash Grumpy Old Man

    Joined:
    Mar 18, 2004
    Messages:
    5,752
    Location:
    Land of King James
    Shouldn't this be in the tutorials section?
     
  6. Stormrage

    Stormrage Ever Present Taskmaster

    Joined:
    Oct 21, 2005
    Messages:
    10,573
    Location:
    behind the scenes
    Its not a finished file ya noob! :p
     
  7. Goldflash

    Goldflash Grumpy Old Man

    Joined:
    Mar 18, 2004
    Messages:
    5,752
    Location:
    Land of King James
    So? All tutorials go in the tutorial section.
     
  8. Stormrage

    Stormrage Ever Present Taskmaster

    Joined:
    Oct 21, 2005
    Messages:
    10,573
    Location:
    behind the scenes
    That doesn`t make it right!
     
  9. odintheking

    odintheking Lighting the way...

    Joined:
    Jul 12, 2004
    Messages:
    4,588
    Location:
    Stickin it to the man
    It should still be in there, says I.
     
  10. Padma

    Padma the Inbond Administrator

    Joined:
    Dec 10, 2001
    Messages:
    14,397
    Location:
    Omaha, Nebraska USA
    When it's done, give us moderators a shout via PM, and we'll get it moved for you. :)
     
  11. Takhisis

    Takhisis excuse me

    Joined:
    Jul 11, 2005
    Messages:
    43,054
    Location:
    up yours!
    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...
     
  12. Orthanc

    Orthanc Shipwright

    Joined:
    Jan 4, 2004
    Messages:
    1,420
    Location:
    A shipyard near you
    UPDATE:scan:

    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.
     
  13. Spacer One

    Spacer One Avatar subject to change

    Joined:
    Aug 23, 2005
    Messages:
    3,702
    Location:
    NorCal
    unfortunatly I dont have the time to work through this right now...but I will as soon as I have a chance...Thanx Orthanc...Im sure this will be invaluable
     
  14. WildWeazel

    WildWeazel -- Turns to Completion

    Joined:
    Jul 14, 2003
    Messages:
    6,837
    Location:
    %CIV3%\Conquests\Scenarios\
    This looks like a very good start. Maybe it will inspire me to learn more advanced stuff and make some good units. :)
     
  15. Takhisis

    Takhisis excuse me

    Joined:
    Jul 11, 2005
    Messages:
    43,054
    Location:
    up yours!
    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 :)
     
  16. Drift

    Drift It's a boy!

    Joined:
    Mar 31, 2003
    Messages:
    2,180
    Location:
    Tampere, Finland
    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!
     
  17. Stormrage

    Stormrage Ever Present Taskmaster

    Joined:
    Oct 21, 2005
    Messages:
    10,573
    Location:
    behind the scenes
    I think its 10....
     
  18. Orthanc

    Orthanc Shipwright

    Joined:
    Jan 4, 2004
    Messages:
    1,420
    Location:
    A shipyard near you
    Is that for attached images or linked images? Because mine are links from image shack...
     
  19. Drift

    Drift It's a boy!

    Joined:
    Mar 31, 2003
    Messages:
    2,180
    Location:
    Tampere, Finland
    Linked. :(

    (but do take this with a grain of salt and test it yourself)
     
  20. Padma

    Padma the Inbond Administrator

    Joined:
    Dec 10, 2001
    Messages:
    14,397
    Location:
    Omaha, Nebraska USA
    I *think* that has been raised to 12. And IIRC, it includes both attached and linked pics. It *definitely* includes links.
     

Share This Page