BoxCAD - flash editor... .. and hours of endless fun

I recently took on the task of learning flash, and having been long interested in physics simulation AND having come across Box2D a short while back - thought it would be cool to make a sort of "physics playground" app. In process, however, I noticed a couple of things:

1. There are already lots of "playgrounds" out there.
2. Making (coding) complex scenes by hand sucks.

So I changed my focus a bit, to making something a little more serious and - hopefully - useful. So this editor puts accuracy and speed-with-a-bit-of-a-learning-curve over "fun." It is great for experimenting with Box2D's capabilities, and will dump the code for any scene (AS3.0 right now, more langs to follow).

ANYway, here is BoxCAD 1.0: http://www.brainblitz.org/BoxCAD/

Maybe 0.9 would be more accurate, because after I published and uploaded, I noticed the code dump wasn't processing joints. And realized that one must refresh the page if one wants to clear the scene.

And, quite frankly, it's WAY past my bedtime.

Ahh well. Tomorrow.

Ahem.

To start, I'd recommend clicking "File...", then load a demo or two. They are rather weak, as I just finished this thing and really must take a break, but they give you an idea.

Or maybe look at the help file.

By all means, if you make something cool, please email me the file name at trresonant (at) yahoo.com, so I can add it to the demo list.

Thank you Erin. Blessed are you among humanity. If you are ever in Spokane, WA, let me know so I can buy you a pint or 14 of redhook longhammer pale ale.

And thank YOU Matthew. The same goes for you, if you ever find yourself in WA.

G'nite.
Linked!
Very cool! You should mention somewhere that SPACE runs the simulation. I know it gives you tips at the bottom, but the tip to hit space to pause or run simulation doesn't come up until you've already hit space... Would be cool to list buttons below the app.
Indeed, this is great! Thanks a lot for putting this together, it's going to come in handy setting up prototypes of ideas 🙂

Bill
Thanks for the link Erin!

And thanks for the tip, brainclog. As a quick, temporary solution, I've added a button. I mean, who wants to spend time on something so mundane when one could be programming a chain tool or something exciting like that? 😛

After making a couple more demos (you really should see SelfPortait and the DollhouseDementia series), I'm realizing that the functionality isn't quite up to par for complex mechanical needs. The main thing I've struggled with is how to handle object manipulation when the world isn't stepping. Right now it doesn't maintain constraints, and that makes it very easy to build unstable systems.

Also, I haven't focused on speed optimization at all, so it doesn't take much to bog it down.

Anyway, if this version is neat, just wait for the next update. 👿

It will be magical.
verso wrote:
The main thing I've struggled with is how to handle object manipulation when the world isn't stepping.
If you are using v2.0, you could try stepping the world with a 0 timestep. That updates all constraints, without any motion or forces. Though you wouldn't want it while trying to put joints together, it's probably a useful mode for dragging things around while paused.
This is really great stuff.

I would like to implement it with a video background for my physics classes.
Do you plan to release the source code at some point?
It would be really appreciated.

Martin
Hey, this looks great! And may I ask what your IDE of choice is and what classes you are using for the windows?
BorisTheBrave:
Quote:
If you are using v2.0, you could try stepping the world with a 0 timestep. That updates all constraints, without any motion or forces. Though you wouldn't want it while trying to put joints together, it's probably a useful mode for dragging things around while paused.


I'm actually holding off on the upgrade until it's a bit more stable, but that sounds like exactly what I need. Thanks for the tip.

circinus:
Quote:
I would like to implement it with a video background for my physics classes.
Do you plan to release the source code at some point?
It would be really appreciated.


I haven't really thought about that, actually. I wasn't planning on it - mainly because it's not something that would be generally/generically useful.

Honestly, I would like to get BoxCAD to the point where it has enough flexibility to do whatever you need, without any programming.

That said, I AM having thoughts about distributed development via an open api for tools. All of the tools so far - particles, joints, etc, are standalone objects. I need to clean it up a bit more, but my design for tools is very clean and modular; I'm not real knowledgeable in flash yet (so don't know what the limitations are), but I'm hoping it will be as easy as uploading a file to the server and having a button appear in a plugins menu. The api would provide access to nearly every aspect of the physics engine and some access to "extras" - such as loading graphics to be attached to objects/set as background, etc. So if it doesn't do something you need it to do, you can take 2 hours to write a plugin rather than going through my masses of code. 😀

Also perhaps of interest is a "publish" view I'm working on, which would provide a non-editable version of a scene for embedding on personal pages.

efnx:
Quote:
Hey, this looks great! And may I ask what your IDE of choice is and what classes you are using for the windows?

Thank you!
Just straight up Flash CS3 at this point. The windows system is a slightly modified version of free Window Manager that can be downloaded at http://segfaultlabs.com/projects/fui . I am so greatful for it - I still can't believe there is no basic dialog/modal support built into flash. I still have some tweaking to do (i.e. I hate that the "canvas" is still active when the "Clear Scene" alert pops up).
Thank you for the answer to my questions.
Quote:
haven't really thought about that, actually. I wasn't planning on it - mainly because it's not something that would be generally/generically useful.

I don't agree, an open source flash editor/drawer for Box2D would be really useful for a lot of persons.
Besides, BoxCAD is based on open source components. Maybe you could release just a part of it to help us.
Quote:
Honestly, I would like to get BoxCAD to the point where it has enough flexibility to do whatever you need, without any programming.

Honestly, for a lot of reasons, this will be impossible to achieve. For example, with my students, I really need to make some modifications (not just adding a button) before I can start thinking about really using it. On the other hand, I don't have any experience nor time to learn the plugin programming that you propose. I will most certainly take me a more than 2 hours just to understand that it is impossible to do what I really need to do...

Anyway, once again, this is really great work!
and of course the decision is entirely yours.

Original thread: https://box2d.org/forum/viewtopic.php?t=702