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

Description

Vertices representing a 3D object.

Classes

struct  VuoVertices
 A 3d mesh. More...
 

Enumerations

enum  VuoVertices_ElementAssemblyMethod {
  VuoVertices_IndividualTriangles, VuoVertices_TriangleStrip, VuoVertices_TriangleFan, VuoVertices_IndividualLines,
  VuoVertices_LineStrip, VuoVertices_Points
}
 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_valueFromJson (json_object *js)
 Decodes the JSON object js to create a new value.
 
json_object * VuoVertices_jsonFromValue (const VuoVertices value)
 Encodes value as a JSON object.
 
char * VuoVertices_summaryFromValue (const VuoVertices value)
 A brief summary of the contents of this mesh.
 
VuoVertices VuoVertices_alloc (unsigned int vertexCount, unsigned int elementCount)
 Allocates and registers the vertex (position, normal, ...) and element arrays.
 
VuoVertices VuoVertices_getQuad (void)
 Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.
 
VuoVertices VuoVertices_getQuadWithoutNormals (void)
 Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.
 
VuoVertices VuoVertices_getEquilateralTriangle (void)
 Returns an equilateral triangle with bottom edge length 1, pointing upward on the XY plane, centered at the origin.
 
VuoVertices VuoVertices_makeFrom2dPoints (VuoList_VuoPoint2d positions, VuoVertices_ElementAssemblyMethod elementAssemblyMethod)
 Returns a VuoVertices consisting of the given positions and element assembly method.
 
VuoVertices VuoVertices_makeFrom3dPoints (VuoList_VuoPoint3d positions, VuoVertices_ElementAssemblyMethod elementAssemblyMethod)
 Returns a VuoVertices consisting of the given positions and element assembly method.
 
VuoVertices VuoVertices_valueFromString (const char *str)
 Automatically generated function.
 
char * VuoVertices_stringFromValue (const VuoVertices value)
 Automatically generated function.
 
void VuoVertices_retain (const VuoVertices v)
 Automatically generated function.
 
void VuoVertices_release (const VuoVertices v)
 Automatically generated function.
 

Class Documentation

struct VuoVertices
Class Members
VuoPoint4d * bitangents Vertex bitangents. May be NULL.
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. May be NULL.
VuoPoint4d * positions XYZW vertex positions.
Todo:
Change to VuoDictionary_VuoPoint4D vertexAttributes; once dictionaries exist: a string-keyed list of equal-size arrays of points (vertex attributes). Typically contains at least 'positions', 'normals', and 'textureCoordinates'.
VuoPoint4d * tangents Vertex tangents. May be NULL.
VuoPoint4d * textureCoordinates STRQ texture coordinates. May be NULL.
unsigned int vertexCount Number of vertices in positions, normals, tangents, bitangents, 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.

VuoVertices_IndividualLines 

GL_LINES, requires elementCount % 2 == 0.

VuoVertices_LineStrip 

GL_LINE_STRIP, requires elementCount >= 2.

VuoVertices_Points 

GL_POINTS.

Function Documentation

VuoVertices VuoVertices_alloc ( unsigned int  vertexCount,
unsigned int  elementCount 
)

Allocates and registers the vertex (position, normal, ...) and element arrays.

const char* VuoVertices_cStringForElementAssemblyMethod ( VuoVertices_ElementAssemblyMethod  elementAssemblyMethod)

Returns a string constant representing elementAssemblyMethod.

VuoVertices_ElementAssemblyMethod VuoVertices_elementAssemblyMethodFromCString ( const char *  elementAssemblyMethodString)

Returns the VuoVertices_ElementAssemblyMethod corresponding with the string elementAssemblyMethodString.

If none matches, returns VuoVertices_IndividualTriangles.

VuoVertices VuoVertices_getEquilateralTriangle ( void  )

Returns an equilateral triangle with bottom edge length 1, pointing upward on the XY plane, centered at the origin.

VuoVertices VuoVertices_getQuad ( void  )

Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.

VuoVertices VuoVertices_getQuadWithoutNormals ( void  )

Returns a quad with dimensions 1x1, on the XY plane, centered at the origin.

The quad consists of only positions and texture coordinates (without normals, tangents, or bitangents).

struct json_object * VuoVertices_jsonFromValue ( const VuoVertices  value)
read

Encodes value as a JSON object.

Todo:
create an interprocess-serializer with the commented-out function calls
VuoVertices VuoVertices_makeFrom2dPoints ( VuoList_VuoPoint2d  positions,
VuoVertices_ElementAssemblyMethod  elementAssemblyMethod 
)

Returns a VuoVertices consisting of the given positions and element assembly method.

Its normals, tangents, bitangents, and texture coordinates are all null.

VuoVertices VuoVertices_makeFrom3dPoints ( VuoList_VuoPoint3d  positions,
VuoVertices_ElementAssemblyMethod  elementAssemblyMethod 
)

Returns a VuoVertices consisting of the given positions and element assembly method.

Its normals, tangents, bitangents, and texture coordinates are all null.

void VuoVertices_release ( const VuoVertices  v)

Automatically generated function.

void VuoVertices_retain ( const VuoVertices  v)

Automatically generated function.

char* VuoVertices_stringFromValue ( const VuoVertices  value)

Automatically generated function.

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)
Todo:
Report if value.elementCount isn't a multiple of 3.
VuoVertices VuoVertices_valueFromJson ( json_object *  js)

Decodes the JSON object js to create a new value.

Parameters
jsA JSON object containing:
  • a positions array
  • an optional normals array
  • an optional tangents array
  • an optional bitangents array
  • an optional textureCoordinates array
  • an elementAssemblyMethod
  • an array of element indexes into the vertex array.

For efficiency, the arrays may have been serialized as pointers to C arrays. In that case, values for vertexCount and elementCount are required.

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
]
}
VuoVertices VuoVertices_valueFromString ( const char *  str)

Automatically generated function.