/* Wine Bottle by Charles Fusner last updated 10/5/97 contains declarations for a wine bottle with an optional wooden cork, and also, optionally, a variable liquid level. Assumes the existance of an image file "LABEL.GIF" which contains the label to put on the bottle. Parameters needed for use: Bottle is declared to be standing upright with its base at Y=0. It is roughly 13.75 POV units tall, and approximately 3.75 units wide at it widest point. #declared name is "Wine_Bottle" 2 parameters can be declared before #inclusion. "Liquid_Level" is a floating point value from 0 to 1 which determines the amount of wine colored liquid in the bottle. Default is zero (completely empty). "Corkoff" is a boolean value, either yes or no. If yes, bottle will be declared as being uncorked. Default is no. Special Note: Also declared is "Cork" (so it can be used independantly if the variable "Corkoff" is set to yes.) If the cork is to be lying beside the bottle, use the initial transformation: rotate <0,0,-82.5> translate <0,.3,0> to set the cork lying on its side, over the origin, flush with Y=0. Then translate further to where you want it. */ #ifndef (LiquidLevel) #declare LiquidLevel = 0 #end #ifndef (Corkoff) #declare Corkoff = no #end #declare Wine = texture { pigment { rgbf <.8,0,0, .7> } } #declare CorkTex = texture { pigment { granite color_map { [0.00, 0.60 color rgb <0.93, 0.71, 0.532> color rgb <0.98, 0.81, 0.60>] [0.60, 0.65 color rgb <0.50, 0.30, 0.20> color rgb <0.50, 0.30, 0.20>] [0.65, 1.00 color rgb <0.80, 0.53, 0.46> color rgb <0.85, 0.75, 0.35>] } } finish { diffuse .58 } scale <0.1,0.25,.1> } #declare Green_Glass = texture { pigment { color rgbt <0.02, 0.4, 0.05, 0.3> } finish { ambient 0.2 //was .25 diffuse 0.3 //was .5 reflection 0.1 refraction 1 ior 1.02 specular 0.4 roughness 0.0003 brilliance 1.25 //was default } } #declare Cork = union { //the Cork... cone { <0,0,0>, .075 <0,.2,0>, .095 translate <0,0,0> } superellipsoid { <1,.5> rotate <90,0,0> scale <.1,.05,.1> translate <0,0.2,0>//2.65 } texture { CorkTex } scale <4.5,4.9412,4.5> } #declare Wine_Bottle = union { // the bottle... union { torus { 0.30, 0.04 } cylinder { < 0, 0.00, 0 >, < 0, 1.65, 0 >, .34 } lathe { cubic_spline 5, < 0.00, 1.00 >, < 0.34, 1.65 >, < 0.14, 2.00 >, < 0.12, 2.45 >, < 0.00, 3.09 > } torus { .1063, .025 scale <1,1.2,1> translate <0,2.4509,0> } torus { .1063, .025 scale <1,1.2,1> translate <0,2.375,0> } texture { Green_Glass } //texture { pigment { rgb < 0, 0, 1 > } } texture { //the label pigment { image_map { gif "label.gif" interpolate 2 once map_type 2 transmit 255,1 } scale .9 translate <0,.3,0> rotate <0,-90,0> } } } #if ( Corkoff = no ) object { Cork scale <1/4.5, 1/4.9412, 1/4.5> translate <0,2.65,0> } #end #if (LiquidLevel > 0) intersection { //put some liquid inside lathe { cubic_spline 7, <0.0, -.3248>, <.3424, 0.00>, <.3424, 0.9980>, <.3424, 1.6500>, <.1405, 2.0074>, <.1162, 2.4509>, <0.00, 3.0925> } cylinder { <0,-1,0>,<0,2.6*LiquidLevel,0>, .45 } scale <.95,1,.95> texture { Wine } } #end scale <4.6,4.92,4.6> //size to table rotate <0,6,0> } //end the union