// Persistence of Vision Ray Tracer Scene Description File // File: reference_axis.inc // Vers: 3.6 // Desc: Include file for Reference_Axis. Each arrow tip is 1 unit from the origin. Scale as desired. // Date: Originally created in 2005. Last modified Nov 2006 // Auth: Charles Coyle // // This file can be rendered independently or used as an include. If Main_POV_File is undefined // when this file is #included, this file may assume that it is the main scene file and will define // it's own camera etc, making it self-renderable. But that's easy to bypass. // #ifndef(Main_POV_File) #declare Main_POV_File = "reference_axis.inc" #ifdef(Red) #declare Main_POV_File="\nRed already defined\n"#end #ifdef(camera) #declare Main_POV_File="\nCamera already defined\n"#end #debug Main_POV_File #end //#declare Main_POV_File = "I don't use this system."; //Uncomment if this sentence fits your style. #local Temp_Vers = version; #version 3.6; #ifdef(View_POV_Include_Stack) #debug "including reference_axis.inc\n" #end //Returns a union. Usage E.g. #declare ClearRefAxis = Define_Reference_Axis(3); #object{ClearRefAxis scale 5} // #macro Define_Reference_Axis(Ref_Axis_Textype) #switch (Ref_Axis_Textype) #case (1) //SOLID: #local Xtex = texture{ pigment{rgb x} } #local Ytex = texture{ pigment{rgb y} } #local Ztex = texture{ pigment{rgb z} } #break #case (2) //TRANSPARENT: #local Xtex = texture{ pigment{rgbt <1,0,0,.7>} finish{ambient 0} } #local Ytex = texture{ pigment{rgbt <0,1,0,.7>} finish{ambient 0} } #local Ztex = texture{ pigment{rgbt <0,0,1,.7>} finish{ambient 0} } #break #case (3) //TRANSPARENT 0 diffuse, with ambience: #local Xtex = texture{ pigment{rgbt <1,0,0,.7>} finish{diffuse 0 ambient .5} } #local Ytex = texture{ pigment{rgbt <0,1,0,.7>} finish{diffuse 0 ambient .5} } #local Ztex = texture{ pigment{rgbt <0,0,1,.7>} finish{diffuse 0 ambient .5} } #end //end #switch (Ref_Axis_Textype) // union{ //sphere{<0,0,0> .09 pigment{Black} } //origin cylinder {<0,0,0>, <.7,0,0> .05 texture{Xtex} } //x-axis cylinder {<0,0,0>, <0,.7,0> .05 texture{Ytex} } //y-axis cylinder {<0,0,0>, <0,0,.7> .05 texture{Ztex} } //z-axis cone{<.7,0,0>, .1, <1,0,0>, 0 texture{Xtex} } //x-axis cone{<0,.7,0>, .1, <0,1,0>, 0 texture{Ytex} } //y-axis cone{<0,0,.7>, .1, <0,0,1>, 0 texture{Ztex} } //z-axis text { ttf "crystal.ttf", "X", .2, 0 scale <.5,.5,.5> texture{Xtex} translate <1.2,-.15,-.05> } //x-axis text { ttf "crystal.ttf", "Y", .2, 0 scale <.5,.5,.5> texture{Ytex} translate <1.2,-.15,-.05> rotate z*90 } //y-axis text { ttf "crystal.ttf", "Z", .2, 0 scale <.5,.5,.5> texture{Ztex} translate <1.2,-.15,-.05> rotate z*90 rotate x*90 }//z-axis no_shadow } #end //end #macro Define_Reference_Axis(Ref_Axis_TexType) #declare Reference_Axis = Define_Reference_Axis(1); //Call macro again from scene if you don't want to use this default. //********************************************************************************* #if (strcmp(Main_POV_File, "reference_axis.inc") = 0 ) //Do the following if "reference_axis.inc" is the main scene file. //********************************************************************************* //background {rgb 1} camera { location <5,5,5> look_at <0,0,0> direction <0,0,2> sky y up y right x*image_width/image_height } //POV standard L/H //camera { location <5,5,5> look_at <0,0,0> direction <0,0,2> sky z up z right x*image_width/image_height } //Z up, CAD R/H light_source {<500,500,500> color rgb 1} object{Reference_Axis} //******************************************************************************** #end // Do the preceding if "reference_axis.inc" is the main scene file. //********************************************************************************* #version Temp_Vers; // Restore previous version