#include "colors.inc" #include "stones.inc" #include "textures.inc" //---------------------------------- #macro bottle (BodyHeight, BaseRadius,BodyRadius, ShoulderRadius, FilletRadius, NeckRadius, NeckLength, Thickness, Lip) // gotta have a thickness #if (!Thickness > 0) #declare Thickness = BodyRadius/10; #end // calculate where the shoulder torus goes #local Theta = 90-degrees(atan(BodyHeight/(BodyRadius - BaseRadius))); #local Voffset = sin(radians(Theta))*ShoulderRadius; #local Hoffset = cos(radians(Theta))*ShoulderRadius; difference { merge { cone { <0,0,0>BaseRadius <0,BodyHeight ,0> BodyRadius } #if (ShoulderRadius > 0) merge { difference { torus {BodyRadius - Hoffset , ShoulderRadius } translate <0,BodyHeight+Voffset,0> } cylinder {<0,BodyHeight,0> <0,BodyHeight + ShoulderRadius +Voffset ,0>BodyRadius - ShoulderRadius} } #end // if there is a neck, make it #if (NeckLength > 0) cylinder {<0,0,0><0,NeckLength,0> NeckRadius translate <0,BodyHeight + ShoulderRadius,0>} #if (FilletRadius > 0) difference { cylinder {<0,BodyHeight,0><0,BodyHeight+ShoulderRadius+FilletRadius,0>NeckRadius + FilletRadius} torus {NeckRadius+FilletRadius, FilletRadius translate<0,BodyHeight+ShoulderRadius+FilletRadius,0>} } #end #end // if there is a neck and a lip, create the lip #if (NeckLength >= Lip & Lip > 0) torus {NeckRadius -(Thickness/2), Lip translate <0,BodyHeight + NeckLength + ShoulderRadius,0> } #end } merge { cone { <0,Thickness,0>BaseRadius - Thickness<0,BodyHeight ,0> BodyRadius - Thickness } #if (ShoulderRadius > 0) merge { difference { torus {BodyRadius - Hoffset, ShoulderRadius - Thickness} translate <0,BodyHeight+ Voffset,0> } cylinder {<0,BodyHeight - Thickness,0> <0,BodyHeight + Voffset +ShoulderRadius - Thickness ,0>BodyRadius - ShoulderRadius} } #end #if (NeckLength > 0) cylinder {<0,BodyHeight - Thickness,0><0,2 * BodyHeight +NeckLength,0> NeckRadius - Thickness } #if (FilletRadius > 0) difference { cylinder {<0,BodyHeight,0><0,BodyHeight+ShoulderRadius+FilletRadius - Thickness,0>NeckRadius + FilletRadius} torus {NeckRadius+FilletRadius - Thickness, FilletRadius translate<0,BodyHeight+ShoulderRadius+FilletRadius - Thickness,0>} } #end #end } } #end //---------------------------------- global_settings { photons { spacing 0.01 } } camera { location <10, 10, -30> look_at <0.4, 1.75, 0> // look_at <0, 1, 0> angle 7.5 } light_source { <20, 30, 40> color White * 1.1 photons { refraction on reflection on } } light_source { <20, 30, -40> color White *1.3 photons { refraction on reflection on } } plane { y, 0 texture {pigment {color rgb <1.3, 1.2, 1.1>}}} object {bottle(.75, // BodyHeight 1, // BaseRadius 1, // BodyRadius .3, // ShoulderRadius .2 // FilletRadius from body to neck .3,// NeckRadius .5, // NeckLength .1,// Thickness .05) // lip texture {T_Grnt2} translate <-1.5,-.001,2> } object {bottle(1, // BodyHeight .85, // BaseRadius 1, // BodyRadius .6, // ShoulderRadius .0 // FilletRadius .6,// NeckRadius .25, // NeckLength .01,// Thickness .2) // lip material {M_Yellow_Glass} photons { refraction on reflection on collect off } translate <1.1,-.001,1.6> } object {bottle(.5, // BodyHeight .3 // BaseRadius .6, // BodyRadius .3, // ShoulderRadius .3 // FilletRadius .15,// NeckRadius 1.3, // NeckLength .05,// Thickness .08) // lip material {M_NB_Glass} photons { refraction on reflection on collect off } translate <-.3,-.001,.4> } object {bottle(2, // BodyHeight .7 // BaseRadius .2, // BodyRadius .0, // ShoulderRadius .0 // FilletRadius .2,// NeckRadius .5, // NeckLength .01,// Thickness .01) // lip photons { refraction on reflection on collect off } translate <-.5,-.001,3.75> material {M_Ruby_Glass} }