I've been looking at this reference of distance functions trying to understand how they work:
http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
They are so compact I can barely understand them though. I have a sphere and cube working correctly, but they are aligned with the world grid (not rotated at all, although in the case of the sphere it doesn't matter obviously). The domain operation for rotation uses something called an invert() function. Does anyone know what this is? Does Processing have something like this if so? It also uses something called a primitive() function, no idea what that is either.
EDIT: Maybe primitive() is any one of the functions listed at the top, not something built in? If someone math knowledgeable could confirm this that would be great.
1