/*This is a crystal wine glass half filled with red wine. I had some trouble in rendering the wine part so it is commented out. Try it and see if you can make it work.*/
#include "colors.inc"
#include "shapes.inc"
#include "textures.inc"
/*camera { //un-comment the camera and light source to view or make adjustments
location <0 0 -6>
direction <0 0 1.5>
up <0 1 0>
right <1.33 0 0>
look_at <0 1 1>
}*/
/*object {
light_source {<2 5 -4> color White}
}*/
/*object {
sphere {<0 0 0> 1000}
texture {color White}
}*/
#declare Hollow_Sphere=
difference {
sphere {<0 1 0> 1}
sphere {<0 1 0> .98}
}
#declare Goblet_Top=
intersection {
difference {
Hollow_Sphere
}
plane {<0 1 0> -1 translate <0 2.25 0>}
}
//texture {color White}
#declare Wine=
intersection {
sphere {<0 1 0> .98}
plane {<0 1 0> -1 translate <0 1.85 0>}
}
#declare Stem=
intersection {
quadric {
Cylinder_Y
scale <.12 1 .12>
}
plane {<0 1 0> -1 translate <0 2.5 0>}
plane {<0 1 0> -1 inverse translate <0 .95 0>}
}
#declare Base=
intersection {
quadric { QCone_Y scale <2 1 2>}
plane {<0 1 0> 0}
plane {<0 1 0> -1 translate <0 .2 0> inverse}
}
#declare Wine_Goblet=
composite {
object {
intersection {
Goblet_Top
translate <0 1.5 0>
}
texture { //color White}
color red 1.0 blue 1.0 green 1.0 alpha 1
reflection 0.15
refraction 1.0
specular 1.0
roughness .001
ior 1.5
phong 1 phong_size 200
}
}
object {
intersection {
Stem
}
texture { //color White}
color red 1.0 blue 1.0 green 1.0 alpha 1
reflection 0.15
refraction 1.0
specular 1.0
roughness .001
ior 1.5
phong 1 phong_size 200
}
}
object {
intersection {
Base
scale <.5 .5 .5>
}
texture {
color red 1.0 blue 1.0 green 1.0 alpha 1
reflection 0.15
refraction 1.0
specular 1.0
roughness .001
ior 1.5
phong 1 phong_size 200
}
}
/*object {
intersection {
Wine
translate <0 1.2 0>
}
texture {color red .5 alpha 1
refraction 1.0
ior 1.33
}
}*/
}
When I tried to render the wine goblet in another scene, I got only a flat disc instead of a half sphere. This file rendered fine. It is an unsolved mystery. If you find the answer, let me know.