#version unofficial megapov 1.1; global_settings { assumed_gamma 1.0 max_trace_level 100 /*radiosity { count 600 error_bound .16 brightness 1.8 pretrace_end .008 pretrace_start .02 }*/ } #declare scene1 = 1; #if(scene1 = 1) camera { location <-5, 6,-18> up y*image_height right x*image_width look_at < 0, 1.5, 0> angle 45 } #else camera { location <-5, 6,-18>*4 //location <0,10,-300> //location <00,20,0> up y*image_height right x*image_width look_at < 0, 1.5, 0>*4 //look_at y*10 //look_at <00,0,0> angle 45 } #end #local floorOn = 1; // Floor visibility switch #local blackOrWhite = 0; // Black or white background switch #local Debug = 0; // Global debug switch // Black or White Background #if(blackOrWhite = 0) background {rgb <0,0,0>} #else background {rgb <1,1,1>} #end #local RsA = seed(3141592654); // Global Rand seed for general use // Color Variables #local cMultA = 0.45;//0.00095; // need to alter this based on number of glows :-( // For Reds #local seedR = seed(112080); #local cMultRmin0 = 0.5; #local cMultRmax0 = 0.55; #local cMultRmin1 = 0.6; #local cMultRmax1 = 0.66; // For Greens #local seedG = seed(208011); #local cMultGmin0 = 0.75; #local cMultGmax0 = 0.55; #local cMultGmin1 = 0.6; #local cMultGmax1 = 0.66; // For Blues #local seedB = seed(801120); #local cMultBmin0 = 0.75; #local cMultBmax0 = 0.555; #local cMultBmin1 = 0.66; #local cMultBmax1 = 0.666; // These 5 Macros By Chris Huff : [As Far As I Know] #macro SRand(RS) (rand(RS)*2 - 1) #end #macro RRand(RS, Min, Max) (rand(RS)*(Max-Min) + Min) #end #macro Clamp(V, Min, Max) (min(Max, max(Min, V))) #end #macro Range(V, Rmn, Rmx) (V*(Rmx-Rmn) + Rmn) #end #macro RClamp(V, Rmn, Rmx, Min, Max) (Clamp(Range(V, Rmn, Rmx), Min, Max)) #end // RVector Macro By Icewind : [As Far As I Know] #macro RVector(Vmin, Vmax, RandSeed) #local xMin = Vmin.x; #local yMin = Vmin.y; #local zMin = Vmin.z; #local xMax = Vmax.x; #local yMax = Vmax.y; #local zMax = Vmax.z; #local RandVector = <(rand(RandSeed)*(xMax-xMin) + xMin), (rand(RandSeed)*(yMax-yMin) + yMin), (rand(RandSeed)*(zMax-zMin) + zMin)>; (RandVector) #end // cylinderMacro By [GDS|Entropy] #macro cylinderMacro(v1,v2,radi,useRot,rot,useTrans,trans) cylinder { v1, v2, radi #if(useRot = 1) rotate rot #end #if(useTrans = 1) translate trans #end } #end // isEvenOrOdd Macro By [GDS|Entropy] #macro isEvenOrOdd(integer) #if(mod(integer,2) = 0) #local isEven = 1; #local isOdd = 0; #else #local isEven = 0; #local isOdd = 1; #end #end #macro endNode(nodeCenterVector,numSpokes,glowsOn) #local blueNode = union { #local J = 0; #while(J color rgb cMultA*< rand(RsA)*cMultRmin0, rand(RsA)*cMultGmin0, rand(RsA)*cMultBmin0> //shadowless glow { size rand(RsA)*0.01 // Determines if even or odd #if(mod(glowTypeRand,2) = 0) type 0 //#debug concat("Type 0, Even Rand = ", str(glowTypeRand, 0, -1),"\n") #else type 2 //#debug concat("Type 2, Odd Rand = ", str(glowTypeRand, 0, -1),"\n") #end } fade_distance 1 fade_power 3 } cylinder { <0,0,0>, <0,1,0.5>, 0.05 // z vector positive int = upturned, and obviously the inverse } } #else cylinder { <0,0,0>, <0,1,0.5>, 0.05 // z vector positive int = upturned, and obviously the inverse } #end object { groupGlow rotate x*-90 rotate <0,RRand(RsA,-180,180),0> translate nodeCenterVector pigment {color rgb 0} //pigment {color rgb nodeCenterVector} } #set J = J + 1; #end object { cylinderMacro(<0,-1.9,0>,<0,0,0>,0.1,0,0,0,0) translate nodeCenterVector pigment {color rgb 0} } } object {blueNode} #end #macro treeLevel(twigAmount,needleAmount,glowsOn) #local treeTier = #local i=0; //#declare j=0; object { union { #while (i<=twigAmount) //#while (j<=i) object { endNode(,needleAmount,glowsOn) rotate <90,22.5*i,0> }/* object { cylinderMacro(<0,0,0>,<0,45,0>,0.1,0,0,0,0) rotate <90,22.5*j,0> } */ //#declare j=j+1; //#end #set i=i+1; #end } } object { treeTier translate <0,0,0> } #end #if(scene1 = 1) #macro christmasTree(levelAmount,twigAmount,needleAmount,glowsOn) #local tree = #local i=0; object { union { #while (i<=levelAmount) object { treeLevel(twigAmount-(i*levelAmount),needleAmount,glowsOn) translate <0,i*2,0> } #set i=i+1; #end } } object { tree translate <0,0,0> } #end #else // This is the REAL macro #macro christmasTree(levelAmount,twigAmount,needleAmount,glowsOn) #local tree = #local i=0; object { union { #while (i<=levelAmount) object { treeLevel(twigAmount-(i*levelAmount),needleAmount,glowsOn) translate <0,i*6,0> } #set i=i+1; #end cylinderMacro(<0,0,0>,<0,((twigAmount*1.1)/(levelAmount*0.19)),0>,0.5,0,0,0,0) } } object { tree translate <0,0,0> } #end #end #if(scene1 = 1) object { christmasTree(3,100,10,1) scale <1,1,1> translate <0,0.25,0> } #else // These are the proper settings object { christmasTree(13,100,10,1) scale <1,0.65,1> translate <0,0.25,-20> } #end #if(floorOn = 1) #if(scene1 = 1) box { <-15, 0,-10>, < 15, 0, 10> pigment {checker color rgb 0.05, color rgb 1} finish { //reflection {0.5, 0.75 metallic } diffuse 0.25 ambient 0 } } #else box { <-55, 0,-50>, < 55, 0, 50> pigment {checker color rgb 0.05, color rgb 1} finish { //reflection {0.5, 0.75 metallic } diffuse 0.25 ambient 0 } } #end #end /* light_source { <0, 100, 0> color rgb 1.0 } */