// Pov v3.1 scene of an ornate lathe object studded with precious stones. // By: Ken Tyler tylereng@pacbell.net 08-01-1999 // Scene file illustrating how to use John VanSickels connect the dots macro. // You are granted permission to use the in any way you choose. // these are the same points used to create the lathe object #declare Bnum = 73; #declare B_spline = array [Bnum][2] { {0.0000, 0.3750},{0.0070, 0.3750},{0.0060, 0.3750},{0.0208, 0.3750}, {0.0473, 0.3743},{0.0804, 0.3700},{0.1125, 0.3583},{0.1378, 0.3370}, {0.1566, 0.3101},{0.1708, 0.2833},{0.1822, 0.2611},{0.1927, 0.2444}, {0.2041, 0.2333},{0.2179, 0.2271},{0.2334, 0.2228},{0.2500, 0.2166}, {0.2663, 0.2058},{0.2808, 0.1913},{0.2916, 0.1750},{0.2976, 0.1584}, {0.3009, 0.1429},{0.3041, 0.1291},{0.3094, 0.1179},{0.3155, 0.1084}, {0.3208, 0.1000},{0.3239, 0.0915},{0.3260, 0.0820},{0.3291, 0.0708}, {0.3347, 0.0572},{0.3430, 0.0427},{0.3541, 0.0291},{0.3675, 0.0177}, {0.3810, 0.0072},{0.3916, -0.0041},{0.3970, -0.0179},{0.3959, -0.0334}, {0.3875, -0.0500},{0.3716, -0.0668},{0.3520, -0.0845},{0.3333, -0.1041}, {0.3189, -0.1260},{0.3074, -0.1489},{0.2958, -0.1708},{0.2819, -0.1904}, {0.2652, -0.2081},{0.2458, -0.2250},{0.2239, -0.2416},{0.2010, -0.2583}, {0.1791, -0.2750},{0.1595, -0.2916},{0.1418, -0.3083},{0.1250, -0.3250}, {0.1086, -0.3415},{0.0941, -0.3570},{0.0833, -0.3708},{0.0777, -0.3819}, {0.0777, -0.3902},{0.0833, -0.3958},{0.0941, -0.3990},{0.1086, -0.4023}, {0.1250, -0.4083},{0.1413, -0.4189},{0.1558, -0.4324},{0.1666, -0.4458}, {0.1714, -0.4569},{0.1660, -0.4652},{0.1458, -0.4708},{0.1091, -0.4737}, {0.0658, -0.4748},{0.0291, -0.4750},{0.0086, -0.4750},{0.0010, -0.4750}, {0.0000, -0.4750} } // this array is nearly identical to the first only the first set of points // were removed. This was necessary to have a start point and an end point // for the connection macro #declare Cnum = 72; #declare C_spline = array [Cnum][2] { {0.0070, 0.3750},{0.0060, 0.3750},{0.0208, 0.3750},{0.0473, 0.3743}, {0.0804, 0.3700},{0.1125, 0.3583},{0.1378, 0.3370},{0.1566, 0.3101}, {0.1708, 0.2833},{0.1822, 0.2611},{0.1927, 0.2444},{0.2041, 0.2333}, {0.2179, 0.2271},{0.2334, 0.2228},{0.2500, 0.2166},{0.2663, 0.2058}, {0.2808, 0.1913},{0.2916, 0.1750},{0.2976, 0.1584},{0.3009, 0.1429}, {0.3041, 0.1291},{0.3094, 0.1179},{0.3155, 0.1084},{0.3208, 0.1000}, {0.3239, 0.0915},{0.3260, 0.0820},{0.3291, 0.0708},{0.3347, 0.0572}, {0.3430, 0.0427},{0.3541, 0.0291},{0.3675, 0.0177},{0.3810, 0.0072}, {0.3916, -0.0041},{0.3970, -0.0179},{0.3959, -0.0334},{0.3875, -0.0500}, {0.3716, -0.0668},{0.3520, -0.0845},{0.3333, -0.1041},{0.3189, -0.1260}, {0.3074, -0.1489},{0.2958, -0.1708},{0.2819, -0.1904},{0.2652, -0.2081}, {0.2458, -0.2250},{0.2239, -0.2416},{0.2010, -0.2583},{0.1791, -0.2750}, {0.1595, -0.2916},{0.1418, -0.3083},{0.1250, -0.3250},{0.1086, -0.3415}, {0.0941, -0.3570},{0.0833, -0.3708},{0.0777, -0.3819},{0.0777, -0.3902}, {0.0833, -0.3958},{0.0941, -0.3990},{0.1086, -0.4023},{0.1250, -0.4083}, {0.1413, -0.4189},{0.1558, -0.4324},{0.1666, -0.4458},{0.1714, -0.4569}, {0.1660, -0.4652},{0.1458, -0.4708},{0.1091, -0.4737},{0.0658, -0.4748}, {0.0291, -0.4750},{0.0086, -0.4750},{0.0010, -0.4750},{0.0000, -0.4750}} /*This macro will connect two points in space defined as the position of two spheres. It will not supply the spheres only the cones*/ /* example Connect(StartPoint,StartRadius,EndPoint,EndRadius) object {Connect(y*4,2,y*9,3)texture { MyTexture }}*/ #macro Connect(SP,SR,EP,ER) #local D = vlength(EP-SP); #local Rd = SR-ER; #local D2 = sqrt(D*D-Rd*Rd); cone { SP + (EP-SP)/D*Rd*(SR)/D,(SR)*D2/D,EP+(EP-SP)/D*Rd*(ER)/D,(ER)*D2/D } #end // distribute the cones along the curve of the lathe using the macro #declare Sweep1 = union{ #declare ab=0; #while (ab,0.01, ,0.01 ) } #declare ab = ab + 1; #end } // distribute the spheres along the curve of the lathe #declare Sweep2 = union{ #declare a=0; #while (a,.01 } #declare a = a + 1; #end } // distribute the clear spheres along the curve of the lathe #declare Sweep3 = union{ #declare d=0; #while (d,.01 scale<1,1,.25>} #declare d = d + 1; #end } // combine the cones with the spheres to make the gold bands #declare Sweep = union { object { Sweep1 } object { Sweep2 } } #include "golds.inc" // the gold bands swept in an arc #declare b=0; #while (b<36) object { Sweep rotate b*10*y texture { T_Gold_3E}} #declare b = b + 1; #end // the red stones #declare c=0; #while (c<36) object { Sweep2 rotate 5*y rotate c*10*y pigment { rgbf<.65,0,0,1> } interior { ior 1.6 } finish { ambient .4 diffuse .2 specular 1 roughness .001 reflection .3} } #declare c = c + 1; #end // the little clear stones right of the red stones #declare e=0; #while (e<36) object { Sweep3 rotate 2.5*y rotate e*10*y pigment { rgbf<1,1,1,1> } interior { ior 1.6 } finish { ambient .4 diffuse .2 specular 1 roughness .001 reflection .3} } #declare e = e + 1; #end // the little clear stones left of the red stones #declare e=0; #while (e<36) object { Sweep3 rotate -2.5*y rotate e*10*y pigment { rgbf<1,1,1,1> } interior { ior 1.6 } finish { ambient .4 diffuse .2 specular 1 roughness .001 reflection .3} } #declare e = e + 1; #end // These are the same points used in the arrays above and form the lathe // object that all else follow the contour of. lathe{ quadratic_spline 73, <0.0000, 0.3750>,<0.0070, 0.3750>,<0.0060, 0.3750>,<0.0208, 0.3750>, <0.0473, 0.3743>,<0.0804, 0.3700>,<0.1125, 0.3583>,<0.1378, 0.3370>, <0.1566, 0.3101>,<0.1708, 0.2833>,<0.1822, 0.2611>,<0.1927, 0.2444>, <0.2041, 0.2333>,<0.2179, 0.2271>,<0.2334, 0.2228>,<0.2500, 0.2166>, <0.2663, 0.2058>,<0.2808, 0.1913>,<0.2916, 0.1750>,<0.2976, 0.1584>, <0.3009, 0.1429>,<0.3041, 0.1291>,<0.3094, 0.1179>,<0.3155, 0.1084>, <0.3208, 0.1000>,<0.3239, 0.0915>,<0.3260, 0.0820>,<0.3291, 0.0708>, <0.3347, 0.0572>,<0.3430, 0.0427>,<0.3541, 0.0291>,<0.3675, 0.0177>, <0.3810, 0.0072>,<0.3916, -0.0041>,<0.3970, -0.0179>,<0.3959, -0.0334>, <0.3875, -0.0500>,<0.3716, -0.0668>,<0.3520, -0.0845>,<0.3333, -0.1041>, <0.3189, -0.1260>,<0.3074, -0.1489>,<0.2958, -0.1708>,<0.2819, -0.1904>, <0.2652, -0.2081>,<0.2458, -0.2250>,<0.2239, -0.2416>,<0.2010, -0.2583>, <0.1791, -0.2750>,<0.1595, -0.2916>,<0.1418, -0.3083>,<0.1250, -0.3250>, <0.1086, -0.3415>,<0.0941, -0.3570>,<0.0833, -0.3708>,<0.0777, -0.3819>, <0.0777, -0.3902>,<0.0833, -0.3958>,<0.0941, -0.3990>,<0.1086, -0.4023>, <0.1250, -0.4083>,<0.1413, -0.4189>,<0.1558, -0.4324>,<0.1666, -0.4458>, <0.1714, -0.4569>,<0.1660, -0.4652>,<0.1458, -0.4708>,<0.1091, -0.4737>, <0.0658, -0.4748>,<0.0291, -0.4750>,<0.0086, -0.4750>,<0.0010, -0.4750>, <0.0000, -0.4750>sturm texture {T_Gold_3E}scale 1.0225 rotate 0*x} plane{y,-4.75 pigment{rgb 0}finish{ambient 0 diffuse 0 reflection 1}} global_settings{assumed_gamma 1.9 max_trace_level 25} camera{location <0,.1,-1.3> look_at 0 } light_source {<0,10,-29> 1} light_source {<220,710,-10> 1}