« Nature of Code: Interstitial | Main | Audio Art: Week 8 Omnibus »

GLArt Week 7: Self-Similar

screenshot thumbnail

Click the thumbnail above for a screenshot of my latest assignment for GLArt. This program loads in a 3D model and draws each vertex to the screen with a pixel. One vertex in the model, however, is drawn not with a pixel but with a smaller copy of the model. The smaller copy is drawn similarly, creaing a recursive, self-similar structure. The motion blur effect is created by copying the current screen to a texture, which is then drawn behind the points that make up the model.

Pressing up will zoom in toward the innermost iteration of the model; pressing down will zoom out. Left and right will rotate the model. Download the source code here (requires a bunch of Mark Napier's code and LWJGL).

I like the effect, though I realize now I could have achieved the same thing without using the recursive rendering algorithm. The original intention was to have every point in the model be drawn with a smaller version of the model, but that quickly became too computationally expensive.

You can also download a 640x480 QuickTime movie of the program's output here (~60MB). The camera heads straight on into the recursion, then rotates on the way out. I'm not sure why the model bumps around so much when you're zoomed in and rotating—I'm betting on floating point accuracy errors. (After five or six iterations, the values this program passes to OpenGL become very, very small.)

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)