We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › JBox2d Demos
Page Index Toggle Pages: 1
JBox2d Demos (Read 3648 times)
JBox2d Demos
Jun 12th, 2008, 5:07am
 
Ah, I can't believe I forgot to post this here - I'm maintaining JBox2d, a Java port of the Box2d physics engine (http://www.box2d.org), and though the engine is written in pure Java, the demos all use Processing.

Check them out at http://www.jbox2d.org/v2demos, also the project home page is http://www.jbox2d.org (there are links there to the Subversion repository and Sourceforge page if you'd like to try out the engine).  JBox2d uses Java 1.5 features, so up until the Processing JVM switch it wasn't possible to release a library that integrated well with the PDE; now that Processing is 1.5 too, I'll be able to put together a good library that should make rigid body physics a lot easier to integrate with Processing.  Look for that soon...
Re: JBox2d Demos
Reply #1 - Jun 12th, 2008, 5:56am
 
Nice work, very cool.
Re: JBox2d Demos
Reply #2 - Jun 12th, 2008, 7:18am
 
Yes, I noticed that with your exhibition of the constant volume blob...
I searched Discourse and was surprised not to see any reference to this library. Cheesy
I was planning to use Phys2D but your implementation seems to follow more closely Erin's one, and people say it is faster (and allows continuous collision detection, among other goodies).

I haven't tried it yet... I downloaded the Jar file. You should make evident somewhere on your page that you have packaged the source in a Zip file: I was surprised not to see any source code download for a project hosted on SF. Then I remembered SVN... That's not a practical access, I prefer unique archive to download. Then I found a Zip file at the root of the 1.4.3 branch... And later, I found that the Zip of the v.2 demo has the source too!

Anyway, that's a great, convincing demo, I am eager to try it out.
Re: JBox2d Demos
Reply #3 - Jun 12th, 2008, 8:32am
 
Excellent advice about the download stuff - for now the only people using it are ones who've seen it in the Box2d forums, but I really should update the SF page (I think the most recent download there is from version 1.4.1, and we're at 2.0.1 now, so that's real old...).

There's not much reference to this library yet here because until now it hasn't been possible to use inside Processing itself, since it relies on Java 1.5.  Plus, the API is a little too complex as-is to be useful without a full Javadoc-aware IDE.  When I get the Processing library set, I'll follow tradition and set up a separate page with independent documentation for it, too, since it should be significantly simpler to do most things - in particular, things like translating from screen to world space should be automatically handled, as well as drawing setup and simulation.

Phys2d is excellent, I've used it quite happily in the past, but it's a port of the old Box2d, so it's not quite as feature-complete as JBox2d and is not updated very often.  Kevin Glass decided he didn't really have time to maintain it or update it to the new version of Box2d, so we started the project separately.  Phys2d is probably better integrated with Slick, though, which is a definite plus if you use that.
Re: JBox2d Demos
Reply #4 - Jun 14th, 2008, 2:57am
 
I already posted this in the library development part of the board, but there's now a very early demo of BoxWrap2d, a Processing library that wraps JBox2d to make it easier to use.  It's up at http://www.jbox2d.org/processing/, anyone is free to check it out.
Re: JBox2d Demos
Reply #5 - Jun 14th, 2008, 4:38am
 
hi,
nice lib!

btw, although it is 3d and too heavy to converge, could you improve my old elastic joint model and add it to your joint collection?
http://www.geocities.jp/classiclll_newweb/EtudeOfString/applet/index.html
Re: JBox2d Demos
Reply #6 - Jun 14th, 2008, 8:46pm
 
@Classiclll - Very cool demo!  It might be a little tricky to get something like that working within JBox2d, at the moment, at least - right now we have a bunch of segment based methods that we'd love to integrate with the engine, but there are some difficulties, especially with getting collision detection to work right between all types of shapes.  I'm probably not going to get a chance to work it all out myself for a while.  That said, you're free to play around with the source yourself, though I think if you do you'll understand why I'm saying I probably can't do it now, it's quite a lot of code!
Re: JBox2d Demos
Reply #7 - Nov 19th, 2008, 8:12pm
 
I was just looking around for some physics lib and found this thread. I don't know if I'm missing something in the javadoc but shouldn't there be a getPosition() and a getRotation() function? Because it seems like it's the best option to skin the jbox2d quick and dirty.

And I'm assuming I can turn the drawing off by switching the renderer to some null function, right?
Re: JBox2d Demos
Reply #8 - Nov 21st, 2008, 7:14pm
 
It seems rendering is broken with P0157. Only boxes are visible in the demo, no circles nor strings. Neither P3D, P2D, JAVA2D nor OPENGL works.

This is still an old version of JBox2D, right?

Cheers!
Mkn.
Re: JBox2d Demos
Reply #9 - Apr 19th, 2009, 2:09pm
 
Thanks, I will have a look at it, it looks exactly like the thing i need.
Re: JBox2d Demos
Reply #10 - Jun 10th, 2009, 2:42pm
 
I am so incredibly excited about this. I am a beginning processing user, and I'm not thrilled about having to switch to eclipse to take advantage of jbox2d, but I will do just about anything to be able to develop a game with a deep physics set like this. I hope I can learn to use it.  Cheesy
Re: JBox2d Demos
Reply #11 - Jun 10th, 2009, 5:21pm
 
Awesome Job! This will be fun to play with.
Re: JBox2d Demos
Reply #12 - Jun 11th, 2009, 1:57am
 
weevil wrote on Jun 10th, 2009, 2:42pm:
I'm not thrilled about having to switch to eclipse to take advantage of jbox2d

Why do you think that
You can use any Java library directly from the PDE, and ewjordan even provided a wrapper for Processing (boxwrap2d).
See for example jbox2d with custom rendering method for a pure Processing sketch. And of course the SwingingDemo provided by the above mentioned library.
Page Index Toggle Pages: 1