how might I deform raster images, like in Wobble?

Hello all,

I am very interested in applying the warp/deform effect seen in the iPhone app Wobble (it lets you define regions on a raster image and then deforms those regions as it gets input from the accelerometer or the user’s touch as if they had adopted faux soft-body physics) to a game I am making, but I’m not sure how this effect was achieved. Anyone have any advice as to how I might program an analogous effect using Corona?

Thanks,

CCJ [import]uid: 5975 topic_id: 2091 reply_id: 302091[/import]

That can’t be done at the moment in Corona.

As we regroup after shipping the latest Corona, we are going to prioritize features, etc and publish a road map of some sort to let you all know what features are coming up next.

Carlos [import]uid: 24 topic_id: 2091 reply_id: 6253[/import]

are there any updates to this coming to future builds? i’d really like to be able to add a bit more of an effect to my squish app: Head Smoosh!

http://itunes.apple.com/us/app/head-smoosh!/id480762630?mt=8

[import]uid: 80250 topic_id: 2091 reply_id: 69172[/import]

Hello,

Is it possible now in Corona to do the image deformation effects like the wobble effects? [import]uid: 136829 topic_id: 2091 reply_id: 95709[/import]

Not yet, no. Keep eyes on roadmap for latest planned features - or @carlosicaza on Twitter :slight_smile: [import]uid: 52491 topic_id: 2091 reply_id: 95875[/import]

thinking of doing something like this using the sprite capability of corona, ie treat my image as a load of 2pix sprites stacked on top of each other, then wobble the individual sprites to make the image appear to wobble - will post code. [import]uid: 74338 topic_id: 2091 reply_id: 97187[/import]

If you go ahead with that would love to see results! :slight_smile: [import]uid: 52491 topic_id: 2091 reply_id: 97255[/import]

hey hey it worked - not just possible! impressible!!

https://www.sugarsync.com/pf/D6265787_9225421_759441

which means deforms *are* possible! with a bit of
lateral thinking.

[import]uid: 74338 topic_id: 2091 reply_id: 100646[/import]

and off course this can be easily be extended to
wobbling along the y axis by using vertical stripes,
and beyond into both horizontal and vertical
deforms by taking snaphots warping those.

in theory then it may be possible to create a full pseudo
3d texture mapped polygon environment with corona by
applying the deforms, snapshotting and saving to file.

[import]uid: 74338 topic_id: 2091 reply_id: 100650[/import]

Man! That is AWESOME!

Can I encourage you to put this on the code exchange? It is SUPERB and others, I am sure, would love to see it :slight_smile: [import]uid: 52491 topic_id: 2091 reply_id: 100759[/import]

hey peach thanks :wink: for the complement.

A little more to do, just have to optimise it by cacheing
the math.sin calls and we’ll be cooking on gas and I’ll share.

heers

[import]uid: 74338 topic_id: 2091 reply_id: 100858[/import]

cool. i did just that in my line truck game
http://itunes.apple.com/us/app/line-truck/id501693051?mt=8 [import]uid: 58777 topic_id: 2091 reply_id: 100878[/import]

Or they just implement support to rotate each sprite along the X, Y axis also and saves all of us, the GPU and CPU on target devices a lot of hassle :wink:

Nice effect anyway!

[import]uid: 37802 topic_id: 2091 reply_id: 102126[/import]

Open768, thank you, but the file is no longer available.
Could you please reupload it or put this on the code exchange? [import]uid: 136829 topic_id: 2091 reply_id: 108234[/import]

in github
https://github.com/open768/library/blob/master/lib-wobbler.lua [import]uid: 74338 topic_id: 2091 reply_id: 108401[/import]

Thank you! [import]uid: 136829 topic_id: 2091 reply_id: 108462[/import]

hi open768, how can i test this? [import]uid: 130366 topic_id: 2091 reply_id: 108972[/import]

@jacksparrow.greg simples download the lib-wobbler, and dependent libraries from the githug, give it an image and off you go.
Then improve it and post it back.

[lua]require (“lib-wobbler”)
require (“lib-utility”)

utility:InitScreen()

– the hard work begins here
local oWobbler1 = cWobbler:create(“myimage”, width,height)
utility:moveToScreenCentre(oWobbler1.group)
oWobbler1.delay =20
oWobbler1:go()[/lua] [import]uid: 74338 topic_id: 2091 reply_id: 109285[/import]

Hi, open768!
How would you realize image skew by x and y axis (both directions)? I tried to make image skew by x axis by (xSkew - ySkew) angle and rotate group with sprites by ySkew. But I got image irtifact due to rotation. [import]uid: 153428 topic_id: 2091 reply_id: 115289[/import]

@alex243

havent tried this but I would do one skew first (say x axis) , do a snapshot, save the image, load the new snaphot as vertical strips and skew them.

Could give some fun results :wink: but obviously this will suck performance if you do this in-process. rather prepare your animation ahead of time and load the frames of the skew animation as a spritesheet.

http://www.coronalabs.com/blog/2012/03/20/taking-snapshots-of-objects-and-groups/

if I find the time in-between coding and marketing my up and coming game I’ll knock out an example. [import]uid: 74338 topic_id: 2091 reply_id: 115427[/import]