Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Geometric Shapes in POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
 
  Geometric Shapes
   Index
Basic Shapes
  - sphere
  > cylinder
  - cone
  - torus
  - box
  - prism
  - plane
  - sor
  - lathe
  - superellipsoid
  - ovus

Shapes by macro + CSG
Shapes in "shapes3.inc"
Other Shapes by macros
3D text shapes
other Shapes
Non CSG Shapes
height_field + HF macros
Isosurfaces
                                   
Sample cone

cylinder = tube


Samples spheres 600x450
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 examples here:
// the white cylinder left side:
cylinder{ <0,0,0>,<0,3,0>,1
          texture{ pigment{ color White}
                   finish { reflection 0.1 phong 1}
                 }
          scale <1,1,1> rotate<0,0,0> translate<0,0,0>
        }
// the both violet cylinders in front:
cylinder{ <2,0,0>,<3.5,2,0>,0.2
          texture{ pigment{ color Plum}
                   finish { phong 1}
                 }
          scale <1,1,1> rotate<0,0,0> translate<0,0,-1>
        }
cylinder{ <3.5,2,0>,<5,0,0>,0.2
          texture{ pigment{ color Plum}
                   finish { phong 1}
                 }
          scale <1,1,1> rotate<0,0,0> translate<0,0,-1>
        }
// the slice of a tree right:
cylinder{ <0,0,0>,<0,0,0.5>,1
          texture{ EMBWood1 scale 0.1
                   finish { phong 1}}
           translate<5,2,3>}
//white flat cylinder, shrinked in z-direction right:
cylinder{ <0,0,0>,<0,0.2,0>,2
          texture{ pigment{ color White}
                   finish { reflection 0.1 phong 1}
                 }
          scale <1,1,0.5> rotate<0,0,0> translate<4,0,2>
        }
// the chrome mirrored cylinder in the back:
cylinder{ <0,0,0>,<0,6,0>,2
          texture{ Polished_Chrome
                   finish {reflection 0.7}
                 }
          scale <1,1,1> rotate<0,0,0> translate<3,0,6>
        }

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 add 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 { phong 0.4 reflection 0.05}
                  } // end of texture
           scale <1,1,1> rotate<0,0,0> translate<0,0,0>
         } // end of cone ------------------------------
cylinder open

© Friedrich A. Lohmüller, 2010
www.f-lohmueller.de
  top