OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaliSDK::TorusModel Class Reference

Functions for generating torus shapes. More...

#include <TorusModel.h>

Static Public Member Functions

static void generateNormals (unsigned int circlesCount, unsigned int pointsPerCircleCount, float *normals)
 Generates torus's normal vectors. More...
 
static void calculateTriangleStripIndices (unsigned int circlesCount, unsigned int pointsPerCircleCount, unsigned int *indices)
 Determines indices for DrawElements() call for shaded torus drawn in triangle strip mode. More...
 
static void generateVertices (float torusRadius, float circleRadius, unsigned int circlesCount, unsigned int pointsPerCircleCount, float *vertices)
 Generate vertices of the torus model. More...
 
static void calculateControlPointsIndices (unsigned int patchDimension, unsigned int patchInstancesCount, unsigned int controlPointsIndicesCount, unsigned int *controlPointsIndices)
 Determines an array of indices defining a mesh of control points for instanced torus patches. More...
 
static void calculatePatchData (unsigned int patchDensity, float *patchVertices, unsigned int *patchTriangleIndices)
 Determines patch data for an instanced torus model. More...
 
static void calculateWireframeIndices (unsigned int circlesCount, unsigned int pointsPerCircleCount, unsigned int *indices)
 Determines indices for glDrawElements() call for wireframed torus. More...
 
static void generateBezierVertices (float torusRadius, float circleRadius, float *vertices)
 Generate torus vertices applying distortions to some of them. More...
 
static void generateNormals (unsigned int circlesCount, unsigned int pointsPerCircleCount, float *normals)
 Generates torus's normal vectors. More...
 
static void calculateTriangleStripIndices (unsigned int circlesCount, unsigned int pointsPerCircleCount, unsigned int *indices)
 Determines indices for DrawElements() call for shaded torus drawn in triangle strip mode. More...
 
static void generateVertices (float torusRadius, float circleRadius, unsigned int circlesCount, unsigned int pointsPerCircleCount, float *vertices)
 Generate vertices of the torus model. More...
 
static void calculateControlPointsIndices (unsigned int patchDimension, unsigned int patchInstancesCount, unsigned int controlPointsIndicesCount, unsigned int *controlPointsIndices)
 Determines an array of indices defining a mesh of control points for instanced torus patches. More...
 
static void calculatePatchData (unsigned int patchDensity, float *patchVertices, unsigned int *patchTriangleIndices)
 Determines patch data for an instanced torus model. More...
 
static void calculateWireframeIndices (unsigned int circlesCount, unsigned int pointsPerCircleCount, unsigned int *indices)
 Determines indices for glDrawElements() call for wireframed torus. More...
 
static void generateBezierVertices (float torusRadius, float circleRadius, float *vertices)
 Generate torus vertices applying distortions to some of them. More...
 

Detailed Description

Functions for generating torus shapes.

Definition at line 31 of file TorusModel.h.

Member Function Documentation

void MaliSDK::TorusModel::calculateControlPointsIndices ( unsigned int  patchDimension,
unsigned int  patchInstancesCount,
unsigned int  controlPointsIndicesCount,
unsigned int controlPointsIndices 
)
static

Determines an array of indices defining a mesh of control points for instanced torus patches.

To simplify mathemathics, it is assumed that torus model consists of 12 circles, each built of 12 points, so it is easy to divide each circle into 4 quadrants and define Bezier surfaces approximating perfectly round torus.

Parameters
[in]patchDimensionNumber of control points in one dimension for a patch.
[in]patchInstancesCountNumber of instances needed to draw the whole torus.
[in]controlPointsIndicesCountNumber of indices needed to create a control mesh.
[out]controlPointsIndicesDeref will be used to store control points indices. Cannot be null.

Definition at line 58 of file TorusModel.cpp.

static void MaliSDK::TorusModel::calculateControlPointsIndices ( unsigned int  patchDimension,
unsigned int  patchInstancesCount,
unsigned int  controlPointsIndicesCount,
unsigned int controlPointsIndices 
)
static

Determines an array of indices defining a mesh of control points for instanced torus patches.

To simplify mathemathics, it is assumed that torus model consists of 12 circles, each built of 12 points, so it is easy to divide each circle into 4 quadrants and define Bezier surfaces approximating perfectly round torus.

Parameters
[in]patchDimensionNumber of control points in one dimension for a patch.
[in]patchInstancesCountNumber of instances needed to draw the whole torus.
[in]controlPointsIndicesCountNumber of indices needed to create a control mesh.
[out]controlPointsIndicesDeref will be used to store control points indices. Cannot be null.
void MaliSDK::TorusModel::calculatePatchData ( unsigned int  patchDensity,
float patchVertices,
unsigned int patchTriangleIndices 
)
static

Determines patch data for an instanced torus model.

Parameters
[in]patchDensityNumber of vertices in one edge of a patch.
[out]patchVerticesDeref will be used to store patch vertices. Cannot be null.
[out]patchTriangleIndicesDeref will be used to store indices of triangle vertices. Cannot be null.

