For the sphere map, the math I used is the equation of a sphere: X^2 + Y^2 + Z^2 = R^2
solving this to Z: Z = SQRT(R^2 - X^2 - Y^2)
You can write it this way: Z = SQRT(R^2 - (X - ScreenWidth/2)^2 - (Y - ScreenHeight^2)) to translate the sphere calcs to the center of the screen.
R can be variable, depending in that the sphere is bigger or smaller, play with the values to find a good size.
Now, that equation gives a Z value for each (X,Y) pixel in the screen. That Z value by using a displacement functions gave the Xb, Yb of a bitmap according to real X, Y on screen. You read from the texture in Xb, Yb position to write in X, Y pixel position according to the following:
Xb = (X - ScreenWidth/2) / Z
Yb = (Y - ScreenHeight/2) / Z
iirc
Now, that's the math in few words. The trick for speed is to just calculate these displacements for each pixel in some buffer arrays, e.g. DIM SphereDispX[320*200] AS INTEGER and DIM SphereDispY[320*200] AS INTEGER for example and you can use the precalculated values now without calculating any slow math!
In a nutshell. If you have anything else maybe I'll be here to reply oneday..
p.s. The twirl is another effect I'd like to make. Aren't some of them done with voxels? Maybe I'll read the comments and think again about it. Maybe it's much easier than I thought..