Hello POV-Ray

August 31st, 2006. Tagged: 3d, pov-ray, tools

End-of-summer draft postings cleanup time! I found this piece of code I wanted to share but never had the time to. The code is in the POV-Ray programming language. "POV-what?" you might think. Well, from the hourse's mouth:

http://www.povray.org:
--
The Persistence of Vision Raytracer is a high-quality, totally free tool for creating stunning three-dimensional graphics. It is available in official versions for Windows, Mac OS/Mac OS X and i86 Linux. The source code is available for those wanting to do their own ports.

Maybe a year or so ago, I played with it, and here's the result.

teardrop2.png

Funny, isn't it? But don't judge me too harsh, I'm the first to admit my design and color matching abilities as trully very limited.

Anyway, here's the code, I hope you can make sense from the limitted amount of comments.

#include "shapes.inc"
#include "colors.inc"
#include "textures.inc"
#include "shapesq.inc"
#include "metals.inc"
#include "skies.inc"

// drop definition
#declare drop = object {
   Piriform
   sturm
   rotate -90*z
   translate 0.5*y
   
   scale <0.5, 2, 1>
   texture {
      pigment { P_Cloud1 }
      finish { F_MetalB }
   }
}

// add 5 drops
object {
    drop
    //pigment { Col_Fluorite_01 }
    translate -1.5*x
}
object {
    drop
    //pigment { Col_Fluorite_02 }
    translate 0.8*y
    translate 15.5*z
    translate 0.5*x
}
object {
    drop
    translate .5*z
    translate 1.9*x
}
object {
    drop
    translate 2.5*z
    translate 1.5*y
    translate -0.8*x
}
object {
    drop
    translate -1.5*z
    translate 1.8*y
    translate 2.5*x
}
 

// some clouds
O_Cloud1

// this is the sky 
sky_sphere {
    pigment {
        gradient y
        color_map {
            [0 color Blue]
            [1 color Brown]
        }
    scale 1.5
    translate -11
    }  

}

// the ground
plane { 
    y, -1.5
    pigment { checker pigment{Jade}, pigment{Yellow} }   
    //finish { reflection {1.0} ambient 0 diffuse 0 }  
    finish { reflection { 0.03, 0.81 }}
}

// camera, light ... shoot!
camera {
    location <0, 1, -8>
    look_at 0
    angle 43
}

light_source { 
    <200, 150, 100> White    
    //projected_through {O_Cloud2}
}

Warning before anyone dives into POV-Ray: It's a time killer! Once you get hooked you might suffer from sudden lapse of sleep. 😉 BTW, in the pov-ray programming manual there are some clever bits that start with "You know you have been raytracing too long when ...". I can totally relate to this one:

You know you have been raytracing too long when ...
... You want to cheat and look at nature's source code.
-- Mark Stock

In case you thought JavaScript could be tough...

Comments? Feedback? Find me on Twitter, Mastodon, Bluesky, LinkedIn, Threads