![]() |
OpenGL ES SDK for Android
ARM Developer Center
|
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... | |
Functions for generating torus shapes.
Definition at line 31 of file TorusModel.h.
|
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.
[in] | patchDimension | Number of control points in one dimension for a patch. |
[in] | patchInstancesCount | Number of instances needed to draw the whole torus. |
[in] | controlPointsIndicesCount | Number of indices needed to create a control mesh. |
[out] | controlPointsIndices | Deref will be used to store control points indices. Cannot be null. |
Definition at line 58 of file TorusModel.cpp.
|
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.
[in] | patchDimension | Number of control points in one dimension for a patch. |
[in] | patchInstancesCount | Number of instances needed to draw the whole torus. |
[in] | controlPointsIndicesCount | Number of indices needed to create a control mesh. |
[out] | controlPointsIndices | Deref will be used to store control points indices. Cannot be null. |
|
static |
Determines patch data for an instanced torus model.
[in] | patchDensity | Number of vertices in one edge of a patch. |
[out] | patchVertices | Deref will be used to store patch vertices. Cannot be null. |
[out] | patchTriangleIndices | Deref will be used to store indices of triangle vertices. Cannot be null. |
Definition at line 125 of file TorusModel.cpp.
|
static |
Determines patch data for an instanced torus model.
[in] | patchDensity | Number of vertices in one edge of a patch. |
[out] | patchVertices | Deref will be used to store patch vertices. Cannot be null. |
[out] | patchTriangleIndices | Deref will be used to store indices of triangle vertices. Cannot be null. |
|
static |
Determines indices for DrawElements() call for shaded torus drawn in triangle strip mode.
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | indices | Deref will be used to store calculated indices. |
|
static |
Determines indices for DrawElements() call for shaded torus drawn in triangle strip mode.
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | indices | Deref will be used to store calculated indices. |
Definition at line 268 of file TorusModel.cpp.
|
static |
Determines indices for glDrawElements() call for wireframed torus.
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | indices | Deref will be used to store calculated indices. |
|
static |
Determines indices for glDrawElements() call for wireframed torus.
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | indices | Deref will be used to store calculated indices. |
Definition at line 196 of file TorusModel.cpp.
|
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.
[in] | torusRadius | Distance between the center of torus and the center of its tube. |
[in] | circleRadius | Radius of circles that model the tube. |
[out] | vertices | Deref will be used to sotre generated vertices. Cannot be null. |
|
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.
[in] | torusRadius | Distance between the center of torus and the center of its tube. |
[in] | circleRadius | Radius of circles that model the tube. |
[out] | vertices | Deref will be used to sotre generated vertices. Cannot be null. |
Definition at line 315 of file TorusModel.cpp.
|
static |
Generates torus's normal vectors.
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | normals | Deref will be used to store normal vectors. |
Definition at line 30 of file TorusModel.cpp.
|
static |
Generates torus's normal vectors.
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | normals | Deref will be used to store normal vectors. |
|
static |
Generate vertices of the torus model.
The vertices are grouped in circlesCount circles, where each circle consists of pointsPerCircleCount vertices.
[in] | torusRadius | Distance between the center of torus and the center of its tube. |
[in] | circleRadius | Radius of circles that model the tube. |
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | vertices | Deref will be used to store generated vertices. Cannot be null. |
Definition at line 234 of file TorusModel.cpp.
|
static |
Generate vertices of the torus model.
The vertices are grouped in circlesCount circles, where each circle consists of pointsPerCircleCount vertices.
[in] | torusRadius | Distance between the center of torus and the center of its tube. |
[in] | circleRadius | Radius of circles that model the tube. |
[in] | circlesCount | Number of circles in torus model. |
[in] | pointsPerCircleCount | Number of points in one circle. |
[out] | vertices | Deref will be used to store generated vertices. Cannot be null. |