Polarith AI
1.8

◆ CreateUvSphere()

static SpatialSensor CreateUvSphere ( int  segments,
int  rings,
float  radius 
)
static

Constructs a sensor shape such that its receptors resemble a UV sphere.

The Sphere is rotated such that the north pole is aligned with the global front vector (0, 0, 1).

Parameters
segmentsThe number of receptors in each ring (latitude). Note that there should be at least 4 segments to create a proper UV sphere.
ringsThe number of receptor rings (longitude). Note that there should be at least 1 ring to create a proper sphere.
radiusThe radius of the UV sphere.
Returns
The constructed UV sphere sensor.
Exceptions
OverflowExceptionIf segments * rings is less than 0.
ArgumentOutOfRangeExceptionIf either segments or rings is less than 0.
Imprint