POV-Ray Experiments

Last Updated on November 2nd 1997

CSG: Difference


CSG means Constructive Solid Geometry. Quoting from POV-Ray documentation (section 4.5.1):
"POV-Ray allows us to construct complex solids by combining primitive shapes in four different ways. These are UNION, where two or more shapes are added together. INTERSECTION, where two or more shapes are combined to make a new shape that consists of the area common to both shapes. DIFFERENCE, where subsequent shapes are subtracted from the first shape. And last not least MERGE, which is like a union where the surfaces inside the union are removed (useful in transparent CSG objects)."
When I thought of using DIFFERENCE operator, an image I saw in D.R.Hofstadter's book "Gödel, Escher, Bach" came to my mind.
'SNA' - Sergio Nasi 1997
So I took a marble cube and started removing prismatic parts from it, using the DIFFERENCE operator.
Then I used three cylindrical light sources to cast the shadows of the first letter of may e-mail address upon three orthogonal screens.
That's what came out.

When you use DIFFERENCE, you should avoid coincidence between the surfaces of the object you're digging and the surfaces of the removed parts.
Otherwise, the rays will be incorrectly traced and, usually, they won't penetrate the cavities.


Image Maps


'Weird Solar System' - Sergio Nasi 1997
Using image maps, you can wrap your shapes in wonderful packing-papers.

I took the maps of Earth and Jupiter from The RayTracing Hub of the Apocalypse.
Here you can find other planet maps and a very handy INC file to generate the starfield I put in the background.

Experienced astronomers will forgive wrong proportions...

The syntax of image maps statements is very simple. The following is the one I used for Jupiter, without scaling and rotation options:

sphere { 0,1
  texture {
   pigment {
    image_map {tga "jupiter" map_type 1 } } } }
TGA indicates the file format of the image. Graphical file formats supported: gif, tga, iff, ppm, pgm, png, sys.
You'll need to convert JPG's.

MAP_TYPE 1 gives a spherical mapping. It assumes that the object is a sphere of any size sitting at the origin.
Other possible maps could be: planar, cylindrical, toroidal.


Text Objects


Text Objects allow you to create 3D text in a twinkling of an eye.
The syntax is very simple (POV-Ray doc. 4.4.10) :
text { ttf "FONT FILE" "TEXT STRING" 1 , 0}
FONT FILE is the TTF (True Type Font) file that POV-Ray opens to extract the information on how to generate the TEXT STRING wanted. You should place the TTF file in the "/include" sub-directory of POV-Ray 's tree.
The first numeric parameter is THICKNESS: it tells POV-Ray how thick letters will be.
The second number is OFFSET: it introduces some spacing between letters.
The generated text object is placed so that the lower left front corner of the first letter is at the origin.
For this scene I also used a COLOR MAP of grey shades to give the object a blackened surface: you know, Dark Star explodes in the end...
'Dark Star debris' - Sergio Nasi 1997



Any questions? E-mail me

Stay tuned for more experiments.



Take me
back to Ray Tracing Page

Take me
back to Dark Star Resort Home Page