26
edits
No edit summary |
RalfGerlich (talk | contribs) (more information about triangles, fixed triangle fans) |
||
Line 419: | Line 419: | ||
The indices reference the respective lists, i.e. the vertex index references the vertex list. | The indices reference the respective lists, i.e. the vertex index references the vertex list. | ||
We assume that the individual elements are numbered sequentially, starting with index 0 for the first element. | |||
==== Points ==== | ==== Points ==== | ||
Line 427: | Line 429: | ||
In case of the Triangle object type, three succeeding elements are combined to form the vertices of a single triangle. | In case of the Triangle object type, three succeeding elements are combined to form the vertices of a single triangle. | ||
The vertices of triangle <code>i</code> (starting with 0 for the first triangle) are given by elements <code>3*i</code>, <code>3*i+1</code> and <code>3*i+2</code>. | |||
To represent <code>n</code> triangles the list must therefore contain <code>3*n</code> elements. | To represent <code>n</code> triangles the list must therefore contain <code>3*n</code> elements. | ||
Line 432: | Line 435: | ||
The Triangle Strips object type also represents triangles, but in a more compact form. Any three succeeding elements in the list represent a triangle. | The Triangle Strips object type also represents triangles, but in a more compact form. Any three succeeding elements in the list represent a triangle. | ||
The vertices of triangle <code>i</code> (starting with 0 for the first triangle) are given by elements <code>i</code>, <code>i+1</code> and <code>i+2</code>. | |||
In order to represent <code>n</code> triangles the list must therefore contain <code>n+2</code> elements. | In order to represent <code>n</code> triangles the list must therefore contain <code>n+2</code> elements. | ||
Line 438: | Line 442: | ||
Triangle Fans are similar to Triangle Strips. | Triangle Fans are similar to Triangle Strips. | ||
However, in case of triangle fans, all triangles share the first element and the other two triangle vertices are provided in pairs of elements, representing a fan of triangles around a single vertex. | However, in case of triangle fans, all triangles share the first element and the other two triangle vertices are provided in pairs of elements, representing a fan of triangles around a single vertex. | ||
To represent <code>n</code> triangles the list must therefore contain <code> | The vertices of triangle <code>i</code> (starting with 0 for the first triangle) are given by elements <code>0</code>, <code>i+1</code> and <code>i+2</code>. | ||
To represent <code>n</code> triangles the list must therefore contain <code>n+2</code> elements, similar to triangle strips. | |||
{{Terra}} | {{Terra}} | ||
[[Category:Scenery enhancement]] | [[Category:Scenery enhancement]] |
edits