This planet has a slice taken out of it.
It uses a very simple ray-caster to compute a deformation of the sphere onto three planes. This has a benefit that we can take normal vectors from the planes, saving us the cost of computing normals for the entire deformed surface. It also has the benefit that as the ray-caster gains more geometries, it will be possible to project surfaces onto those geometries as well.
The ray caster will also be used to implement collision detection for projectiles and beams.
So the first working version of the Roguestar Animation and Graphics Library is almost ready (but not in darcs yet).
One of the chief goals of RSAGL is a modeling language and model optimizer. You can see the results in this image:
This image consists of three surfaces: two spheres and one disk with a hole. The moon in the background is modeled with visibly few polygons, being small, while the nearby planet is rendered at a high detail. The ring (which is unrealistically too close to the planet) is deformed using a sine wave.
Here’s another image with the same number of total vertices but the optimizer turned off. The moon actually looks better:
(++) is basically `mappend`.
(.) is basically `fmap`.
I’m told that (++) originally was `mappend`, but it was specialized to avoid confusing the newbies. I’m not going to waste bytes arguing with consensus formed before I knew the language existed, but I disagree.