Timendus wrote:
Yeah, it's huge, but very cool none the less

The lens is my favourite too. How exactely does that work..?
Very simply, and can easily be altered to change the effect. Each pixel of the area the lens is over is put through a transformation table. Like the tunnel, this is precomputed. The lens is 32x32 pixels, so the transformation table is 32x32 elements. Each element has an X and a Y, so the most basic transformation table would be:
Code:
.for y, 0, 31
.for x, 0, 31
.db x, y
.loop
.loop
This is a "neutral" table, as each pixel coordinate gets transformed back into the same coordinate.
Code:
.for y, 0, 31
.for x, 0, 31
.db x/2, y/2
.loop
.loop
This one would "zoom" the area under the lens by two - for example, the point (16,16) of the lens would map to position ( 8,8 ) of the old area under the lens.
Code:
.for y, 0, 31
.for x, 0, 31
.db 31-x, y
.loop
.loop
This would flip the image in the y-axis under the lens.
A sort of pseudo-code would be:
Code:
transform[32][32] ; transformation table
lens_x = 10 ; \_ position of lens
lens_y = 10 ; /
old_area[32][32]; old area under the lens
; Copy the area under the lens to a temporary buffer
for x = 0 to 31
for y = 0 to 31
old_area[x][y] = get_pixel(lens_x+x, lens_y+y)
next y
next x
; Redraw the lens, applying the transformation:
for x = 0 to 31
for y = 0 to 31
set_pixel(lens_x+x, lens_y+y) = old_area[transform[x][y].x][transform[x][y].y]
next y
next x
To get the correct lens transformation table, I cheated - making a 32x32 bitmap where each pixel was a different colour, blowing it up to 3200x3200, running two "spherize" transformations in Photoshop, then dropping back to 32x32. I could then work out where each of my individually-coloured pixels had gone to, and built the table out of that.
EDIT: Reading this back, the explanation sucks. Er...