### Complete povray.conf Example Source: https://www.povray.org/documentation/3.7.0/u1_4.html A comprehensive example showing File I/O security, shellout security, and various permitted path configurations. ```ini [File I/O Security] ; none ; read-only restricted [Shellout Security] allowed ; forbidden [Permitted Paths] read*=%INSTALLDIR%/include read*=%INSTALLDIR%/scenes read=%INSTALLDIR%/../../etc read+write=. read+write*=/tmp ``` -------------------------------- ### Image Map Usage Examples Source: https://www.povray.org/documentation/3.7.0/r3_4.html Examples showing explicit file type declaration versus implicit type detection based on output settings. ```POV-Ray plane { -z,0 pigment { image_map {png "Eggs.png"} } } plane { -z,0 pigment { image_map {"Eggs"} } } ``` -------------------------------- ### Initialize Scene Environment Source: https://www.povray.org/documentation/3.7.0/t2_3.html Standard scene setup including camera, background, and lighting. ```POV-Ray #include "colors.inc" camera { location <10, 5, -20> look_at 0 angle 15 } background { color rgb <.5, .5, .5> } light_source { <10, 50, -100> White } ``` ```POV-Ray #include "colors.inc" #include "textures.inc" camera { location <10, 5, -20> look_at 0 angle 15 } background { color rgb <.5, .5, .5> } light_source{ <10, 50, -100> White } ``` -------------------------------- ### Read Directive Example Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of a #read directive expecting specific data formats. ```POV-Ray #read (FILE_HANDLE_IDENTIFIER,MyString,MyFloat,MyVect) ``` -------------------------------- ### Implement a while loop Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of a standard #while loop used to place multiple objects. ```POV-Ray #declare Count=0; #while (Count < 5) object { MyObject translate x*3*Count } #declare Count=Count+1; #end ``` -------------------------------- ### Configure Object Photon Settings Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of enabling reflection and refraction for a specific object. ```POV-Ray object { MyObject photons { target refraction on reflection on collect off } } ``` -------------------------------- ### Configure Light Source Photon Settings Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of enabling reflection and refraction for a light source. ```POV-Ray light_source { MyLight photons { refraction on reflection on } } ``` -------------------------------- ### Set Read-Only Installation Directory Source: https://www.povray.org/documentation/3.7.0/u1_4.html Permit reading from the directory where POV-Ray supplementary files are installed. ```ini [Permitted Paths] read=%INSTALLDIR% ``` -------------------------------- ### Macro Example: Window Frame Source: https://www.povray.org/documentation/3.7.0/r3_3.html A practical example of a macro that creates a window frame object based on provided dimensions. ```POV-Ray #macro Make_Frame(OuterWidth,OuterHeight,InnerWidth, InnerHeight,Depth) #local Horz = (OuterHeight-InnerHeight)/2; #local Vert = (OuterWidth-InnerWidth)/2; difference { box { <0,0,0>, } box { , } } #end Make_Frame(8,10,7,9,1) //invoke the macro ``` -------------------------------- ### Basic Identifier Examples Source: https://www.povray.org/documentation/3.7.0/r3_3.html Examples of declaring various data types and using them within object definitions. ```POV-Ray #declare Rows = 5; #declare Count = Count+1; #local Here = <1,2,3>; #declare White = rgb <1,1,1>; #declare Cyan = color blue 1.0 green 1.0; #declare Font_Name = "ariel.ttf" #declare Rod = cylinder {-5*x,5*x,1} #declare Ring = torus {5,1} #local Checks = pigment { checker White, Cyan } object { Rod scale y*5 } // not "cylinder { Rod }" object { Ring pigment { Checks scale 0.5 } transform Skew } ``` -------------------------------- ### Example Color Declarations Source: https://www.povray.org/documentation/3.7.0/r3_3.html Examples showing various ways to define color identifiers, including using expressions and existing identifiers. ```POV-Ray #declare White = rgb <1,1,1>; #declare Cyan = color blue 1.0 green 1.0; #declare Weird = rgb ; #declare LightGray = White*0.8; #declare LightCyan = Cyan red 0.6; ``` -------------------------------- ### Write Directive Implementation Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example code demonstrating how to write data to a file using the #write directive. ```POV-Ray #declare Val1 = -123.45; #declare Vect1 = <1,2,-3>; #write (FILE_HANDLE_IDENTIFIER,"\"A quote delimited string\",",Val1,",",Vect1,"\n") ``` -------------------------------- ### Configure Photons in Global Settings Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of adding a photons block to the global_settings section of a scene. ```POV-Ray global_settings { photons { count 20000 autostop 0 jitter .4 } } ``` -------------------------------- ### Configure Global Media Photon Settings Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of enabling photon interaction with media in global settings. ```POV-Ray global_settings { photons { count 10000 media 100 } } ``` -------------------------------- ### Complete While Loop Structure Source: https://www.povray.org/documentation/3.7.0/t2_3.html A full example of a while loop including initialization, condition, body, and manual incrementing. ```POV-Ray #declare Index = 1; #while(Index <= 10) (some commands here) #declare Index = Index + 1; #end ``` -------------------------------- ### Retrieving Date and Time Source: https://www.povray.org/documentation/3.7.0/r3_3.html Syntax for the datetime function and an example using the now keyword. ```POV-Ray datetime(FLOAT [,STRING]) ``` ```POV-Ray datetime(now) ``` -------------------------------- ### Initialize Multi-Dimensional Array Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of initializing a multi-dimensional array using nested initializer syntax. ```POV-Ray #declare Digits = array[4][10] { {7,6,7,0,2,1,6,5,5,0}, {1,2,3,4,5,6,7,8,9,0}, {0,9,8,7,6,5,4,3,2,1}, {1,1,2,2,3,3,4,4,5,5} } ``` -------------------------------- ### Example of conditional #if usage Source: https://www.povray.org/documentation/3.7.0/r3_3.html Demonstrates using #if, #elseif, and #else to control output based on float expressions. ```POV-Ray #if (Foo) #debug "Foo is true\n" #elseif (Bar) #debug "Foo is false, but Bar is true\n" #else #debug "Foo and Bar are both false\n" #end ``` -------------------------------- ### Transformation Order Example Source: https://www.povray.org/documentation/3.7.0/t2_2.html Demonstrates the effect of scaling after translation, which multiplies the translation amount. ```POV-Ray translate <5, 6, 7> scale 4 ``` -------------------------------- ### Initialize One-Dimensional Array Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of initializing a one-dimensional array using array initializer syntax. ```POV-Ray #include "colors.inc" #declare FlagColors = array[3] {Red,White,Blue} ``` -------------------------------- ### Nested Loop Initialization Example Source: https://www.povray.org/documentation/3.7.0/t2_3.html Initializes nested loops for creating a 2D array of objects. ```POV-Ray SDL #declare Index1 = 0; #while(Index1 <= 9) #declare Index2 = 0; #while(Index2 <= 19) ``` -------------------------------- ### Create a Simple Polygon Object Source: https://www.povray.org/documentation/3.7.0/t2_3.html Example of a single polygon object representing the letter V, including camera and light source setup. ```POV-Ray camera { orthographic location <0, 0, -10> right 1.3 * 4/3 * x up 1.3 * y look_at <0, 0.5, 0> } light_source { <25, 25, -100> color rgb 1 } polygon { 8, <0.45, 0.0>, <0.30, 1.0>, // Letter "V" <0.40, 1.0>, <0.55, 0.1>, <0.70, 1.0>, <0.80, 1.0>, <0.65, 0.0>, <0.45, 0.0> pigment { color rgb <1, 0, 0> } } ``` -------------------------------- ### Intersection Example Source: https://www.povray.org/documentation/3.7.0/r3_4.html An example of an intersection between a box and a cylinder. ```POV-Ray intersection { box { <-1.5, -1, -1>, <0.5, 1, 1> } cylinder { <0.5, 0, -1>, <0.5, 0, 1>, 1 } } ``` -------------------------------- ### Apply Density with Color List Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of using a checker pattern with a density color list. ```POV-Ray SDL density { checker density {rgb<1,0,0>} density {rgb<0,0,0>} } ``` -------------------------------- ### Multi-line comment example Source: https://www.povray.org/documentation/3.7.0/r3_3.html Demonstrates the use of block comments to ignore multiple lines of code. ```POV-Ray /* These lines are ignored by the ray-tracer */ ``` -------------------------------- ### Vector Identifier Examples Source: https://www.povray.org/documentation/3.7.0/r3_3.html Examples showing the declaration and re-declaration of vector identifiers. ```POV-Ray #declare Here = <1,2,3>; #declare There = <3,4,5>; #declare Jump = ; #declare Route = There-Here; #declare Jump = Jump+<1,2,3>; ``` -------------------------------- ### Sample INI File Structure Source: https://www.povray.org/documentation/3.7.0/t2_2.html Demonstrates basic INI file syntax including comments, input file settings, and nested INI file inclusion. ```ini ; This is a sample INI file. This entire line is a comment. ; Blank lines are permitted. Input_File_Name=simple.pov ;This sets the input file name +W80 +H60 ; Traditional +/- switches are permitted too MOREOPT ; Read MOREOPT.INI and continue with next line +V ; Another switch ; That's all folks! ``` -------------------------------- ### Render Preview with Gamma Settings Source: https://www.povray.org/documentation/3.7.0/t2_3.html Use these command-line parameters to render the showcase scene in a preview window for sanity checking. ```text +w640 +h480 +a0.3 +am1 -f +d ``` -------------------------------- ### Example of an Averaged Pigment Source: https://www.povray.org/documentation/3.7.0/r3_4.html A practical example of averaging three pigments with specific weights. ```povray pigment { average pigment_map { [1.0 Pigment_1] [2.0 Pigment_2] [0.5 Pigment_3] } } ``` -------------------------------- ### Execute POV-Ray with Command Line Switches Source: https://www.povray.org/documentation/3.7.0/t2_2.html Example of running the POV-Ray executable with specific switches to define input files, verbosity, and image dimensions. ```bash povray +Isimple.pov +V +W80 +H60 ``` -------------------------------- ### Object Pattern Example Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of using the object pattern with a declared object and turbulence. ```POV-Ray pigment { object { myTextObject color White color Red } turbulence 0.15 } ``` -------------------------------- ### Complete POV-Ray Scene Example Source: https://www.povray.org/documentation/3.7.0/t2_2.html A full scene file including background, camera, sphere, and light source. ```POV-Ray #include "colors.inc" background { color Cyan } camera { location <0, 2, -3> look_at <0, 1, 2> } sphere { <0, 1, 2>, 2 texture { pigment { color Yellow } } } light_source { <2, 4, -3> color White} ``` -------------------------------- ### Square Polygon Example Source: https://www.povray.org/documentation/3.7.0/r3_4.html A simple square polygon example using 2D vectors and a texture. ```POV-Ray polygon { 4, <0, 0>, <0, 1>, <1, 1>, <1, 0> texture { finish { ambient 1 diffuse 0 } pigment { image_map { gif "test.gif" } } } //scale and rotate as needed here } ``` -------------------------------- ### Example of a Text Object Source: https://www.povray.org/documentation/3.7.0/r3_4.html A practical example of defining a text object with a specific font and pigment. ```POV-Ray text { ttf "timrom.ttf" "POV-Ray" 1, 0 pigment { Red } } ``` -------------------------------- ### Initialize CSG Demo Scene Source: https://www.povray.org/documentation/3.7.0/t2_2.html Sets up the camera, lighting, and ground plane for a CSG demonstration. ```POV-Ray #include "colors.inc" camera { location <0, 1, -10> look_at 0 angle 36 } light_source { <500, 500, -1000> White } plane { y, -1.5 pigment { checker Green White } } ``` -------------------------------- ### Example of a Parametric Unit Sphere Source: https://www.povray.org/documentation/3.7.0/r3_4.html A practical example of a parametric object representing a unit sphere. ```POV-Ray parametric { function { sin(u)*cos(v) } function { sin(u)*sin(v) } function { cos(u) } <0,0>, <2*pi,pi> contained_by { sphere{0, 1.1} } max_gradient ?? accuracy 0.0001 precompute 10 x,y,z pigment {rgb 1} } ``` -------------------------------- ### Pigment Map Example Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of a sphere using a gradient pattern with a pigment_map to blend multiple textures. ```POV-Ray sphere { <0,1,2>, 2 pigment { gradient x //this is the PATTERN_TYPE pigment_map { [0.3 wood scale 0.2] [0.3 Jade] //this is a pigment identifier [0.6 Jade] [0.9 marble turbulence 1] } } } ``` -------------------------------- ### Initialize Chain Scene Environment Source: https://www.povray.org/documentation/3.7.0/t2_2.html Sets up the camera, lighting, and base objects required for modeling a chain link. ```POV-Ray #include "colors.inc" camera { location <0, .1, -25> look_at 0 angle 30 } background { color Gray50 } light_source{ <300, 300, -1000> White } #declare Half_Torus = difference { torus { 4,1 sturm rotate x*-90 // so we can see it from the top } box { <-5, -5, -1>, <5, 0, 1> } pigment { Green } } #declare Flip_It_Over = x*180; #declare Torus_Translate = 8; ``` -------------------------------- ### Rainbow Arc Example Source: https://www.povray.org/documentation/3.7.0/r3_4.html A practical example of a 120-degree rainbow arc with a 30-degree falloff region. ```POV-Ray SDL rainbow { direction <0, 0, 1> angle 42.5 width 5 distance 1000 jitter 0.01 color_map { Rainbow_Color_Map } up <0, 1, 0> arc_angle 120 falloff_angle 30 } ``` -------------------------------- ### Initialize Text Object Scene Source: https://www.povray.org/documentation/3.7.0/t2_3.html Sets up the camera, lighting, and a checkered plane for rendering text objects. ```POV-Ray #include "colors.inc" camera { location <0, 1, -10> look_at 0 angle 35 } light_source { <500,500,-1000> White } plane { y,0 pigment { checker Green White } } ``` -------------------------------- ### Julia Fractal Pigment Example Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of applying a Julia fractal pattern to a box object with custom interior coloring. ```POV-Ray box {<-2, -2, 0>, <2, 2, 0.1> pigment { julia <0.353, 0.288>, 30 interior 1, 1 color_map { [0 rgb 0] [0.2 rgb x] [0.4 rgb x+y] [1 rgb 1] [1 rgb 0] } } } ``` -------------------------------- ### Use Functions from functions.inc Source: https://www.povray.org/documentation/3.7.0/r3_4.html Demonstrates how to include the functions library and apply predefined functions within isosurface or pigment blocks. ```POV-Ray SDL #include "functions.inc" isosurface { function { f_torus_gumdrop(x,y,z, P0) } ... } pigment { function { f_cross_ellipsoids(x,y,z, P0, P1, P2, P3) } COLOR_MAP ... } ``` -------------------------------- ### Implement a switch directive Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example demonstrating the use of #switch, #case, #range, and #break to handle conditional logic. ```POV-Ray #switch (VALUE) #case (TEST_1) // This section is parsed if VALUE=TEST_1 #break //First case ends #case (TEST_2) // This section is parsed if VALUE=TEST_2 #break //Second case ends #range (LOW_1,HIGH_1) // This section is parsed if (VALUE>=LOW_1)&(VALUE<=HIGH_1) #break //Third case ends #range (LOW_2,HIGH_2) // This section is parsed if (VALUE>=LOW_2)&(VALUE<=HIGH_2) #break //Fourth case ends #else // This section is parsed if no other case or // range is true. #end ``` -------------------------------- ### Example Bicubic Patch Implementation Source: https://www.povray.org/documentation/3.7.0/r3_4.html A concrete example of a bicubic_patch using 16 control points and specific subdivision settings. ```POV-Ray SDL bicubic_patch { type 0 flatness 0.01 u_steps 4 v_steps 4 <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> } ``` -------------------------------- ### Define INI File Syntax and Equivalents Source: https://www.povray.org/documentation/3.7.0/t2_2.html Shows the standard format for INI file options and how to map command-line switches to INI keywords. ```ini Option_keyword=VALUE ; Text after semicolon is a comment ``` ```ini Input_File_Name=simple.pov ``` -------------------------------- ### Specify INI Files via Command Line Source: https://www.povray.org/documentation/3.7.0/t2_2.html Examples of passing INI configuration files as arguments to the POV-Ray command, either alone or combined with switches. ```bash povray myopts.ini ``` ```bash povray myopts +V other ``` -------------------------------- ### Example of a Gradient Texture Map Source: https://www.povray.org/documentation/3.7.0/r3_4.html A practical example of using a gradient pattern to blend different textures based on float values. ```POV-Ray SDL texture { gradient x //this is the PATTERN_TYPE texture_map { [0.3 pigment{Red} finish{phong 1}] [0.3 T_Wood11] //this is a texture identifier [0.6 T_Wood11] [0.9 pigment{DMFWood4} finish{Shiny}] } } ``` -------------------------------- ### Implement Material Map with Multiple Textures Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example showing how to map multiple textures to specific indices of a PNG file. ```POV-Ray SDL texture { material_map { png "povmap.png" texture { //used with index 0 pigment {color red 0.3 green 0.1 blue 1} normal {ripples 0.85 frequency 10 } finish {specular 0.75} scale 5 } texture { //used with index 1 pigment {White} finish { ambient 0 diffuse 0 reflection 0.9 specular 0.75 } } // used with index 2 texture {pigment{NeonPink} finish{Luminous}} texture { //used with index 3 pigment { gradient y color_map { [0.00 rgb < 1 , 0 , 0>] [0.33 rgb < 0 , 0 , 1>] [0.66 rgb < 0 , 1 , 0>] [1.00 rgb < 1 , 0 , 0>] } } finish{specular 0.75} scale 8 } } scale 30 translate <-15, -15, 0> } ``` -------------------------------- ### Cubic Spline Sphere Sweep Example Source: https://www.povray.org/documentation/3.7.0/t2_3.html A cubic_spline sphere sweep example using six control points to create a curved object. ```POV-Ray sphere_sweep { cubic_spline 6, <-4, -5, 0>, 1 <-5, -5, 0>, 1 <-5, 5, 0>, 0.5 < 5, -5, 0>, 0.5 < 5, 5, 0>, 1 < 4, 5, 0>, 1 tolerance 0.1 } ``` -------------------------------- ### Configuration File Syntax Source: https://www.povray.org/documentation/3.7.0/u1_4.html The general structure for POV-Ray configuration files, supporting comments and section-based settings. ```text ;Comment [Section] setting ``` -------------------------------- ### Linear Sphere Sweep Example Source: https://www.povray.org/documentation/3.7.0/t2_3.html A basic linear sphere sweep example forming an 'N' shape using four control points. ```POV-Ray sphere_sweep { linear_spline 4, <-5, -5, 0>, 1 <-5, 5, 0>, 1 < 5, -5, 0>, 1 < 5, 5, 0>, 1 } ``` -------------------------------- ### Union Example Source: https://www.povray.org/documentation/3.7.0/r3_4.html A simple union containing a box and a cylinder. ```POV-Ray union { box { <-1.5, -1, -1>, <0.5, 1, 1> } cylinder { <0.5, 0, -1>, <0.5, 0, 1>, 1 } } ``` -------------------------------- ### Declare Multi-Dimensional Array Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of declaring a two-dimensional array. ```POV-Ray #declare MyGrid = array[4][5] ``` -------------------------------- ### Calculate Factorial using prod Source: https://www.povray.org/documentation/3.7.0/r3_3.html Demonstrates the use of the prod function to calculate a factorial, requiring a wrapper declaration. ```POV-Ray #declare factorial = function(C) { prod(i, 1, C, i) } #declare A = factorial(5); ``` -------------------------------- ### Create a Basic Superellipsoid Source: https://www.povray.org/documentation/3.7.0/t2_3.html Example of a simple superellipsoid with a red pigment. ```POV-Ray superellipsoid { <.25, .25> pigment { Red } } ``` -------------------------------- ### Include Standard POV-Ray Files Source: https://www.povray.org/documentation/3.7.0/t2_2.html Import pre-defined scene elements like colors and textures. Include only necessary files to optimize parsing time and memory usage. ```POV-Ray #include "colors.inc" // The include files contain #include "stones.inc" // pre-defined scene elements ``` ```POV-Ray #include "textures.inc" // pre-defined scene elements #include "shapes.inc" #include "glass.inc" #include "metals.inc" #include "woods.inc" ``` -------------------------------- ### Define a Basic Spotlight Source: https://www.povray.org/documentation/3.7.0/t2_2.html Initial configuration for a spotlight source using the spotlight keyword and standard parameters. ```povray light_source { <0, 10, -3> color White spotlight radius 15 falloff 20 tightness 10 point_at <0, 0, 0> } ``` -------------------------------- ### Looping with the for directive Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of a loop that rotates a sphere at 30-degree increments. ```POV-Ray #for (i,0,330,30) sphere { 0,1 translate <0,0,-10> rotate y*i } #end ``` -------------------------------- ### Demonstrate Macro Substitution Precedence Source: https://www.povray.org/documentation/3.7.0/r3_3.html Illustrates how macro substitution can lead to incorrect mathematical results if parentheses are omitted. ```POV-Ray SDL #declare Value = Interpolate(I,0,15,3.0,5.5)*15; ``` ```POV-Ray SDL #declare Value = P1+(T1+T/(T2-T1))*(P2-P1) * 15; ``` ```POV-Ray SDL #declare Value = (P1+(T1+T/(T2-T1))*(P2-P1)) * 15; ``` -------------------------------- ### Modify Default Pigment Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of changing only the default pigment component. ```POV-Ray #default { pigment {rgb <1,0,0>} } ``` -------------------------------- ### Declare One-Dimensional Array Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of declaring a simple one-dimensional array. ```POV-Ray #declare MyArray = array[10] ``` -------------------------------- ### Basic Macro Definition and Usage Source: https://www.povray.org/documentation/3.7.0/t2_3.html Demonstrates the basic syntax for defining and calling a macro in POV-Ray. ```POV-Ray #macro UnitSphere() sphere { 0,1 } #end object { UnitSphere() pigment { rgb 1 } } ``` ```POV-Ray object { sphere { 0,1 } pigment { rgb 1 } } ``` -------------------------------- ### Declare Index Identifier Source: https://www.povray.org/documentation/3.7.0/t2_3.html Initialize an index variable before starting a loop. ```POV-Ray #declare Index = 1; ``` -------------------------------- ### Initialize and use random number streams Source: https://www.povray.org/documentation/3.7.0/r3_3.html Demonstrates how to initialize multiple independent pseudo-random number streams using seed() and retrieve values with rand(). ```POV-Ray SDL #declare R1 = seed(0); #declare R2 = seed(12345); sphere { , rand(R2) } ``` -------------------------------- ### Apply Turbulence to a Vector Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of using the vturbulence function to modify a vector. ```POV-Ray #declare MyVector = MyVector + Amount * vturbulence(2, 0.5, 6, MyVector * Frequency); ``` -------------------------------- ### Scaling Media Density in POV-Ray Source: https://www.povray.org/documentation/3.7.0/r3_4.html Demonstrates how to maintain consistent media appearance when scaling objects by adjusting the emission value. ```POV-Ray SDL #version 3.5; global_settings { assumed_gamma 1.0 } camera {location <0, 0,-12.0> look_at 0 angle 30 } #declare Container_T = texture { pigment {rgbt <1,1,1,1>} finish {ambient 0 diffuse 0} } #declare Scale=2; box { //The reference <-1,-1,0>,<1,1,.3> hollow texture {Container_T} interior { media { intervals 1 samples 1,1 emission 1 } } translate <-2.1,0,0> } box { //Object scaled twice as big <-1,-1,0>,<1,1,.3> //looks different but same hollow //particle density texture {Container_T} interior { media { intervals 1 samples 1,1 emission 1 } } scale Scale translate<0,0,12> } box { //Object scaled twice as big <-1,-1,0>,<1,1,.3> //looks the same but particle hollow //density scaled down texture {Container_T} interior { media { intervals 1 samples 1,1 emission 1/Scale } } scale Scale translate<0,0,12> translate<4.2,0,0> } ``` -------------------------------- ### Nested multi-line comment example Source: https://www.povray.org/documentation/3.7.0/r3_3.html Demonstrates that multi-line comments can be nested within each other. ```POV-Ray /* This is a comment // This too /* This also */ */ ``` -------------------------------- ### Initialize Raytracer Parameters Source: https://www.povray.org/documentation/3.7.0/t2_3.html Calculates array dimensions and normalizes light source vectors using a while loop. ```POV-Ray SDL #declare MaxDist = 1e5; #declare ObjAmnt = dimension_size(Coord, 1); #declare LightAmnt = dimension_size(LVect, 1); #declare Ind = 0; #while(Ind < LightAmnt) #declare LVect[Ind][0] = vnormalize(LVect[Ind][0]); #declare Ind = Ind+1; #end ``` -------------------------------- ### Solid Color Pigment Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of defining a pigment using a simple solid color. ```POV-Ray pigment { color Orange } ``` -------------------------------- ### Initialize a CSG Text Inlay Scene Source: https://www.povray.org/documentation/3.7.0/t2_3.html Initial setup for a scene using CSG, including includes, background, camera, and light source. ```pov #include "colors.inc" #include "stones.inc" background { color rgb 1 } camera { location <-3, 5, -15> look_at 0 angle 25 } light_source { <500,500,-1000> White } ``` -------------------------------- ### Define Face Indices Source: https://www.povray.org/documentation/3.7.0/r3_4.html Example of the face_indices section structure within a mesh2 object. ```POV-Ray face_indices { number_of_faces, , , ... } ``` -------------------------------- ### Set Default Texture Properties Source: https://www.povray.org/documentation/3.7.0/r3_3.html Example of setting a full default texture including pigment, normal, and finish. ```POV-Ray #default { texture { pigment { rgb <1,0,0> } normal { bumps 0.3 } finish { ambient 0.4 } } } ``` -------------------------------- ### Valid Float Literals Source: https://www.povray.org/documentation/3.7.0/r3_3.html Examples of valid floating point literal representations in POV-Ray. ```text -2.0 -4 34 3.4e6 2e-5 .3 0.6 ``` -------------------------------- ### Using the select function Source: https://www.povray.org/documentation/3.7.0/r3_3.html Demonstrates the behavior of the select function with three and four parameters based on the value of A. ```povray // A = -2 -1 0 1 2 select (A, -1, 0, 1) //returns -1 -1 0 1 1 select (A, -1, 1) //returns -1 -1 1 1 1 ``` -------------------------------- ### Define a Plain Texture for Layering Source: https://www.povray.org/documentation/3.7.0/t2_3.html This snippet shows the initial setup of a base texture using a checker pattern, which can later be used as a foundation for layered textures. ```povray #include "colors.inc" camera { location <0, 0, -6> look_at <0, 0, 0> } light_source { <-20, 30, -100> color White } light_source { <10, 30, -10> color White } light_source { <0, 30, 10> color White } #declare PLAIN_TEXTURE = // red/white check texture { pigment { checker color rgb<1.000, 0.000, 0.000> color rgb<1.000, 1.000, 1.000> scale <0.2500, 0.2500, 0.2500> } } // plain red/white check box box { <-1, -1, -1>, <1, 1, 1> texture { PLAIN_TEXTURE } translate <-1.5, 1.2, 0> } ``` -------------------------------- ### Set Geometry Option Source: https://www.povray.org/documentation/3.7.0/u1_6.html Example of setting image dimensions and window position using the geometry flag. ```bash -geometry 640x480+10+20 ``` -------------------------------- ### Initialize Mesh2 Object Source: https://www.povray.org/documentation/3.7.0/t2_3.html Start defining a mesh2 object using the vertex_vectors list. ```POV-Ray mesh2 { vertex_vectors { 24, ... ```