Vuo  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Enumerations | Functions
VuoMeshUtility.cc File Reference

Description

VuoMeshUtility implementation.

Macros

#define PI   3.14159265359
 Constant providing the ratio of a circle's circumference to its diameter.
 

Enumerations

enum  Plane {
  PlaneX, PlaneY, PlaneZ, PlaneNegX,
  PlaneNegY, PlaneNegZ
}
 Defines a direction on the X, Y, or Z axis (and their negated direction). More...
 

Functions

static VuoPoint4d VuoPoint4d_min (const VuoPoint4d lhs, const VuoPoint4d rhs)
 Returns component-wise min, ignoring W.
 
static VuoPoint4d VuoPoint4d_max (const VuoPoint4d lhs, const VuoPoint4d rhs)
 Returns component-wise max, ignoring W.
 
void VuoMeshUtility_calculateNormals (VuoSubmesh *submesh)
 Calculates the normal for each vertex in this submesh.
 
void VuoMeshUtility_calculateTangents (VuoSubmesh *submesh)
 Calculates tangents and bitangents for a mesh given vertices, textures, normals, and triangles.
 
bool VuoMeshUtility_bounds (const VuoSubmesh mesh, VuoPoint4d *min, VuoPoint4d *max)
 Get the bounds of a submesh.
 
void VuoMeshUtility_calculateSphericalUVs (VuoSubmesh *submesh)
 Generate UVs by calculating each vertex position as projected onto a bounding sphere.
 
Plane VuoMeshUtility_calculateBestPlane (VuoPoint4d normal)
 Returns the plane with the axis most similar to normal.
 
static VuoPoint4d VuoMeshUtility_averageNormal (VuoPoint4d a, VuoPoint4d b, VuoPoint4d c)
 Averages the x, y, z components of points a, b, c.
 
void VuoMeshUtility_calculateCubicUVs (VuoSubmesh *submesh)
 Generate cubic UVs for this submesh.
 
void VuoMeshUtility_calculateCubicUVsPerTriangle (VuoSubmesh *submesh)
 Generate cubic UVs for this submesh, using the triangle normal to project UV instead of vertex normal.
 
static float dot (const VuoPoint4d lhs, const VuoPoint4d rhs)
 Dot product of XYZ values in 4d points.
 
static bool VuoPoint4d_equals (const VuoPoint4d a, const VuoPoint4d b)
 Returns true if a is equal to b within a tolerance of a very small value.
 
void VuoMeshUtility_insertSeam (VuoSubmesh *submesh)
 Inserts a seam on a submesh.
 
static int compare (const void *lhs, const void *rhs)
 Compare function for triangle ordering qsort in removeUnusedVertices.
 
void VuoMeshUtility_removeUnusedVertices (VuoSubmesh *mesh)
 Removes unused vertices from a mesh.
 

Macro Definition Documentation

#define PI   3.14159265359

Constant providing the ratio of a circle's circumference to its diameter.

Enumeration Type Documentation

enum Plane

Defines a direction on the X, Y, or Z axis (and their negated direction).

Function Documentation

static int compare ( const void *  lhs,
const void *  rhs 
)
static

Compare function for triangle ordering qsort in removeUnusedVertices.

static float dot ( const VuoPoint4d  lhs,
const VuoPoint4d  rhs 
)
static

Dot product of XYZ values in 4d points.

static VuoPoint4d VuoMeshUtility_averageNormal ( VuoPoint4d  a,
VuoPoint4d  b,
VuoPoint4d  c 
)
inlinestatic

Averages the x, y, z components of points a, b, c.

bool VuoMeshUtility_bounds ( const VuoSubmesh  mesh,
VuoPoint4d min,
VuoPoint4d max 
)

Get the bounds of a submesh.

Plane VuoMeshUtility_calculateBestPlane ( VuoPoint4d  normal)

Returns the plane with the axis most similar to normal.

Ex: { .2, .1, .9 } returns PlaneZ.

void VuoMeshUtility_calculateCubicUVs ( VuoSubmesh submesh)

Generate cubic UVs for this submesh.

Works best with IndividualTriangles meshes where no vertex is shared between triangles.

void VuoMeshUtility_calculateCubicUVsPerTriangle ( VuoSubmesh submesh)

Generate cubic UVs for this submesh, using the triangle normal to project UV instead of vertex normal.

void VuoMeshUtility_calculateNormals ( VuoSubmesh submesh)

Calculates the normal for each vertex in this submesh.

Generate normals for this submesh.

Vertices pointed at by multiple element indices will be averaged.

void VuoMeshUtility_calculateSphericalUVs ( VuoSubmesh submesh)

Generate UVs by calculating each vertex position as projected onto a bounding sphere.

Generate spherical UVs for this submesh.

http://en.wikipedia.org/wiki/UV_mapping

void VuoMeshUtility_calculateTangents ( VuoSubmesh submesh)

Calculates tangents and bitangents for a mesh given vertices, textures, normals, and triangles.

Generate tangents and bitangents for this submesh.

Assumes triangles are wound using VuoMesh_IndividualTriangles, and that the positions, textures, normals, and triangles arrays are valid. Lengyel, Eric. “Computing Tangent Space Basis Vectors for an Arbitrary Mesh”. Terathon Software 3D Graphics Library, 2001. http://www.terathon.com/code/tangent.html

void VuoMeshUtility_insertSeam ( VuoSubmesh submesh)

Inserts a seam on a submesh.

Inserts a seam along a vertical line on the left side of a mesh.

May (probably will) leave unused vertices.

void VuoMeshUtility_removeUnusedVertices ( VuoSubmesh mesh)

Removes unused vertices from a mesh.

Remove unused vertices in a mesh.

static bool VuoPoint4d_equals ( const VuoPoint4d  a,
const VuoPoint4d  b 
)
static

Returns true if a is equal to b within a tolerance of a very small value.

static VuoPoint4d VuoPoint4d_max ( const VuoPoint4d  lhs,
const VuoPoint4d  rhs 
)
inlinestatic

Returns component-wise max, ignoring W.

static VuoPoint4d VuoPoint4d_min ( const VuoPoint4d  lhs,
const VuoPoint4d  rhs 
)
inlinestatic

Returns component-wise min, ignoring W.