Hacker News new | ask | show | jobs
by kragen 887 days ago
sharlin has explained how the sphere coordinates are computed; the checkerboard plane is implemented by converting downward-pointing vectors (where the y-component v is negative) into upward-pointing vectors toward a point in the sky with the right color

    IF V < 0 then P = (Y + 2)/V : V = -V*((INT(X - U*P) + INT(Z - W*P) AND 1)/2 + .3) + .2
then the (palette index of?) the color of the sky is computed from the square root of the y-coordinate of the direction vector as

    GCOL 0, 3 - (48*SQR V) DIV 16
plus a fixed dithering table