// 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 MyHubType=1; #declare MyAxleRadius=.03; #declare MyFlangeSpan=.27; #declare MyFlangeType=1; #declare MyFlangeRadius=.15; #declare MyFlangeThickness=.01; #declare MyRimSize=1.28; #declare MySpokeThickness=.004; #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) #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<9) cylinder{<0,-FlangeThickness,0>, <0, FlangeThickness,0>,FlangeRadius/6 translate x*FlangeRadius*.6 rotate y*Looper*40} #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) #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; // box{<-.01, 0, 1> < .01,0,.9> //the nipple wrenchable #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 13 thorns object {Thorn rotate y*27.692307692307692307692307692308*Looper} #declare Looper=Looper+1; #end //while } //MakeSpoke(HubEnd,RimEnd,SpokeThickness,Leading,Washered) #declare Spokeage=union{ #declare Looper=0; #while (Looper<9) object{MakeSpoke(<0,(-MyFlangeSpan+MyFlangeThickness)/2+MySpokeThickness, -MyFlangeRadius*.9>, -MyRimSize*.98*x, //first 9 trailing MySpokeThickness,1,0) rotate y*(Looper*40)} #declare Looper=Looper+1; #end //while Looper #declare Looper=0; //second 9 trailing #while (Looper<9) object{MakeSpoke(<0,-((-MyFlangeSpan+MyFlangeThickness)/2+MySpokeThickness), // <<< minus sign -MyFlangeRadius*.9>, -MyRimSize*.98*x, MySpokeThickness,1,0) rotate y*(Looper*40+10)} // <<, //negative z! vrotate(-MyRimSize*.98*x,60*y), ///// VROTATE!!! MySpokeThickness,0,0) //trailing to 0! rotate y*(Looper*40+0)} // #declare Looper=Looper+1; #end //while Looper #declare Looper=0; //second 9 leading #while (Looper<9) object{MakeSpoke(<0,-((-MyFlangeSpan-MyFlangeThickness)/2-MySpokeThickness), // <<< minus sign, other flange MyFlangeRadius*.9>, //'members, negative z! vrotate(-MyRimSize*.98*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, 1>} //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>} camera {location <.75 , -1 ,0> look_at <.75 ,0 ,0> } camera {location <0 , -3.3 ,0> look_at <0 ,0 ,0> } background { color red 0.522352 green 0.542549 blue 0.7223529 } //background { color red 0.122352 green 0.042549 blue 0.1223529} /*object {ThornyTire2 scale <1,1,1> //rotate y*clock*40 //rotate z*16 //rotate x*16 } */ /* ^ | -z | |_____> -x / / L -y */