int sintabsize = 2048; int sintab[] = new int[sintabsize]; void setup() { size(320,240); for (int i=0; i> 8) & 0xFF; int cy = (ray_position_y >> 8) & 0xFF; int cz = (ray_position_z >> 8) & 0xFF; i += cx ^ ((cy ^ cz) + shift); ray_position_x += ray_direction_x; ray_position_y += ray_direction_y; ray_position_z += ray_direction_z; } i = i >> 7; int d = 1; if ( y < 32 ) d = (8 - (y / 4)); if ( y > 208 ) d = ((y - 204) / 4); pixels[ y * 320 + x ] = color(i / d); } } updatePixels(); }