Vuo  0.4.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Enumerations | Functions
VuoVertices

Description

Vertices representing a 3D object.

Classes

struct  VuoVertices
 Vertices representing a 3D object. More...
 

Enumerations

enum  VuoVertices_ElementAssemblyMethod { VuoVertices_IndividualTriangles, VuoVertices_TriangleStrip, VuoVertices_TriangleFan }
 The way in which an elements array should be interpreted during rasterization. More...
 

Functions

VuoVertices_ElementAssemblyMethod VuoVertices_elementAssemblyMethodFromCString (const char *elementAssemblyMethodString)
 Returns the VuoVertices_ElementAssemblyMethod corresponding with the string elementAssemblyMethodString.
 
const char * VuoVertices_cStringForElementAssemblyMethod (VuoVertices_ElementAssemblyMethod elementAssemblyMethod)
 Returns a string constant representing elementAssemblyMethod.
 
VuoVertices VuoVertices_valueFromString (const char *initializer)
 Parses initializer, a mesh represented as a JSON C string, and returns a VuoVertices structure.
 
char * VuoVertices_stringFromValue (const VuoVertices value)
 Returns a JSON string representing the specified mesh, in the same format as typeInitWithValue.
 
char * VuoVertices_summaryFromValue (const VuoVertices value)
 A brief summary of the contents of this mesh.
 
void VuoVertices_retain (const VuoVertices v)
 Retains memory allocated for this mesh.
 
void VuoVertices_release (const VuoVertices v)
 Releases memory allocated for this mesh.
 
VuoVertices VuoVertices_getQuad (void)
 Returns a quad with dimensions 1x1, centered at the origin.
 

Class Documentation

struct VuoVertices
Class Members
VuoPoint4d * bitangents Vertex bitangents.
VuoVertices_ElementAssemblyMethod elementAssemblyMethod The way in which the elements array should be interpreted during rasterization.
unsigned int elementCount Number of elements in elements.
unsigned int * elements An array of size elementCount of integer elements (triangle indices) which are indexes into positions.

(Requires conversion to i16 for OpenGL ES unless GL_OES_element_index_uint.)

VuoPoint4d * normals Vertex normals.
VuoPoint4d * positions XYZW vertex positions.
VuoPoint4d * tangents Vertex tangents.
VuoPoint4d * textureCoordinates STRQ texture coordinates.
unsigned int vertexCount Number of vertices in positions, normals, and textureCoordinates.

Enumeration Type Documentation

The way in which an elements array should be interpreted during rasterization.

Enumerator
VuoVertices_IndividualTriangles 

GL_TRIANGLES, requires elementCount % 3 == 0.

VuoVertices_TriangleStrip 

GL_TRIANGLE_STRIP, requires elementCount >= 3.

VuoVertices_TriangleFan 

GL_TRIANGLE_FAN, requires elementCount >= 3.

Function Documentation

VuoVertices_ElementAssemblyMethod VuoVertices_elementAssemblyMethodFromCString ( const char *  elementAssemblyMethodString)

Returns the VuoVertices_ElementAssemblyMethod corresponding with the string elementAssemblyMethodString.

If none matches, returns VuoVertices_IndividualTriangles.

void VuoVertices_release ( const VuoVertices  v)

Releases memory allocated for this mesh.

void VuoVertices_retain ( const VuoVertices  v)

Retains memory allocated for this mesh.

char * VuoVertices_summaryFromValue ( const VuoVertices  value)

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)
VuoVertices VuoVertices_valueFromString ( const char *  initializer)

Parses initializer, a mesh represented as a JSON C string, and returns a VuoVertices structure.

Parameters
initializerA JSON string containing:
  • a positions array
  • an optional normals array
  • an optional tangents array
  • an optional bitangents array
  • an optional textureCoordinates array
  • an elementAssemblyMethod ("IndividualTriangles", "TriangleStrip", or "TriangleFan")
  • 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
]
}