Box2D Physics?

Discuss ideas for new features with other users. To submit feature requests to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Box2D Physics?

Post by bupaje »

Hi. Haven't been using Moho in quite a while now but still hang around as I love it. I spotted a Flash implementation of this free 2D physics engine and wondered if AS could also benefit.

http://www.box2d.org/

here is a Flash demo by someone using this library.

http://box2dflash.sourceforge.net/

might be cool
[url=http://burtabreu.animationblogspot.com:2gityfdw]My AnimationBlogSpot[/url:2gityfdw]
Postality
Posts: 248
Joined: Sat Aug 07, 2004 3:21 am
Location: Toronto, Ontario
Contact:

Post by Postality »

This is something I've asked for countless times.

I don't think it would ever be put in because the majority always has some negative comment(s) about why this kind of thing is to "3d app" kind of stuff...

Personally I don't even use Anime Studio any more for movies or animation for games etc. I've moved over to Animation Master.

I do however still use Anime Studio to create title screens, buttons, and menus etc. because I love the font editing ability once you put the points in.

Other than that, I've kind of steered away from it.

I think alot of it was due to the efrontier and now that other company (I don't even care to know who) getting their hands in on this fine app.

Mike did much more for this app when it was just him, even after his miracle was born there was still SOMETHING to look forward to and updates where more frequent.

Please, don't take this as a bashing post because it's not. I still love the app.

If you are going 3D and like how Anime studio works, you'll LOVE Animation Master. It's almost identical in how it works.

The only snag in the app that I've seen is the patch modeling, but once you understand how they work, it's a beautiful thing.

Anyway, to support your post I would agree that this would be very nice in Moho or Anime Studio (or whatever they call it these days).
Anime Studio - Ultimate Game Graphics
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Can't believe I missed this post from November!

Don't know if you are aware of this but I am working on a 2D physics utility script to add this type of physics properties to bones in AS.

I am definately going to look at this project. It does much more than mine does at the moment although I can see my version continuing to expand.

Currently I have a few samples all done using Anime Studio:
http://www.lowrestv.com/moho_stuff/scri ... ection.mov
http://www.lowrestv.com/moho_stuff/scripts/physics1.mov
http://www.lowrestv.com/moho_stuff/scri ... ounce1.mov
http://www.lowrestv.com/moho_stuff/scripts/springs1.mov

You can download and play with the scripts and files. Not much flexibility yet. I plan to create a menu script to apply different physics properties to bones and save the settings in a separate preference file.

viewtopic.php?t=9488

The best part of this for me is that Flash physics are generally... slow... depending on the processor. You don't always get streamlined animation. When I animate with AS I don't care about "real time" performance. As far as I know this should render out SWF although I haven't tested that yet.

-vern
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Post by jahnocli »

I love that last springy one! Could be really useful for hair, light clothing etc. Any plans for development along these lines?
You can't have everything. Where would you put it?
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

jahnocli wrote:I love that last springy one! Could be really useful for hair, light clothing etc. Any plans for development along these lines?
Absolutely. It could be used for anything really. I was thinking since this works with bones you could assign just a few spring chains that would control larger sections of vector hair or clothes. I think this could produce some really exciting effects with out a lot of effort.

I got stuck because I'm having trouble making it NOT "stretch" for hair. I just want dangly non stretchy chains.

I am also thinking possibly... down the road... applying the physics directly to vectors the same way flash does. This would make "hair" type things easier. I would use points of a vector instead of bones for the physics chains. It's much harder to do this in AS though because "points" in a vector aren't as easy to name. Point groups aren't as easy to work with as bones are.

I am going to look at that box 2D thing. If it works with Flash it should work with AS... uh... I just have to re-write it in lua. ;)

-vern
User avatar
Víctor Paredes
Site Admin
Posts: 5665
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

heyvern wrote:
jahnocli wrote:I am also thinking possibly... down the road... applying the physics directly to vectors the same way flash does.
wow, that would be amazing.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Vector physics would be amazing. The trouble is bones are so much easier to do this with. Vectors would have to work with point groups and then traversing the points to assign physical properties in a specific order or getting some kind of bounding box area around the vector shapes.

With bones I can specifically assign a physical property to a named bone and use it's length to determine the "size" of the physical object. With a vector shape I would have to jump through more hoops to figure out the specific size and shape.

What I REALLY want is to use both bones AND vectors. If you bind a shape to a bone theoretically you could have irregular shaped objects with physics. The shape of the paths would determine the boundaries for the physics properties of that object. So a triangular shape would bounce differently than a round or square shape.

Currently this version of my script assumes a round shape (or a "line") for everything since it is based on bones... and round shapes are just easier. ;)

-vern
Samb
Posts: 84
Joined: Thu Dec 29, 2005 5:18 am
Location: Hamburg,Germany
Contact:

Post by Samb »

if you would convert box2D in lua for anime studio.. I think we would have to call you... "god"... or something like that :]
User avatar
Mikdog
Posts: 1901
Joined: Tue Jul 05, 2005 3:51 pm
Location: South Africa
Contact:

Post by Mikdog »

Something like that'd be awesome
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I don't know a lot about "open source" licensing etc. If I converted the action script version of Box2D to lua would I be violating any copyrights? How should I handle that?

I suppose if I do this I should contact them directly to find out.

-vern
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Never mind. I have read more about box2D and I think I can't use it. It still uses the Box2D C++ compilation for the physics and uses Flash as the "display engine". I am not a good enough programmer to convert that. There appears to be a Java port going on which might be more my speed. ;)

EDIT: Wrong again! This IS an Actionscript port... but yikes! I don't think I can handle porting it to use for AS. I am better off playing around with my own solution so far.

p.s. In a perfect world Box3D or something similar would be a part of AS. Built in. Probably run a lot faster.

I am still capable of continuing with what I've already got though.

-vern
Post Reply