#include "colors.inc" #include "textures.inc" #include "vector.inc" //object { Op scale 100} #declare bbb = yes; // show body? #local Esize = 200; light_source { < Esize, 0, 0> color Gray75 } light_source { <-Esize, 0, 0> color Gray75 } light_source { <0, Esize, 0> color Gray75 } light_source { <0, -Esize, 0> color Gray75 } light_source { <0, 0, Esize> color Gray75 } light_source { <0, 0, -Esize> color Gray75 } //plane { y, -Esize*2 pigment { Blue }} //camera{ location look_at<0,0,0> } //camera{ location look_at<0,0,0> } //camera{ location look_at } //camera{ location look_at<0,0,0> } // good camera{ location <0,0,-Esize*2.2> look_at<0,0,0> } //camera{ location <-240,100,-Esize*0.6> look_at<-240,100,0> } //camera{ location <0,Esize*2.2,0> look_at<0,0,0> } //camera{ location <0,0,-20> look_at<0,0,0> } // s=o/h c=a/h t=o/a // x-200, y-30 #declare Dragon = array[113][5] { {521,11,0,1,1}, {510,11,0,2,2}, {499,10,0,3,2}, {491,10,0,4,2}, {483,11,0,5,2}, {476,11,0,6,2}, {466,11,0,7,2}, {455,15,0,8,2}, {443,22,0,9,2}, {438,32,0,10,2}, //10 {442,44,0,11,2}, {449,59,0,12,2}, {446,72,0,13,2}, {433,82,0,14,2}, {412,90,0,15,2}, {386,97,0,17,2}, {365,93,0,17,2}, // hip {353,87,0,17,2}, // hip2 {341,80,0,17,2}, {317,70,0,15,2}, {290,68,0,13,2}, //20 {252,70,0,10,2}, {212,77,0,10,2}, {175,88,0,13,2}, {148,100,0,17,2}, {125,107,0,17,2}, {100,96,0,17,2}, //breast {92,85,0,16,2}, {98,74,0,15,2}, {112,64,0,14,2}, {135,52,0,14,2}, //30 {156,40,0,16,2}, {168,30,0,17,1}, {161,20,0,22,1}, //head1 {148,20,0,20,1}, //head2 {115,32,0,10,0}, // tip of mouth {148,20,0,20,1}, // head1 {116,22,0,7,1}, //top jaw {101,26,0,6,1}, {65,28,0,4,0}, {148,20,0,20,1}, // head1 {117,37,0,8,1}, //bottom jaw {106,39,0,7,1}, {88,43,0,6,1}, {68,42,0,4,0}, {353,87,0,17,1}, // hip bl-leg {391,107,-9,15,1}, {411,111,-19,8,1}, {429,126,-29,4,0}, {429,126,-29,3,5}, //1 {392,126,-29,1,0}, {429,126,-29,3,5}, //2 {390,132,-39,1,0}, {429,126,-29,3,5}, //3 {398,138,-49,1,0}, {429,126,-29,3,5}, //4 {409,142,-49,1,0}, {429,126,-29,3,5}, //5 {454,117,-19,1,0}, {353,87,0,17,1}, // hip br-leg {309,90,9,15,1}, {284,98,19,8,1}, {259,100,29,4,0}, {259,100,29,3,5}, //1 {217,106,29,1,0}, {259,100,29,3,5}, //2 {223,93,39,1,0}, {259,100,29,3,5}, //3 {239,83,49,1,0}, {259,100,29,3,5}, //4 {261,84,49,1,0}, {259,100,29,3,5}, //5 {264,114,19,1,0}, {100,96,0,17,1}, //breast fl-leg {126,94,-9,17,1}, {150,114,-19,15,1}, {164,141,-29,8,1}, {169,151,-29,4,0}, {169,151,-29,3,5}, //1 {132,153,-29,1,0}, {169,151,-29,3,5}, //2 {132,159,-39,1,0}, {169,151,-29,3,5}, //3 {139,165,-49,1,0}, {169,151,-29,3,5}, //4 {155,167,-49,1,0}, {169,151,-29,3,5}, //5 {195,146,-19,1,0}, {100,96,0,17,1}, //breast fr-leg {70,98,9,17,1}, {48,102,19,15,1}, {10,100,29,8,1}, {-16,81,29,4,0}, {-16,81,29,3,5}, //1 {-40,71,29,1,0}, {-16,81,29,3,5}, //2 {-18,60,39,1,0}, {-16,81,29,3,5}, //3 { 3,64,49,1,0}, {-16,81,29,3,5}, //4 { 15,80,49,1,0}, {-16,81,29,3,5}, //5 {-22,96,19,1,0}, {152,19,-11,8,1}, //l-horn {180,16,-31,6,1}, {194,12,-33,5,1}, {208,6,-31,3,1}, {222,4,-22,0,0}, {152,19,11,8,1}, //r-horn {180,16,31,6,1}, {194,12,33,5,1}, {208,6,31,3,1}, {222,4,22,0,0} // {,,0,0,1}, } #macro claw(X,Y,Z) union{ #local M = 1.2; #local R = 0; #local Dx = 0; #local Dy = 0; #while (M > 0) #declare Dx = sin(R) * 5; #declare Dy = cos(R) * 5; sphere{ , M } #declare M = M - .005; #declare R = R + .01; #end texture{Gold_Metal} //pigment{ rgb<0.25, 0.25, 0.25> } finish{Shiny} translate } #end #macro dbp( VA, I ) #local X = VA[I][0]; #local Y = -VA[I][1]; #local Z = VA[I][2]; #local Px = VA[I+1][0]; #local Py = -VA[I+1][1]; #local Pz = VA[I+1][2]; #local Ss = VA[I][3]; #local Sd = VA[I+1][3]; #local uv = 0.25; #local dx = Px - X; #local dy = Py - Y; #local dz = Pz - Z; //#warning concat( "Value:",str(X,5,1),str(Y,5,1),str(Z,5,1),"\n") #local dh = sqrt((dx*dx) + (dy*dy) + (dz*dz)); #if (dx = 0) #if (dz < 0) #local rzx = radians(90); #else #local rzx = radians(270); #end #else #local rzx = degrees(atan2( -dz, dx )); #end #local rzh = degrees(asin( dy / dh )); // CCC - change to merge if using glass merge{ #if (bbb) #if (Ss < Sd) #local R = asin( (Sd - Ss) / dh ); #else #local R = asin( (Sd - Ss) / dh ); #end #local T = sin( R ) * Ss; #local Q = sin( R ) * Sd; #local Ty = cos( R ) * Ss; #local Qy = cos( R ) * Sd; cone{ <-T, 0, 0>, Ty, , Qy } #if (VA[I][4] = 2) prism { linear_sweep linear_spline -1, 1, 4, <-T,Ss>, <(dh/2),Ss+5>, , <-T,Ss> pigment { Green } #if (dx >0 ) rotate <90,0,0> #else rotate <-90,0,0> #end } #end sphere{ < 0,0,0>, Ss } sphere{ , Sd } #if (VA[I][4] = 5) claw (dh,0,0) #end #else union{ // blob{ threshold 0.5 cylinder { <0,0,0>, 0.2,1 } } cylinder { <0,0,0>, .02 } cone { <0,0,0>, .05, , 0 translate } scale } sphere{ <0,0,0>, 5 scale <0.3,1,1> } #if (VA[I][4] = 5) claw (dh,0,0) #end #end } rotate <0, 0, rzh> rotate <0, rzx, 0> translate #end #macro VP( va ) // CCC - change to merge if using glass union { #local vu = dimension_size( va, 1 ); #local X = 0; #local sx = 0; #local lx = 0; #local sy = 0; #local ly = 0; #local sz = 0; #local lz = 0; #while (X < vu) #if (va[X][0] > lx) #declare lx = va[X][0]; #end #if (va[X][0] < sx) #declare sx = va[X][0]; #end #if (va[X][1] > ly) #declare ly = va[X][1]; #end #if (va[X][1] < sy) #declare sy = va[X][1]; #end #if (va[X][2] > lz) #declare lz = va[X][2]; #end #if (va[X][2] < sz) #declare sz = va[X][2]; #end #declare X = X + 1; #end #local dx = -((sx + lx) / 2); #local dy = ((sy + ly) / 2); #local dz = -((sz + lz) / 2); //#warning concat( str(sx,5,0), " ", str(lx,5,0), " ", str(dx,5,0),"\n" ) //#warning concat( str(sy,5,0), " ", str(ly,5,0), " ", str(dy,5,0),"\n" ) //#warning concat( str(sz,5,0), " ", str(lz,5,0), " ", str(dz,5,0),"\n" ) #local X = 0; #while (X < vu) #if (va[X][4] != 0) object{ dbp( va, X ) /// //texture{ Ruby_Glass } //texture{ DMFWood6 scale 20} pigment{ rgb< 1, 0, 0> } /* #if (mod(X,5) = 0) pigment {rgb <1,1,0> } #else pigment {rgb <0,1,1> } #end */ } #end #declare X = X + 1; #end translate } #end //plane { y,-200 pigment {Red} } object { VP( Dragon ) no_shadow}