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

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...
 

Detailed Description

Functions for generating sphere shapes.

Definition at line 31 of file SphereModel.h.

Member Function Documentation

static void MaliSDK::SphereModel::getPointRepresentation ( const float  radius,
const int  numberOfSamples,
int numberOfCoordinates,
float **  coordinates 
)
staticprivate

Compute coordinates of points which make up a sphere.

Parameters
[in]radiusRadius of a sphere. Has to be greater than zero.
[in]numberOfSamplesSphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero.
[out]numberOfCoordinatesNumber of generated coordinates.
[out]coordinatesDeref will be used to store generated coordinates. Cannot be null.
void MaliSDK::SphereModel::getPointRepresentation ( const float  radius,
const int  numberOfSamples,
int numberOfCoordinates,
float **  coordinates 
)
staticprivate

Compute coordinates of points which make up a sphere.

Parameters
[in]radiusRadius of a sphere. Has to be greater than zero.
[in]numberOfSamplesSphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero.
[out]numberOfCoordinatesNumber of generated coordinates.
[out]coordinatesDeref will be used to store generated coordinates. Cannot be null.

Definition at line 31 of file SphereModel.cpp.

void MaliSDK::SphereModel::getTriangleRepresentation ( const float  radius,
const int  numberOfSamples,
int numberOfCoordinates,
int numberOfPoints,
float **  coordinates 
)
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

Parameters
[in]radiusRadius of a sphere. Has to be greater than zero.
[in]numberOfSamplesA sphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero.
[out]numberOfCoordinatesNumber of generated coordinates.
[out]numberOfPointsNumber of generated points.
[out]coordinatesDeref will be used to store generated coordinates. Cannot be null.

Definition at line 132 of file SphereModel.cpp.

void MaliSDK::SphereModel::getTriangleRepresentation ( const float  radius,
const int  numberOfSamples,
int numberOfCoordinates,
float **  coordinates 
)
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

Parameters
[in]radiusRadius of a sphere. Has to be greater than zero.
[in]numberOfSamplesA sphere consists of numberOfSamples circles and numberOfSamples points lying on one circle. Has to be greater than zero.
[out]numberOfCoordinatesNumber of generated coordinates.
[out]coordinatesDeref will be used to store generated coordinates. Cannot be null.

Definition at line 133 of file SphereModel.cpp.


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