defaults.ini =========== include_header = /path/to/defaults.inc defaults.inc =========== #include "default_01_00_00.inc" defaults_01_00_00.inc =========== // This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. // To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0/ or send a // letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. // Persistence of Vision Raytracer version 3.8 include file // File: defaults.inc // Desc: common identifiers to be referenced by other include files // Date: 2025-??-?? // Updated: 2025-??-?? // Auth: Richard Callwood III & William H. Walker IV // avoid version 3.8 errors #version version global_settings {assumed_gamma 1.0} #ifndef (Defaults_Inc_Temp) //============================================= // VERSION handling //============================================= #macro Version (_Installed, _Set, _Intended) // do versioning stuff here // maybe need multiple version handling macros // _Set would be what the current #version is set to #end //============================================= #declare Defaults_Inc_Temp = version; #version 3.8; #ifdef (View_POV_Include_Stack) #debug "including defaults.inc\n" #end //============================================= // default GAMMA //============================================= #macro Set_Default_Gamma (_Gamma) #declare Default_Gamma = _Gamma; global_settings {assumed_gamma Default_Gamma} #end #ifndef (Default_Gamma) Set_Default_Gamma (1.0); // https://wiki.povray.org/content/User:Clipka/Gamma #end //============================================= //============================================= // default FINISH //============================================= #macro Set_Default_Ambient (_Ambient) #declare Default_Ambient = rgb _Ambient; #end #macro Set_Default_Diffuse (_Diffuse) #declare Default_Diffuse = _Diffuse; #end #ifndef (Default_Ambient) Set_Default_Ambient (0.0); #end #ifndef (Default_Diffuse) Set_Default_Diffuse (0.6); #end #macro Set_Default_Finish (_Ambient, _Diffuse) #default { finish { ambient _Ambient diffuse _Diffuse } } #end Set_Default_Finish (Default_Ambient, Default_Diffuse) //============================================= // for coincident surfaces: #ifndef (Defaults_Epsilon) #declare Defaults_Epsilon = 1e-6; // provide a source-code file and line number reference for this magic number #end //============================================= // default FONT //============================================= #if (file_exists ("Lucida_sans_unicode.ttf")) #declare Default_Font = "Lucida_sans_unicode.ttf" #else // internal 1 #declare Default_Font = "timrom.ttf" #end //============================================= //============================================= // default mathematical CONSTANTS //============================================= // tau // https://news.povray.org/5b9b39cb%241%40news.povray.org #if (version >= 3.8) // tau is already defined as a keyword #else #declare tau = 2*pi; #end #declare e = exp (1); #declare NAN = val ("NAN"); #declare INF = val ("INF"); #declare Phi = (1 + sqrt(5))/2; #declare phi = Phi - 1; // Golden Angle #declare ga = 180 * (3 - sqrt(5)); //============================================= //============================================= // default physical CONSTANTS //============================================= // Earth gravity #declare G = 9.80665; // m/s^2 //============================================= //============================================= // default mathematical FUNCTIONS //============================================= #declare even = function (x) {select (mod (x, 2), 0, 1, 0)} #declare odd = function (x) {select (mod (x, 2), 1, 0, 1)} #declare sgn = function (x) {select (x, -1, 0, 1)} // Pow (_base, _exponent) for handling pow (0, 0) https://news.povray.org/povray.advanced-users/thread/%3C5b819469%40news.povray.org%3E/ #macro Pow (_base, _exp, _mode) #if (_base != 0 & _exp != 0) pow (_base, _exp) #else #switch (_mode) #case (0) 0 #break #case (1) 1 #break #case (2) #error "Result for pow (0, 0) is indeterminate." #break #else #error "Invalid Pow () mode." #end #end #end #declare fmod = function (Value, Modulo) {select (Value, 1 - mod (abs (Value), Modulo), mod (abs (Value), Modulo))} // this gives a mod function that remains consistant across the origin // trigonometric functions #declare csc = function (N) {1/sin(N)} #declare sec = function (N) {1/cos(N)} #declare cot = function (N) {1/tan(N)} // inverse trigonometric functions #declare acsc = function (N) {asin(1 / N)} #declare asec = function (N) {acos(1 / N)} #declare acot = function (N) {atan(1 / N)} // full set of value-tolerant trig functions (macros) //============================================= //============================================= // default SCENE elements //============================================= #macro Default_Scene () sky_sphere {rgb <1.0, 1.0, 1.0>} light_source {<0.0, 10.0, -10.0> rgb 1.0} #end // Axes // Plane //============================================= #version Defaults_Inc_Temp; #end