Effects: Rotozoom
This is the classic rotozoomer effect. Again, the code is old, but it has been cleaned up. It is somewhat optimized, because I don't want to un-optimize the old code. I did add a bilinear texture filtering to it to make it look slightly better.
(There is no hardware version of this. It'd be just one rotating polygon. You can do that yourself.)
Basically, it textures the destination area with copies of the texture, rotating and zooming in/out repeatedly. The zoom origin is changed on every frame. The demo contains three movement functions:
- 3:2 Lissajous figure
- Circular
- Fixed midpoint (just zoom in/out)
Press Tab to change the movement function, or Space to pause/unpause. Esc quits. The demo uses a
512x512 window and when compiled with SSE3 optimizations (GCC -O2 -ffast-math
-msse3
) it produces fairly fast code.
My original code had no FPS measurement or framerate capping and I was too lazy to add them now, so the demo runs as fast (or slow) as your computer can handle.
As usual, there is a precompiled x86 Windows binary. It requires the SDL DLL to run, but SDL is not required for the effect itself.
Texture credits to the old Limefly.net texture collection. Sadly it no longer exists.
Rotozoom source | |
---|---|
File | rotozoom.zip |
Size | 47 KiB (48009 bytes) |
Released | Sep 6. 2011 |
SHA-256 | 583e5fa8040875bb |
Precompiled x86 Windows executable | |
---|---|
File | rotozoom_win.zip |
Size | 60 KiB (61521 bytes) |
Released | Sep 6. 2011 |
SHA-256 | e277f890fc263d15 |