@com.POV-Ray 3 PC Template file @com.Version: 3.0 beta 7 @com.Last Modified: @com. [Bob Hughes] (97.849) @com. Name/Date, clock, atmospheres, lights, cameras, fogs, color, @com. sky_spheres, rainbows, halos, definitions, many other changes to format @com.------------------------------ @com.============================================================ @mt1.Title @com.============================================================ @com.------------------------------ @mt2.Scene File Header // Persistence of Vision Ray Tracer Scene Description File // File: .pov // Vers: 3 // Desc: // Date: // Auth: Bob Hughes @com.------------------------------ @mt2.Name/Date Objects @com.------------------------------ @mt3.Name/Date // Name and date addition #declare NameD = union { text { ttf "timrom.ttf", "Bob Hughes", 0.5, 0 translate 0.55*y} text { ttf "timrom.ttf", "97.85", 0.5, 0 translate -0.55*y } pigment { color rgb <.5,.75,1>} scale <1,1,1> rotate <0,0,0> translate <0,0,0> } @com.------------------------------ @mt3.Title #declare Title = text { ttf, "timrom.ttf", "Title", 0.5, 0 pigment { color rgb <1,.75,.5>} scale <1,1,1> rotate <0,0,0> translate <0,0,0> } @com.------------------------------ @com.============================================================ @mt1.Version @com.============================================================ @com.------------------------------ @mt2.version3 // (Note: This can toggle versions anywhere in the source) #version 3.0 @mt2.version2 // (Note: This can toggle versions anywhere in the source) #version 2.0 @mt2.version1 // (Note: This can toggle versions anywhere in the source) #version 1.0 @com.------------------------------ @com.============================================================ @mt1.Animation @com.============================================================ @com.------------------------------ @mt2.declare clock #declare _C_ = clock @mt2.clock identifier _C_ @com.------------------------------ @mt2.INI parameters @mt3.Clock Initial_Clock=0 Final_Clock=1 @mt3.Cyclic Cyclic_Animation=On @mt3.Frames Initial_Frame=0 Final_Frame=29 @mt3.Subset frames Subset_Start_Frame=10 ; put a semi-colon before both Subset_s to comment out Subset_End_Frame=19 @mt3.Output Output_File_Name=C:\Frames\ Output_File_Type=T ; C for compressed targa files. Some compilers won't use compressed targas @com.------------------------------ @com.============================================================ @mt1.Global Set @com.============================================================ @com.------------------------------ @mt2.Individual Globals @com.------------------------------ @mt3.global_settings global_settings { } @mt3.Gamma assumed_gamma 2.2 @mt3.Trace Level LO max_trace_level 2 @mt3.Trace Level HI max_trace_level 12 @mt3.Ambience ambient_light <1.5,1.5,1.5> @mt3.Wavelength irid_wavelength <0.25, 0.18, 0.14> @mt3.Wave Number number_of_waves 7 @mt3.Radiosity radiosity { brightness 3.3 count 167 distance_maximum 3 // 1/3 camera to object distance error_bound 0.38 gray_threshold 0.41 low_error_factor 0.69 minimum_reuse 0.018 nearest_count 7 recursion_limit 1 } @mt3.Intersections LO max_intersections 32 @mt3.Intersections HI max_intersections 128 @mt3.adc adc_bailout 0.004 @mt3.HFGray16 hf_gray_16 on //off @com.------------------------------ @com.------------------------------ @mt2.All Globals global_settings { assumed_gamma 2.2 max_trace_level 5 ambient_light rgb <1.1,1.1,1.1> irid_wavelength <0.3, 0.2, 0.25> number_of_waves 7 radiosity { brightness 3.3 count 167 distance_maximum 3 // 1/3 camera to object distance error_bound 0.38 gray_threshold 0.41 low_error_factor 0.69 minimum_reuse 0.018 nearest_count 7 recursion_limit 1 } max_intersections 64 adc_bailout 0.0039 hf_gray_16 off } @com.------------------------------ @com.============================================================ @mt1.Includes @com.============================================================ @com.------------------------------ @mt2.Standard // ==== Standard POV-Ray Includes ==== #include "_color.inc" // Standard Color definitions #include "_surface.inc" // Standard Finish definitions #include "_texture.inc" // Standard Texture definitions @com.------------------------------ @mt2.Additional // ==== Additional Includes ==== #include "_EARTH.INC" // Rock, dirt, sand, etc. #include "_WOOD.INC" // Wood #include "_GLASS.INC" // Glass #include "_METAL.INC" // Metal @com.------------------------------ @mt2.Extra // ==== Extra Includes ==== #include "_PLASTIC.INC" // Plastics #include "_NATURAL.INC" // Naturally occuring materials #include "_ARTIFIC.INC" // Artificially made materials #include "_MATERIA.INC" // Various combination materials //#include "_CHAR.INC" // Common keyboard characters in several custom shapes @com.------------------------------ @mt2.POV 2 //#include "2SHAPES.INC" // Primary shapes //#include "2SHAPES2.INC" // Secondary shapes //#include "2SHAPESQ.INC" // Special shapes //#include "2STONES.INC" // Rock, stone textures //#include "2WOODS.INC" // Wood //#include "2METALS.INC" // Various metallic textures //#include "2GLASS.INC" // Glass @com.------------------------------ @mt2.POV 3 #include "_SHAPES.INC" // Shapes //#include "_ATMOSPH.INC" // Atmospheres, fogs, bows //#include "_HALOS.INC" // Halos //#include "_CONST.INC" // Structures @com.------------------------------ @mt2.Environ // Environment Includes #include "_SKY.INC" // Skies, clouds //#include "_GROUND.INC" // Ground, land //#include "_WATER.INC" // Ocean, lake, river, liquid, etc. //#include "_SPACE.INC" // Stars, planets, etc. //#include "_FLORA.INC" // Vegetation oriented //#include "_FAUNA.INC" // Animal oriented @com.------------------------------ @com.============================================================ @mt1.Directives @com.============================================================ @com.------------------------------ @mt2.default // sets default texture that objects use when there's no texture specified #default { texture { pigment {color red 1} finish {ambient 0.2} } } @com.------------------------------ @mt2.include #include ".inc" @com.------------------------------ @mt2.declare #declare @com.------------------------------ @mt2.if #if ( ) #else #end @com.------------------------------ @mt2.ifdef #ifdef ( ) #else #end @com.------------------------------ @mt2.ifndef #ifndef ( ) #else #end @com.------------------------------ @mt2.switch #switch ( ) #case ( ) #break #case ( , ) #break #else #end @com.------------------------------ @mt2.while #declare Count = 0 #while (Count < 10) // Put 'Count'ed things here #declare Count = Count+1 #end @com.------------------------------ @mt2.Messages @mt3.debug #debug "During scene parsing; general info message" @mt3.fatal #fatal "During scene parsing; display and force POV-Ray to stop" @mt3.render #render "After scene parsing, before render" @mt3.statistics #statistics "After scene frame is rendered" @mt3.warning #warning "During scene parsing" #end @com.------------------------------ @mt2.Compatibility #declare Temp_Vers = version // Save original value of #version #version 2.0 // Change to 2.0 mode // Version 2.0 stuff goes here ... #version Temp_Vers // Restore original #version value @com.------------------------------ @com.============================================================ @mt1.Lights/Camera! @com.============================================================ @com.------------------------------ @mt2.Normal // 4 X 3 window and white pointlight at camera position #declare LCX = 0.0 #declare LCY = 0.0 #declare LCZ = -10.0 // (-6.32 = 4x3 view at <0,0,0> with angle 36) light_source { color rgb <1.5,1.5,1.5> } camera { location angle 22.5 // angle 67 = direction 1 // direction 3.33*z look_at <0.0 , 0.0 , 0.0> } @mt2.Movable Point // 4 X 3 window and white pointlight and camera with variable positions #declare LCX = 0.0 #declare LCY = 0.0 #declare LCZ = -10.0 // (-6.32 = 4x3 view at <0,0,0> with angle 36) // rotation vectors (adjust for varying placements) #declare RLX = 0 #declare RCX = 0 #declare RLY = 0 #declare RCY = 0 #declare RLZ = 0 #declare RCZ = 0 light_source { color rgb <1.5,1.5,1.5> rotate RLX*x rotate RLY*y rotate RLZ*z } camera { location angle 22.5 // angle 67 = direction 1 rotate RCX*x rotate RCY*y rotate RCZ*z // direction 3.33*z look_at <0.0 , 0.0 , 0.0> } @mt2.Movable Spot // 4 X 3 window and white spotlight and camera with variable positions #declare LCX = 0.0 #declare PLCX = 0.0 #declare LCY = 0.0 #declare PLCY = 0.0 #declare LCZ = -10.0 #declare PLCZ = 0.0 // (-6.32*z = 4x3 view at <0,0,0> with angle 36) // rotation vectors (for same or different placements) #declare RLX = 0 #declare RCX = 0 #declare RLY = 0 #declare RCY = 0 #declare RLZ = 0 #declare RCZ = 0 light_source { color rgb <1.5,1.5,1.5> rotate RLX*x rotate RLY*y rotate RLZ*z spotlight point_at radius 3 falloff 6 tightness 25 //fade_distance 9 fade_power 1 //atmospheric_attenuation on } camera { location angle 22.5 // angle 67 = direction 1 rotate RCX*x rotate RCY*y rotate RCZ*z // direction 3.33*z look_at } @mt2.Movable Beam // 4 X 3 window and white laserlight and camera with variable positions #declare LCX = 0.0 #declare PLCX = 0.0 #declare LCY = 0.0 #declare PLCY = 0.0 #declare LCZ = -10.0 #declare PLCZ = 0.0 // (-6.32*z = 4x3 view at <0,0,0> with angle 36) // rotation vectors (for same or different placements) #declare RLX = 0 #declare RCX = 0 #declare RLY = 0 #declare RCY = 0 #declare RLZ = 0 #declare RCZ = 0 light_source { color rgb <1.5,1.5,1.5> rotate RLX*x rotate RLY*y rotate RLZ*z cylinder point_at radius 6 falloff 9 tightness 15 //fade_distance 9 fade_power 1 //atmospheric_attenuation on } camera { location angle 22.5 // angle 67 = direction 1 rotate RCX*x rotate RCY*y rotate RCZ*z // direction 3.33*z look_at } @mt2.Movable Area // 4 X 3 window and white arealight and camera with variable positions #declare LCX = 0.0 #declare PLCX = 0.0 #declare LCY = 0.0 #declare PLCY = 0.0 #declare LCZ = -10.0 #declare PLCZ = 0.0 // (-6.32*z = 4x3 view at <0,0,0> with angle 36) // rotation vectors (for same or different placements) #declare RLX = 0 #declare RCX = 0 #declare RLY = 0 #declare RCY = 0 #declare RLZ = 0 #declare RCZ = 0 light_source { color rgb <1.5,1.5,1.5> rotate RLX*x rotate RLY*y rotate RLZ*z area_light <0.3,0,0>,<0,0.3,0>,3,3 adaptive 1 jitter //fade_distance 9 fade_power 1 //atmospheric_attenuation on } camera { location angle 22.5 // angle 67 = direction 1 rotate RCX*x rotate RCY*y rotate RCZ*z // direction 3.33*z look_at } @com.------------------------------ @com.============================================================ @mt1.Cameras @com.============================================================ @com.------------------------------ @mt2.Normal // approx. 4 X 3 window camera { location <0.0 , 0.0 ,-9.0> direction 3*z look_at <0.0 , 0.0 , 0.0> } @mt2.Zoom // approx. 2 X 1.5 window camera { location <0.0 , 0.0 ,-9.0> direction 6*z look_at <0.0 , 0.0 , 0.0> } @mt2.Wide // approx. 12 X 9 window camera { location <0.0 , 0.0 ,-9.0> direction 1*z look_at <0.0 , 0.0 , 0.0> } @mt2.Up camera { location <0.0 , 0.0 ,-9.0> direction 3*z rotate 45*x // avoid rotate 90*x with look_at <0,0,0> look_at <0.0 , 0.0 , 0.0> } @mt2.Up Left camera { location <0.0 , 0.0 ,-9.0> direction 3*z rotate 45*x rotate 45*y look_at <0.0 , 0.0 , 0.0> } @mt2.Up Right camera { location <0.0 , 0.0 ,-9.0> direction 3*z rotate 45*x rotate -45*y look_at <0.0 , 0.0 , 0.0> } @mt2.Unit Area // use square output file (160x160) camera { location <0.0 , 0.0 ,-6.32> direction pi*z // rotate 0*x rotate 0*y right 1*x look_at <0.0 , 0.0 , 0.0> } @mt2.Window 10 camera { location <0.0 , 0.0 ,-30.0> direction 3*z // rotate 0*x rotate 0*y look_at <0.0 , 0.0 , 0.0> } @mt2.Window 100 camera { location <0.0 , 0.0 ,-300.0> direction 3*z // rotate 0*x rotate 0*y look_at <0.0 , 0.0 , 0.0> } @mt2.Window 1000 camera { location <0.0 , 0.0 ,-3000.0> direction 3*z // rotate 0*x rotate 0*y look_at <0.0 , 0.0 , 0.0> } @com.------------------------------ @mt2.Lenses @com.------------------------------ @mt3.Ortho orthographic // size of view, up/right adjusted @mt3.Panorama panoramic // sides expanded @mt3.Fisheye fisheye // portal created, size of view, angle or direction adjusted @mt3.Ultra Wide ultra_wide_angle // approx. 2X zoom @mt3.Omnimax omnimax // theatrical portal @mt3.Cylindric cylinder 1 // 1=compress x, 0/2=compress y, 3=stretch y, 4=stretch x @com.------------------------------ @com.------------------------------ @mt2.Filters @com.------------------------------ @mt3.Iced // Iced filter. Place INSIDE 'camera' statement normal { crackle .01 scale .05 } @mt3.Frosted // Frosted filter. Place OUTSIDE of 'camera' statement sphere { ,.1 hollow pigment { color rgbft<1.1,1.1,1.1,.4,.4> } normal { granite .03 scale .003 } finish { crand .033 } scale 1 // change to use multiple filters rotate } @mt3.Skylight // Skylight filter. Place OUTSIDE of 'camera' statement sphere { ,.1 hollow pigment { color rgbf<1,.9,.8,.9> } scale 1 // change to use multiple filters rotate } @mt3.UV // UV filter. Place OUTSIDE of 'camera' statement sphere { ,.1 hollow pigment { color rgbft<1,.95,.9,.5,.5> } scale 1 // change to use multiple filters rotate } @mt3.Gradient // Gradient filter. Place OUTSIDE of 'camera' statement sphere { ,.1 hollow pigment { gradient y color_map {[.5,1 color rgbf<1,1,1,1> color rgbf<1.5,.75,0,.75>]} sine_wave scale .1 rotate 0*x} scale 1 // change to use multiple filters rotate } @mt3.Polarized // Polarized filter. Place OUTSIDE of 'camera' statement sphere { ,.1 hollow pigment { gradient z color_map {[0,.9 color rgbt<1,1,1,.5> color rgbt<1,1,1,1>]} sine_wave scale .125 rotate 0*y} scale 1 // change to use multiple filters rotate } @mt3.Distortion // Distortion filter. Place INSIDE 'camera' statement normal {wrinkles .05 scale .1} @mt3.Stained Glass // Stained-glass filter. Place OUTSIDE of 'camera' statement sphere { ,.1 hollow pigment { wrinkles frequency 9 color_map { [0 color rgbf<1,0,0,1>] [.25 color rgbf<1,1,0,1>] [.5 color rgbf<0,1,0,1>] [.75 color rgbf<0,1,1,1>] [1 color rgbf<0,0,1,1>]} sine_wave scale .1 } scale 1 // change to use multiple filters rotate } @com.------------------------------ @com.============================================================ @mt1.Light sources @com.============================================================ @com.------------------------------ @mt2.Point Lights @mt3.Normal // point-light source light_source { 0*x // light's position (translated below) color red 1.5 green 1.5 blue 1.5 // light's color translate <-10, 20, -30> scale <1,1,1> // scale to distance } @mt3.Overhead // overhead point-light source light_source { 0*x // light's position (translated below) color red 1.5 green 1.5 blue 1.5 // light's color translate <0, 30, 0> } @mt3.Backlight // back point-light source light_source { 0*x // light's position (translated below) color red 1.5 green 1.5 blue 1.5 // light's color translate <0, 20, -30> rotate 180*y // transform } @mt3.Sidelight // side point-light source light_source { 0*x // light's position (translated below) color red 1.5 green 1.5 blue 1.5 // light's color translate <0, 20, -30> rotate -90*y // transform (- = R, + = L) } @mt3.Frontlight // front point-light source light_source { 0*x // light's position (translated below) color red 1.5 green 1.5 blue 1.5 // light's color translate <0, 20, -30> // camera postion vectors } @com.------------------------------ @com.------------------------------ @mt2.Spotlight // create a point "spotlight" (conical/directed) light source light_source { 0*x color rgb <1.5,1.5,1.5> spotlight translate <40, 80, -40> point_at <0, 0, 0> radius 6 tightness 50 falloff 9 } @com.------------------------------ @mt2.Beam Light // create an area "spotlight" (cylindrical/directed) light source light_source { 0*x color rgb <1.5,1.5,1.5> spotlight cylinder translate <40, 80, -40> point_at <0, 0, 0> radius 9 // larger numbers required to equal area of normal spotlight tightness 25 // smaller numbers here for same effect falloff 12 } @com.------------------------------ @mt2.Object Light // light_source { ... // put this inside a light_source to give it a visible shape looks_like { sphere { 0*x, 5 pigment { Yellow } } } @com.------------------------------ @mt2.Area Light // An area light (creates soft shadows) // WARNING: This special light can significantly slow down rendering times! light_source { 0*x // light's position (translated below) color rgb 1.5 // light's color // nLightsWide mLightsHigh area_light <8, 0, 0>, <0, 0, 8>, // lights spread out across this distance (x * z) 4, 4 // total number of lights in grid (4x*4z = 16 lights) adaptive 0 // 0,1,2,3... jitter // adds random softening of light translate <40, 80, -40> // position of light } @com.------------------------------ @mt2.Effects @com.------------------------------ @com.------------------------------ @mt3.Atmospheric atmospheric_attenuation on // on/off @mt3.Fading fade_distance 10 fade_power 1 @mt3.Shadowless shadowless @com.------------------------------ @com.------------------------------ @mt2.Movable Lights @com.------------------------------ @mt3.Movable Point // 4 X 3 window and white pointlight and camera with variable positions #declare LCX = 0.0 #declare LCY = 0.0 #declare LCZ = -9.0 // -30, -300, -3000, -6.32 (unit) // rotation vectors (adjust for varying placements) #declare RLX = 0 #declare RLY = 0 #declare RLZ = 0 light_source { color rgb <1.5,1.5,1.5> rotate RLX*x rotate RLY*y rotate RLZ*z } @mt3.Movable Spot // White spotlight with variable positions // origin and rotation vectors (adjust for varying placements) #declare OLX = 0 #declare OPX = 0 #declare OLY = 0 #declare OPY = 0 #declare OLZ = -9 #declare OPZ = 0 #declare RLX = 0 #declare RPX = 0 #declare RLY = 0 #declare RPY = 0 #declare RLZ = 0 #declare RPZ = 0 light_source { color rgb <1.5,1.5,1.5> rotate RLX*x rotate RLY*y rotate RLZ*z spotlight point_at radius 6 tightness 50 falloff 9 } @mt3.Movable Beam // White lightbeam with variable positions // origin and rotation vectors (adjust for varying placements) #declare OLX = 0 #declare OPX = 0 #declare OLY = 0 #declare OPY = 0 #declare OLZ = -9 #declare OPZ = 0 #declare RLX = 0 #declare RPX = 0 #declare RLY = 0 #declare RPY = 0 #declare RLZ = 0 #declare RPZ = 0 light_source { color rgb <1.5,1.5,1.5> rotate RLX*x rotate RLY*y rotate RLZ*z spotlight cylinder point_at // original point plus offset radius 9 // larger numbers required to equal area of normal spotlight tightness 25 // smaller numbers here for same effect falloff 12 } @mt3.Movable Square Spot // White square spotlight with variable positions // origin and rotation vectors (adjust for varying placements) #declare SBX = 0 #declare OPX = 0 #declare SBY = 0 #declare OPY = 0 #declare SBZ = 0 #declare OPZ = 0 #declare OLZ = -9 #declare RLX = 0 #declare RPX = 0 #declare RLY = 0 #declare RPY = 0 #declare RLZ = 0 #declare RPZ = 0 #declare SSR = 1 // scale multiplier for radius [?<.2 to 2>?] union { light_source {OLZ*z color rgb <1.5,1.5,1.5> spotlight point_at radius 3*SSR tightness 50 falloff 9*SSR } disc { 0, z, 2 pigment {rgb<0,0,0>} clipped_by { box { -.0555,.0555 scale SSR inverse } } translate (OLZ+.5)*z } rotate RLX*x rotate RLY*y rotate RLZ*z translate } @mt3.Movable Square Beam // White square lightbeam with variable positions // origin and rotation vectors (adjust for varying placements) #declare SBX = 0 #declare OPX = 0 #declare SBY = 0 #declare OPY = 0 #declare SBZ = 0 #declare OPZ = 0 #declare OLZ = -9 #declare RLX = 0 #declare RPX = 0 #declare RLY = 0 #declare RPY = 0 #declare RLZ = 0 #declare RPZ = 0 #declare SSR = 1 // scale multiplier for radius [?<.2 to 2>?] union { light_source {OLZ*z color rgb <1.5,1.5,1.5> cylinder point_at radius 9*SSR tightness 33 falloff 27*SSR } disc { 0, z, 2 pigment {rgb<0,0,0>} clipped_by { box { -.0555,.0555 scale SSR inverse } } translate (OLZ+.5)*z } rotate RLX*x rotate RLY*y rotate RLZ*z translate } @com.------------------------------ @com.============================================================ @mt1.Props @com.============================================================ @com.------------------------------ @mt2.Background // Set a color of the background. NOTE: this affects scene reflections background { color red 0.1 green 0.3 blue 0.8 } @com.------------------------------ @mt2.Skies @com.------------------------------ // Create an infinite sphere around scene and allow any texture on it @mt3.Day sky_sphere // daytime { pigment { gradient y color_map { [0.0 color rgb<0.8,0.9,1.0>] [1.0 color rgb<0.6,0.7,0.9>] } } } @mt3.Dusk sky_sphere // evening { pigment { gradient y color_map { [0.0 color rgb<0.9,0.5,0.475>] [1.0 color rgb<0.2,0.45,0.65>] } } } @mt3.Night sky_sphere // night { pigment { gradient y color_map { [0.0 color rgb<0.2,0.325,0.425>] [1.0 color rgb<0.1,0.225,0.25>] } } } @mt3.Stars sky_sphere // stars { pigment { granite turbulence 1.2 color_map { [0.0,0.07 color rgb<0.425,0.475,0.4> color rgb<0.425,0.5,0.4>] [0.07,0.5 color rgb<0,0,0> color rgb<0,0,0>] [0.5,0.9 color rgb<0,0,0> color rgb<0,0,0>] [0.9,1 color rgb<0.3,0.35,0.375> color rgb<0.3,0.375,0.4>] } scale 0.07 } pigment { granite turbulence 2 color_map { [0.0,0.06 color rgbt<0.775,0.75,0.725,0> color rgbt<0.8,0.75,0.725,0>] [0.06,0.3 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.3,0.9 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.9,1 color rgbt<0.8,1,1.2,0> color rgbt<0.8,1.2,1.4,0>] } scale 0.08 } /* pigment // horizon obscuration layer { gradient y color_map { [0.0 color rgbt<.001,.001,.001,0>] [1.0 color rgbt<.001,.001,.001,1>] } } */ pigment { gradient y color_map { [0.0 color rgbt<.2,.3,.35,0>] [1.0 color rgbt<.175,.225,.25,1>] } } } @mt3.Dawn sky_sphere // morning { pigment { gradient y color_map { [0.0 color rgb<1.0,0.825,0.675>] [1.0 color rgb<0.45,0.55,0.75>] } } } @mt3.Clouds sky_sphere // clouds { pigment { gradient y color_map { [0 color rgb<.825,.85,.95>] [1 color rgb<.8,.8,.95>] } } pigment { bozo turbulence .1 color_map { [0.0,0.07 color rgb<0.425,0.475,0.4> color rgb<0.425,0.5,0.4>] [0.07,0.5 color rgb<0,0,0> color rgb<0,0,0>] [0.5,0.9 color rgb<0,0,0> color rgb<0,0,0>] [0.9,1 color rgb<0.3,0.35,0.375> color rgb<0.3,0.375,0.4>] } scale <2,.66,1> } pigment { granite turbulence .6 color_map { [0.0,0.3 color rgbt<.6,.65,.675,0> color rgbt<.65,.625,.675,.7>] [0.3,0.5 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.5,0.8 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.8,1 color rgbt<.55,.525,.6,.8> color rgbt<.5,.525,.55,0>] } scale <1,3,1> } } @mt3.High/Low Clouds sky_sphere // high/low clouds { pigment { gradient y color_map { [0 color rgb<.8,.9,1.1>] [1 color rgb<.55,.65,1.6>] } } pigment { leopard turbulence 1.4 color_map { [0.0,0.3 color rgbt<.81,.82,.84,.1> color rgbt<.83,.85,.86,.3>] [0.3,0.4 color rgbt<.83,.85,.86,.3> color rgbt<1,1,1,1>] [0.4,0.5 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.5,0.6 color rgbt<1,1,1,1> color rgbt<.9,.92,.95,.6>] [0.6,1.0 color rgbt<.9,.92,.93,.5> color rgbt<.93,.92,.94,.1>] } scale <2,.33,1> } pigment { spotted turbulence 1.3 color_map { [0.0,0.2 color rgbt<.9,.93,.95,0> color rgbt<.93,.92,.94,.4>] [0.2,0.4 color rgbt<.93,.92,.94,.4> color rgbt<1,1,1,1>] [0.4,0.7 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.7,0.8 color rgbt<1,1,1,1> color rgbt<.96,.95,.97,.3>] [0.8,1.0 color rgbt<.96,.95,.97,.3> color rgbt<.9,.92,.94,0>] } scale <1,.33,1.5> } /* pigment { gradient y color_map { [0 color rgbt<1,1,1,0>] [1 color rgbt<0,0,0,1>] } } */ } @mt3.Purple Clouds sky_sphere // morning/evening clouds { pigment { gradient y color_map { [0 color rgb<.8,.9,1.1>] [1 color rgb<.55,.65,1.6>] } } pigment { bozo turbulence 1.4 color_map { [0.0,0.3 color rgbt<.81,.82,.84,.1> color rgbt<.83,.85,.86,.3>] [0.3,0.4 color rgbt<.83,.85,.86,.3> color rgbt<1,1,1,1>] [0.4,0.5 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.5,0.6 color rgbt<1,1,1,1> color rgbt<.9,.92,.95,.6>] [0.6,1.0 color rgbt<.9,.92,.93,.5> color rgbt<.93,.92,.94,.1>] } scale <2,.33,1> } pigment { granite turbulence .3 color_map { [0.0,0.2 color rgbt<.8,.83,.85,0> color rgbt<.83,.82,.84,.4>] [0.2,0.4 color rgbt<.83,.82,.84,.4> color rgbt<1,1,1,1>] [0.4,0.7 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.7,0.8 color rgbt<1,1,1,1> color rgbt<.86,.85,.87,.3>] [0.8,1.0 color rgbt<.86,.85,.87,.3> color rgbt<.8,.82,.84,0>] } scale <2,.66,2> } /* pigment { gradient y color_map { [0 color rgbt<1,1,1,0>] [1 color rgbt<0,0,0,1>] } } */ } @mt3.Rain sky_sphere // rain clouds { pigment { gradient y color_map { [0 color rgb<.7,.8,.9>] [1 color rgb<.6,.7,.9>] } } pigment { bozo turbulence .3 color_map { [0.0,0.07 color rgbt<.425,.475,.4> color rgbt<.425,.5,.4>] [0.07,0.5 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.5,0.9 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.9,1 color rgbt<.3,.35,.375> color rgbt<.3,.375,.4>] } scale <2,.66,1> } pigment { granite turbulence .2 color_map { [0.0,0.3 color rgbt<.6,.65,.675,0> color rgbt<.65,.625,.675,.7>] [0.3,0.5 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.5,0.8 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.8,1 color rgbt<.55,.525,.6,.8> color rgbt<.5,.525,.55,0>] } scale <1,3,1> } } @mt3.Shower sky_sphere // rain shower clouds { pigment { gradient y color_map { [0 color rgb<.7,.8,.9>] [1 color rgb<.6,.7,.9>] } } pigment { bozo turbulence .7 color_map { [0.0,0.4 color rgbt<.7,.75,.775,0> color rgbt<.75,.75,.775,.4>] [0.4,0.5 color rgbt<.75,.75,.775,.4> color rgbt<1,1,1,1>] [0.5,0.7 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.7,1 color rgbt<.8,.825,.875,.5> color rgbt<.825,.85,.85,0>] } scale <1,.33,1> } pigment { granite turbulence .1 color_map { [0.0,0.4 color rgbt<.6,.65,.675,0> color rgbt<.65,.625,.675,.7>] [0.4,0.5 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.5,0.7 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.7,1 color rgbt<.55,.525,.6,.8> color rgbt<.5,.525,.55,0>] } scale <1,1.25,1> } pigment { gradient y color_map { [0 color rgbt<.725,.7,.8,.3>] [1 color rgbt<.9,.925,.95,.9>] } } } @mt3.Storm sky_sphere // storm clouds { pigment { gradient y color_map { [0 color rgb<.45,.5,.55>] [1 color rgb<.425,.5,.6>] } } pigment { bozo turbulence .9 color_map { [0.0,0.5 color rgbt<.7,.75,.775,0> color rgbt<.75,.75,.775,.4>] [0.5,0.55 color rgbt<.75,.75,.775,.4> color rgbt<1,1,1,1>] [0.55,0.6 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.6,1 color rgbt<.8,.825,.875,.5> color rgbt<.825,.85,.85,0>] } scale <1,.5,.8> } pigment { granite turbulence .3 color_map { [0.0,0.45 color rgbt<.6,.65,.675,0> color rgbt<.65,.625,.675,.7>] [0.45,0.55 color rgbt<.65,.625,.675,.7> color rgbt<1,1,1,1>] [0.55,0.65 color rgbt<1,1,1,1> color rgbt<.55,.525,.6,.8>] [0.65,1 color rgbt<.55,.525,.6,.8> color rgbt<.5,.525,.55,0>] } scale <1.5,1.25,1> } pigment { marble turbulence 4 omega .2 lambda 4 color_map { [0.0,0.02 color rgbt<1.2,1.3,1.5,0> color rgbt<.7,1,1.3,.3>] [0.02,0.03 color rgbt<.7,1,1.2,.7> color rgbt<1,1,1,1>] [0.09,0.97 color rgbt<1,1,1,1> color rgbt<1,1,1,1>] [0.97,0.99 color rgbt<1,1,1,1> color rgbt<1.3,1.1,1,.8>] [0.99,1 color rgbt<1.3,1.1,1,.2> color rgbt<1.4,1.3,1.4,0>] } scale <2,4,1.5> } pigment { gradient y color_map { [0 color rgbt<.725,.7,.8,.3>] [1 color rgbt<.9,.925,.95,.9>] } } } @com.------------------------------ @mt2.Spectral Bows @com.------------------------------ @mt3.Rainbow // realistic bright rainbow rainbow { direction <0,0,1> angle 30 width 5 distance 15 color_map { [ 0.0,0.19 color rgbt<2,0,2,1> color rgbt<0,0,3,.975> ] [ 0.19,0.33 color rgbt<0,0,3,.975> color rgbt<0,2,2,.925> ] [ 0.33,0.475 color rgbt<0,2,2,.925> color rgbt<0,3,0,.95>] [ 0.475,0.6 color rgbt<0,3,0,.95> color rgbt<2,2,0,.925>] [ 0.6,0.75 color rgbt<2,2,0,.925> color rgbt<2.5,1.5,0,.9125>] [ 0.75,1.0 color rgbt<2.5,1.5,0,.9125> color rgbt<3,0,0,1>] } jitter 0.02 up <0.1,1,0> // 1*y is normal up (any x value will tilt) arc_angle 160 falloff_angle 90 } @com.------------------------------ @mt3.Double Rainbow // realistic bright rainbow (double) rainbow { direction <0,0,1> angle 30 width 5 distance 15 color_map { [ 0.0,0.19 color rgbt<2,0,2,1> color rgbt<0,0,3,.975> ] [ 0.19,0.33 color rgbt<0,0,3,.975> color rgbt<0,2,2,.925> ] [ 0.33,0.475 color rgbt<0,2,2,.925> color rgbt<0,3,0,.95>] [ 0.475,0.6 color rgbt<0,3,0,.95> color rgbt<2,2,0,.925>] [ 0.6,0.75 color rgbt<2,2,0,.925> color rgbt<2.5,1.5,0,.9125>] [ 0.75,1.0 color rgbt<2.5,1.5,0,.9125> color rgbt<3,0,0,1>] } jitter 0.02 // small number needed to keep smoothness up <0.1,1,0> // 1*y is normal up (any x value will tilt) arc_angle 160 falloff_angle 90 } // secondary bow rainbow { direction <0,0,1> angle 39 width 6.6 distance 15 color_map { [ 0.0,0.19 color rgbt<2.4,0,0,1> color rgbt<2,1,0,.97> ] [ 0.19,0.33 color rgbt<2,1,0,.97> color rgbt<2,2,0,.98> ] [ 0.33,0.425 color rgbt<2,2,0,.98> color rgbt<0,2.4,0,.985> ] [ 0.425,0.6 color rgbt<0,2.4,0,.985> color rgbt<0,2,2,.98> ] [ 0.6,0.75 color rgbt<0,2,2,.98> color rgbt<0,0,2.4,.99> ] [ 0.75,1.0 color rgbt<0,0,2.4,.99> color rgbt<2,0,2,1> ] } jitter 0.04 up <0.2,1,0> // 1*y is normal up (any x value will tilt) arc_angle 90 // lesser bow falloff_angle 60 } @mt3.Multi-Rainbow // realistic bright rainbow (inner multiples) rainbow { direction <0,0,1> angle 30 width 5 distance 15 color_map { [ 0.0,0.19 color rgbt<2,0,2,1> color rgbt<0,0,3,.975> ] [ 0.19,0.33 color rgbt<0,0,3,.975> color rgbt<0,2,2,.925> ] [ 0.33,0.475 color rgbt<0,2,2,.925> color rgbt<0,3,0,.95>] [ 0.475,0.6 color rgbt<0,3,0,.95> color rgbt<2,2,0,.925>] [ 0.6,0.75 color rgbt<2,2,0,.925> color rgbt<2.5,1.5,0,.9125>] [ 0.75,1.0 color rgbt<2.5,1.5,0,.9125> color rgbt<3,0,0,1>] } jitter 0.02 // small number needed to keep smoothness up <0.1,1,0> // 1*y is normal up (any x value will tilt) arc_angle 160 falloff_angle 90 } // secondary bow rainbow { direction <0,0,1> angle 24 width 3.6 distance 15 color_map { [ 0.0,0.19 color rgbt<2.4,0,0,1> color rgbt<2,1,0,.97> ] [ 0.19,0.33 color rgbt<2,1,0,.97> color rgbt<1.8,1.8,0,.98> ] [ 0.33,0.425 color rgbt<1.8,1.8,0,.98> color rgbt<0,2.4,0,.985> ] [ 0.425,0.6 color rgbt<0,2.4,0,.985> color rgbt<0,1.8,1.8,.98> ] [ 0.6,0.75 color rgbt<0,1.8,1.8,.98> color rgbt<0,0,2.4,.99> ] [ 0.75,1.0 color rgbt<0,0,2.4,.99> color rgbt<1.8,0,1.8,1> ] } jitter 0.03 up <0,1,0> // 1*y is normal up (any x value will tilt) arc_angle 120 // lesser bow falloff_angle 60 } // tertiary bow rainbow { direction <0,0,1> angle 20 width 3 distance 15 color_map { [ 0.0,0.19 color rgbt<1.8,0,0,1> color rgbt<1.6,.8,0,.97> ] [ 0.19,0.33 color rgbt<1.6,.8,0,.97> color rgbt<1.6,1.6,0,.98> ] [ 0.33,0.425 color rgbt<1.6,1.6,0,.98> color rgbt<0,1.8,0,.985> ] [ 0.425,0.6 color rgbt<0,1.8,0,.985> color rgbt<0,1.6,1.6,.98> ] [ 0.6,0.75 color rgbt<0,1.6,1.6,.98> color rgbt<0,0,1.8,.99> ] [ 0.75,1.0 color rgbt<0,0,1.8,.99> color rgbt<1.6,0,1.6,1> ] } jitter 0.04 up <0,1,0> // 1*y is normal up (any x value will tilt) arc_angle 90 // lesser bow falloff_angle 40 } @com.------------------------------ @mt2.Air Fogs @com.------------------------------ @mt3.Near fog { fog_type 1 distance 30 // 67% visibilty at distance color <.5,.9,1> } @mt3.Far fog { fog_type 1 distance 300 // 67% visibilty at distance color <.5,.9,1> } @com.------------------------------ @mt2.Ground Fogs @com.------------------------------ @mt3.Smooth // undisturbed ground fog fog { fog_type 2 distance 20 color <0.9,0.9,0.9> fog_offset 0.1 fog_alt 0.2 } @mt3.Thick // undisturbed deep ground fog fog { fog_type 2 distance 20 color <0.9,0.9,0.9> fog_offset 0.1 fog_alt 1.0 } @mt3.Disturbed // unsettled ground fog fog { fog_type 2 distance 20 color <0.9,0.9,0.9> fog_offset 0.1 fog_alt 0.4 turbulence 0.6 turb_depth 0.3 } @mt3.Chaotic // stirred up ground fog fog { fog_type 2 distance 20 color <0.9,0.9,0.9> fog_offset 0.1 fog_alt 0.9 turbulence 0.9 turb_depth 0.6 octaves 3 omega 0.3 lambda 2.0 } @mt3.Vapor // steamy vapor ground fog fog { fog_type 2 distance 20 color <0.95,0.925,0.95> fog_offset 0.3 fog_alt 0.9 turbulence 1.0 turb_depth 1.0 octaves 3 omega 0.3 lambda 2.5 } @mt3.Smoke // smokey swirling ground fog fog { fog_type 2 distance 20 color <0.85,0.9,0.95> fog_offset 0.9 fog_alt 1.6 turbulence 0.9 turb_depth 0.9 octaves 3 omega 0.6 lambda 5.0 } @mt3.Unworldly // choppy consistency ground fog fog { fog_type 2 distance 20 color <0.95,0.85,0.9> fog_offset 0.6 fog_alt 0.9 turbulence 0.6 turb_depth 0.9 octaves 4 omega 0.6 lambda 6.0 } @com.------------------------------ @com.============================================================ @mt1.Atmospheres @com.============================================================ @com.------------------------------ @mt2.All Types // Atmosphere with isotropic scattering, // constant atmosphere (independent of incident light). #declare A1 = atmosphere { type samples 20 distance 20 scattering 0.6 aa_level 6 aa_threshold 0.6 jitter 0.6 color rgbt<1,1,1,0.5> } // Atmosphere with Mie scattering, // hazy atmosphere (dependent on incident light). #declare A2 = atmosphere { type 2 samples 20 distance 20 scattering 1.5 aa_level 6 aa_threshold 0.6 jitter 0.6 color rgbt<1,1,1,0.5> } // Atmosphere with Mie scattering, // murky atmosphere (dependent on incident light). #declare A3 = atmosphere { type 3 samples 20 distance 20 scattering 6 aa_level 6 aa_threshold 0.6 jitter 0.6 color rgbt<1,1,1,0.5> } // Atmosphere with Rayleigh scattering, // murky atmosphere (dependent on incident light). #declare A4 = atmosphere { type 4 samples 20 distance 20 scattering 0.6 aa_level 6 aa_threshold 0.6 jitter 0.6 color rgbt<1,1,1,0.5> } // Atmosphere with Henyey-Greenstein scattering, // vaporous atmosphere (dependent on incident light). #declare A5 = atmosphere { type 5 samples 20 distance 20 scattering 0.3 eccentricity 0.2 aa_level 6 aa_threshold 0.6 jitter 0.6 color rgbt<1,1,1,0.5> } atmosphere { A1...5 } @mt2.Air atmosphere { type 1 // ISOTROPIC_SCATTERING samples 20 // Number of samples in first distance interval distance 20 // Atmosphere density, similar to fog scattering 0.6 // Reflectivity of atmosphere, determines brightness aa_level 6 // Level of binary subdivision in case of aa aa_threshold 0.6 // Threshold for aa to push in jitter 0.01 // Amount of sample jittering color rgbt<1,1,1,0.5> // Color with transparency of background } @mt2.Hazy #declare A2 = atmosphere { type 2 // MIE_HAZY_SCATTERING samples 20 // Number of samples in first distance interval distance 20 // Atmosphere density, similar to fog scattering 1.5 // Reflectivity of atmosphere, determines brightness aa_level 6 // Level of binary subdivision in case of aa aa_threshold 0.6 // Threshold for aa to push in jitter 0.03 // Amount of sample jittering color rgbt<1,1,1,0.5> // Color with transparency of background } @mt2.Murky #declare A3 = atmosphere { type 3 // MIE_MURKY_SCATTERING samples 20 // Number of samples in first distance interval distance 20 // Atmosphere density, similar to fog scattering 6 // Reflectivity of atmosphere, determines brightness aa_level 6 // Level of binary subdivision in case of aa aa_threshold 0.6 // Threshold for aa to push in jitter 0.06 // Amount of sample jittering color rgbt<1,1,1,0.5> // Color with transparency of background } @mt2.Smoky #declare A4 = atmosphere { type 4 // RAYLEIGH_SCATTERING samples 20 // Number of samples in first distance interval distance 20 // Atmosphere density, similar to fog scattering 0.6 // Reflectivity of atmosphere, determines brightness aa_level 6 // Level of binary subdivision in case of aa aa_threshold 0.6 // Threshold for aa to push in jitter 0.2 // Amount of sample jittering color rgbt<1,1,1,0.5> // Color with transparency of background } @mt2.Vapor #declare A5 = atmosphere { type 5 // HENYEY_GREENSTEIN_SCATTERING samples 20 // Number of samples in first distance interval distance 20 // Atmosphere density, similar to fog scattering 0.3 // Reflectivity of atmosphere, determines brightness eccentricity 0.2 // Balance of directional scatter aa_level 6 // Level of binary subdivision in case of aa aa_threshold 0.6 // Threshold for aa to push in jitter 0.3 // Amount of sample jittering color rgbt<1,1,1,0.5> // Color with transparency of background } @com.------------------------------ @com.============================================================ @mt1.Ground @com.============================================================ @com.------------------------------ @mt2.Flat plane { y, 0 pigment { color rgb <.7,.6,.3> } } @com.------------------------------ @mt2.Convex sphere { 0, 1 clipped_by { plane { -y, 0.5 } } scale 1000 translate -1000*y pigment { color rgb <.7,.6,.3> } } @com.------------------------------ @mt2.Concave sphere { 0, 1 clipped_by { plane { -y, 0.5 } } scale 1000 translate -1000*y pigment { color rgb <.7,.6,.3> } rotate 180*x } @com.------------------------------ @com.============================================================ @mt1.Shapes @com.============================================================ @com.------------------------------ @mt2.Simple @com.------------------------------ @mt3.plane plane { y, -1.0 } @com.------------------------------ @mt3.box box { <-1, -1, -1>, < 1, 1, 1> } @com.------------------------------ @mt3.sphere sphere { 0, 1 } @com.------------------------------ @mt3.blob #declare StrengthVal = 1.0 #declare RadiusVal = 1.0 blob { threshold 0.6 sphere { < 0.5, 0, 0>, RadiusVal, StrengthVal } sphere { <-0.5, 0.5, 0>, RadiusVal, StrengthVal } sphere { <-0.5, -0.5, 0>, RadiusVal, StrengthVal } cylinder { -z, +z, RadiusVal, StrengthVal } // sturm } @com.------------------------------ @mt3.cone cone { 1*y, 0.0, -1*y, 1.0 // open } @com.------------------------------ @mt3.cylinder cylinder { -1*z, 1*z, 1 // open } @com.------------------------------ @mt3.disc disc { <0, 0, 0>, z, 1.0, 0.0 } @com.------------------------------ @mt3.torus torus { 0.75, 0.25 } @com.------------------------------ @mt3.superellipsoid superellipsoid { <.5, .5> } @com.------------------------------ @mt3.sor sor { 7, <0.000000, 0.000000> <0.118143, 0.000000> <0.620253, 0.540084> <0.210970, 0.827004> <0.194093, 0.962025> <0.286920, 1.000000> <0.468354, 1.033755> // open } @com.------------------------------ @mt3.triangle triangle { <-1, 0, -1> < 1, 0, -1> < 0, 0, 1> } @com.------------------------------ @mt3.text text { ttf "cour.ttf", "POV-Ray", 1, 0 } @com.------------------------------ @mt2.Complex @com.------------------------------ @mt3.cubic cubic { < // x^3, x^2y, x^2z, x^2, 0, 0, 0, 0, // xy^2, xyz, xy, xz^2, 0, 0, 0, 0, // xz, x, y^3, y^2z, 0, 0, 0, 0, // y^2, yz^2, yz, y, 0, 0, 0, 0, // z^3, z^2, z, C 0, 0, 0, 0 > // sturm } @com.------------------------------ @mt3.bicubic_patch bicubic_patch { type 1 flatness 0.1 u_steps 3 v_steps 3 <0, 0, 2> <1, 0, 0> <2, 0, 0> <3, 0, -2> <0, 1, 0> <1, 1, 0> <2, 1, 0> <3, 1, 0> <0, 2, 0> <1, 2, 0> <2, 2, 0> <3, 2, 0> <0, 3, 2> <1, 3, 0> <2, 3, 0> <3, 3, -2> } @com.------------------------------ @mt3.lathe lathe { linear_spline // | quadratic_spline | cubic_spline 5, <2, 0>, <3, 0>, <3, 5>, <2, 5>, <2, 0> } @com.------------------------------ @mt3.mesh // box example here mesh { /* top side */ triangle { <-2, 2, -2>, <2, 2, -2>, <2, 2, 2> texture { Red } } triangle { <-2, 2, -2>, <-2, 2, 2>, <2, 2, 2> texture { Red } } /* bottom side */ triangle { <-2, -2, -2>, <2, -2, -2>, <2, -2, 2> } triangle { <-2, -2, -2>, <-2, -2, 2>, <2, -2, 2> } /* left side */ triangle { <-2, -2, -2>, <-2, -2, 2>, <-2, 2, 2> } triangle { <-2, -2, -2>, <-2, 2, -2>, <-2, 2, 2> } /* right side */ triangle { <2, -2, -2>, <2, -2, 2>, <2, 2, 2> texture { Green } } triangle { <2, -2, -2>, <2, 2, -2>, <2, 2, 2> texture { Green } } /* front side */ triangle { <-2, -2, -2>, <2, -2, -2>, <-2, 2, -2> texture { Blue } } triangle { <-2, 2, -2>, <2, 2, -2>, <2, -2, -2> texture { Blue } } /* back side */ triangle { <-2, -2, 2>, <2, -2, 2>, <-2, 2, 2> } triangle { <-2, 2, 2>, <2, 2, 2>, <2, -2, 2> } } } @com.------------------------------ @mt3.polygon // A letter "P" polygon { 12, <0, 0>, <0, 6>, <4, 6>, <4, 3>, <1, 3>, <1, 0>, <0, 0>, <1, 4>, <1, 5>, <3, 5>, <3, 4>, <1, 4> } @com.------------------------------ @mt3.polynomial poly { 5, // order of polynomial (2...7) < // x^5, x^4y, x^4z, x^4, 0, 0, 0, 0, // x^3y^2, x^3yz, x^3y, x^3z^2, 0, 0, 0, 0, // x^3z, x^3, x^2y^3, x^2y^2z, 0, 0, 0, 0, // x^2y^2, x^2yz^2, x^2yz, x^2y, 0, 0, 0, 0, // x^2z^3, x^2z^2, x^2z, x^2, 0, 0, 0, 0, // xy^4, xy^3z, xy^3, xy^2z^2, 0, 0, 0, 0, // xy^2z, xy^2, xyz^3, xyz^2, 0, 0, 0, 0, // xyz, xy, xz^4, xz^3, 0, 0, 0, 0, // xz^2, xz, x, y^5, 0, 0, 0, 0, // y^4z, y^4, y^3z^2, y^3z, 0, 0, 0, 0, // y^3, y^2z^3, y^2z^2, y^2z, 0, 0, 0, 0, // y^2, yz^4, yz^3, yz^2, 0, 0, 0, 0, // yz, y, z^5, z^4, 0, 0, 0, 0, // z^3, z^2, z, C 0, 0, 0, 0 > // sturm } @com.------------------------------ @mt3.prism prism { linear_sweep // linear_sweep | conic_sweep linear_spline // linear_spline | quadratic_spline | cubic_spline -0.5, 0.5, 10, < 0.2, -1.0>, < 0.2, 0.2>, < 1.0, -0.2>, < 1.0, 0.2>, < 0.2, 1.0>, <-0.2, 1.0>, <-1.0, 0.2>, <-1.0, -0.2>, <-0.2, 0.2>, <-0.2, -1.0> // open // sturm } @com.------------------------------ @mt3.quadric quadric { <0, 1, 1> // A x^2 + B y^2 + C z^2 + <1, 0, 0> // D xy + E xz + F yz + <0, 3, 0> // G x + H y + I z + 2 // J // sturm } @com.------------------------------ @mt3.quartic quartic { < // x^4, x^3y, x^3z, x^3, x^2y^2, 0, 0, 0, 0, 0, // x^2yz, x^2y, x^2z^2, x^2z, x^2, 0, 0, 0, 0, 0, // xy^3, xy^2z, xy^2, xyz^2, xyz, 0, 0, 0, 0, 0, // xy, xz^3, xz^2, xz, x, 0, 0, 0, 0, 0, // y^4, y^3z, y^3, y^2z^2, y^2z, 0, 0, 0, 0, 0, // y^2, yz^3, yz^2, yz, y, 0, 0, 0, 0, 0, // z^4, z^3, z^2, z, C 0, 0, 0, 0, 0 > // sturm } @com.------------------------------ @mt3.smooth_triangle smooth_triangle { < 0, 30, 0> <0, 0.7071, -0.7071> // < 40, -20, 0> <0, -0.8664, -0.5> // < 0, 0, 0> <0, -0.5, -0.8664> // } @com.------------------------------ @mt3.fractal julia_fractal { <1,0,0,0> quaternion sqr max_iteration 20 precision 20 slice <0,0,0,1>,0 } @com.------------------------------ @com.============================================================ @mt1.Object Modifiers @com.============================================================ @com.------------------------------ @mt2.Declare object #declare OBJECT = object { } @mt2.bounded_by bounded_by { box { -1, 1 } } @com.------------------------------ @mt2.clipped_by clipped_by { sphere { 0, 1 } } @com.------------------------------ @mt2.hollow hollow @com.------------------------------ @mt2.inverse inverse @com.------------------------------ @mt2.no_shadow no_shadow @com.------------------------------ @mt2.open open @com.------------------------------ @com. @com.============================================================ @mt1.Constructs @com.============================================================ @com. @com.------------------------------ @mt2.object object { } @com.------------------------------ @mt2.difference difference { } @com.------------------------------ @mt2.intersection intersection { } @com.------------------------------ @mt2.merge merge { } @com.------------------------------ @mt2.union union { } @com.------------------------------ @mt2.inverse inverse @com.------------------------------ @com.============================================================ @mt1.Height Fields @com.============================================================ @com. @mt2.height_field height_field { tga ".tga" // inverse // smooth // water_level 0.015 } @com.------------------------------ @mt2.h_f+image_map height_field { tga ".tga" texture { pigment { image_map { tga ".tga" map_type 0 interpolate 2 once } rotate 90*x } } } @com.------------------------------ @com.============================================================ @mt1.Textures @com.============================================================ @com.------------------------------ @mt2.texture texture { } @com.------------------------------ @mt2.pigment pigment { } @com.------------------------------ @mt2.normal normal { } @com.------------------------------ @mt2.Patterns @com.------------------------------ @mt3.brick brick color Red color Gray brick_size <2,1,1> mortar 0.2 @com.------------------------------ @mt3.checker checker color red 1 green 1 blue 1 color red 0 green 1 blue 0 @com.------------------------------ @mt3.hexagon hexagon color blue 1 color red 1 color green 1 @com.------------------------------ @mt3.agate agate // agate_turb 0.3 @com.------------------------------ @mt3.bozo bozo @com.------------------------------ @mt3.bumps bumps 0.3 @com.------------------------------ @mt3.crackle crackle 0.5 @com.------------------------------ @mt3.dents dents 0.6 @com.------------------------------ @mt3.gradient gradient x // x+y x*y x/y etc. @com.------------------------------ @mt3.granite granite @com.------------------------------ @mt3.leopard leopard @com.------------------------------ @mt3.mandel mandel 256 // scale <...> translate <...> @com.------------------------------ @mt3.marble marble // turbulence 1.0 @com.------------------------------ @mt3.onion onion @com.------------------------------ @mt3.quilted quilted 0.5 control0 -1 control1 1 @com.------------------------------ @mt3.radial radial // frequency 4.0 @com.------------------------------ @mt3.ripples ripples 0.4 // phase clock frequency 1 @com.------------------------------ @mt3.spiral1 spiral1 5 @com.------------------------------ @mt3.spiral2 spiral2 5, 0.5 @com.------------------------------ @mt3.spotted spotted @com.------------------------------ @mt3.waves waves 0.8 // phase clock frequency 1 @com.------------------------------ @mt3.wood wood // turbulence 0.1 @com.------------------------------ @mt3.wrinkles wrinkles 0.5 @com.------------------------------ @mt2.Attributes @com.------------------------------ @mt3.frequency frequency 1.0 // -1 reverses mapping @com.------------------------------ @mt3.lambda lambda 1.2 // (1.0...5.0) [2.0] @com.------------------------------ @mt3.phase phase 0.5 // If phase decreases ripples move outward @com.------------------------------ @mt3.octaves octaves 3 // (1...10) [6] @com.------------------------------ @mt3.omega omega 1.2 // (0.0...2.0) [0.5] @com.------------------------------ @mt3.turbulence turbulence <0, 1, 0.5> // vector or float allowed (0...1 or more) @com.------------------------------ @com.------------------------------ @mt2.quick_color quick_color green @com.------------------------------ @mt2.warp warp { black_hole // black_hole | repeat | turbulence turbulence 0.3*x // octaves 2 repeat .2*x flip y offset 0.2*z } @com.------------------------------ @mt2.finish finish { } @com.------------------------------ @mt2.Finishes @com.------------------------------ @mt3.ambient ambient 0.2 @com.------------------------------ @mt3.attenuation fade_distance 20 fade_power 1 // 1 or 2 @com.------------------------------ @mt3.brilliance brilliance 2 @com.------------------------------ @mt3.caustics caustics 1.5 // (0...10?) @com.------------------------------ @mt3.crand crand 0.03 @com.------------------------------ @mt3.diffuse diffuse 0.5 @com.------------------------------ @mt3.ior ior 1.2 @com.------------------------------ @mt3.irid irid { 0.25 thickness 0.2 turbulence <0.7,0.5,0.3> } @com.------------------------------ @mt3.metallic metallic 1.0 // ? @com.------------------------------ @mt3.phong phong 0.8 @com.------------------------------ @mt3.phong_size phong_size 80 @com.------------------------------ @mt3.reflection reflection 0.3 // when a vector: <1,1,1> :is used rgb will reflect colors =< values @com.------------------------------ @mt3.refraction refraction 1 // decimals or other integers may cause interference patterns @com.------------------------------ @mt3.roughness roughness 0.025 @com.------------------------------ @mt3.specular specular 0.7 @com.------------------------------ @com.============================================================ @mt1.Halos @com.============================================================ @com.------------------------------ @mt2.Attenuating sphere {<0,0,0>,1 hollow pigment { color rgbt <1,1,1,1> } halo { attenuating // attenuating, emitting, glowing, dust linear // constant, linear, cubic, poly spherical_mapping // planar, spherical, cylindrical, box // exponent 1 // used only with poly max_value 1 // 0...1 frequency 1 // -1 = reverse phase 0 // 0...1 samples 15 // aa_level 3 // aa_threshold 0.3 // jitter 0.3 turbulence <0.2,0.4,0.6> octaves 2 omega 0.3 lambda 1.2 color_map { [ 0 color rgbt <1, .9, .8, 1> ] [ 1 color rgbt <.9, .8, 1, 0> ] } // scale <0.9,0.9,0.9> // rotate <15,45,90> // translate <5,10,15> } } @mt2.Dust sphere {<0,0,0>,1 hollow pigment { color rgbt <1,1,1,1> } halo { dust // attenuating, emitting, glowing, dust constant // constant, linear, cubic, poly planar_mapping // planar, spherical, cylindrical, box // exponent 1 // used only with poly dust_type 1 // 1, 2, 3, 4, 5 // eccentricity 0.5 // 0...1 used only with type 5 max_value 1 // 0...1 frequency 1 // -1 = reverse phase 0 // 0...1 samples 15 // aa_level 3 // aa_threshold 0.3 // jitter 0.3 turbulence <0.2,0.4,0.6> octaves 2 omega 0.25 lambda 1.5 color_map { [ 0 color rgbft <1, .9, .8, .5, 1> ] [ 1 color rgbft <.9, .8, 1, .5, 0> ] } // scale <0.9,0.9,0.9> // rotate <15,45,90> // translate <5,10,15> } } @com.------------------------------ @mt2.Emitting sphere {<0,0,0>,1 hollow pigment { color rgbt <1,1,1,1> } halo { emitting // attenuating, emitting, glowing, dust linear // constant, linear, cubic, poly spherical_mapping // planar, spherical, cylindrical, box //exponent 1 // used only with poly max_value 1 // 0...1 frequency 1 // -1 = reverse phase 0 // 0...1 samples 15 // aa_level 3 // aa_threshold 0.3 // jitter 0.3 turbulence <0.2,0.4,0.6> octaves 2 omega 0.3 lambda 1.2 color_map { [ 0 color rgbt <1, .9, .8, 1> ] [ 1 color rgbt <.9, .8, 1, -1> ] } // scale <0.9,0.9,0.9> // rotate <15,45,90> // translate <5,10,15> } } @com.------------------------------ @mt2.Glowing sphere {<0,0,0>,1 hollow pigment { color rgbt <1,1,1,1> } halo { glowing // attenuating, emitting, glowing, dust poly // constant, linear, cubic, poly spherical_mapping // planar, spherical, cylindrical, box exponent 1 // used only with poly max_value 1 // 0...1 frequency 1 // -1 = reverse phase 0 // 0...1 samples 15 // aa_level 3 // aa_threshold 0.3 // jitter 0.3 turbulence <0.2,0.4,0.6> octaves 2 omega 0.3 lambda 1.2 color_map { [ 0 color rgbt <1, .9, .8, 1> ] [ 1 color rgbt <.9, .8, 1, 0> ] } // scale <0.9,0.9,0.9> // rotate <15,45,90> // translate <5,10,15> } } @com.------------------------------ @com.============================================================ @mt1.Colors @com.============================================================ @com.------------------------------ @mt2.red red 1 @com.------------------------------ @mt2.green green 1 @com.------------------------------ @mt2.blue blue 1 @com.------------------------------ @mt2.rgb rgb <0.3, 0.5, 0.7> @com.------------------------------ @mt2.filter color rgb 1 filter 0.6 @com.------------------------------ @mt2.transmit color rgb 1 transmit 0.6 @com.------------------------------ @mt2.rgbf rgbf <0.2, 0.3, 0.4, 0.6> @com.------------------------------ @mt2.rgbt rgbt <0.2, 0.3, 0.4, 0.6> @com.------------------------------ @mt2.rgbft // NOTE: filter + transmit should equal 1.0 normally color rgbft <0.5, 0.5, 0.5, 0.4, 0.6> @com.------------------------------ @mt2.Enhance rgb <3, 2, 1.5> // >1 adds ambient value, fluorescence [0...10] @com.------------------------------ @mt2.Components // extract each component of a color: // #if (MyColor.red < 0.5) ... // #if (MyColor.green < 0.5) ... // #if (MyColor.blue < 0.5) ... // #if (MyColor.filter < 0.5) ... // #if (MyColor.transmit < 0.5) ... @com.------------------------------ @com.============================================================ @mt1.Maps @com.============================================================ @com.------------------------------ @mt2.texture_map texture { gradient x texture_map { [ 0 texture {pigment {wood color_map { [ 0.0, 0.2 color rgb<1,0,0> color rgb<1,0,0>] [ 0.2, 0.4 color rgb<1,1,0> color rgb<1,1,0>] [ 0.4, 0.6 color rgb<0,1,1> color rgb<0,1,1>] [ 0.6, 0.8 color rgb<0,0,1> color rgb<0,0,1>] [ 0.8, 1.0 color rgb<1,0,1> color rgb<1,0,1>] } } } ] [ .5 Silver_M ] [ 1 pigment {rgb <1,.5,.25>} ] } } @com.------------------------------ @mt2.pigment_map pigment { gradient x pigment_map { [ 0 pigment {Red} } ] [ .5 Green ] [ 1 pigment {rgb <0,0,1>} ] } } @com.------------------------------ @mt2.material_map texture { material_map { tga ".tga" map_type 0 interpolate 2 // [once] texture { pigment {wood} } // color index 0 texture { pigment {granite} } // 1 // texture { pigment {agate} } // N } } @com.------------------------------ @mt2.color_map pigment { color_map { } } @com.------------------------------ @mt2.Color Map Cores @com.------------------------------ @mt3.Smooth [ 0.0 color red 1.0 green 0.0 blue 0.0] [ 0.1 color red 1.0 green 1.0 blue 0.0] [ 0.3 color red 0.0 green 1.0 blue 0.0] [ 0.5 color red 0.0 green 1.0 blue 1.0] [ 0.7 color red 0.0 green 0.0 blue 1.0] [ 0.9 color red 1.0 green 0.0 blue 1.0] [ 1.0 color red 1.0 green 0.0 blue 0.0] @com.------------------------------ @mt3.Sharp [ 0.0, 0.2 color rgb<1,0,0> color rgb<1,0,0>] [ 0.2, 0.4 color rgb<1,1,0> color rgb<1,1,0>] [ 0.4, 0.6 color rgb<0,1,1> color rgb<0,1,1>] [ 0.6, 0.8 color rgb<0,0,1> color rgb<0,0,1>] [ 0.8, 1.0 color rgb<1,0,1> color rgb<1,0,1>] @com.------------------------------ @mt3.Filter [ 0.0, 0.2 color rgbf<1,0,0,0> color rgbf<1,0,0,1>] [ 0.2, 0.4 color rgbf<1,1,0,0> color rgbf<1,1,0,1>] [ 0.4, 0.6 color rgbf<0,1,1,0> color rgbf<0,1,1,1>] [ 0.6, 0.8 color rgbf<0,0,1,0> color rgbf<0,0,1,1>] [ 0.8, 1.0 color rgbf<1,0,1,0> color rgbf<1,0,1,1>] @com.------------------------------ @mt3.Transmit [ 0.0, 0.2 color rgbt<1,0,0,0> color rgbt<1,0,0,1>] [ 0.2, 0.4 color rgbt<1,1,0,0> color rgbt<1,1,0,1>] [ 0.4, 0.6 color rgbt<0,1,1,0> color rgbt<0,1,1,1>] [ 0.6, 0.8 color rgbt<0,0,1,0> color rgbt<0,0,1,1>] [ 0.8, 1.0 color rgbt<1,0,1,0> color rgbt<1,0,1,1>] @com.------------------------------ @mt3.Filter/Transmit [ 0.0, 0.2 color rgbft<1,0,0,0,1> color rgbft<1,0,0,1,0>] [ 0.2, 0.4 color rgbft<1,1,0,0,1> color rgbft<1,1,0,1,0>] [ 0.4, 0.6 color rgbft<0,1,1,0,1> color rgbft<0,1,1,1,0>] [ 0.6, 0.8 color rgbft<0,0,1,0,1> color rgbft<0,0,1,1,0>] [ 0.8, 1.0 color rgbft<1,0,1,0,1> color rgbft<1,0,1,1,0>] @com.------------------------------ @com.------------------------------ @mt2.image_map pigment { image_map { gif ".gif" map_type 0 interpolate 2 // [filter N V] // [transmit N V] // [use_color | use_index] // [once] } } @com.------------------------------ @mt2.slope_map normal { slope_map { // Now let's get fancy [ 0.0 <0, 1>] // Do tiny triangle here [ 0.2 <1, 1>] // down [ 0.2 <1,-1>] // to [ 0.4 <0,-1>] // here. [ 0.4 <0, 0>] // Flat area [ 0.5 <0, 0>] // through here. [ 0.5 <1, 0>] // Square wave leading edge [ 0.6 <1, 0>] // trailing edge [ 0.6 <0, 0>] // Flat again [ 0.7 <0, 0>] // through here. [ 0.7 <0, 3>] // Start scallop [ 0.8 <1, 0>] // flat on top [ 0.9 <0,-3>] // finish here. [ 0.9 <0, 0>] // Flat remaining through 1.0 } } @com.------------------------------ @mt2.normal_map normal { gradient x normal_map { [0.3 bumps scale 2] [0.3 dents] [0.6 granite] [0.9 marble turbulence 1] } } @com.------------------------------ @mt2.bump_map normal { bump_map { gif ".gif" map_type 0 interpolate 2 // [use_color | use_index] // [once] bump_size 0.5 // 0...3 } } @com.------------------------------ @mt2.tiles texture { tiles { texture { pigment { agate scale 0.3 } finish { ambient 0.2 } } tile2 texture { pigment { granite } finish { specular 0.3 reflection 0.2 } } } } @com.------------------------------ @com.============================================================ @mt1.Transforms @com.============================================================ @com.------------------------------ @mt2.scale scale <1.0, 2.0, 1.0> @com.------------------------------ @mt2.rotate rotate <45, 45, 0> @com.------------------------------ @mt2.translate translate <2.0, 4.0, -1.0> @com.------------------------------ @mt2.matrix matrix < 0.886, 0.5, 0.5, 0, 1, 0, 0.5, 0, -0.886, 0, 1.5, 0 > @com.------------------------------ @mt2.transform #declare Trans_Example = transform { scale 4.0 rotate 30*z translate 2*y } transform Trans_Example @com.------------------------------ @com.============================================================ @mt1.Definitions @com.============================================================ @com.------------------------------ @mt2.Directives @com.------------------------------ @mt3.default // sets default texture that objects use when there's no texture specified #default { texture { pigment {color red 1} finish {ambient 0.2} } } @com.------------------------------ @mt3.include // sets file to be used as part of whole, included, for parsing #include "myinc.inc" @com.------------------------------ @mt3.declare // sets an identifier for later use #declare MyColor = color red 0.7 green 0.5 blue 0.3 @mt3.if #if (High_Quality) // This section is parsed if High_Quality is true #end // End of conditional part // or you can use the else clause also #if (clock > 2) // This section is parsed if clock is > 2 #else // This section is parsed if clock is <= 2 #end // End of conditional part @com.------------------------------ @mt3.ifdef #ifdef (SphereFlake_Shape) // This section is parsed if SphereFlake_Shape is declared #else // This section is parsed if SphereFlake_Shape is NOT declared #declare SphereFlake_Shape = sphere {0,1} // make a default shape #end // End of conditional part @com.------------------------------ @mt3.ifndef #ifndef (SphereFlake_Shape) // This section is parsed if SphereFlake_Shape is NOT declared #else // This section is parsed if SphereFlake_Shape IS declared #declare SphereFlake_Shape = sphere {0,1} // new shape #end // End of conditional part @com.------------------------------ @mt3.switch // Let's make some constant names #declare CS_Easy = 1 #declare CS_Medium = 3 #declare CS_Hard = 5 // Let the user choose the method to use #declare Complexity_Switch = CS_Medium // or CS_Easy or CS_Hard // Do something dependent on the user's choice #switch (Complexity_Switch) #case (CS_Easy) // This statement is done if (Complexity_Switch = CS_Easy) #declare MyShape = box{-1,+1} #break // end of CS_Easy #case (CS_Medium, CS_Hard) // This statement is done if Complexity_Switch is CS_Medium // or CS_Hard or anything in between #declare MyShape = torus{1, 0.5} #break // end of CS_Hard #else // This statement is done if none of the above match #declare MyShape = sphere{0,1} #end @com.------------------------------ @mt3.while // Create 10 balls along X axis, from 0 to 9 #declare BallCount = 0 #while (BallCount < 10) sphere { , // NOTE: <0,0,0>, <1,0,0>, <2,0,0>, etc. 0.5 } #declare BallCount = BallCount+1 // increment our counter #end @com.------------------------------ @mt3.Messages #debug "During scene parsing; general info message" #fatal "During scene parsing; display and force POV-Ray to stop" #render "After scene parsing, before render" #statistics "After scene frame is rendered" #warning "During scene parsing" #end @com.------------------------------ @mt3.version #declare Temp_Vers = version // Save original value of #version #version 2.0 // Change to 2.0 mode // Version 2.0 stuff goes here ... #version Temp_Vers // Restore original #version value @com.------------------------------ @mt2.Globals @com.------------------------------ @mt3.global_settings // allows for setting scene-wide parameters //global_settings { // } @mt3.assumed_gamma // adjusts display preview and final image brightness //assumed_gamma 2.2 @mt3.max_trace_level // levels of reflectivity or filter/transmit layers to distinguish //max_trace_level 5 @mt3.ambient_light // vector or float multiple of original ambience value //ambient_light rgb <1.5,1.5,1.5> // 1.5 @mt3.irid_wavelength //The default value is rgb <0.25,0.18,0.14> and any filter or transmit //values are ignored. These values are proportional to the wavelength of //light but they represent no real world units (red longer, blue shorter). //irid_wavelength <0.25, 0.18, 0.14> @mt3.number_of_waves // used by waves or ripples for unit number of surface perturbations //number_of_waves 7 @mt3.max_intersections /* Set of internal stacks to collect ray/object intersection points. The usual maximum number of entries in these I-Stacks is 64. Complex scenes may cause these stacks to overflow. POV-Ray doesn't stop but it may incorrectly render your scene. If you see I-Stack Overflows reported in the statistics you should increase the stack size. */ //max_intersections 64 @mt3.adc_bailout // reflectivity/transparency limiter, default 0.0039 //adc_bailout 0.0039 @mt3.hf_gray_16 // generate a 16 bit gray-scale image based upon luminosity //hf_gray_16=on @mt3.radiosity // simulated light re-transmission or reflection /* radiosity { brightness FLOAT // 3.3 [0...10>?] count INTEGER // 100 [0...999>?] number of ray calculations distance_maximum FLOAT // 0 is default [1/3 camera to object distance] error_bound FLOAT // 0.4 [?<0.3...1] percent to limit low_error_factor FLOAT // 0.8 [0...1>?] multiplied by error_bound minimum_reuse FLOAT // 0.015 [?<0.01...0.02>?] corner/crevice extinct. nearest_count INTEGER // 6 [?<1...10] blend recursion_limit INTEGER // 1 [1 or 2] number times to apply gray_threshold FLOAT // 0.5 [0...1] permits original hue to pervade // radiosity_quality [?...?] NOT USED! } */ @com.------------------------------ @com.------------------------------ @mt2.camera /* camera { // (camera types) // perspective (default) | orthographic | fisheye | // ultra_wide_angle | omnimax | panoramic | cylinder 1 location <0.0, 1.0, -6.0> // position of camera direction 2.0*z // which way are we looking & zoom // sky y // rarely used up y // which way is +up right 4/3*x // which way is +right and aspect ratio look_at <0.0, 0.0, 0.0> // point center of view at this point // angle FLOAT [>0...360<] // overrides "direction" with specific angle // normal { ripples 0.2 } // perturb the camera lens with a pattern // (focal blur extras) // aperture 0.2 // 0...N (large is shallow depth of field) // blur_samples 4 // # of rays per pixel // focal_point // x,y,z point that is in focus } */ @com.--------------------------- @mt2.light_source /* light_source {
color [ spotlight ] [ cylinder ] [ point_at ] [ radius RADIUS ] [ falloff FALLOFF ] [ tightness TIGHTNESS ] [ area_light , , SIZE1, SIZE2 ] [ adaptive ADAPTIVE ] [ jitter JITTER ] [ looks_like { OBJECT } ] [ fade_distance FADE_DISTANCE ] [ fade_power FADE_POWER (1...2) ] [ atmospheric_attenuation BOOL ] [ shadowless ] } */ @com.------------------------------ @mt2.Environment @com.------------------------------ @mt3.fog /* // set global atmospheric fog effect in the scene. fog { fog_type 1 // 1=constant, 2=ground_fog distance 10 // 37% fog obscuration at this distance color <0.5,0.5,0.5> // color of filtration // turbulence // thick to thin ratio // turb_depth TURB_DEPTH // recursion of turbulence // octaves OCTAVES // layer incursion // omega OMEGA // layer shift // lambda LAMBDA // layer shift adjustment // fog_offset FOG_OFFSET // type 2 position // fog_alt FOG_ALT // type 2 decrease amount as function of y } */ @com.-------------------------- @mt3.rainbow rainbow { direction angle ANGLE width WIDTH distance DISTANCE color_map { COLOUR_MAP } [ jitter JITTER ] [ up ] [ arc_angle ARC_ANGLE ] [ falloff_angle FALLOFF_ANGLE ] } @com.------------------------- @mt3.sky_sphere sky_sphere { pigment { gradient y color_map { [0.0 color rgb<0.8,0.9,1.0>] [1.0 color rgb<0.6,0.7,0.9>] } } } @com.------------------------- @mt3.atmosphere /* atmosphere { type SCATTERING_TYPE // [1...5] distance DISTANCE // similar to 'fog's parameter [ scattering SCATTERING ] // [0...10>?] small decimal/large # OK [ eccentricity ECCENTRICITY ] // use for type 5 (oblateness) [ samples SAMPLES ] // quality [ jitter JITTER ] // jitter [ aa_threshold AA_THRESHOLD ] // smoothness [ aa_level AA_LEVEL ] // quality of smoothness [ color ] // color } */ @com.------------------------------ @com.------------------------------ @mt2.object // general purpose enclosing wrapper for a predefined shape #declare MyShape = box {-1,1} // define a shape object { MyShape } // create defined object with that shape object { MyShape translate 3*x} // transform object with that shape @com.------------------------------ @mt2.Simple Shapes @com.------------------------------ @mt3.plane // An infinite planar surface // plane {, D } where: A*x + B*y + C*z = D plane { y, // unit surface normal, vector is "outside surface" -1.0 // distance from the origin in the direction of the surface normal } @com.------------------------------ @mt3.box // create a box that extends between the 2 specified points box { <-1, -1, -1> // one corner position or <-1> < 1, 1, 1> // other corner position or <1> } @com.------------------------------ @mt3.blob // create a smooth bloby shape #declare StrengthVal = 1.0 // (+ or -) strength of component's eminating density, negative repels #declare RadiusVal = 1.0 // (0 < RadiusVal) outer sphere of influence on other components blob { // threshold (0.0 < threshold <= StrengthVal) surface falloff threshold # threshold 0.6 sphere { < 0.75, 0, 0>, StrengthVal, RadiusVal } sphere { <-0.375, 0.65, 0>, StrengthVal, RadiusVal } sphere { <-0.375, -0.65, 0>, StrengthVal, RadiusVal } cylinder { -z, +z, 0.1, StrengthVal, RadiusVal } // [sturm] scale 2 } @com.------------------------------ @mt3.cone // clipped conical shape // cone { , RADIUS1, , RADIUS2 [open] } // Where and are vectors defining the x,y,z // coordinates of the center of each end of the cone // and RADIUS1 and RADIUS2 are float values for the radii // of those ends. open, if present, cone is hollow, else capped cone { 1*y, 0.0, -1*y, 1.0 // open } @com.------------------------------ @mt3.cylinder // Capped Cylinder, closed [or open ended] // cylinder { , , RADIUS [open] } // END1 = coord of one end of cylinder // END2 = coord of other end // RADIUS = size of cylinder // open = if present, cylinder is hollow, else capped cylinder { -1*z, 1*z, 1 // open } @com.------------------------------ @mt3.disc // flat circular FINITE (no CSG) shape, center hole cutout is optional disc { <0, 0, 0> // center position z, // normal vector 1.0, // outer radius 0.2 // optional hole radius } @com.------------------------------ @mt3.sphere // create a sphere shape sphere { <0, 0, 0> // center of sphere 1 // radius of sphere // scale <1,2,1> // Note: Spheres can become ellipses by uneven scaling } @com.------------------------------ @mt3.torus // torus {MAJOR, MINOR} // (positioned on the X-Z plane by default) // MAJOR = float value of major radius // MINOR = float value of minor radius // The major radius extends from the center of the torus // to the middle of the minor diameter which // is the cross-section of the rim. torus { 0.8, // major 0.2 // minor, can be larger than major radius } @com.------------------------------ @mt3.superellispoid // create a superquadric ellipsoid shape // As the exponents approach 1.0, the edges get rounder superellipsoid { 0.5, // east-west exponent (0.0 ... 1.0) 1.0, // north-south exponent (0.0 ... 1.0) } @com.------------------------------ @mt3.sor // create a Surface of Revolution shape (like lathe, but faster) sor { 7, // # of points <0.000000, 0.000000> // list of points <0.118143, 0.000000> <0.620253, 0.540084> <0.210970, 0.827004> <0.194093, 0.962025> <0.286920, 1.000000> <0.468354, 1.033755> // [open] } @com.------------------------------ @mt3.triangle // triangular FINITE (no CSG) shape (vertices are endpoints) triangle { <-1, 0, -1> // < 1, 0, -1> // < 0, 0, 1> // } @com.------------------------------ @mt2.Complex @com.------------------------------ @mt3.cubic // create a 3rd order infinite polynomial surface cubic { < // x^3, x^2y, x^2z, x^2, 0, 0, 0, 0, // xy^2, xyz, xy, xz^2, 0, 0, 0, 0, // xz, x, y^3, y^2z, 0, 0, 0, 0, // y^2, yz^2, yz, y, 0, 0, 0, 0, // z^3, z^2, z, C 0, 0, 0, 0 > sturm // optional, slower but reduces speckles } @com.------------------------------ @mt3.bicubic_patch // 3D curved FINITE (no CSG) surface created from a mesh of triangles bicubic_patch { type 1 // patch_type (0..1) // 0 = Bezier patch, just store the triangular vertices // 1 = Bezier patch, store all plane equations defined by // the triangulation of the patch into sub patches // (faster, uses more memory) flatness 0.1 // flatness value // flatness_value = 0.0 to 1.0, with higher values // giving flatter, less smooth results u_steps 3 // # of triangles to subdivide (1-5) v_steps 3 // # of triangles to subdivide (1-5) <0, 0, 2> <1, 0, 0> <2, 0, 0> <3, 0, -2> <0, 1, 0> <1, 1, 0> <2, 1, 0> <3, 1, 0> <0, 2, 0> <1, 2, 0> <2, 2, 0> <3, 2, 0> <0, 3, 2> <1, 3, 0> <2, 3, 0> <3, 3, -2> } @com.------------------------------ @mt3.lathe // rotate a 2-D outline of points around the Y axis to create a 3-D shape lathe { linear_spline // linear_spline | quadratic_spline | cubic_spline 5, // number of points <2, 0>, <3, 0>, <3, 5>, <2, 5>, <2, 0> // the list of points } @com.------------------------------ @mt3.mesh // triangle or smooth-triangle mesh FINITE (no CSG) shape // NOTE: Each triangle can be independently textured, // remaining triangles get texture at bottom // box example here mesh { /* top side */ triangle { <-2, 2, -2>, <2, 2, -2>, <2, 2, 2> texture { Red } } triangle { <-2, 2, -2>, <-2, 2, 2>, <2, 2, 2> texture { Red } } /* bottom side */ triangle { <-2, -2, -2>, <2, -2, -2>, <2, -2, 2> } triangle { <-2, -2, -2>, <-2, -2, 2>, <2, -2, 2> } /* left side */ triangle { <-2, -2, -2>, <-2, -2, 2>, <-2, 2, 2> } triangle { <-2, -2, -2>, <-2, 2, -2>, <-2, 2, 2> } /* right side */ triangle { <2, -2, -2>, <2, -2, 2>, <2, 2, 2> texture { Green } } triangle { <2, -2, -2>, <2, 2, -2>, <2, 2, 2> texture { Green } } /* front side */ triangle { <-2, -2, -2>, <2, -2, -2>, <-2, 2, -2> texture { Blue } } triangle { <-2, 2, -2>, <2, 2, -2>, <2, -2, -2> texture { Blue } } /* back side */ triangle { <-2, -2, 2>, <2, -2, 2>, <-2, 2, 2> } triangle { <-2, 2, 2>, <2, 2, 2>, <2, -2, 2> } texture { // remaining triangles get this texture pigment { color rgb<0.9, 0.9, 0.9> } finish { ambient 0.2 diffuse 0.7 } } } @com.------------------------------ @mt3.polygon // arbitrary X,Y FINITE (no CSG) shape // A complex example for a polygon is the letter "P": polygon { 12, // number of points <0, 0>, <0, 6>, <4, 6>, <4, 3>, <1, 3>, <1, 0>, <0, 0>, // list of points <1, 4>, <1, 5>, <3, 5>, <3, 4>, <1, 4> } @com.------------------------------ @mt3.polynomial // create an Nth order infinite polynomial surface // poly { N [sturm] } // N = order of poly, M terms where M = (N+1)*(N+2)*(N+3)/6 poly { 5, // order of polynomial (2...7) < // x^5, x^4y, x^4z, x^4, 0, 0, 0, 0, // x^3y^2, x^3yz, x^3y, x^3z^2, 0, 0, 0, 0, // x^3z, x^3, x^2y^3, x^2y^2z, 0, 0, 0, 0, // x^2y^2, x^2yz^2, x^2yz, x^2y, 0, 0, 0, 0, // x^2z^3, x^2z^2, x^2z, x^2, 0, 0, 0, 0, // xy^4, xy^3z, xy^3, xy^2z^2, 0, 0, 0, 0, // xy^2z, xy^2, xyz^3, xyz^2, 0, 0, 0, 0, // xyz, xy, xz^4, xz^3, 0, 0, 0, 0, // xz^2, xz, x, y^5, 0, 0, 0, 0, // y^4z, y^4, y^3z^2, y^3z, 0, 0, 0, 0, // y^3, y^2z^3, y^2z^2, y^2z, 0, 0, 0, 0, // y^2, yz^4, yz^3, yz^2, 0, 0, 0, 0, // yz, y, z^5, z^4, 0, 0, 0, 0, // z^3, z^2, z, C 0, 0, 0, 0 > sturm // optional, slower but reduces speckles } @com.------------------------------ @mt3.prism // extrude a closed 2-D shape along an axis prism { linear_sweep // or conic_sweep for tapering to a point cubic_spline // linear_spline | quadratic_spline | cubic_spline -0.5, // height 1 0.5, // height 2 10, // number of points // the points < 0.2, -1.0>, < 0.2, 0.2>, < 1.0, -0.2>, < 1.0, 0.2>, < 0.2, 1.0>, <-0.2, 1.0>, <-1.0, 0.2>, <-1.0, -0.2>, <-0.2, 0.2>, <-0.2, -1.0> // [open] // [sturm] } @com.------------------------------ @mt3.quadric // create a quadratic (2nd order) infinite polynomial surface quadric { <0, 1, 1> // A x^2 + B y^2 + C z^2 + <1, 0, 0> // D xy + E xz + F yz + <0, 3, 0> // G x + H y + I z + 2 // J sturm // optional, slower but reduces speckles } @com.------------------------------ @mt3.quartic // create a 4th order infinite polynomial surface quartic { < // x^4, x^3y, x^3z, x^3, x^2y^2, 0, 0, 0, 0, 0, // x^2yz, x^2y, x^2z^2, x^2z, x^2, 0, 0, 0, 0, 0, // xy^3, xy^2z, xy^2, xyz^2, xyz, 0, 0, 0, 0, 0, // xy, xz^3, xz^2, xz, x, 0, 0, 0, 0, 0, // y^4, y^3z, y^3, y^2z^2, y^2z, 0, 0, 0, 0, 0, // y^2, yz^3, yz^2, yz, y, 0, 0, 0, 0, 0, // z^4, z^3, z^2, z, C 0, 0, 0, 0, 0 > sturm // optional, slower but reduces speckles } @com.------------------------------ @mt3.smooth_triangle // rounded-surface FINITE (no CSG) triangle shape smooth_triangle { < 0, 30, 0> <0, 0.7071, -0.7071> // < 40, -20, 0> <0, -0.8664, -0.5> // < 0, 0, 0> <0, -0.5, -0.8664> // } @com.------------------------------ @mt3.fractal // create a 3-D slice of a 4-D julia fractal object julia_fractal { 4DJULIA_PARAMETER // default is <1,0,0,0> [ quaternion | hypercomplex ] // default is quaternion [ sqr | cube | exp | reciprocal | sin | asin | sinh | asinh | cos | acos | cosh | acosh | tan | atan | tanh | atanh | log | pwr(X,Y) ] // default is sqr [ max_iteration MAX_ITERATION ] // default value 20 [ precision PRECISION ] // default value 20 [ slice 4DNORMAL, DISTANCE ] // default <0,0,0,1>,0 } @com.------------------------------ @com.------------------------------ @mt2.text // create a TrueType text shape text { ttf // font type (only TrueType format for now) "cour.ttf", // Microsoft Windows-format TrueType font file name "POV-Ray", // the string to create 2, // the extrusion depth 0 // offset } @com.------------------------------ @mt2.CSG @com.------------------------------ @mt3.difference // CSG difference, subtract intersections of shapes 2...N from Shape1 difference { Shape1 {...} // first objects texture is used Shape2 {...} // all others will be "cut out" of Shape1 ShapeN {...} } @com.------------------------------ @mt3.intersection // CSG intersection, the common space where all shapes meet intersection { Shape1 {...} Shape2 {...} ShapeN {...} // last objects texture is used } @com.------------------------------ @mt3.union // CSG union, add all of shapes 1...N union { Shape1 {...} Shape2 {...} ShapeN {...} } @com.------------------------------ @mt3.merge // CSG merge, merge all of shapes 1...N // like union, but welded together so no internal faces remain merge { Shape1 {...} Shape2 {...} ShapeN {...} } @com.------------------------------ @mt3.inverse // flip an object's inside and outside for intersection/difference intersection { Shape1 {...} Shape2 {... inverse } // still uses only the last textured object } @com.------------------------------ @mt3.bounded_by // set an outer proposed boundary for parent object(s) // allows the ray-tracer to do a quick check on the bounding shape, // and if outside, it skips checking this object, which can speed // up overall render of complex shapes. Note that this // is not a 100% guaranteed clipping shape... use the // clipped_by statement for true clipping. bounded_by { box { -(1) +(1) } @com.------------------------------ @mt3.clipped_by // set clipping shape for parent object. NOTE: leaves parent object(s) open, hollow or not. // (parent shape will not extend beyond clipped bounds) clipped_by { sphere { 0*x, 1.0 } } @com.------------------------------ @mt3.hollow // allow atmosphere effects inside shape hollow @com.------------------------------ @mt3.no_shadow // shadows ignored. NOTE: object itself will NOT be affected by lights, shadow-side remains. no_shadow @com.------------------------------ @mt3.open // some objects (cylinder, cone, prism, etc.) can have their ends open. open @com.------------------------------ @com.------------------------------ @mt2.height_field // uses image color index as height, extends along X-Z axes // from <0 0 0> to <1 1 1> height_field { gif // the file type to read (gif/tga/pot/pgm/ppm/png/sys) "plasma3.gif" // the file name to read // inverse | texture {...} // [smooth] // make smoother surface // [water_level N] // truncate/clip below N (0.0 ... 1.0) // translate VECTOR | rotate VECTOR | scale VECTOR } @com.------------------------------ @mt2.h_f+image_map // uses image color index as height, extends along X-Z axes // from <0 0 0> to <1 1 1> height_field { gif "plasma3.gif" texture { pigment { image_map { gif "plasma3.gif" map_type 0 interpolate 2 once } rotate x*90 // lay X-Y image map down onto X-Z height field plane } } } @com.------------------------------ @mt2.texture /* texture { TEXTURE_IDENTIFIER // all following keyword values over-ride any previous TEXTURE_IDENTIFIER values pigment { PIGMENT_IDENTIFIER PATTERN_TYPE PIGMENT_MODIFIERS TRANSFORMATIONS... } normal { NORMAL_IDENTIFIER NORMAL_PATTERN_TYPE NORMAL_MODIFIERS TRANSFORMATIONS... } finish { FINISH_IDENTIFIER [ ambient AMBIENT | ] [ diffuse DIFFUSE ] [ phong PHONG ] [ phong_size PHONG_SIZE ] [ specular SPECULAR ] [ roughness ROUGHNESS ] [ metallic [ METALLIC ] ] [ brilliance BRILLIANCE ] [ reflection REFLECTION | ] [ refraction [REFRACTION] ] [ ior IOR ] [ caustics CAUSTICS ] [ fade_distance FADE_DISTANCE ] [ fade_power FADE_POWER ] [ irid { AMOUNT thickness THICKNESS turbulence TURBULENCE } ] [ crand CRAND ] } */ @com.------------------------------ @mt2.Pattern @com.------------------------------ @mt3.brick // texture pigment/normal pattern // rectangular pattern, alternates color1 and color2 brick color Red color Gray <2,1,1> // size of brick 0.2 // width of mortar } @com.------------------------------ @mt3.checker // texture pigment/normal pattern // square pattern, alternates color1 and color2 checker color red 1 green 1 blue 1 color red 0 green 1 blue 0 @com.------------------------------ @mt3.hexagon // texture pigment/normal pattern // create a hexagonal pattern texture with 3 colors // hexagons are in the X-Z plane, extending infinitely in Y plane hexagon color blue 1 color red 1 color green 1 @com.------------------------------ @mt3.agate // texture pigment/normal pattern agate // use an agate-like texture agate_turb 0.3 // can alter turbulence [1.0] // color_map {...} // optional color map @com.------------------------------ @mt3.bozo // texture pigment/normal pattern bozo // use color map to swirl colors // turbulence 0.3 // color_map... @com.------------------------------ @mt3.bumps // texture pigment/normal pattern bumps 0.3 // bumpy surface (0...1) @com.------------------------------ @mt3.crackle // texture pigment/normal pattern crackle 0.5 turbulence 0.5 @com.------------------------------ @mt3.dents // texture pigment/normal pattern dents 0.6 // dented surface (0...1) [0.0] @com.------------------------------ @mt3.gradient // texture pigment/normal pattern gradient x+y // specify color_map direction(s) // color_map {...} // requires a color map @com.------------------------------ @mt3.granite // texture pigment/normal pattern granite // create a granite-like texture // color_map {...} // optional color map @com.------------------------------ @mt3.leopard // texture pigment/normal pattern leopard // create a leopard spotted texture // color_map {...} // optional color map @com.------------------------------ @mt3.mandel // texture pigment/normal pattern // create a mandelbrot fractal surface in the X-Y plane mandel 50 // (2...1000) [256] // scale <...> translate <...> // zoom and move // color_map {...} // requires a color map @com.------------------------------ @mt3.marble // texture pigment/normal pattern marble // create a marble-like texture // turbulence 1.0 // should have some! // color_map {...} // uses a color map @com.------------------------------ @mt3.onion // texture pigment/normal pattern onion // create an onion-like concentric circle texture // color_map {...} // requires a color map @com.------------------------------ @mt3.quilted // texture pigment/normal pattern // creates a pattern like a quilt quilted 0.4 // amount control0 -1 // lower curvature (-1...1) control1 1 // upper curvature (-1...1) @com.------------------------------ @mt3.radial // texture pigment/normal pattern // radially projected color_map in X-Z radial // frequency 4.0 // increases # of color "spokes" // color_map ... @com.------------------------------ @mt3.ripples // texture pigment/normal pattern ripples 0.5 // make surface ripply (0...1) @com.------------------------------ @mt3.spiral1 // texture pigment/normal pattern spiral1 5 @com.------------------------------ @mt3.spiral2 // texture pigment/normal pattern spiral2 5, 0.6 @com.------------------------------ @mt3.spotted // texture pigment/normal pattern spotted // create a spotted texture, turbulence has no effect // color_map {...} // requires a color map @com.------------------------------ @mt3.waves // texture pigment/normal pattern // create a wavy surface (also use phase) waves 0.5 @com.------------------------------ @mt3.wood // texture pigment/normal pattern // create a concentric cylindrical wood-like texture, // grain along Z axis wood // turbulence 0.1 // should have some! // color_map {...} // optional color map @com.------------------------------ @mt3.wrinkles // texture pigment/normal pattern // create a wrinkly surface (0...1 or more) wrinkles 0.5 @com.------------------------------ @com.------------------------------ @mt2.Attributes @com.------------------------------ @mt3.frequency // texture pigment/normal attribute frequency 2.0 // oscillation freq. of radial, ripples, waves, etc @com.------------------------------ @mt3.lambda // texture pigment/normal attribute // change surface perturbation property // makes turbulence more "swirly" lambda 1.2 // (1.0...5.0) [2.0] @com.------------------------------ @mt3.phase // texture pigment/normal attribute // change the phase of ripples, etc. // Animation note: As phase DECREASES, ripples move OUTWARD. phase 0.5 @com.------------------------------ @mt3.octaves // texture pigment/normal attribute // increases the "folds" in turbulence changes octaves 3 // (1...10) [6] @com.------------------------------ @mt3.omega // texture pigment/normal attribute // change surface perturbation property // makes turbulence more "krinkly" omega 1.2 // (0.0...2.0) [0.5] @com.------------------------------ @mt3.turbulence // texture pigment/normal attribute // Takes a float or vector, see also octaves, omega, lambda, frequency turbulence <0, 1, 0.5> // how much to Òstir upÓ the texture (0...1 or more) @com.------------------------------ @com.------------------------------ @mt2.Map @com.------------------------------ @mt3.material_map texture // texture attribute // create texture that maps different textures onto different color indexs // image maps into X-Y plane from <0,0,0> to <1,1,0> material_map { gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys) map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance // [once] texture { pigment {wood} } // texture for color index # 0 texture { pigment {granite} } // texture for color index # 1 texture { pigment {agate} } // texture for color index # 2 // etc... } // material_map @com.------------------------------ @mt3.color_map pigment // texture pigment {} attribute // create a smooth color gradation map color_map { } @com.------------------------------ @mt3.image_map pigment // texture pigment {} attribute // create a texture that lays an image's colors onto a surface // image maps into X-Y plane from <0,0,0> to <1,1,0> image_map { gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys) map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance // [filter N V] // N=all or color index # (0...N), V= value (0.0...1.0) // [transmit N V] // N=all or color index # (0...N), V= value (0.0...1.0) // [use_color | use_index] // [once] } // image_map @com.------------------------------ @mt3.slope_map normal normal{ PATTERN_TYPE Value slope_map { [ NUM_1 POINT_SLOPE_1] [ NUM_2 POINT_SLOPE_2] [ NUM_3 POINT_SLOPE_3] ... } NORMAL_MODIFIERS... } @com.------------------------------ @mt3.normal_map normal normal{ PATTERN_TYPE normal_map { [ NUM_1 NORMAL_BODY_1] [ NUM_2 NORMAL_BODY_2] [ NUM_3 NORMAL_BODY_3] ... } NORMAL_MODIFIERS... } @com.------------------------------ @mt3.bump_map normal // texture normal {} attribute // create a texture that has a bumpiness corresponding to color index // image maps into X-Y plane from <0,0,0> to <1,1,0> bump_map { // uses image color or index as bumpiness gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys) map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance // [use_color | use_index] // [once] bump_size 0.5 // 0...3 } // bump_map @com.------------------------------ @com.------------------------------ @mt2.halo /* texture { halo { attenuating | emitting | glowing | dust [ constant | linear | cubic | poly ] [ planar_mapping | spherical_mapping | cylindrical_mapping | box_mapping [ dust_type DUST_TYPE ] [ eccentricity ECCENTRICITY ] [ max_value MAX_VALUE ] [ exponent EXPONENT ] [ samples SAMPLES ] [ aa_level AA_LEVEL ] [ aa_threshold AA_THRESHOLD ] [ jitter JITTER ] [ turbulence ] [ octaves OCTAVES ] [ omega OMEGA ] [ lambda LAMBDA ] [ colour_map COLOUR_MAP ] [ frequency FREQUENCY ] [ phase PHASE ] [ scale ] [ rotate ] [ translate ] } TRANSFORMATIONS } */ @com.------------------------------ @com.============================================================ @mt1.Expressions @com.============================================================ @com.------------------------------ @mt2.Built-in IDs // These identifiers are built in to POV-Ray, ready to use // #declare pi = 3.1415926535897932384626 // #declare true = 1 // #declare yes = 1 // #declare on = 1 // #declare false = 0 // #declare no = 0 // #declare off = 0 // #declare u = <1,0> // #declare v = <0,1> // #declare x = <1,0,0> // #declare y = <0,1,0> // #declare z = <0,0,1> // #declare t = <0,0,0,1> @com.------------------------------ @mt2.Math Operators @com.------------------------------ // Expressions are evaluated left to right with innermost parentheses // evaluated first, then unary +, - or !, then multiply or divide, then // add or subtract, then relational, then logical, then conditional. // () Order // * Multiply // / Divide // + Plus [positive] // - Minus [negative] // ! Not #declare MyResult = -2*B + (A*A - 4) / !3 5 @mt3.Relational Expressions // Relationals must be within parentheses // Return arithmetic value 0 for false or 1 for true // < Less // <= Less or equal // = Equal // != Not equal // >= Greater or equal // > Greater #declare BallColor = pigment { red (clock > 0.5) } // black or red @mt3.Logical Expressions // (A & B) true only if both A and B are true, false otherwise // (A | B) true if either A or B or both are true @mt3.Conditional Expressions // (C ? A : B) if C then A else B // ((This=Thing)?Foo:Bar) @com.------------------------------ @com.------------------------------ @mt2.Vector Components /* <0,0> <0,0,0> <0,0,0,0> are 2D, 3D and 4D vectors using the dot operator to extract each component of a vector: #if (MyVector.u > 5) ... #if (MyVector.v > 5) ... #if (MyVector.x > 5) ... #if (MyVector.y > 5) ... #if (MyVector.z > 5) ... #if (MyVector.t > 5) ... */ @com.------------------------------ @mt2.Functions @com.------------------------------ @mt3.Float /* abs(A): Absolute value of A. If A is negative, returns -A otherwise returns A. acos(A): Arc-cosine of A. Returns the angle, measured in radians, whose cosine is A. asin(A): Arc-sine of A. Returns the angle, measured in radians, whose sine is A. atan2(A,B): Arc-tangent of (A/B). Returns the angle, measured in radians, whose tangent is (A/B). Returns appropriate value even if B is zero. Use atan2(A,1) to compute usual atan(A) function. ceil(A): Ceiling of A. Returns the smallest integer greater than A. Rounds up to the next higher integer. cos(A): Cosine of A. Returns the cosine of the angle A, where A is measured in radians. degrees(A): Convert radians to degrees. Returns the angle measured in degrees whose value in radians is A. Formula is degrees=A/pi*180.0. div(A,B): Integer division. The integer part of (A/B). exp(A): Exponential of A. Returns the value of e raised to the power A where e is the base of the natural logarithm, i.e. the non-repeating value approximately equal to 2.71828182846. floor(A): Floor of A. Returns the largest integer less than A. Rounds down to the next lower integer. int(A): Integer part of A. Returns the truncated integer part of A. Rounds towards zero. log(A): Natural logarithm of A. Returns the natural logarithm base e of the value A. max(A,B): Maximum of A and B. Returns A if A larger than B. Otherwise returns B. min(A,B): Minimum of A and B. Returns A if A smaller than B. Otherwise returns B. mod(A,B): Value of A modulo B. Returns the remainder after the integer division of A/B. Formula is mod=((A/B)-int(A/B))*B. pow(A,B): Exponentiation. Returns the value of A raised to the power B. radians(A): Convert degrees to radians. Returns the angle measured in radians whose value in degrees is A. Formula is radians=A*pi/180.0. rand(A): Returns the next pseudo-random number from the stream specified by the positive integer A. You must call seed() to initialize a random stream before calling rand(). The numbers are uniformly distributed, and have values between 0.0 and 1.0, inclusively. The numbers generated by separate streams are independent random variables. seed(A): Initializes a new pseudo-random stream with the initial seed value A. The number corresponding to this random stream is returned. Any number of pseudo-random streams may be used as shown in the example below: #declare R1 = seed(0) #declare R2 = seed(12345) #sphere { , rand(R2) } Multiple random generators are very useful in situations where you use rand() to place a group of objects, and then decide to use rand() in another location earlier in the file to set some colors or place another group of objects. Without separate rand() streams, all of your objects would move when you added more calls to rand(). This is very annoying. sin(A): Sine of A. Returns the sine of the angle A, where A is measured in radians. sqrt(A): Square root of A. Returns the value whose square is A. tan(A): Tangent of A. Returns the tangent of the angle A, where A is measured in radians. */ @mt3.Vector /* vaxis_rotate(A,B,F): Rotate A about B by F. vcross(A,B): Cross product of A and B. vdot(A,B): Dot product of A and B. vlength(A): Length of A. vnormalize(A): Normalize vector A. vrotate(A,B): Rotate A about origin by B. */ @mt3.String /* asc(S1) // Convert 1st character of S1 to ASCII value chr(A) // Convert extended ASCII value A [1 to 127] to 1 character string concat(S1,S2) // combine S1 and S2 into one long string file_exists(S1): Search current and include directories for existence of file S1 (0 or 1) str(A,L,P) // Convert float A to string, at least L characters long, // with P digits after the decimal point (if P is -1, make max) strcmp(S1,S2) // compare S1 to S2, return -1, 0, or +1 if S2 is <, =, > than S1 strlen(S1) // Returns # of characters in string S1 strlwr(S1) // Lower case of S1 substr(S1,P,L) // Sub-string from S1, start at position P for length L strupr(S1) // Upper case of S1 val(S1) // Convert string S1 to float // some special control characters that can be used within strings "\a" Bell or alarm, 0x07 "\b" Backspace, 0x08 "\f" Form feed, 0x0C "\n" New line (line feed) 0x0A "\r" Carriage return 0x0D "\t" Horizontal tab 0x09 "\v" Vertical tab 0x0B "\0" Null 0x00 "\\" Backslash 0x5C "\'" Single quote 0x27 */ @com.------------------------------ @mt1.isosurface /**** Isosurface **** An isosurface. The isosurface is extremely "flexible" object which is defined by an isosurface (equi-value surface) of a 3D function in a finite region. The 3D function can be specify both with the parsing function in the POV file or with the name of the internal/external function. If you have a compiler which can make DLL or shared library, you can make your own external 3D functions easily. See sample programs in "i_*.c" files. The isosurface syntax is: isosurface{ function { f1(x,y,z) [ | or ~ ] f2(x,y,z) .... } or function {"foo", , [ library "lib_name", "string", ] } // where "foo" is name of the internal/external function foo(x,y,z). // p0, p1,... are parameters for foo(x,y,z) // function(x,y,z)<0 : inside for solid shapes. //------ optional keywords ----------- bounded_by{ box {, }} // bounding shape // or bounded_by {sphere {, float_value}} // or clipped_by { box {, }} // or clipped_by {sphere {, float_value}} max_gradient MAX_GRADIENT accuracy ACCURACY max_trace MAX_TRACE [or all_intersections] threshold THRESHOLD_VALUE sign -1 // or 1 eval // evaluates max_gradient method 1 // or 2 ..... } Description of OPTIONAL KEYWORDS "bounded_by" or "clipped_by" [default bounded_by{box {<-1,-1,-1>,<1,1,1>}} ] These keywords specify the bounding shape in which POVRay looks for the isosurface. If there is a cross section with the bounding shape, "clipped_by" allows you to remove the surface on the bounding object. On the other hand, if you use "bounded_by" you will see the surface of the bounding shape. If you want to use isosurfaces with CSG operation, use "bounded_by" (and "max_trace" in some cases). "method" : This POV-Ray version provides two isosurface finding methods. Both methods are based on recursive subdivision. In default, "method 1" is used for parsing functions and "method 2" is used for the functions specified by the name. Generally, POV-Ray automatically selects the method and the user dose not neet to specify this keyword. "max_gradient": [default MAX_GRADIENT: 1.1] For internal/external functions, the user should specify max_gradient value, which is the maximum gradient in the bounding region. "accuracy" [default ACCURACY: 0.001] POV-Ray calculates the isosurface with the accuracy of "ACCURACY" value. Lower accuracy value gives better results but it will take longer rendering time. "max_trace" [default MAX_TRACE: 1] This keyword specifies the maximum number of points which POV-Ray looks for. "threshold" [default THRESHOLD_VALUE: 0.0] The optional keyword "threshold" specifies the THRESHOLD_VALUE of the 3D function. POV-Ray looks for the point where the value of the function equals to the THRESHOLD_VALUE. "library" "library" keyword is used for specifying and initializing external functions. "lib_name" specifies the name of the dynamic link library (DLL) for external function0s. "string" and p0, p1, .. are parameters for the initializing routine. NOTE: This keyword should be placed before the "function" keyword. "sign" [default 1] "sign" keyword specifies which region is inside or outside. "sign 1" : f(x,y,z)-THRESHOLD_VALUE <0 inside "sign -1" : f(x,y,z)-THRESHOLD_VALUE <0 outside "isosurfaces" can be used in CSG shapes and they can be scaled, rotated and translated. */ //A very simple "isosurface" object, which uses an internal "rounded_box" //function, is: isosurface { function {"rounded_box", <0.3>} bounded_by {box {<-2,-1,-2>,<2,1,2>}} } //This object is a rounded box which radius of the rounded corner is 0.3. @com.------------------------------ @com.============================================================ @mt1.Ready-Made Scenes @com.============================================================ @com. @com.------------------------------ @mt2.Basic scene // Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3 // Desc: Basic Scene Example // Date: 97.5 // Auth: Bob Hughes // #version 3.0 #include "colors.inc" global_settings { assumed_gamma 2.2 } #declare _c_ = <1,1,1,1,1> #declare _r_ = red 1 #declare _g_ = green 1 #declare _b_ = blue 1 #declare _f_ = filter 1 #declare _t_ = transmit 1 #declare _w_ = red 1 green 1 blue 1 #declare _R_ = 1 #declare _G_ = 1 #declare _B_ = 1 #declare _F_ = 1 #declare _T_ = 1 #declare _W_ = 1 #declare _u_ = 1 #declare _v_ = 1 #declare _x_ = 1 #declare _y_ = 1 #declare _z_ = 1 #declare _d_ = 1 // ---------------------------------------- camera { location <0, 1, -9> direction 3*z right 4/3*x look_at <0, 0, 0> } light_source { 0*x rgb 1.5 translate <-30, 30, -30> } // ---------------------------------------- sky_sphere { pigment { gradient y color_map { [0.0 color blue 0.6] [1.0 color rgb 1] } } } // ---------------------------------------- plane {y, -1 pigment {color rgb <0.8,0.7,0.35>}} sphere {0, 1 texture {pigment {radial frequency 8} finish {specular .5}} } @com.------------------------------ @mt2.Checkered floor // Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3 // Desc: Checkered Floor Example // Date: mm/dd/yy // Auth: ? // #version 3.0 #include "colors.inc" global_settings { assumed_gamma 2.2 } camera { location <0.0, 0.5, -4.0> direction 1.5*z right 4/3*x look_at <0.0, 0.0, 0.0> } sky_sphere { pigment { gradient y color_map { [0.0 color blue 0.6] [1.0 color rgb 1] } } } light_source { 0*x // light's position (translated below) color red 1.0 green 1.0 blue 1.0 // light's color translate <-30, 30, -30> } plane { y, -1 texture { pigment {checker color rgb 1 color blue 1 scale 0.5} finish {reflection 0.2} } } sphere { 0.0, 1 texture {pigment {radial frequency 8} finish {specular 1}} } @com.------------------------------ @mt2.Image Map // Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3 // Desc: Image Map Example // Date: mm/dd/yy // Auth: ? // #version 3.0 #include "colors.inc" global_settings { assumed_gamma 2.2 } // ---------------------------------------- camera { location <0.0, 0.0, -4.0> direction 2*z right 4/3*x look_at <0.0, 0.0, 0.0> } sky_sphere { pigment { gradient y color_map { [0.0 color blue 0.6] [1.0 color rgb 1] } } } light_source { 0*x // light's position (translated below) color red 1.0 green 1.0 blue 1.0 // light's color translate <-30, 30, -30> } // ---------------------------------------- plane { y, -1 texture { pigment {checker color rgb 1 color blue 1 scale 0.5} finish {reflection 0.2} } } plane { z, -1 texture { pigment { image_map { gif "test.gif" interpolate 2 // smooth it once // don't tile image, just one copy // filter 0 0.8 // make 1st color mostly transparent // filter 1 0.8 // make 2nd color mostly transparent filter all 0.5 // make all color indices semi-transparent transmit all 0.5 // 50% invisible } // transform it to unit-size (-1 to +1) and center it translate -1*(x+y) // center on the origin scale 2 // make it unit-sized } finish {ambient 0.3} } } @com.------------------------------ @mt2.Height Field // Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3 // Desc: Height Field Example // Date: mm/dd/yy // Auth: ? // #version 3.0 #include "colors.inc" global_settings { assumed_gamma 2.2 } // ---------------------------------------- camera { location <0.0, 2.0, -4.0> direction 2*z right 4/3*x look_at <0.0, 0.0, 0.0> } sky_sphere { pigment { gradient y turbulence .5 color_map { [0.0 color rgb 1] [1.0 color color red .3 green .7 color blue .9] } } } light_source { 0*x // light's position (translated below) color red 1.0 green 1.0 blue 1.0 // light's color translate <-30, 30, -30> } // ---------------------------------------- plane { y, -1 texture { pigment {checker color rgb 1 color rgb 0} finish {reflection 0.2} scale 0.5 } } height_field { gif "test.gif" // inverse // ? smooth // smooth it water_level 0.001 // cut HF at lowest level (or palette index # 0) scale 2 // make it unit-sized translate -1*(x+z) // center on the origin // enhance height characteristics with Y axis gradient texture { pigment { gradient y color_map { [0.0 color red 1] [0.5 color green 1] [1.0 color blue 1] } } finish {ambient 0.3} } scale .1*y // decrease height factor by 1/10 } @com. @com.============================================================ @com.end of insert menu template file @@@@