Basic Geometic Objects
|
|
cylinder = Zylinder
general syntax:
cylinder{<x1,y1,z1>,<x2,y2,z2>, r
texture{ ... ... }
}
In this <x1,y1,z1> and <x2,y2,z2>
are the coordinates of the centers of the both ends and r is the radius.
|
The samples here:
// the white cylinder left side:
cylinder {<0,0,0>,<0,3,0>,1 scale <1,1,1> rotate<0,0,0> translate<0,0,0>
texture{pigment{color White}
finish {ambient 0.15 diffuse 0.75 reflection 0.1 phong 1}}}
// the both violet cylinders in front:
cylinder {<2,0,0>,<3.5,2,0>,0.2 scale <1,1,1> rotate<0,0,0> translate<0,0,-1>
texture{pigment{color Plum}
finish {ambient 0.45 diffuse 0.55 phong 1}}}
cylinder {<3.5,2,0>,<5,0,0>,0.2 scale <1,1,1> rotate<0,0,0> translate<0,0,-1>
texture{pigment{color Plum}
finish {ambient 0.15 diffuse 0.85 phong 1}}}
// the slice of a tree right:
cylinder {<0,0,0>,<0,0,0.5>,1
texture{EMBWood1 scale 0.1
finish {ambient 0.15 diffuse 0.85 phong 1}}
translate<5,2,3>}
// the white flat cylinder, shrinked in z-direction right:
cylinder {<0,0,0>,<0,0.2,0>,2 scale <1,1,0.5> rotate<0,0,0> translate<4,0,2>
texture{pigment{color White}
finish {ambient 0.15 diffuse 0.75 reflection 0.1 phong 1}}}
// the chrome mirrored cylinder in the back:
cylinder {<0,0,0>,<0,6,0>,2 scale <1,1,1> rotate<0,0,0> translate<3,0,6>
texture{Polished_Chrome
finish {reflection 0.7}}} |
|
Hint: To construct a cylinder which is parallel to one of the axis of the coordinatensystem but
not in zero position, this can be done in a more difficult way but also in an easier way:
|
The most times worse style:
Start and end point of the cylinder are definded by their final values
=> the length and the position is hard to understand! |
cylinder{<4,2,2>,<4,2,5>,0.5
texture{ ... ... } } |
The better style much easier to understand is better done according to this
principle of construction:
1st step: modellizzing (length and radius) the body at zero and then
2nd step: moving the body to it's final position.
In this case the instructions better to understand would be the following:
|
cylinder{<0,0,0>,<0,0,3>,0.5
translate<4,2,2>
texture{ ... ... } } |
|
Special Effect: If we the optional command "open" we get an open cylinder:
|
cylinder{ <0,0,0>, <0,0.35,0>, 0.45 open
texture { pigment{ color rgb<1,1,1>*0.75}
finish { diffuse 0.7 phong 0.4 reflection 0.05}
} // end of texture
scale <1,1,1> rotate<0,0,0> translate<0,0,0>
} // end of cone ------------------------------------- |
|
|