Vertices representing a 3D object.
Class Members |
VuoSceneVertices_ElementAssemblyMethod |
elementAssemblyMethod |
The way in which the elements array should be interpreted during rasterization. |
unsigned long |
elementCount |
Number of elements in elements . |
unsigned long * |
elements |
An array of size elementCount of integer elements (triangle indices) which are indexes into positions . (Requires conversion to i16 for OpenGL ES.)
|
VuoPoint4d * |
normals |
Vertex normals. |
VuoPoint4d * |
positions |
XYZW vertex positions. |
VuoPoint4d * |
textureCoordinates |
STRQ texture coordinates. |
unsigned long |
vertexCount |
Number of vertices in positions , normals , and textureCoordinates . |
The way in which an elements
array should be interpreted during rasterization.
Enumerator |
---|
VuoSceneVertices_IndividualTriangles |
GL_TRIANGLES, requires elementCount % 3 == 0 .
|
VuoSceneVertices_TriangleStrip |
GL_TRIANGLE_STRIP, requires elementCount >= 3 .
|
VuoSceneVertices_TriangleFan |
GL_TRIANGLE_FAN, requires elementCount >= 3 .
|
Returns the VuoSceneVertices_ElementAssemblyMethod
corresponding with the string elementAssemblyMethodString
.
If none matches, returns VuoSceneVertices_IndividualTriangles.
A brief summary of the contents of this mesh.
- Example:
4 vertices in a fan of 2 triangles
with first position (0,0,0,0)
- Example:
8 vertices, 12 triangles
with first position (-0.5,-0.5,-0.5,0)
Parses initializer
, a mesh represented as a JSON C string, and returns a VuoSceneVertices
structure.
- Parameters
-
initializer | A JSON string containing an array of position vertices, an elementAssemblyMethod ("IndividualTriangles", "TriangleStrip", or "TriangleFan"), and an array of element indexes into the vertex array. |
- Example:
{
"positions": [
[-0.6, -0.5],
[ 0.5, -0.5],
[-0.5, 0.5],
[ 0.5, 0.5]
],
"elementAssemblyMethod": "TriangleFan",
"elements": [
0,
1,
2,
3
]
}