March 2017
Intermediate to advanced
480 pages
11h 3m
English
A sphere is the 3D version of a circle. It is defined by a 3D point in space and a radius. Like a circle in 2D, in 3D the sphere is considered to be one of the simplest shapes we can implement. The simplicity of a sphere makes it very fast for collision detection:

We are going to declare a new Sphere structure in the Geometry3D.h header file. This structure will hold a position and a radius.
Follow these steps to implement a 3D sphere:
Sphere structure in Geometry3D.h:typedef struct Sphere {Point position; float radius;
Read now
Unlock full access