PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Morphing demo

Hey all,

I needed a morph effect for the new demo of Nutcracker 2006, so yesterday I whipped up a quick proof of concept demo to see if it can be done on PocketPC. Check out the result here:

http://www.bik5.com/nc2/morphdemo.zip

No installer, so just copy the files to your PPC. Feel free to replace the tga's with your own, must be 200x240, 16bit tga uncompressed.

While taking a shower this morning I realised that this can be made twice as fast by using palettized source data, as most time is spend in blending the pixels, while each image uses the same opacity for each pixel in a single frame. So I'll use that in the Nutcracker demo.
looks good... I wouln't mind seeing the code.

BTW, I just realized you're the same phantom that wrote the graphics tutorials. They're very useful.
Is there any specific functionality you're curious about?
I guess I'm interested in the tweening of the distortion grid.
Code is here:
http://www.bik5.com/nc2/morphsrc.zip

License: You may use parts of it for anything you like, except a PocketPC/Smartphone morphing app. :)

Some notes:
- This code was done in 3 hours, from zero to 'working PPC app'. That's a warning. :)
- The most interesting bit is probably the 'double barrel texture mapper'. It takes two sets of uv coords and a set of screen coords, and draws a quad. It's subpixel and subtexel accurate. Bilep is not yet supported (should be fast enough when you work with palettized images).
- The surface class is the one I use in Nutcracker, but I removed the sprite class and support for palettized surfaces (didn't need those in the morph app). You may find the font class interesting: It takes a bitmap and a string of characters that is supposed to be in the image file. If you separate characters by one or more vertical line of black pixels, it automatically finds the characters. The characters do not need to have the same width. So, go to paintshop, type in the characters you need with spaces inbetween, save as tga, and voila, game font ready.

The code is pretty self-explanatory I hope. If you have questions, just let me know.

Ow one last note: Zlib is expected to reside in ..\zlib. PocketHAL is supposed to reside in ..\PocketHAL. If you can't figure out how to get it working with these hints, you're not a coder.

- Jacco.