gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Take a look at this warping demo

#133359 - philip - Thu Jul 05, 2007 7:40 pm

Hey, can anybody take a look at this for me, please? It's a nice little warping demo I've done. The algorithm is based on that of IWarp, an open-source plug-in for GIMP. It's a lot like DSGoo, which in turn was based on Kai's Power Goo (except my version is faster than DSGoo!): you drag the stylus across the image to warp it. The default warp is very high, but you can reduce it for more subtle effects.

You can change the amount of deform with up/down on the d-pad and change the radius of the area warped with left/right BUT that's the problem; changing the radius causes the area you warp to be corrupted. This is weird, because I can set any value I want as the initial radius value and it's fine, it just seems to be CHANGING the value during runtime that's the problem (even if you change it back to the start value of 50, it is still corrupt)

So, can someone have a look and see if they can help? There's nothing obvious that needs re-initialising that I've missed.

Download it here:

http://www.vertex.ukfsn.org/linked/DSWarp.zip

#133791 - philip - Sun Jul 08, 2007 7:10 pm

Well, I see you all failed to spot my deliberate mistake, which was - of course - that the deform_area_vectors array was not getting re-initialised when the radius was changed, but it is initialised to begin with because it's global.

You can find the finished thing, in all it's glory, here:

http://www.vertex.ukfsn.org