The POV-Ray Tutorial Thread

Orthanc.. this is definitely what I've been waiting for. I downloaded PovRay a while ago... installed it and looked at it and looked away again: It still looked like a boom with seven seals. So I decided to just go and play Civ instead! :lol:
Your tutorial will entice me to continue my aircraft production lines. Please finish it. :)
 
Expect something tomorrow...:D
 
This is good new Orthanc, as POV Ray actually works on my crappy old computer. Consider how my 'newer' computer died and is beyond repair (may it RIP), I couldn't continue with learning how to make units with other software. It is now possible for me to continue with making units. :goodjob:

It seems that POV Ray will be easier to create units for CivIII. Don't get me wrong, it still looks daunting at first glance. It just seems more 'intuitive' for some reason when making units for CivIII.

Thank you for starting this tutorial and sharing it with us.
 
So... what happened here? Did this get moved? Did I come out of Civ3 retirement just to look like a complete noob? Where's the POV-Ray guruism? I want include files and links to great tutorials (I have a few by the way). Did this get swallowed by Civ4 like everything else? I'm so confused.
 
Sorry, my bad, it's just the kind of thing that has a tendency to get pushed down, though I've got a plan for getting around the image-per-post problem, I'll just create a second post with a direct link to it at the bottom of the first, and it'll just carry on like that as neccessary.
 
Orthanc said:
Sorry, my bad, it's just the kind of thing that has a tendency to get pushed down, though I've got a plan for getting around the image-per-post problem, I'll just create a second post with a direct link to it at the bottom of the first, and it'll just carry on like that as neccessary.

Wha? Still in a daze. What am I drinking (no... not mercury)? Egat!, I must have been gone for a long time. Where's Oz, and Hikaro, and uncle Bob, and you were there too Jim? Lord, I'm not in Kansas anymore.:hammer2: I'm guessing image-per-post is for the tutorial (good pedrov... breathe). But then I get caught in an ad infinitum loop of craziness!
 
Thank you for making a tutorial for POV-ray. I PMed aaglo about this a while back but he never got back to me. Your my hero:worship: :worship: :worship: :worship:
Ive always waited for this. ONce you complete the tutorial and it gets moved into the tutorial section, please PM me so i can add it to the library there.

You are a god:worship: :worship: :worship: :worship: :worship: :worship: :worship: :worship: :worship: :lol:
 
Part 2

-Now if you are making a space unit, you don't need a floor, so you can make you're setup look like so:

-The "difference {" is switched with a "union {", and the box is removed completely. That union is there for much later when you're putting explosions and the like into the scene. Sorry folks, explosions gotta come ALOT later:(

-Now look at this:


-You can add the "+A" yourself, this activates anti-aliasing, without going into too much detail, it kinda smooths your images, without it your animations would have lots of messed up pixels everywhere (this just works for me, honestly I haven't bothered to find out why)
-The "256x256" in that box, on the other hand, you won't be able to find by clicking the little 'options arrow' beside it. Why? Because that's a setting for the size of the image rendered which I put there myself.
-Don't worry! You can too, otherwise you'd be in a real mess! There's a little button in your tools bar labelled "Ini", if you've got POV-Ray v3.5 (I'm pretty sure later versions are identical), it's got an image of a wrench beside a little guy running. Click that.
-A window will pop-up, click the "Edit" button.
-Doing so will open up a new file, which is you're INI file. Add the following to the top:

[256x256]
Width=256
Height=256
Antialias=On

-It'll look like somewhat like this:

-Don't worry if you see a few extra entries in my image, I've changed my INI alot, and often, just as long as the text isn't merged or something with another entry, you should be fine.
-Click the Ini button again, and click "Set but don't Render". You don't want to render, because right now, there's nothing to render, so you'd just create a black or blank image nestled somewhere in your POV-Ray directory.
-Now you can click that little arrow and select "256x256". By doing so, when you render each frame will now be 256x256 pixels in size (which is the maximum size allowed in FLCster, and twice as large as the large Civilopedia image)
-This size is great for making previews of your work, but it's much more useful for letting you see your model as you make it. You can always go back now and add more frame sizes to the INI file using the same process. It's pretty basic from here.
-Now to get back to your unit, either go to File, Close (keyboard shortcut is Ctrl+F4) or click the little tab I've highlighted here:


-NOW, you're set up. Hit Alt+G (that's the shortcut to render the scene, IT IS YOUR BEST FRIEND:yup:) and a 256x256 blank image will be created in your unit's folder. Even more exciting, that same image will appear in a window that popped up when you hit Alt+G. That window is how you view your work in POV-Ray.
-POV-Ray uses code and math and stuff yes, but you can always just hit Alt+G to see if something's wrong, and it will be dead obvious if it is. Seeing a problem, you'll see what you have to fix, and you can fix it right then and there. So if you got just over 50% in math class (LIKE ME), it doesn't matter, you've got as many attempts to get this right as you're willing to take. Thus, 100% in POV-Ray is available to everyone.:woohoo:

-Now that setup is complete, we can finally begin creating the 3-Dimensional model of your unit. We'll call the first part of the unit 'Part A' (wow), and we'll label it and declare it with this code:

//Part A
#declare PartA= union {

};

-Place this below the camera/scene information but above the declaration of the entire unit:

-Then add this line directly below the "#declare Tutorial= union {":

object {Part A}


-This makes "Part A" an object that is included within the object "Tutorial" (which is as you recall the assembly of all the parts that make up our unit).
-Again, always remember we must first declare the object above where it is being included.
-If we want a Part B, it doesn't even have to go below Part A, either in the order we declare it or in the order that we are including it within the declaration of the whole unit:


-POV Ray doesn't care what you call your objects/variables, just as long as all included variables have been declared before they are included.

-We have now created two objects, "PartA" and "Tutorial", with PartA included within Tutorial and Tutorial included within the scene. But if we were to hit Alt+G we still wouldn't see anything because we haven't put in any actual geometry in ether of these objects:

Part 3
 
UPDATE: Check the first post, it links to the above post and makes everything make sense.
 
kewl... thanks Orthanc. I'm really glad you're writing this tutorial... it might just kickstart my rusty production lines, especially now that I don't have access to the 3D vector graphics editor anymore that I used to build my models with.
 
Okay, the other day, I downloaded Blender, ppModeler and models for every free 3d program there is (sans POV-ray), and they're all so hard to use!!! :gripe: (But I did get Kinboat's human model to work in OpenFX, :smug: ) But I'm following this tutorial and POV-ray seems way easier than the other ones, :).
 
Thanks Weasel Op, fixed it up.:)
 
hey Orthanc, is this tutorial ever going to be finished, i dont want to start it unitl its finished.

EDIT: sorry for the :bump:
 
It's alright, the bump was needed. Yes, I do still plan to finish this!
 
Part 3

Geometry in POV Ray

-First off, let me explain how to make shapes interact, POV Ray calls these 'CSG Operations'. Your basic operations (there are two more, but in the years I've been doing this I've never used anything but these 4) are:
union
difference
merge
intersection
-You'll notice you've already used 'union' and 'difference', their format (but not their effect) is the same with the all CSG operations...
-First, you type out which operation you want to use (numbers refer to the examples in the image below):

-'union' makes POV Ray consider all geometry/objects/variables within that union as a single piece of geometry, so if you have a box with a cylinder going though it you will see both shapes (1).
-'difference' takes the first piece of geometry and subtracts all the following pieces from it, so if you have a box with a cylinder going though it you will see a box with a cylindrical hole in it, and you won't see the cylinder at all (2). Alternatively if you include the cylinder before the box you will only see the ends of the cylinder where it did not intersect with the box. If you had a box followed by a cylinder going through the top of the box and another going through the box's side you would see a box with cylindrical holes in its top and side (3).
-'intersection' takes every piece of geometry and only shows the space where every piece of geometry intersects. So, again, if you have a box with a cylinder going through it, you will see a cylinder, but only where it is passing through the box (4). If you had a box followed by a cylinder going through the top of the box and another going through the box's side you would see only the shape of the two cylinders meeting, but only if that shape is also within the area of the box (5).
-'merge' is nearly identical to union, the difference between the two is only noticeable with transparent shapes. So if you have a transparent (partially that is, complete transparency is possible but not very helpful in this instance) box with a transparent cylinder going though it you will not see the cylinder where it is passing through the box, but rather you will just see a box with cylinders sticking out the sides (6). But with a union, you would see the entire cylinder, even where it is passing through the box (7,8).


-Once you type in the desired operation, you must follow it with a '{' followed by the code for the geometry to be effected by the operation, and finally end the operation with a '}' For example, the code for the geometry in example #1 is (I'll explain the 'pigment' part later):

union {
box {<10,10,10>,<-10,-10,-10>}
cylinder {<20,0,0>,<-20,0,0>,5}
pigment {color rgbt <.5,.5,.5,0>}
}

-This would do the same thing, except it takes up less visual space in the code editor:

union {box {<10,10,10>,<-10,-10,-10>}
cylinder {<20,0,0>,<-20,0,0>,5} pigment {color rgbt <.5,.5,.5,0>}}



-We can finally get to the shapes themselves. The basic geometric shapes you'll be using are:
box
sphere
cylinder
cone
torus
plane
-And while more complex, these shapes are necessary to at least mention for now:
blob
sphere_sweep
bicubic_patch

-Of course you can't just type 'box' and expect a box to appear when you render again, POV Ray needs to be told some key information in order to form a shape. The information needed is different for each shape, we'll touch on each one briefly.
-First, the common feature with all shapes is, similar to CSG operations, the initial code begins with the name of the shape, followed by a '{', then the information, and finally ended with a '}'.
-While not common to all shapes, you will find with most a small block of code like this:

<0,0,0>

-With code for shapes, this is the X,Y,Z coordinates (IN THAT ORDER) of a point in that shape. The measurement units are of no real-world value, but 1 unit in one POV Ray file is 1 unit in every POV Ray file (you could probably change that, but I don't know how, or why you would want to:crazyeye:)

Box
-the basic code for a box is:

box {<0,0,0>,<0,0,0>}

-Note the comma between the each <0,0,0> , it is necessary.
-If you were to render that, you would see nothing, because every part of the box exists at the location X=0,Y=0,Z=0. To make the box visible, at last one of these points has to be somewhere different than the other point, ie:

box {<10,10,10>,<0,0,0>}

or

box {<0,0,0>,<10,10,10>}

-These 2 boxes would look the exact same. Each has one corner at X=0,Y=0,Z=0 and another corner at X=10,Y=10,Z=10. POV Ray generates the other corners with this information.
-Make sure all 3 values are different between the two points, because:

box {<0,0,0>,<10,10,0>}

-This shape does not look the same as the previous two. The 2nd point has the same Z value as the 1st point, so this would create a mathematically flat plane stretching out 10 units on the X axis and 10 units up the Y axis. If you were to look at this shape directly down the Z axis it would be invisible, like the world's thinnest sheet of paper.
-You may in fact want a shape like that, there is a shape similar (the plane) but it goes on infinitely on all but one axis.

Sphere




-We could actually have skipped all the declarations of objects like 'Part A' and 'Tutorial' (or whatever you called your unit), you can just place the code down for geometry outside of those variable declarations and it will appear in the scene when you render, but since every unit is a collection of many (sometimes A LOT) of shapes that need to maintain their positions relative to each other while moving or rotating, uniting them in some way is necessary.

Stay tuned for more updates!
 
Top Bottom