Attach a simple physics object to an animated image?

Hi Peeps.

Simple question, I have a slightly animated tree. By that I mean, simple swaying up and down animation of the leaves/branches on the tree. I then have a simple image like a christmas tree decoration that I want to load as a physics object.

How / is it possible to attach this phyisics object to the swaying / animated leaf / branch of the tree so that it also hangs / moves with the animation? [import]uid: 130366 topic_id: 34020 reply_id: 334020[/import]

Hi @jacksparrow.greg,

I meant to respond to your last post on this (I had some new thoughts about it), but it got lost in the shuffle, sorry about that. :open_mouth:

Considering this now, I suggest that you actually construct the tree entirely out of physics objects… multi-element bodies for the truly “rigid” parts, and joints for the somewhat “flexible” parts. I know this is in direct contrast to my previous advice, but it seems like you need a more realistic physical representation, along with collision sensing capability (as sensors or regions where the user can attach these decorations).

Do you mind posting a screen shot of the tree you have so far, so I can see how complex the physics body construction might be?

Thanks,
Brent
[import]uid: 200026 topic_id: 34020 reply_id: 135298[/import]

Hi @jacksparrow.greg,

I meant to respond to your last post on this (I had some new thoughts about it), but it got lost in the shuffle, sorry about that. :open_mouth:

Considering this now, I suggest that you actually construct the tree entirely out of physics objects… multi-element bodies for the truly “rigid” parts, and joints for the somewhat “flexible” parts. I know this is in direct contrast to my previous advice, but it seems like you need a more realistic physical representation, along with collision sensing capability (as sensors or regions where the user can attach these decorations).

Do you mind posting a screen shot of the tree you have so far, so I can see how complex the physics body construction might be?

Thanks,
Brent
[import]uid: 200026 topic_id: 34020 reply_id: 135298[/import]

Hi brent, thanks alot! appreciate the help. Im trying to figure out the most efficient way to do this, if it comes together nicely i’ll do a blog post and post the example!!! Think itl really help from a workflow pov.

but before that, ive gotta figure it out lol.

Im trying to do a simple segmentation. i.e. cut sections from the middle of the tree towards the branches, and just transition them up and down in corona (for the branch swaying effect.)

then was thinking of just Attaching a physics object on the end of the branch section so it simply sways with it.

not sure how to attach images here tho. but ive got a png of the tree and cut out a square section that includes a branch.

Heres a question. How do we / can we use physics editor, to load the images but also export the branch and tree to corona with the branches position in the right place?

Like im tryng to avoid placing the branch in corona using trial and error x and y placements [import]uid: 130366 topic_id: 34020 reply_id: 135711[/import]

Hi Greg,
I could certainly come up with some useful tips if I can see your tree animation. :wink: If you can please send me the core image (not the full animation), that would help. Also, possibly show how you want to cut it apart, and which parts must move, versus which are locked in rigid position to the whole. Address is bjsorrentino (at) hotmail (dot) com

In any case, attaching the decorations using joints will be correct. I suggest a “distance joint”, but another type might be better. Joints can be tricky and they require some careful tweaking of their parameters, but it shouldn’t be too hard in this case.
http://developer.coronalabs.com/content/game-edition-physics-joints

Brent [import]uid: 200026 topic_id: 34020 reply_id: 135715[/import]

Hi brent, thanks alot! appreciate the help. Im trying to figure out the most efficient way to do this, if it comes together nicely i’ll do a blog post and post the example!!! Think itl really help from a workflow pov.

but before that, ive gotta figure it out lol.

Im trying to do a simple segmentation. i.e. cut sections from the middle of the tree towards the branches, and just transition them up and down in corona (for the branch swaying effect.)

then was thinking of just Attaching a physics object on the end of the branch section so it simply sways with it.

not sure how to attach images here tho. but ive got a png of the tree and cut out a square section that includes a branch.

Heres a question. How do we / can we use physics editor, to load the images but also export the branch and tree to corona with the branches position in the right place?

Like im tryng to avoid placing the branch in corona using trial and error x and y placements [import]uid: 130366 topic_id: 34020 reply_id: 135711[/import]

Hi Greg,
I could certainly come up with some useful tips if I can see your tree animation. :wink: If you can please send me the core image (not the full animation), that would help. Also, possibly show how you want to cut it apart, and which parts must move, versus which are locked in rigid position to the whole. Address is bjsorrentino (at) hotmail (dot) com

In any case, attaching the decorations using joints will be correct. I suggest a “distance joint”, but another type might be better. Joints can be tricky and they require some careful tweaking of their parameters, but it shouldn’t be too hard in this case.
http://developer.coronalabs.com/content/game-edition-physics-joints

Brent [import]uid: 200026 topic_id: 34020 reply_id: 135715[/import]

Hi Brent, sorry for delay, I’ll send you some stuff in a couple of weeks, I started to explore options with the new and upcoming Spriter animation program that promises easier animation tools and integration with corona!! check it out!! will send you tree stuff soon!!

Hi Brent, sorry for delay, I’ll send you some stuff in a couple of weeks, I started to explore options with the new and upcoming Spriter animation program that promises easier animation tools and integration with corona!! check it out!! will send you tree stuff soon!!