// Persistence of Vision Ray Tracer Scene Description File // File: onetire2.pov // Vers: 3.1 // Desc: soon to be the quintissential collecion of bike tire producing macros // Date: begun September 13,2002 // Auth: dookie x (dookiex@counterbalancebicycles.com) #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions #include "METALS.INC" #include "SHAPES.INC" #include "SHAPES2.INC" #include "SHAPESQ.INC" #include "SKIES.INC" #include "STONES.INC" #include "STONES2.INC" #include "WOODMAPS.INC" #include "WOODS.INC" #declare ShinyTex=texture{T_Chrome_4C finish{ambient .6}} #declare NotAsShinyTex=texture{T_Chrome_4C finish{ambient .53}} #declare DarkMetal=texture{T_Chrome_4C finish{ambient .12}} /* #declare ShinyTex=texture{T_Chrome_4C finish{ambient .3}} #declare NotAsShinyTex=texture{T_Chrome_4C finish{ambient .265}} //easy with the glowing steel... #declare DarkMetal=texture{T_Chrome_4C finish{ambient .06}} */ #declare MyHubType=1; #declare MyAxleRadius=.03; #declare MyFlangeSpan=.27; #declare MyFlangeType=1; #declare MyFlangeRadius=.15; #declare MyFlangeThickness=.01; #declare MyRimSize=1.28; #declare MySpokeThickness=.005; #declare ThreadPig=pigment{gradient y color_map{[0 color White] [.1 color White] [.4 color White*.3] [.7 color White*.3]}} #macro MakeHub(HubType,AxleRadius,FlangeSpan,FlangeType,FlangeRadius,FlangeThickness) #switch (FlangeType) #case (1) #declare Flange=difference{union{cylinder{<0,-FlangeThickness/2,0>,<0,FlangeThickness/2>,FlangeRadius} torus{FlangeRadius,FlangeThickness/2} cylinder{<0,0,0>,<0,.025,0>,AxleRadius*1.5} cone{<0,.025,0>,AxleRadius*1.5,<0,.06,0>,AxleRadius*.9} sphere{<0,0,0>,AxleRadius*1.5 scale <1,.7,1>} } sphere{<0,0,0>,AxleRadius*1.5 scale <.98,.68,.98>} //bearing hole cylinder{<0,0,0>,<0,-.1,0>,AxleRadius*.9} //hole for bearing race #declare Looper=0; #while (Looper<8) cylinder{<0,-FlangeThickness,0>, <0, FlangeThickness,0>,FlangeRadius/6 translate x*FlangeRadius*.6 rotate y*Looper*45} #declare Looper=Looper+1; #end //while } //end difference #break #end //switch FlangeType #switch (HubType) #case (1) //da freakin original, yuhno? #declare Flange=difference{union{cylinder{<0,-FlangeThickness/2,0>,<0,FlangeThickness/2>,FlangeRadius} torus{FlangeRadius,FlangeThickness/2} cylinder{<0,0,0>,<0,.025,0>,AxleRadius*1.5} cone{<0,.025,0>,AxleRadius*1.5,<0,.06,0>,AxleRadius*.9} sphere{<0,0,0>,AxleRadius*1.5 scale <1,.7,1>} } sphere{<0,0,0>,AxleRadius*1.5 scale <.98,.68,.98>} //bearing hole cylinder{<0,0,0>,<0,-.1,0>,AxleRadius*.9} //hole for bearing race #declare Looper=0; #while (Looper<8) cylinder{<0,-FlangeThickness,0>, <0, FlangeThickness,0>,FlangeRadius/6 translate x*FlangeRadius*.6 rotate y*Looper*45} #declare Looper=Looper+1; #end //while } //end difference difference{union{cylinder{<0,-FlangeSpan/2,0>,<0,FlangeSpan/2,0>,AxleRadius} //fat axle object{Flange translate y*-FlangeSpan/2} //one flange object{Flange rotate x*180 translate y* FlangeSpan/2} //other flange } //end union cylinder{<0,-FlangeSpan,0>,<0,FlangeSpan,0>,AxleRadius*.9} } //end difference #break #case (2) ////////////////////SECOND/TRY//////////////////////// /// Campagnolo Pista Record /// #declare Flange=difference{intersection{sphere{-400*y,400} cylinder{-20*y,y*20,34} } //end intersection sphere{-385*y,385} translate y*47 pigment{color White} }//end difference #declare Washer=cylinder{-y*3.5,y*3.5,17 pigment{color White}} difference{union{cylinder{-107*y,117*y,7 pigment{ThreadPig}} //axle object{Flange pigment{color White}} //one flange object{Flange rotate z*180 pigment{color White}} //other flange /* object{Washer translate y*-85.2} object{Washer translate y* 89.73} cone{-85.2*y,13,-68.2*y,12 pigment{color White*.1}} //non-drive cone cone{85.2*y,13,70.2*y,12 pigment{color White*.1}} //drive cone cylinder{70.2*y,60.2*y,23 pigment{ThreadPig}} //locknut threads cylinder{60.2*y,66.2*y,28 pigment{color White*.8}} //locknut cylinder{60.2*y,50.2*y,25 pigment{ThreadPig}} //rear cog thread difference{cylinder{0,18*y,31.2} torus{31.2,7 scale<1,2.57142,1>} //non-drive ramp up translate y*-62.73 pigment{color White}} difference{cylinder{-44.73*y,44.73*y,30} torus{31.2,20 scale<1,2.485,1>} //hub body translate y*0 pigment{color White}} cylinder{-15*y,15*y,12 pigment{color White}} //more body cylinder{-10*y,-3.4*y,13 pigment{color White*.9}} //banding cylinder{ 10*y, 3.4*y,13 pigment{color White*.9}} difference{cylinder{0,-10*y,31.2} torus{31.2,4.2 scale<1,2.381,1>} //drive ramp up translate y*54.73 pigment{color White}} */ } //end union #declare Looper=0; #while (Looper<18) cylinder{<31.24,-10,0>,<31.24,10,0>,1.704 rotate Looper*y*20 translate y*47} cylinder{<31.24,-10,0>,<31.24,10,0>,1.704 rotate (Looper*20+10)*y translate y*-47} #declare Looper=Looper+1; #end //while scale .00444444444444 } //end difference #break #end //switch HubType #end //macro MakeHub #declare SpokeHead=sphere{0,MySpokeThickness*1.5 scale <1,.4,1>} #macro MakeSpoke(HubEnd,RimEnd,SpokeThickness,Leading,Washered) union{cylinder{HubEnd,RimEnd,SpokeThickness} sphere{HubEnd,SpokeThickness} //the elbow //figger out howta nipple... #if (HubEnd.y<0) #declare WhichWay=-1; #else #declare WhichWay=1; #end //the if #if (Leading=true) union{object{SpokeHead translate HubEnd+y*MyFlangeThickness*WhichWay*1.8} cylinder{HubEnd,HubEnd+y*MyFlangeThickness*WhichWay*1.8,SpokeThickness}} #else union{object{SpokeHead translate HubEnd-y*MyFlangeThickness*WhichWay*1.8} cylinder{HubEnd,HubEnd-y*MyFlangeThickness*WhichWay*1.8,SpokeThickness}} #end //the Leading/Trailing if for the spoke head, and "forearm" } #end //MakeSpoke #declare Pclock=2*abs(1-clock)-1; #declare Hub=MakeHub(MyHubType,MyAxleRadius,MyFlangeSpan,MyFlangeType,MyFlangeRadius,MyFlangeThickness) #declare BikeRim=torus{1.28,.04 } //the rim itself #declare Thorn= difference{ sphere{<0,0,0>,.1 scale <1,2.4,.2>} //an ovally, pill shape, box{<-.1,-.3,-.1>,<0,.3,.1>} //chop the bottom, box{<-.1,-.3,-.1>,<.1,0,.1>} // the side, (quarter it...) cylinder{<0.05,0,-.1>,<0.05,0,.1>,.05} //and drill out the hole rotate x*-90 //spin 'er rotate z*3 //and tilt it jes right translate <1.39,0,0> //and stick 'er in the rubber } #declare BikeRubber= union{torus{1.35,.07} //just a big piece o rubber #declare Looper=0; #while (Looper<13) //and a dozen thorns object {Thorn rotate y*27.692307692307692307692307692308*Looper} #declare Looper=Looper+1; #end //while } #declare Spokeage=union{ #declare Looper=0; #while (Looper<9) object{MakeSpoke(<0,(-MyFlangeSpan+MyFlangeThickness)/2+MySpokeThickness, -MyFlangeRadius*.9>, -MyRimSize*1*x, //first 9 trailing MySpokeThickness,1,0) rotate y*(Looper*40)} object{MakeSpoke(<0,-((-MyFlangeSpan+MyFlangeThickness)/2+MySpokeThickness), // <<< minus sign -MyFlangeRadius*.9>, -MyRimSize*1*x, MySpokeThickness,1,0) rotate y*(Looper*40+10)} // <<, //negative z! vrotate(-MyRimSize*1*x,60*y), ///// VROTATE!!! MySpokeThickness,0,0) //trailing to 0! rotate y*(Looper*40+0)} object{MakeSpoke(<0,-((-MyFlangeSpan-MyFlangeThickness)/2-MySpokeThickness), // <<< minus sign, other flange MyFlangeRadius*.9>, //'members, negative z! vrotate(-MyRimSize*1*x,60*y), //// VROTATE!! MySpokeThickness,0,0) //'members, trailing to 0, rotate y*(Looper*40+10)} // <<} light_source{0*x color red 1.0 green 1.0 blue 1.0 translate <2, -7, -2>} light_source{0*x color red 1.0 green 1.0 blue 1.0 translate <7, -2, -7>} light_source{0*x color red 1.0 green 1.0 blue 1.0 translate <-7,2, -2>} */ //light_source{<1,-3,0> color White} light_source{<-1,0,-1> color White*2} //camera {location <0 , .05 ,-.9> sky -x look_at<-0 ,.050 ,0>} //hub looker //camera {location <.4 , -.23 ,-1.9> sky -x look_at<-0 ,.00 ,0>} // EFFIN' CAM!! // camera {location <0 , 4.5,0> sky -x right x*image_width/image_height look_at<-0 ,.00 ,0>} background { color red 0.322352 green 0.242549 blue 0.3223529} //object{ThornyTire rotate<-50,4,37>}//front tire //object{ThornyTire rotate<-230,4,43>} //reartire (horsie tyre polo thing) /*#declare Looper=0; //second 9 leading #while (Looper<5) object {ThornyTire scale <1.5,1.5,1.5> translate rotate y*-3*Looper //rotate z*-3*Looper } #declare Looper=Looper+1; #end */ //object {ThornyTire scale <1.5,1.5,1.5> //rotate z*60 //} /* ^ | -x | |____\ -z / / / L -y */