RasterCore
Ready to execute

Hardware Heritage

The Rotozoomer is a masterclass in coordinate transformation. By applying a rotation and scaling matrix to every pixel's texture lookup, programmers could spin and zoom a background plane in real-time. On systems without a GPU, this required a clever "incremental" approach to avoid expensive per-pixel matrix multiplications.

PC Optimization

The Rotozoomer was the ultimate PC flex. By using fixed-point math and incremental steps (du/dx, dv/dx), programmers could rotate a texture on a 386 without any floating-point math.

Amiga Limits

Amigas lacked a linear framebuffer, making arbitrary texture rotation very slow. Amiga coders often used pre-calculated animation frames to achieve similar looks.

Matrix Math

Modern GPUs use 2x2 rotation matrices per fragment. This eliminates the "incremental error" that plagued older software-based rotozoomers over time.

Rotozoomer

Spinning and scaling planes with pure integer math.

Legacy C (PC)

fixed u = startU, v = startV;
for(int x=0; x < 320; x++) {
  // Use bit-shifts for decimals
  int pixel = texture[(u>>16)&255][(v>>16)&255];
  VGA_MEM[ptr++] = pixel;
  u += du_dx; // du_dx = cos(angle) * zoom
  v += dv_dx; // dv_dx = sin(angle) * zoom
}

Modern GLSL

mat2 m = mat2(cos(a), -sin(a), sin(a), cos(a));
uv = m * (uv - 0.5) * zoom + 0.5;
vec3 col = texture(tex, uv).rgb;