Home
- POV-Ray Tutorial
Geometric Shapes
Index
Basic Shapes
Shapes by macro + CSG
3D text shapes
Other Shapes
Non CSG Shapes
- disc
- polygon
- triangle
- smooth_triangle
- bicubic_patch
->mesh
- mesh2
height_field + HF macros
Isosurfaces
|
|
|
mesh{ } - mesh of triangles or smooth_triangles
|
Simple triangle mesh:
//Syntax: --------------------
mesh {
triangle{vertex_1}
triangle{vertex_2}
//...
triangle{vertex_3}
// option for uv_mapped texture:
uv_vectors
<uv_Corner_1>,
<uv_Corner_2>,
<uv_Corner_3>
// ---------
} //------------------------- |
|
//optional with predeclared textures :
mesh {
triangle{vertex_1 texture{Texture_1}}
triangle{vertex_2 texture{Texture_2}}
//...
triangle{vertex_3 texture{Texture_3}}
} //---------------------------------- |
Smooth_triangle_mesh with surface normal vectors:
//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}
} //---------------------------------------------------------------------- |
Example 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>}}
} //---------------------------------------- |
|
|
For use in POV-Tree with TOM_TREE.
|
Example 2: // Note: The texture has to be declared before the mesh is parsed!
#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>
} //---------------------------------------- |
|
|
Example 3:
mesh {
smooth_triangle{<0.20,0, 0.55>,<0.30,1, 0.50>,
<0.25,0, 0.17>,<0.00,1, 0.10>,
<0.00,0, 0.00>,<0.00,1, 0.00>}
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>
} //---------------------------------------- |
|
|
|