<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thought Palace &#187; graphics</title>
	<atom:link href="http://jens.mooseyard.com/tag/graphics/feed/" rel="self" type="application/rss+xml" />
	<link>http://jens.mooseyard.com</link>
	<description>Little boxes made of words, by Jens Alfke</description>
	<lastBuildDate>Thu, 19 Jan 2012 18:29:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Box2D</title>
		<link>http://jens.mooseyard.com/2007/11/box2d/</link>
		<comments>http://jens.mooseyard.com/2007/11/box2d/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 23:52:30 +0000</pubDate>
		<dc:creator>jens</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[graphics]]></category>

		<guid isPermaLink="false">http://mooseyard.com/Jens/2007/11/box2d/</guid>
		<description><![CDATA[Thanks to Steve Dekorte&#8217;s blog, I just ran across Box2D , an open-source 2D physics engine for games. In other words, it simulates the motion over time of convex polygons, taking into account inertia, gravity, collisions, friction, angular momentum, torque &#8212; all the things I once painstakingly learned in college and then completely forgot. Now [...]]]></description>
			<content:encoded><![CDATA[	<p>Thanks to <a href="http://www.dekorte.com/blog/blog.cgi" title="">Steve Dekorte&#8217;s blog</a>, I just ran across <b><a href="http://www.box2d.org/" title="">Box2D</a> </b>, an open-source 2D physics engine for games. In other words, it simulates the motion over time of convex polygons, taking into account inertia, gravity, collisions, friction, angular momentum, torque &#8212; all the things I once painstakingly learned in college and then completely forgot. Now they&#8217;ve suddenly become fascinating again, since Box2D does all the <a href="http://www.chrishecker.com/Physics_References" title="">hard work</a>. The app just has to describe the objects, then call Box2D in a loop to find out how their coordinates change over time.</p>

	<p>Box2D comes with some demos that are bare-bones graphically, but amazingly realistic in motion, including a swinging chain, a web of springs, and a pyramid of blocks that you can undermine and collapse:<br />
<img src="http://mooseyard.com/projects/box2d/pyramid.png" width="500"/><br />
A far more sophisticated usage of Box2D is in the indie game <a href="http://www.kloonigames.com/crayon/" title="">Crayon Physics Deluxe</a>, &#8220;in which you get to experience what it would be like if your drawings would be magically transformed into real physical objects.&#8221; You <em>must watch the amazing video</em> on that site. (Then cry, because it&#8217;s only for Windows.)</p>

	<p>Speaking of Windows, the official Box2D package only builds on that platform, so far. But the core library is platform-independent C++, and the demos use OpenGL, so porting isn&#8217;t a big deal. Building on some work of some others who&#8217;d written makefiles, I put together an Xcode project. Now you can <a href="http://mooseyard.com/projects/box2d/Box2DTestBed.zip" title=""><strong>download the demo app</strong></a> if you want to play with it. If you want to experiment, you can copy the Box2D dylib itself out of the app bundle, or <a href="http://mooseyard.com/projects/box2d/Box2D_r49+MacXcodeSupport.patch" title="">download my patch</a> and apply it to revision 49 from the <a href="http://sourceforge.net/svn/?group_id=205387" title="">Subversion repository</a>.</p>

	<p>There&#8217;s a killer opportunity here to <strong>plug Box2D into Core Animation</strong>. Then you&#8217;d have the gorgeous high-speed compositing of the latter, coupled with far more sophisticated animation capabilities. (The animation functionality in CA is fully subclassable, so this should be straightforward to do.) I&#8217;ve been fooling around with Core Animation lately, and having a lot of fun making pretty pictures that slide around smoothly. I&#8217;ve never before felt the need for a game-physics engine, but the prospect of making my pretty pictures move with that kind of realism is suddenly very enticing!</p>
 ]]></content:encoded>
			<wfw:commentRss>http://jens.mooseyard.com/2007/11/box2d/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

