Polytriangle

Generates a polytriangle strip. In a polytriangle strip, each vertex makes a triangle with the previous two vertices. For a list of N vertices, there are N-2 triangles. If your geometry shape is such that each vertex is shared by a number of different triangles, this type of primitive is efficient description in which to represent your geometry shape.

Normal vector for each vertex can be specified.

Format

# Micro AVS Geom:2.10
polytri
Primitive Name
Vertex Data Type (vertex, normal, color or normal_and_color)
n (number of vertices)
X(1) Y(1) Z(1) (NX(1) NY(1) NZ(1) R(1) G(1) B(1))
X(2) Y(2) Z(2) (NX(2) NY(2) NZ(2) R(2) G(2) B(2))
.
.
.
X(n) Y(n) Z(n) (NX(n) NY(n) NZ(n) R(n) G(n) B(n))

The basic primitive type polytri is specified in the second line.
An arbitrary name is specified in the third line.
In the fourth line, the vertex data type is defined as vertex, normal, color or normal_and_color. When the vertex data type is normal, the normal vector is specified for each vertex. When the vertex data type is color, the R, G, B color values from 0 to 1 are specified for each vertex. When the vertex data type is normal_and_color, both the normal vector and the R, G, B color values are specified for each vertex. When the vertex data type is vertex, only the X, Y and Z coordinates are specified for each vertex.
The total number of verticies is specified in the fifth line. From the 6th line onwards, the X, Y, Z coordinates, (normal vector and RGB color values) are defined.

Example: A polytriangle strip without normal vector or color(pt_vertex.mgf)

# Micro AVS Geometry ASCII Data Format Version: 2.10
polytri
polytri
vertex
10
1 0 1.3
1 2 1.3
2 0 0.3
2 2 0.3
3 0 0.
3 2 0.
4 0 0.3
4 2 0.3
5 0 1.3
5 2 1.3

Example: A polytriangle strip with normal vector and color(pt_normal_and_color.mgf)

# Micro AVS Geometry ASCII Data Format Version: 2.10
polytri
polytri
normal_and_color
10
1 0 1.3    -0.71 0. -0.71    1.0 0. 0.
1 2 1.3    -0.71 0. -0.71    0.9 0. 0.1
2 0 0.3    -0.55 0. -0.84    0.8 0. 0.2
2 2 0.3    -0.55 0. -0.84    0.7 0. 0.3
3 0 0.      0.   0. -1.      0.6 0. 0.4
3 2 0.      0.   0. -1.      0.5 0. 0.5
4 0 0.3     0.55 0. -0.84    0.4 0. 0.6
4 2 0.3     0.55 0. -0.84    0.3 0. 0.7
5 0 1.3     0.71 0. -0.71    0.2 0. 0.8
5 2 1.3     0.71 0. -0.71    0.1 0. 0.9


UP © 1998-2008 KGT Inc. All rights reserved.