Beschreibungen und Beispiele zum Raytracer POV-Ray von Friedrich A. Lohmüller

            Geometrische Körper in POV-Ray

English English English
Italiano Italiano
Français français

Home
- POV-Ray Tutorial
 
Geometrische Körper
   Inhaltsübersicht
Grundkörper
Shapes by macro + CSG
3D-Text-Formen
Andere Körper

 
Non-CSG Objekte
  - disc
  - polygon
  - triangle
  - smooth_triangle
  - bicubic_patch
  ->mesh
  - mesh2

 height_field + HF macros
 Isosurfaces
                                   
mesh
mesh{ } - Netz (mesh) aus triangle-Dreiecken oder smooth_triangles-Dreiecken
Dies benötigt mindestens die Angabe der Scheitelpunkte (vertex) / Eckpunkte der Dreiecke.
built-in shape, non-CSG
 
Einfaches triangle mesh:
//Syntax: --------------------
mesh {
  triangle{vertex_1}
  triangle{vertex_2}
   //...
  triangle{vertex_3}
// Option für uv_mapped texture:
  uv_vectors
  <uv_Corner_1>,
  <uv_Corner_2>,
  <uv_Corner_3>
// ---------
} //-------------------------
       
//optional zuvor deklarierten Texturen :
mesh {
  triangle{vertex_1 texture{Texture_1}}
  triangle{vertex_2 texture{Texture_2}}
   //...
  triangle{vertex_3 texture{Texture_3}}
} //----------------------------------
Smooth_triangle_mesh mit Oberflächen-Normalenvektoren:
//Syntax: -----------------------------------------------------------------
mesh {
 smooth_triangle{vertex_1, normal_1, vertex_2, normal_2, vertex_3, normal_3}
 //...
 smooth_triangle{vertex_1, normal_1, vertex_2, normal_2, vertex_3, normal_3}
} //----------------------------------------------------------------------

Beispiel 1:
mesh {
 triangle{<0.20, 0, 0.55>,<0.25, 0, 0.17>,<0.00, 0, 0.00>}
 triangle{<0.65, 0, 0.50>,<0.50, 0, 0.15>,<0.00, 0, 0.00>}
 triangle{<0.50, 0, 0.15>,<0.00, 0, 0.00>,<0.50, 0,-0.15>}
 triangle{<0.50, 0, 0.15>,<0.50, 0,-0.15>,<1.00, 0, 0.00>}
 triangle{<0.00, 0, 0.00>,<0.50, 0,-0.15>,<0.65, 0,-0.50>}
 triangle{<0.25, 0,-0.52>,<0.25, 0,-0.17>,<0.00, 0, 0.00>}
 texture{ pigment{ color rgb<0.0,1.0,0.0>}}
} //----------------------------------------
mesh
 
mesh
  Gebrauch mit z.B. POV-Tree + TOM_TREE.

Beispiel 2: // Hinweis: Die Texture müssen vor dem Parsen des Netzes(mesh) deklariert werden!

#declare T_1 = texture{ pigment{ color rgb<0.2,0.5,0.0>}}
#declare T_2 = texture{ pigment{ color rgb<0.0,1.0,0.2>}}
#declare T_3 = texture{ pigment{ color rgb<0.0,0.5,0.0>}}
#declare T_4 = texture{ pigment{ color rgb<0.2,0.9,0.0>}}
mesh {
 triangle{<0.20, 0, 0.55>,<0.25, 0, 0.17>,<0.00, 0, 0.00> texture{T_1}}
 triangle{<0.65, 0, 0.50>,<0.50, 0, 0.15>,<0.00, 0, 0.00> texture{T_2}}
 triangle{<0.50, 0, 0.15>,<0.00, 0, 0.00>,<0.50, 0,-0.15> texture{T_4}}
 triangle{<0.50, 0, 0.15>,<0.50, 0,-0.15>,<1.00, 0, 0.00> texture{T_3}}
 triangle{<0.00, 0, 0.00>,<0.50, 0,-0.15>,<0.65, 0,-0.50> texture{T_2}}
 triangle{<0.25, 0,-0.52>,<0.25, 0,-0.17>,<0.00, 0, 0.00> texture{T_1}}
 rotate<0,0,10>
} //----------------------------------------
mesh
Beispiel 3:

mesh {
smooth_triangle{<0.20,0, 0.55>,<0.30,1, 0.50>,//vertex_1, normal_1
                <0.25,0, 0.17>,<0.00,1, 0.10>,//vertex_2, normal_2
                <0.00,0, 0.00>,<0.00,1, 0.00>}//vertex_3, normal_3
smooth_triangle{<0.65,0, 0.50>,<0.20,1, 0.70>,
                <0.50,0, 0.20>,<0.00,1, 0.00>,
                <0.00,0, 0.00>,<0.00,1, 0.00>}
smooth_triangle{<0.50,0, 0.15>,<0.20,1, 0.50>,
                <0.00,0, 0.00>,<0.00,1, 0.00>,
                <0.50,0,-0.20>,<0.00,1,-0.50>}
smooth_triangle{<0.50,0, 0.15>,<0.20,1, 0.50>,
                <0.50,0,-0.15>,<0.20,1,-0.50>,
                <1.00,0, 0.00>,<2.00,1, 0.00>}
smooth_triangle{<0.00,0, 0.00>,<0.00,1, 0.00>,
                <0.50,0,-0.15>,<0.20,1, 0.00>,
                <0.65,0,-0.50>,<0.30,1,-0.70>}
smooth_triangle{<0.25,0,-0.52>,<0.30,1,-0.50>,
                <0.25,0,-0.17>,<0.00,1,-0.10>,
                <0.00,0, 0.00>,<0.00,1,-0.30>}
 texture{ pigment{ color rgb<0.0,0.7,0.0>}}
 rotate<0,0,10>
} //----------------------------------------
mesh
top

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