// File: simple-birthday.pov // Purpose: Simple POV-Ray Birthday Greeting // Original author: Robert Kiraly (OldCoder) // License: MIT/X // Revision: 130613 //-------------------------------------------------------------------- // Overview. // This POV-Ray scene file creates a simple Birthday Greeting in PNG // format. // To use this file under Linux, install "povray", copy "timrom.ttf" // from the "povray" distribution into the same folder as this file, // go to the directory that contains the two files, and execute a com- // mand similar to the following: // // povray simple-birthday.pov +W500 +H200 +Q10 +A0.2 +J //-------------------------------------------------------------------- // Set up some definitions. // Load the standard POV-Ray "shapes" "include" file. // #include "shapes.inc" // Declare the texture to be used for the greetings text. // #declare TextTexture = texture { pigment { rgb <1.0, 0.9, 0.2> } finish { ambient 0.000 diffuse 0.700 specular 0.050 roughness 0.002 metallic reflection { 0.5 metallic } } } //-------------------------------------------------------------------- // Set up background, camera, and plane. background { rgb <1,1,1> } camera { right x*500/75 location <0, 3, -12> look_at <0,0.3,0> angle 35 } plane { y, -0.125 pigment { rgb <.5059, .8667, 1> } finish { specular 1 reflection .3 } } //-------------------------------------------------------------------- // Add light sources. light_source { <1, 4, 3>, <1,1,1> fade_distance 4 fade_power 2 area_light x*8, y*8, 12,12 circular orient adaptive 1 } light_source { <-3, 3, -3>, <1,0,0> fade_distance 4 fade_power 2 area_light x*8, y*8, 12,12 circular orient adaptive 1 } light_source { <0, 3, -3>, <0,1,0> fade_distance 4 fade_power 2 area_light x*8, y*8, 12,12 circular orient adaptive 1 } light_source { <3, 3, -3>, <0,0,1> fade_distance 4 fade_power 2 area_light x*8, y*8, 12,12 circular orient adaptive 1 } //-------------------------------------------------------------------- // Macro that generates one text line per invocation. #macro Text_Line (string, yfactor) Center_Object (text { // Create text using specified TTF font file // The 1st numeric parameter controls thickness // The 2nd numeric parameter controls character spacing // ttf "timrom.ttf" string 0.9, 0.1*x // Set text texture texture { TextTexture } // The text is rolled 10 degrees backwards rotate <10,0,0> // Move text up or down based on yfactor // Positive values move text up // Negative values move text down // translate yfactor*y // Scale the text scale <0.8, 0.4, 0.5> }, x) #end //-------------------------------------------------------------------- // Add text lines to scene. Text_Line ("Happy Birthday", +0.9) Text_Line ("Jane Smith", -0.2)