tag:blogger.com,1999:blog-5217445496019828087.post7010519757727326013..comments2019-04-25T06:07:46.857-05:00Comments on pybox2d: Progressknehttp://www.blogger.com/profile/01886171929967978645noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-5217445496019828087.post-55928164834244804512010-12-02T19:00:59.164-06:002010-12-02T19:00:59.164-06:00Well, I agree up to a point. The framework example...Well, I agree up to a point. The framework examples themselves were intended to be simple, which they for the most part are. The back ends admittedly are much more complicated, but they also show how to do just about everything you could want to do (assuming you can pick it apart).<br /><br />But I always seem to come back to this one point -- when creating these small examples, what do you include? Basic world and shape creation? Of course. An event loop? Absolutely. Converting world->screen coordinates? Yeah, unless using a graphics library that will do it for you. Drawing of circles? Not quite enough. Drawing of all shapes? Yeah. Object picking? Examples aren't terribly interesting without interactivity. Toggling drawing/tuning parameters? Can be vital depending on the specific application.<br /><br />OK, say there are at minimum 30 individual examples for all of these. Multiply that number by 3 or 4 for each back-end, and all of a sudden you have a maintenance nightmare for just one person.<br /><br />Ignoring that, just think about the introduction of a debug drawing class in an example -- that adds a couple hundred lines of code (depending on the back-end). Leave that out, and nobody wants to play with your physics library anymore.<br /><br />I do like pyglet and the direction it's going, but I focus on pygame as it appears to be what most people like to use.knehttps://www.blogger.com/profile/01886171929967978645noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-36284772902896123802010-12-01T21:09:23.443-06:002010-12-01T21:09:23.443-06:00Thanks. I'll definitely take a look at it. I...Thanks. I'll definitely take a look at it. I think the scary part to me is just that the framework is quite a bit of code to go through. <br /><br />I'm an electrical controls engineer who does python for some internal company software and a bit of fun on the side so I'm by no means a trained software engineer, but the whole framework thing just seems rather over-engineered for simple examples.<br /><br />I would rather see smaller, more atomic examples that show one or two principles without bogging the newcomer. The pymunk examples seem to take that approach, and it just seems easier to get up to speed with the basic concepts (I don't have to look at multiple files to figure out how things are initialized, defined, etc.)<br /><br />I used to play mostly with Pygame for graphics, but decided to give Pyglet a whirl. It might not have some of the features of Pygame, but (so far) Pyglet seems cleaner to use.<br /><br />Keep up the good work.Bobhttps://www.blogger.com/profile/13638354185690268788noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-1210006583482809252010-11-30T22:53:58.466-06:002010-11-30T22:53:58.466-06:00No problem.
If you ever wade through the testbed ...No problem.<br /><br />If you ever wade through the testbed and figure out what makes it so daunting, let me know. I'd be keen to simplify it as much as I can.<br /><br />I'd definitely appreciate any help with pyglet that you could offer. Fixing up that backend is on my todo list. :)knehttps://www.blogger.com/profile/01886171929967978645noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-56152382424522396802010-11-29T20:18:41.166-06:002010-11-29T20:18:41.166-06:00OK, thanks for the time. I'm actually trying ...OK, thanks for the time. I'm actually trying to use it with pyglet. Maybe I'll take another look at the testbed again for 2.1.0. I have done some pygame stuff, but the framework code appeared a little daunting to me at first look. <br /><br />Perhaps I'll just give it a try with the 2.0.2 version. I just have a small breakout game I'm trying so I can get a feel for the physics stuff.<br /><br />Thanks again, and good luck with polishing off the rest of the new version. If you want, I can send you what I have for the graphics portion of my project using pyglet for another example.Bobhttps://www.blogger.com/profile/13638354185690268788noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-40225601718317115912010-11-29T11:52:54.278-06:002010-11-29T11:52:54.278-06:00Bob, my guess is you're trying to follow the 2...Bob, my guess is you're trying to follow the 2.0.2 guide using the new 2.1.0 version. It's no longer possible to set the world AABB because -- well, there is no more world AABB.<br /><br />One benefit of the testbed is that you don't have to worry about creating the b2World and deal with pygame when you want to just test out how shapes and everything work in box2d. It allows you (as in all of the test_*.py examples) to create interactive polygons, circles, and whatnot in the world and have them displayed for you regardless of the backend (pygame, pyglet, pyqt4). <br /><br />As much as I hate to send off potential users, my recommendation to you would be to wait until I port the 2.1.0 manual. I've finished most of my todo list for the code, so it should be coming up soon. After getting the documentation done, maybe I'll come up with some bare minimum examples for people to get simple non-testbed projects going.knehttps://www.blogger.com/profile/01886171929967978645noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-48329705847028025892010-11-28T21:06:00.935-06:002010-11-28T21:06:00.935-06:00I must be missing something because I can't se...I must be missing something because I can't seem to set the AABB for the world. It seems like it's no longer part of the __init__ function. I'm sure it's something simple, but I am having a difficult time following the testbed code with the whole pygame framework thing. When I try looking at it, I just end up more confused than I started. :(Bobhttps://www.blogger.com/profile/13638354185690268788noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-27354273376419893962010-11-16T11:57:38.139-06:002010-11-16T11:57:38.139-06:002.0.2 and 2.1.0 are very different -- although the...2.0.2 and 2.1.0 are very different -- although the underlying functionality is similar, the interface has changed greatly. 2.1.0 utilizes properties and kwargs everywhere possible to make things easier. 2.0.2 is very close to the C++ version, with a few added benefits.knehttps://www.blogger.com/profile/01886171929967978645noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-79732884375714284972010-11-16T07:34:16.117-06:002010-11-16T07:34:16.117-06:00So, are there a lot of differences between 2.0.2 a...So, are there a lot of differences between 2.0.2 and 2.1.0? I'm going to print out the manual for 2.0.2 and give it a look-over.<br /><br />Thanks.Bobhttps://www.blogger.com/profile/13638354185690268788noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-25659173472848937642010-11-10T17:05:32.813-06:002010-11-10T17:05:32.813-06:00I think most programmers are that way, Bob. There ...I think most programmers are that way, Bob. There was a decent manual that described how to get started for 2.0.2, but I'm afraid I still haven't gotten around to porting over the 2.1.0 manual. (for 2.0.2, this can be found <a href="http://pybox2d.googlecode.com/svn/trunk/doc/manual.htm" rel="nofollow">here</a> -- mind you, it's essentially unusable for 2.1.0)<br /><br />Unfortunately, your best bet at this point is the testbed (2.1 <a href="http://code.google.com/p/pybox2d/source/browse/#svn/branches/box2d_2.1/examples" rel="nofollow">testbed</a>, old 2.0 <a href="http://code.google.com/p/pybox2d/source/browse/#svn/trunk/testbed" rel="nofollow">testbed</a>). It's overcomplicated for simple examples, but you should be able to see how the bodies/fixtures/shapes match up with the output when experimenting. <br /><br />Looking over the testbed really makes me want to come up with just very basic pygame examples that people can use to learn (without the testbed). Yet another thing to get around to doing...knehttps://www.blogger.com/profile/01886171929967978645noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-12379221048002399912010-11-10T06:53:24.178-06:002010-11-10T06:53:24.178-06:00Sorry, I almost forgot to ask. Do you have any li...Sorry, I almost forgot to ask. Do you have any links to some good tutorials / examples? I'm a lazy learner, and find it easier if I can see something step-by-step or at least see how someone else did things.Bobhttps://www.blogger.com/profile/13638354185690268788noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-51072977936634650342010-11-10T06:37:33.304-06:002010-11-10T06:37:33.304-06:00Well, I haven't had time to fire it up yet. I...Well, I haven't had time to fire it up yet. I am working on a small Breakout / Arkanoid clone, and thought it might be neat to try some more interesting physics with it.<br /><br />So far, I've been using Pygame and Python 3.1, but 2.6 shouldn't cause me any real problems. When I looked at pymunk, it seemed a bit too buggy for me on either 2.6 or 3.1, so I thought I'd look at something else.<br /><br />Good luck. I'm glad to see this is an active project as it looks like only one of two 2D physics libraries for python.Bobhttps://www.blogger.com/profile/13638354185690268788noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-26187476502934351342010-11-09T13:09:18.696-06:002010-11-09T13:09:18.696-06:00Hi Bob,
Thanks for the encouragement. Do keep in...Hi Bob, <br /><br />Thanks for the encouragement. Do keep in mind that if you downloaded the alpha version -- it is, well, 'alpha'. The 2.0.2b1 builds (from early 2009) are stable as far as I know, but the API is not nearly as nice to deal with as the new versions.<br /><br />At one point I did have Python 3 working, but I had forgotten about it until you reminded me. I'll look into compatibility with 3.1 this week if I get a chance.<br /><br />Kenknehttps://www.blogger.com/profile/01886171929967978645noreply@blogger.comtag:blogger.com,1999:blog-5217445496019828087.post-65735366517633425862010-11-08T21:51:24.122-06:002010-11-08T21:51:24.122-06:00Keep plugging away at it, man. I just downloaded ...Keep plugging away at it, man. I just downloaded the latest version from google code, and plan on trying it out tomorrow. I've messed with pymunk a bit, and look forward to seeing how pybox2d compares.<br /><br />Have you tried pybox2d with Python 3 at all?Bobhttps://www.blogger.com/profile/13638354185690268788noreply@blogger.com