Definition at line 125 of file TorusModel.cpp.

static void MaliSDK::TorusModel::calculatePatchData ( unsigned int  patchDensity,
float patchVertices,
unsigned int patchTriangleIndices 
)
static

Determines patch data for an instanced torus model.

Parameters
[in]patchDensityNumber of vertices in one edge of a patch.
[out]patchVerticesDeref will be used to store patch vertices. Cannot be null.
[out]patchTriangleIndicesDeref will be used to store indices of triangle vertices. Cannot be null.
static void MaliSDK::TorusModel::calculateTriangleStripIndices ( unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
unsigned int indices 
)
static

Determines indices for DrawElements() call for shaded torus drawn in triangle strip mode.

Parameters
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]indicesDeref will be used to store calculated indices.
void MaliSDK::TorusModel::calculateTriangleStripIndices ( unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
unsigned int indices 
)
static

Determines indices for DrawElements() call for shaded torus drawn in triangle strip mode.

Parameters
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]indicesDeref will be used to store calculated indices.

Definition at line 268 of file TorusModel.cpp.

static void MaliSDK::TorusModel::calculateWireframeIndices ( unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
unsigned int indices 
)
static

Determines indices for glDrawElements() call for wireframed torus.

Parameters
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]indicesDeref will be used to store calculated indices.
void MaliSDK::TorusModel::calculateWireframeIndices ( unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
unsigned int indices 
)
static

Determines indices for glDrawElements() call for wireframed torus.

Parameters
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]indicesDeref will be used to store calculated indices.

Definition at line 196 of file TorusModel.cpp.

static void MaliSDK::TorusModel::generateBezierVertices ( float  torusRadius,
float  circleRadius,
float vertices 
)
static

Generate torus vertices applying distortions to some of them.

The distortions in control mesh are needed for proper construction of Bezier surface patches. It is assumed that each patch consists of 4 control rows and columns. Hence, in each column and each row, we can distinguish 2 middle control points and 2 edge control points, which are shared between patches. The middle control points have to be moved in such a way that C1 continuity between patches is satisfied. Implemented algorithm assumes that each construction circle contains 12 points and the torus model consists of 12 circles.

Parameters
[in]torusRadiusDistance between the center of torus and the center of its tube.
[in]circleRadiusRadius of circles that model the tube.
[out]verticesDeref will be used to sotre generated vertices. Cannot be null.
void MaliSDK::TorusModel::generateBezierVertices ( float  torusRadius,
float  circleRadius,
float vertices 
)
static

Generate torus vertices applying distortions to some of them.

The distortions in control mesh are needed for proper construction of Bezier surface patches. It is assumed that each patch consists of 4 control rows and columns. Hence, in each column and each row, we can distinguish 2 middle control points and 2 edge control points, which are shared between patches. The middle control points have to be moved in such a way that C1 continuity between patches is satisfied. Implemented algorithm assumes that each construction circle contains 12 points and the torus model consists of 12 circles.

Parameters
[in]torusRadiusDistance between the center of torus and the center of its tube.
[in]circleRadiusRadius of circles that model the tube.
[out]verticesDeref will be used to sotre generated vertices. Cannot be null.

Definition at line 315 of file TorusModel.cpp.

void MaliSDK::TorusModel::generateNormals ( unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
float normals 
)
static

Generates torus's normal vectors.

Parameters
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]normalsDeref will be used to store normal vectors.

Definition at line 30 of file TorusModel.cpp.

static void MaliSDK::TorusModel::generateNormals ( unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
float normals 
)
static

Generates torus's normal vectors.

Parameters
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]normalsDeref will be used to store normal vectors.
void MaliSDK::TorusModel::generateVertices ( float  torusRadius,
float  circleRadius,
unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
float vertices 
)
static

Generate vertices of the torus model.

The vertices are grouped in circlesCount circles, where each circle consists of pointsPerCircleCount vertices.

Parameters
[in]torusRadiusDistance between the center of torus and the center of its tube.
[in]circleRadiusRadius of circles that model the tube.
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]verticesDeref will be used to store generated vertices. Cannot be null.

Definition at line 234 of file TorusModel.cpp.

static void MaliSDK::TorusModel::generateVertices ( float  torusRadius,
float  circleRadius,
unsigned int  circlesCount,
unsigned int  pointsPerCircleCount,
float vertices 
)
static

Generate vertices of the torus model.

The vertices are grouped in circlesCount circles, where each circle consists of pointsPerCircleCount vertices.

Parameters
[in]torusRadiusDistance between the center of torus and the center of its tube.
[in]circleRadiusRadius of circles that model the tube.
[in]circlesCountNumber of circles in torus model.
[in]pointsPerCircleCountNumber of points in one circle.
[out]verticesDeref will be used to store generated vertices. Cannot be null.

The documentation for this class was generated from the following files: