//-----------------------------------// // glowthruObjectFix_test_1.pov | // by [GDS|Entropy] Ian McDonald | // | // Technical assistance by: | // triple_r | // Chris B | //-----------------------------------// #version unofficial megapov 1.21; #declare s = seed(123501); /* Test whether a ray starting at start_pt and * ending at target_pt hits test_obj before it * gets there. Returns either true if it reaches * it or false otherwise. Add an extra epsilon * so that conindident points ARE drawn. * by Rick/triple_r */ #macro test_ray( start_pt, target_pt, test_obj ) #local epsilon = 1.0e-11; // default e-10 #local nrml = <0,0,0>; #local direc = target_pt - start_pt; #local intersec = trace( test_obj, start_pt, direc, nrml ); !(vlength(nrml) > 0 & vlength(direc) > vlength(intersec-start_pt)+epsilon) #end // Light/camera light_source{ <15,25,-20> rgb 0.2 } #declare cam_pt = <12.5,13.0,-13.5>; camera{ location cam_pt look_at <0,0,0> } #local RsA = seed(574647); #macro draw_glow(pt,cam_pt,test_obj,glowTypeCtr) #if(test_ray(cam_pt, pt, test_obj)) light_source { pt #if(mod(glowTypeCtr,2) = 0) color rgb <0.2734*rand(RsA), 0.5078*rand(RsA), 0.7031*rand(RsA)> #else color rgb #end glow { #if(mod(glowTypeCtr,2) = 0) size rand(RsA)*0.1 type 0 #else size rand(RsA)*0.5 type 2 #end } #if(mod(glowTypeCtr,2) = 0) fade_distance 1 fade_power 2 #else fade_distance 2 fade_power 3 #end } //#debug concat("Glow Created = True \n") #else //#debug concat("Glow Created = False \n") #end #end #declare thing = box{-1,1}; // RRand Macro by Chris Huff #macro RRand(RS, Min, Max) (rand(RS)*(Max-Min) + Min) #end // circularRotation Macro by [GDS|Entropy] //------ #declare Sp = 11; #macro circularRotation(ctr) #local i=0; #while (i; #set i=i+1; #end #end #declare circRotVect = array [Sp]; //------ // RRandArray Macro by [GDS|Entropy] //------ #macro RRandArray(Seed,Min,Max,ctr) #local i=0; #while (i, circRotVect[j]+circRotVect[j], 0.05 } object { thing pigment {color rgb <0.2734+vectRGB, 0.5078+vectRGB, 0.7031+vectRGB>} rotate <90,22.5*j,0> translate cirVect scale } //#debug concat("cirVect = ", vstr(3,cirVect,",",3,3),"\n") //#debug concat("j = ", str(j,1,1),"\n") #set j=j+1; #end } } object { testObject pigment {color rgb 1} translate <0,0,0> } #end #declare myTestObj = union{ object { testObj(1.5,0.125,5.625,Sp,1,cam_pt) translate <0,0,0> } // Loop through all vectors in vector array, call draw_glow() with slightly // modified vectors, to remove glows from the center of objects #local i=0; #while (i scale 1 } /* #local i=0; #local j=0; object { union { #while (i<=Sp) #while (j<=Sp) #declare Dia = array [Sp]; #set j=j+1; #end #set i=i+1; #end */ /* #macro YourMacro() #local I=0; #while (I<6) #declare Data[I]=; #local I=I+1; #end #end #declare Data = array [9]; YourMacro() #debug concat("Data element 3: <",vstr(3,Data[3],",",3,3),">\n") */ /* // Draw the objects #declare thing = box{-1,1} draw_glow( x, cam_pt, thing ) draw_glow( -x, cam_pt, thing ) draw_glow( y, cam_pt, thing ) draw_glow( -y, cam_pt, thing ) draw_glow( z, cam_pt, thing ) draw_glow( -z, cam_pt, thing ) object{ thing pigment{rgb 1} } */