/* Persistence of Vision Ray Tracer Scene Description File File: Chain.pov Vers: 3.5 Desc: Date: Auth: Anthony D. Baye */ #include "colors.inc" #include "textures.inc" #declare ft = 12; /* Change location or look_at point before rendering */ camera { location <0.0, 0.0, -10.0> look_at <0.0, 0.0, 0.0> } light_source { <0.0, 15.0*ft, -20.0*ft> color rgb 1.0 } #declare Link1 = union { difference { torus { 0.015625, 0.00390625 } box { <0.0, -0.078125, -0.03125> <0.03125, 0.078125, 0.03125> } translate 0.015625*x } difference { torus { 0.015625, 0.00390625 } box { <0.0, -0.078125, -0.03125> <-0.03125, 0.078125, 0.03125> } translate -0.015625*x } cylinder { <-0.015625, 0.0, -0.015625> <0.015625, 0.0, -0.015625> 0.00390625 } cylinder { <-0.015625, 0.0, 0.015625> <0.015625, 0.0, 0.015625> 0.00390625 } texture { T_Gold_5A } } // <<---------------------------------------------------------->> \\ #local cl = 24.0 ; // Chain length. #local llen = 0.0625 ; // Link Length. #local lwid = 0.03125 ; // Link Width. #local lminr = 0.00390625 ; // Link Minor radius. #local ct = 2 ; // Chain Type. Type 1: Straight Chain | Type 2: Circular Chain. #local ctex = T_Gold_2B ; // Chain tex. // <<---------------------------------------------------------->> \\ #local lio = llen-(2*lminr) ; // Inner length of one link. #local deg = cl / 360 ; // The length of one degree. #local rdeg = lio / deg ; // Fraction of one degree covered by the inner opening of one link. #local crad = (cl / pi) / 2 ; // Cain Radius. #local numl = cl/(llen-(2*lminr)) ; // Number of links. // <<---------------------------------------------------------->> \\ //#debug "The Chain's radius is: \n"crad\"inches." #declare Link2 = union { difference { torus { lwid/2, lminr } box { <0.0, -0.078125, -0.03125> <0.03125, 0.078125, 0.03125> } translate -0.015625*x } difference { torus { lwid/2, lminr } box { <0.0, -0.078125, -0.03125> <-0.03125, 0.078125, 0.03125> } translate 0.015625*x } cylinder { <-0.015625, 0.0, -0.015625> <0.015625, 0.0, -0.015625> lminr } cylinder { <-0.015625, 0.0, 0.015625> <0.015625, 0.0, 0.015625> lminr } torus { lminr, lminr*0.128 rotate 90.0*z translate -lwid/2*z texture { ctex } normal { bumps 1 scale 0.0001 } } texture { ctex } } #local C = -(numl/2) ; #while(C <= (numl/2)) #if(ct = 1) object { Link2 translate (lio*C)*x rotate ((C*2)*36)*x } #else object { Link2 rotate (36.0*(C*2))*x translate crad*y rotate (rdeg*C)*z } object { Link2 rotate (36.0*(C*2))*x translate crad*y rotate (rdeg*C)*z translate <0.0, -3.8, -9.0> } #end #local C = C + 1/2 ; #end