OpenGL ES SDK for Android
ARM Developer Center
|
Functions for generating sphere shapes. More...
#include <SphereModel.h>
Static Public Member Functions | |
static void | getTriangleRepresentation (const float radius, const int numberOfSamples, int *numberOfCoordinates, float **coordinates) |
Create triangular representation of a sphere. More... | |
static void | getTriangleRepresentation (const float radius, const int numberOfSamples, int *numberOfCoordinates, int *numberOfPoints, float **coordinates) |
Create triangular representation of a sphere. More... | |
Static Private Member Functions | |
static void | getPointRepresentation (const float radius, const int numberOfSamples, int *numberOfCoordinates, float **coordinates) |
Compute coordinates of points which make up a sphere. More... | |
static void | getPointRepresentation (const float radius, const int numberOfSamples, int *numberOfCoordinates, float **coordinates) |
Compute coordinates of points which make up a sphere. More... | |
Functions for generating sphere shapes.
Definition at line 31 of file SphereModel.h.
|
staticprivate |
Compute coordinates of points which make up a sphere.
[in] | radius | Radius of a sphere. Has to be greater than zero. |
[in] | numberOfSamples | Sphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero. |
[out] | numberOfCoordinates | Number of generated coordinates. |
[out] | coordinates | Deref will be used to store generated coordinates. Cannot be null. |
|
staticprivate |
Compute coordinates of points which make up a sphere.
[in] | radius | Radius of a sphere. Has to be greater than zero. |
[in] | numberOfSamples | Sphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero. |
[out] | numberOfCoordinates | Number of generated coordinates. |
[out] | coordinates | Deref will be used to store generated coordinates. Cannot be null. |
Definition at line 31 of file SphereModel.cpp.
|
static |
Create triangular representation of a sphere.
For each point of each circle (excluding last circle) there are two triangles created according to rule described in example below:
A2___________.B2 . \ . / | |. \ . / | | . A1____B1 | | . | |. | | D1____C1 . | | / . \ .| | / . \ . D2 .___________C2
Points named A1, B1, C1 and D1 create a first circle of sphere and points named A2, B2, C2 and D2 create the second one (if numberOfSamples is equal to 4). For each loop iteration, for each point lying at one circle of sphere there are 2 triangles created: for point A1: A1 B1 B2, A1 B2 A2 for point B1: B1 C1 C2, B1 C2 B2 for point C1: C1 D1 D2, C1 D2 C2 for point D1: D1 A1 A2, D1 A2 D2
[in] | radius | Radius of a sphere. Has to be greater than zero. |
[in] | numberOfSamples | A sphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero. |
[out] | numberOfCoordinates | Number of generated coordinates. |
[out] | numberOfPoints | Number of generated points. |
[out] | coordinates | Deref will be used to store generated coordinates. Cannot be null. |
Definition at line 132 of file SphereModel.cpp.
|
static |
Create triangular representation of a sphere.
For each point of each circle (excluding last circle) there are two triangles created according to rule described in example below:
A2___________.B2 . \ . / | |. \ . / | | . A1____B1 | | . | |. | | D1____C1 . | | / . \ .| | / . \ . D2 .___________C2
Points named A1, B1, C1 and D1 create a first circle of sphere and points named A2, B2, C2 and D2 create the second one (if numberOfSamples is equal to 4). For each loop iteration, for each point lying at one circle of sphere there are 2 triangles created: for point A1: A1 B1 B2, A1 B2 A2 for point B1: B1 C1 C2, B1 C2 B2 for point C1: C1 D1 D2, C1 D2 C2 for point D1: D1 A1 A2, D1 A2 D2
[in] | radius | Radius of a sphere. Has to be greater than zero. |
[in] | numberOfSamples | A sphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero. |
[out] | numberOfCoordinates | Number of generated coordinates. |
[out] | coordinates | Deref will be used to store generated coordinates. Cannot be null. |
Definition at line 133 of file SphereModel.cpp.