RetouchPRO

Go Back   RetouchPRO > Technique > Photo-Based Art
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Photo-Based Art Emulating natural-media painting techniques

Tutorial: POV-Ray (and great discussion)

Reply
 
Thread Tools
  #1  
Old 11-08-2002, 03:49 PM
CJ Swartz's Avatar
CJ Swartz CJ Swartz is offline
Senior Member
 
Join Date: Sep 2001
Location: Metro Phoenix area, Arizona
Posts: 3,345
Blog Entries: 19
Want to learn to use POV-Ray tracing?

Since Chuck was nice enough to tell us how to run a POV-ray scene, I copied a POV scene into Photoshop and added Sunny, the sleeping cat. Added a shadow and a bit of lighting, then figured that was enough -- at least for now. I don't understand POV-Ray, and I can't create a POV scene, but it's fun just to use the program to run the scenes included with it.

P.S.
DannyR (moderator) changed the thread title after VisualEyes (Truman) responded to my pleading for help and wrote a tutorial to help us get started in using the POV-Ray program. (The program contains a tutorial, but it isn't "user friendly" in my opinion.)

Thanks so many times, Truman!

Folks -- look below to Truman's 3rd post with the tutorial.
Attached Images
File Type: jpg sunny-pov-scene.jpg (81.2 KB, 120 views)

Last edited by CJ Swartz; 11-09-2002 at 01:06 AM.
Reply With Quote top
  #2  
Old 11-08-2002, 05:53 PM
VisualEyes's Avatar
VisualEyes VisualEyes is offline
Member
 
Join Date: Sep 2002
Location: Pasadena, CA
Posts: 47
C.J. - fantastic composite! Very nicely done. The kitty looks really comfy.

POVRay can be very intimidating, I know, but if you take some of the simple scene description files and analyze them, I'm sure you'll see that there are really just a few necessities that are needed to create a basic scene:

1. lights
2. a camera
3. something to point the camera at

Everything else is just bells and whistles.

Attached is a raytraced take on mini-challenge 34.
Attached Images
File Type: jpg mini-challenge-34-trace.jpg (99.6 KB, 71 views)
Reply With Quote top
  #3  
Old 11-08-2002, 05:58 PM
VisualEyes's Avatar
VisualEyes VisualEyes is offline
Member
 
Join Date: Sep 2002
Location: Pasadena, CA
Posts: 47
And here is the .pov description. Take away all the gobbledy-gook and you basically have a camera, 3 light sources, a disc, a couple of donuts and cylinders, some lathes, and a fancy-schmancy b-spline sphere-sweep.

If you look at the Insert menu on POVRay, you'll see almost everything you can use in a scene, along with an explaination of what the different parameters are. Real handy, even if you sorta know what you're doing already.

Truman
Attached Files
File Type: zip mini-challenge-34-trace.zip (1.5 KB, 44 views)
Reply With Quote top
  #4  
Old 11-08-2002, 09:16 PM
CJ Swartz's Avatar
CJ Swartz CJ Swartz is offline
Senior Member
 
Join Date: Sep 2001
Location: Metro Phoenix area, Arizona
Posts: 3,345
Blog Entries: 19
Truman, thanks for the nice comment on my composite, and thanks even more for the POV data. Hmmm, it still looks very intimidating, but maybe... I'm glad that there are some scenes already written up that I can use and look at to see if I can figure it out.

Makes me even more respectful of those of you who can use it to create new environments -- my hat's off to you (if I wore a hat)

Your rendition of the image is just mind-blowing -- beautiful, strange, intriguing.
Reply With Quote top
  #5  
Old 11-08-2002, 09:58 PM
VisualEyes's Avatar
VisualEyes VisualEyes is offline
Member
 
Join Date: Sep 2002
Location: Pasadena, CA
Posts: 47
Quick POV-Ray Intro Tutorial

C.J. - here's my attempt at a quick tutorial thrown together over left-overs and soda tonight. I hope this might be of some benefit to you and others trying to get over the initial hurdle of approaching POV-Ray. Please excuse any typos or other strangeness - I'm bouncing back and forth between training Dragon NaturallySpeaking and good old fashioned typing.

POV-Ray

OK, so you were browsing through some of the forums here on RP and you happened to run across a few threads discussing an odd program called POV-Ray. This got you curious, so you went to www.povray.org and downloaded the 8MB Windows setup file and installed it. Now what?

Of course, first, it might be really nice to know what POV-Ray is. POV-Ray stands for the Persistence of Vision Raytracer. Hmmm, OK, so now what’s a raytracer you ask? Simply put, a raytracer is a program that acts like a virtual camera. It reads a description of a scene and renders (draws) it in vivid three-dimensional reality. You’ve seen raytracing examples practically every time you turn on the TV (think flying 6:00 News logo or even the Terminator II blob guy).

Every raytraced scene is composed of at least three basic components: a camera, a light, and an object to be rendered. In order to describe these components, we need to tell the raytracer some important facts including, but not limited to, the location, the size and the texture of the component. POV-Ray needs to know where the camera is, where the light source is, what color the light source is, what and where the object to be rendered is, and the color of the object.

Coordinates
Before we can describe the location of an object, however, we need to understand the 3D coordinate system of the POV-Ray world. Remember high-school algebra and number lines? A coordinate system describes the location of a point on a number line. A number line consists of an origin, usually 0 (zero), with points emanating out left and right from there. Going to the right you get positive values, while going to the left gives you negative values.

<- - - - - - - - - - - - - - >
-2 -1 0 1 2 3 4 5 6 7

Now let’s imagine you have three number lines. One points left and right, like the one above, while another points up and down with the positive numbers going upwards, and the last number line points front to back (in and out) with the positive numbers going towards the front. The left-right line is the x-axis, the up-down line is the y-axis, and the in-out line is the z-axis. This is POV’s 3D coordinate system, typically called a left-handed coordinate system. If you hold your left hand out and make a fist with your thumb sticking out (like you’re hitchhiking) and point your thumb along an axis, your fingers naturally curl in the positive rotation of that axis.

So how do we describe a location? POV-Ray understands 3D locations as a set of xyz values, bracketed by less-than and greater-than signs (<x,y,z>). For example, a point at the origin would be <0,0,0>. A point 5 units to the right, 3 units up, and 2 units forward would be <5,3,2>. A point 10 units in back of that would be <5, 3, -8> (2 minus 10 = -8).

Syntax
Now that we understand the coordinate system, we can begin describing our objects. Every POV Ray object has a specific syntax. The syntax describes the unique characteristics of an object. If you bring up the POV Ray help file you will see explanations of the syntax of all the language components.

Let's look at the syntax for a camera object. To describe a camera we need to know where it is located, which way is it tilted, what is its depth of field, what is the anticipated aspect ratio of the computer screen on which the image will be rendered, and what 3D coordinate is the camera looking at. The syntax therefore is like this:
camera {
location <x, y, z>
direction <x, y, z>
up <x, y, z>
right <x, y, z>
look_at <x, y, z>
}

Location positions the camera in 3D space. For example, location <0, 0, -100> means that the camera is 100 units behind the origin.

Direction is a vector that indicates the direction the camera is pointing. The magnitude of this vector impacts the depth-of-field of the camera. Larger values give a narrower field of view. Typically, a z-value of 1-2 is appropriate (i.e., <0,0,2>).

Up tells the raytracer the direction to the sky. Normally, a y-value of 1 is appropriate. Playing around with this vector will tilt the camera.

Right indicates where a vector coming out the right side of the camera is pointing and also adjusts the horizontal magnification. An x-value of 1.3333 (4/3) is appropriate for most PC monitors that have an aspect ratio of 4:3.

Look_at tells the camera what to look at (duh). I won’t go into how this is different from “direction”, but suffice it to say that it is.

So, for a sample camera description, describing a camera located 10 units to the right, 15 units up, and 120 units back, looking at an object at the origin, we would say:

camera {
location <10, 15, -120>
direction <0,0, 2>
up <0,1,0>
right <1.3333, 0,0>
look_at <0,0,0>
}

Lights
OK, so now we need a light source. The light_source syntax requires a position description and a color description. Similar to position vectors, colors are described by three values: red, green, and blue (RGB) values. These values range from 0 to 1. The color description for black would be “color rgb <0,0,0>” and the description for white would be “color rgb <1,1,1>”. Absolute red: “color rgb <1,0,0>”. Absolute green: “color rgb <0,1,0>”. 50% gray: “color rgb <0.5, 0.5, 0.5>”. So now our light_source description might go something like this:

light_source {
<100, 400, -1000>
color rgb <1, 1, 1>
}

Objects
Finally, we need an object to render. The simplest primitive is a sphere, so let’s try that. The syntax for a sphere is:

sphere {
<x,y,z> radius
}

So, a sphere located at the origin, with a radius of 10 would be:

sphere {
<0,0,0> 10
}

In order for an object to be visible, it needs a texture. A texture describes what an object looks like. The simplest texture description is a pigment (what color is it?). The texture syntax is:

pigment {
color rgb <r,g,b>
}

The texture statement is placed within the description of the object, so our sphere description might look like this:

sphere {
<0,0,0> 10
pigment {
color rgb <.5, .2, .34>
}
}

Put it all together
And there you have it, the basic components of a POV scene: a camera, a light, and an object. Put them together:
camera {
location <10, 15, -120>
direction <0,0, 2>
up <0,1,0>
right <1.3333, 0,0>
look_at <0,0,0>
}
light_source {
<100, 400, -1000>
color rgb <1, 1, 1>
}
sphere {
<0,0,0> 10
pigment {
color rgb <.5, .2, .34>
}
}

Press alt-G and the next thing you know, you have your first raytraced image! Needless to say, there’s lots of room for improvement on this image, but that's where the fun of experimenting and learning comes in.
Reply With Quote top
  #6  
Old 11-08-2002, 10:20 PM
DannyRaphael's Avatar
DannyRaphael DannyRaphael is offline
Moderator
 
Join Date: Mar 2002
Location: Near Seattle, Washington, USA
Posts: 6,300
Thumbs down Great stuff, Truman!

Really appreciate you taking the time to put this mini-tutorial together.

Wunderful stuff...
~Danny~
Reply With Quote top
  #7  
Old 11-08-2002, 10:42 PM
DJ Dubovsky's Avatar
DJ Dubovsky DJ Dubovsky is offline
Senior Member
 
Join Date: Aug 2001
Location: Upper Penninsula of Michigan
Posts: 1,659
Well, from what I can see of it you need a knowledge of Visual C++. It's definately intimidating to the max for someone like me. But I definatly like the results. It would be nice if they made it more user friendly.
DJ
Reply With Quote top
  #8  
Old 11-08-2002, 10:50 PM
CJ Swartz's Avatar
CJ Swartz CJ Swartz is offline
Senior Member
 
Join Date: Sep 2001
Location: Metro Phoenix area, Arizona
Posts: 3,345
Blog Entries: 19
Thumbs down Truman -- you ROCK!

Truman , the folks here work together to help each other on a daily basis, but explaining POV in clear terms is a fantastic offering even on this forum.

Thank You for providing us the keys to a new artistic vehicle -- it's waiting for anyone who wants to take a test drive -- bet I'm not going to be the only one...
Reply With Quote top
  #9  
Old 11-09-2002, 08:50 AM
clare's Avatar
clare clare is offline
Senior Member
 
Join Date: Aug 2002
Location: England
Posts: 322
Cool

I've had not heard of this until today and thanks to your tutorial have a sphere and everything!! Thanks for the introduction to this program.

I tried a version of another render program a few years back but the thing was too much of a leap for my brain at the time and soon lost interest and went back to PS.

I am going to play now and see what I can create

Thanks again Truman
Reply With Quote top
  #10  
Old 11-10-2002, 08:22 AM
jerry's Avatar
jerry jerry is offline
Senior Member
 
Join Date: Mar 2002
Location: eastern pa.
Posts: 214
Truman,,Now I'm Mad..

I had been avoiding your program saying just too hard to try..Now your forcing me to go download it..

Thanks for the time you invested in this explanation..

Here I go, wish me luck.

Jerry
Reply With Quote top
Reply

  RetouchPRO > Technique > Photo-Based Art


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved