Friday, April 23, 2010

Cover art design with PovRay 6

This will be the last of the blogs on cover art design with Pov-Ray.

Here is the tiled Machiavelli world. Other than the script provided, and Pov-Ray, you'll need the public domain image of Machiavelli, obtained from Wikipedia.


Click on image for larger size

Notice that there are two light sources, and two shadows to the globe.
#include "colors.inc" 
#include "textures.inc"
#include "shapes.inc"

camera {
 right      < -1.33, 0, 0 > 
 up         < 0, 1, 0 > 
 direction  < 0, 0, 1 > 
 location   < 0, 4, 20 > 
 look_at    < 0, 0, 0 > 
}

light_source { < -20, 35, 34 > 
color White
}

light_source { < 0, 0, 24 > 
color White
}

plane { y, -20
    pigment{ color Gray80}
    normal { ripples 1.0 frequency 3 scale 8}
    finish {
        reflection 0.15
        ambient 0.3      
    }
}
                 
sphere { <0, 0, 0>, 5.0
      pigment { image_map 
                { gif "c:\ftp\mach_wiki_public.gif" 
                //filepath for the Machiavelli image                       
                  map_type 0                       
                  interpolate 2 
                 } } 
          }


A modified version of this script was used to produce the cover art for Machiavelli's Laboratory, a satire on science ethics.

-© 2010 Jules J. Berman

Thursday, April 22, 2010

Cover art design with PovRay 5

Here's one more simple Pov-Ray image and its script.


Click on image to see higher resolution


#include "colors.inc"
camera {
location <0, 1, -10>
look_at 0
angle 36
}

sky_sphere {
pigment {
gradient z
color_map {
[0.0 rgb <0.6,0.7,1.0>]
[0.2 rgb <0.2,0.3,0.9>]
}
}
}

light_source { <500, 500, -1000> White }
plane { y, -1.5
pigment { checker Black White }
}

sphere { <0, 0, 0>, 1
texture{pigment{color Blue filter 2 }
finish{phong .8}} interior {ior 0.1}
translate -0.5*x
}
sphere { <0, 0, 0>, 1
texture{pigment{color Red filter 2 }
finish{phong .8}} interior {ior 0.1}
translate 0.5*x
}

sphere { <0, 0, 0>, 1
texture{pigment{color Yellow filter 2 }
finish{phong .8}} interior {ior 0.1}
translate -0.5*y
}
sphere { <0, 0, 0>, 1
texture{pigment{color Green filter 2 }
finish{phong .8}} interior {ior 0.1}
translate 0.5*y
}


- Jules J. Berman

Wednesday, April 21, 2010

Cover art design with PovRay 4

Here is a sample of what you can generate with a simple Pov-Ray script.


Click on the image to see a higher resolution picture.


This is basically the same image that I showed in my blog a few days ago. But I increased the number of reflecting spheres and assigned them random locations in the scene-space. Basically, I just kept tweaking a stock script for a sphere on a checkered plane, until I got what I wanted.

Here's the entire script that produced the image rendered by Pov-Ray.

global_settings { assumed_gamma 1.0 }

camera {
location <5.0, -12.0, 2.0>
up z sky z
look_at <0.0, 0.0, 0.5>
angle 40
}

sky_sphere {
pigment {
gradient z
color_map {

[0.2 rgb 0.2]
[0.2 rgb 0.2]

}
}
}

light_source {
<3, 1, 2>*1000
color rgb <2.2, 1.8, 1.5>
}

plane {
z, 0
texture {
pigment {
checker
color rgb 1, color rgb 0
}
}
}

#macro Sphere(Pos, Radius)
sphere {
<Pos.x, Pos.y, -1 + Radius*3.3>, Radius
texture {
pigment { color rgb 1 }
finish{
diffuse 0.3
ambient 0.0
specular 0.6
reflection 0.8
}
}
}
#end

#local Cnt=0;
#local Seed=seed(0);

#while (Cnt<10000)
Sphere(
-100+<rand(Seed), rand(Seed)>*200,
0.3+pow(rand(Seed),2)*0.8
)
#local Cnt=Cnt+1;
#end

If you try to run this .pov script in Pov-Ray, you'll find that the image looks a little different with each run. That's what happens when you use a random function.

- © 2010 Jules Berman

tags: graphic design, 3-D rendering, pov-ray, povray, cover art, machiavelli's laboratory

Tuesday, April 20, 2010

Cover art design with PovRay 3

Every Pov-Ray newbie should start at the Pov-Ray organization's web site:

http://www.povray.org/

There, you can download the latest version of Pov-Ray, read tons of Pov-Ray documentation, look at amazing galleries of art created with Pov-Ray, find ancillary software that you can use with Pov-Ray, and acquire libraries of Pov-Ray objects that you can insert into your own renderings.

I use Windows, and my Pov-Ray installation was easy. When you open the application, you can choose to open a .pov script editing window [in which you write and save your scripts]. Whenever you get to a point where you think you can render the script, you simply click on an icon, and Pov-Ray will try to render your image.

In practice, especially for people new to Pov-Ray, you will build your first images by taking parts of sample .pov scripts created by others, and placing them into your own scripts. You will repeatedly render the images, making changes in the positions of the camera and lighting, in selection of colors, texture, and size, in modifications of the properties of textures and pigments, until you are happy with the rendered image, and then it becomes "your own". You will eventually add new objects into your image. Eventually, you might reach the stage where most, if not all, of the image is entirely your creation. Even then, you will be indebted to hundreds of Pov-Ray enthusiasts whose works led you to a level of competence.

Like so many other programming languages, you can write your first simple .POV script in under an hour, and you can spend the remainder of your life sharpening your skills.

Pov-Ray needs a little help for certain types of objects. 3-D text is actually very difficult to create "from scratch" in Pov-Ray. For text, you might want to use another freely available software application, Breeze Designer.

Breeze Designer is available at:

http://www.imagos.fl.net.au/

For the cover image I created a few days ago, I used Breeze Designer to make the text object, then I simply copied the object specifications from Breeze Designer and pasted them into my Pov-Ray script for the cover image. Then I added a marble texture to the text.


Click on image for larger size

Finally, I positioned the text on top of the globe from the scene, to produce the final image.


Click on image for larger size

Pov-Ray blends geometry, mathematics, and programming, and art. The online Pov-Ray tutorials are excellent.

- © 2010 Jules Berman

tags: graphic art, 3-D rendering, cover art, self-publishing

Monday, April 19, 2010

Cover art design with PovRay 2

This is the second blog in a multi-part series on Pov-Ray.

Pov-Ray (Persistence of Vision Ray Tracer) is software that renders a 3-D image from a script. Pov-Ray was initially started in the 1980s by David Kirk Buck and Aaron A. Collins. In the 1990s, development was handled by a team of extremely talented and dedicated programmers who have produced upgraded versions of this remarkable, and free software.

Pov-Ray is covered in a very good article in Wikipedia. The Wikipedia article includes a superb, public domain Pov-Ray rendering, shown here:

Click on image for larger size

Before you try any project like this, you've got to start with something small. Every Pov-Ray newbie starts with a simple scene consisting of a ball, placed over a plane.

Here is an example:

Click on image for larger size

The Pov-Ray script for the scene is:

global_settings { assumed_gamma 1.0 }

// ----------------------------------------

camera {
location <5.0, -12.0, 2.0>
up z sky z
look_at <0.0, 0.0, 0.5>
angle 40
}

sky_sphere {
pigment {
gradient z
color_map {
[0.0 rgb <0.6,0.7,1.0>]
[0.2 rgb <0.2,0.3,0.9>]
}
}
}

light_source {
<3, 1, 2>*1000
color rgb <2.2, 1.8, 1.5>
}

// ----------------------------------------

plane {
z, 0
texture {
pigment {
checker
color rgb 1, color rgb 0
}
}
}

sphere {
z*1.4, 1
texture {
pigment { color rgb 1 }
finish{
diffuse 0.3
ambient 0.0
specular 0.6
reflection 0.8
}
}
}


Every Pov-Ray script contains command lines that specify a camera, one or more sources of light, and one or more objects. The camera, light source, and objects are provided coordinates on an imaginary 3-D grid. The Pov-Ray script calulates the pixels on an imaginary camera screen (corresponding to the final image) receiving rays of light that leave the light source(s) and travel through scene. The color of the light that reaches each pixel position on the camera is determined by the properties of the objects in the scene.

Tomorrow, I'll explain a little more about the mechanics of building and executing a Pov-Ray script (called a .pov script) from within the Pov-Ray application.

- © 2010 Jules Berman

tags: graphic art, 3-D rendering, cover art, self-publishing

Sunday, April 18, 2010

Cover art design with PovRay


I have no artistic skill. I cannot draw anything. I would have no way of even starting to represent a 3-D object on a piece of paper. It's been like this all of my life.

I recently self-published an e-book, Machiavelli's Laboratory, (discussed in several prior blogs). I needed to produce a striking cover image for the book. I turned to PovRay and used a public domain photograph from wikipedia of Niccolo Machiavelli, for the tiled globe:


Source: Wikipedia, public domain


The final image (tiled globe, on an infinite rippled plane, with 3-D block letters painted with multi-colored marble) was produced by a script, NOT with computerized drawing aids. The PovRay application rendered the entire image, with script commands, just like any programming language produces an output by following the commands in a program.


Click on image for larger view


I thought the 3-D lettering was a bit too flashy, so I ended up using a flat font, and this final image:



In the next few blogs, I'll discuss PovRay, and Breeze Designer (used to create the 3-D text object in the first rendered image), and I'll provide the two PovRay scripts that produced the final images. I'll also show you how you can obtain PovRay and Breeze Designer (both can be downloaded at no cost).

- © 2010 Jules Berman

tags: graphic art, rendering software, cover art, ebook, e-book