screamyGuy
Barrel & Pincushion
A simple simulation of standard camera distortions. In Processing, the warping effect is achieved in the same way that one might distort the face of a comic transferred onto silly putty. The scene is rendered normally, and the image buffer is captured and mapped onto a uniform grid. Then, the uniform grid points are displaced by a distortion algorithm. To simulate simple camera distortions, the points are moved radially from the center with a magnitude proportional to their distance.

Unfortunately, reading the pixels into a buffer and rerendering them tends to be a bottleneck, so the technique is not necessarily practical in a real time context.

You need to install or enable Java to view this content. Get it from java.com
Figure 1. Navigating in a distorted world. Left mousedrag to look. WASD to maneuver. Space for jetpack. r/f to change distortion, t/g to toggle grid.

Files

by Matthew Kozak
All code GPL
All else... bananas?