Displays an image on a sphere.
Changes from version 1:
-increased speed (around 2x)
-now writes a function into slot 2 instead of using a FOR loop
-removed quality setting since it's faster to just use a smaller size and SPSCALE it up.
Instructions:
1: load map image using LOADMAP:
DIM MAP%[0,0]
MAP%=LOADMAP(file,u,v,width,height)
u: image X start
v: image Y start
width: image width
height: image height
(like SPSET)
2: generate sphere function:
SPHERESETUP radius,width,height,precision
radius: radius of sphere to draw
width: image width
height: image height
precision: angle precision (number of decimal places to keep in the angle value. Higher values can take longer to load initially, and might exceed the maximum program size)
3: draw sphere
DIM OUT%[radius*2-1,radius*2-1]
SPHERE angle,MAP%,OUT%
GLOAD x,y,radius*2-1,radius*2-1,OUT%,TRUE,FALSE
angle: angle to display the sphere at (must be between 0 and 1)