<?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>Seb Lee-Delisle &#187; Uncategorized</title>
	<atom:link href="http://sebleedelisle.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebleedelisle.com</link>
	<description>Actionscript Games, Physics and Papervision3D</description>
	<lastBuildDate>Sat, 31 Jul 2010 15:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AIR for Android first steps</title>
		<link>http://sebleedelisle.com/2010/07/air-for-android-first-steps/</link>
		<comments>http://sebleedelisle.com/2010/07/air-for-android-first-steps/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 17:11:36 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=1108</guid>
		<description><![CDATA[Having finished my first iPhone app in Objective C I thought it was probably time to have a go at setting up my Nexus1 with AIR for Android. Yes. I&#8217;m a digital slut. And no. I&#8217;m not gonna pick a side. Deal with it. But anyway, I digress! I found Lee&#8217;s very cool intro to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F07%252Fair-for-android-first-steps%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FaG9Tmc%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22AIR%20for%20Android%20first%20steps%20%23%22%20%7D);"></div>
<p><a href="http://sebleedelisle.com/2010/07/air-for-android-first-steps" title="My first AIR on Android appr"><img src="http://farm5.static.flickr.com/4140/4830792321_7cc1da9c15.jpg" width="500" height="313" alt="My first AIR on Android app" /></a></p>
<p>Having finished my first iPhone app in Objective C I thought it was probably time to have a go at setting up my Nexus1 with AIR for Android. Yes. I&#8217;m a digital slut. And no. I&#8217;m not gonna pick a side. Deal with it. <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>But anyway, I digress! I found Lee&#8217;s very cool <a href="http://gotoandlearn.com/">intro to Android</a> videos which have been a big help. <del datetime="2010-07-27T19:50:20+00:00">But I did get <a href="http://twitter.com/thecodesculptor/status/19574022845">a warning from Stephan Jones</a> on Twitter who tells me that there is a virus on the site, so possibly make sure you&#8217;re running virus software first!</del> UPDATE : Lee and Serge both assure me there&#8217;s nothing wrong with their sites so I can only assume Stephan&#8217;s virus checker was being a little overzealous!</p>
<p>A few things caught me out, if you navigate to the tools folder in terminal you can&#8217;t just type <em>adb devices</em> as the permissions on the files didn&#8217;t seem to be set right. the easy workaround is to type <em>./adb devices</em> or else change the permissions with chmod if you like that sort of thing. </p>
<p>But the biggest thing was that it just wasn&#8217;t recognising my phone. I&#8217;m not sure if Lee mentioned it or not (maybe I wasn&#8217;t paying attention) but you need to turn on USB debugging on the phone itself. Go to Settings->Applications->Development->USB debugging. That&#8217;ll do it! </p>
<p>Also the link for AIR for Android wasn&#8217;t on the front page of Adobe Labs and it was surprisingly difficult to find it. But it&#8217;s here : <a href="http://labs.adobe.com/technologies/air2/android/">http://labs.adobe.com/technologies/air2/android/</a></p>
<p>And finally I couldn&#8217;t actually get my app to deploy from Flash CS5 &#8211; the reason? I hadn&#8217;t turned USB Storage on &#8211; doh! </p>
<p>And it&#8217;s working! Lunar Lander on Android, anyone? <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/07/air-for-android-first-steps/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Papervision3D training on Lynda.com</title>
		<link>http://sebleedelisle.com/2010/07/papervision3d-training-lynda/</link>
		<comments>http://sebleedelisle.com/2010/07/papervision3d-training-lynda/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 12:04:14 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=1084</guid>
		<description><![CDATA[Remember when I disappeared mysteriously to LA for a week in February? I can now reveal that I was in Ventura, CA recording a 4 hour long tutorial series for Lynda.com that has just gone live! It was such a great experience, the team at Lynda are so professional and they have many recording booths [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2008/03/particle-tutorial-now-on-lyndacom/' rel='bookmark' title='Permanent Link: Particle tutorial now on Lynda.com'>Particle tutorial now on Lynda.com</a></li>
<li><a href='http://sebleedelisle.com/2009/08/papervision3d-training-in-new-york-city/' rel='bookmark' title='Permanent Link: Papervision3D training in New York City!'>Papervision3D training in New York City!</a></li>
<li><a href='http://sebleedelisle.com/2008/09/all-set-for-fotb-papervision3d-session/' rel='bookmark' title='Permanent Link: All set for FOTB Papervision3D session'>All set for FOTB Papervision3D session</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F07%252Fpapervision3d-training-lynda%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2F9J31IR%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Papervision3D%20training%20on%20Lynda.com%20%23%22%20%7D);"></div>
<p><a href="http://sebleedelisle.com/2010/07/papervision3d-training-lynda" title="Papervision3D Essential Training at Lynda.com by sebleedelisle"><img src="http://farm5.static.flickr.com/4097/4785808887_3d008d5336.jpg" width="500" height="295" alt="Papervision3D Essential Training at Lynda.com"></a></p>
<p>Remember when I disappeared mysteriously to LA for a week in February? I can now reveal that I was in Ventura, CA recording a<a href="http://www.lynda.com/home/DisplayCourse.aspx?lpk2=61220"> 4 hour long tutorial series for Lynda.com that has just gone live</a>!</p>
<p>It was such a great experience, the team at Lynda are so professional and they have many recording booths with the best gear. I think there were 6 courses being recorded while I was there so it&#8217;s quite a production! And they have teams of editors cutting out all the gaps, and fixing my mistakes (thanks guys <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>So come learn about importing 3D models, particles, interactivity, ViewportLayers, and much, much more. I&#8217;d love to hear your feedback and find out how you get along so let me know!</p>
<p><a href="http://www.lynda.com/home/DisplayCourse.aspx?lpk2=61220">Papervision3D Essential Training on Lynda.com</a></p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2008/03/particle-tutorial-now-on-lyndacom/' rel='bookmark' title='Permanent Link: Particle tutorial now on Lynda.com'>Particle tutorial now on Lynda.com</a></li>
<li><a href='http://sebleedelisle.com/2009/08/papervision3d-training-in-new-york-city/' rel='bookmark' title='Permanent Link: Papervision3D training in New York City!'>Papervision3D training in New York City!</a></li>
<li><a href='http://sebleedelisle.com/2008/09/all-set-for-fotb-papervision3d-session/' rel='bookmark' title='Permanent Link: All set for FOTB Papervision3D session'>All set for FOTB Papervision3D session</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/07/papervision3d-training-lynda/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>How we broadcast FlashBrighton meetings</title>
		<link>http://sebleedelisle.com/2010/03/how-we-broadcast-flashbrighton-meetings/</link>
		<comments>http://sebleedelisle.com/2010/03/how-we-broadcast-flashbrighton-meetings/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 10:03:31 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=973</guid>
		<description><![CDATA[I&#8217;ve just written a post for Influxis explaining how we used their TVStation app, to broadcast Branden Hall&#8217;s remote Hype presentation last week. Streaming a remote presentation with TVStation Related posts:Branden Hall on Hype at FlashBrighton Papervision3D Simplified at FlashBrighton


Related posts:<ol><li><a href='http://sebleedelisle.com/2010/03/branden-hall-on-hype-at-flashbrighton/' rel='bookmark' title='Permanent Link: Branden Hall on Hype at FlashBrighton'>Branden Hall on Hype at FlashBrighton</a></li>
<li><a href='http://sebleedelisle.com/2008/05/papervision3d-simplified-at-flashbrighton/' rel='bookmark' title='Permanent Link: Papervision3D Simplified at FlashBrighton'>Papervision3D Simplified at FlashBrighton</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F03%252Fhow-we-broadcast-flashbrighton-meetings%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FaqZ8vF%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22How%20we%20broadcast%20FlashBrighton%20meetings%20%23%22%20%7D);"></div>
<p><a href="http://labs.influxis.com/?p=764"><img src="http://farm5.static.flickr.com/4015/4460756778_5684395926.jpg" alt="Branden Hall at FlashBrighton" /></a></p>
<p>I&#8217;ve just written a post for Influxis explaining how we used their TVStation app, to broadcast Branden Hall&#8217;s remote Hype presentation last week. </p>
<p><a href="http://labs.influxis.com/?p=764">Streaming a remote presentation with TVStation</a></p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2010/03/branden-hall-on-hype-at-flashbrighton/' rel='bookmark' title='Permanent Link: Branden Hall on Hype at FlashBrighton'>Branden Hall on Hype at FlashBrighton</a></li>
<li><a href='http://sebleedelisle.com/2008/05/papervision3d-simplified-at-flashbrighton/' rel='bookmark' title='Permanent Link: Papervision3D Simplified at FlashBrighton'>Papervision3D Simplified at FlashBrighton</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/03/how-we-broadcast-flashbrighton-meetings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New York City training course announced</title>
		<link>http://sebleedelisle.com/2010/03/new-york-city-training-course-announced/</link>
		<comments>http://sebleedelisle.com/2010/03/new-york-city-training-course-announced/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 11:00:51 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=957</guid>
		<description><![CDATA[In association with Flash and the City, I&#8217;ll be running my new Flash games programming workshop in New York on the 13th May. I first ran this course in Brighton last month and it went really well with over 97% approval rating. Whether you&#8217;re an beginner or advanced coder you&#8217;ll get something out of the [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2009/08/papervision3d-training-in-new-york-city/' rel='bookmark' title='Permanent Link: Papervision3D training in New York City!'>Papervision3D training in New York City!</a></li>
<li><a href='http://sebleedelisle.com/2010/06/2-days-of-papervision3d-and-flash-games-training-for-249/' rel='bookmark' title='Permanent Link: 2 days of Papervision3D and Flash games training for £249!'>2 days of Papervision3D and Flash games training for £249!</a></li>
<li><a href='http://sebleedelisle.com/2010/02/more-training-courses-in-cologne-minneapolis-new-york-and-san-francisco/' rel='bookmark' title='Permanent Link: More training courses in Cologne, Minneapolis, New York and San Francisco'>More training courses in Cologne, Minneapolis, New York and San Francisco</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F03%252Fnew-york-city-training-course-announced%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FcUoKgE%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22New%20York%20City%20training%20course%20announced%20%23%22%20%7D);"></div>
<p><a href="http://flashgamestrainingnyc.eventbrite.com/" title="Asteroids"><img src="http://farm5.static.flickr.com/4005/4457075948_7ca95747ae.jpg" width="500" height="298" alt="Asteroids" /></a></p>
<p>In association with Flash and the City, I&#8217;ll be running my new Flash games programming workshop in New York on the 13th May. I first ran this course in Brighton last month and it went really well with over 97% approval rating.</p>
<p>Whether you&#8217;re an beginner or advanced coder you&#8217;ll get something out of the course. We walk through the anatomy of several arcade games with all source code and game engines provided. We&#8217;ll also be covering simple physics and collision detection beyond hitTest!</p>
<p><a href="http://flashgamestrainingnyc.eventbrite.com/">There are only a handful of super-early bird tickets left and I expect to sell out so I wouldn&#8217;t hang around if you want a place!</a></p>
<p>And I really look forward to seeing you in New York!</p>
<p>This workshop will also be available in :<br />
<strong>Cologne</strong> for <a href="http://ffk10.flashforum.de/workshops.php">FFK in April</a> (also a PV3D workshop)<br />
<strong>New York City</strong> <a href="http://flashgamestrainingnyc.eventbrite.com/">sponsored by Flash and the City in May</a><br />
<strong>Minneapolis</strong> for <a href="http://flashbelt.com/#/registration/">FlashBelt in June</a> </p>
<p>UK and Norway dates coming soon. </p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2009/08/papervision3d-training-in-new-york-city/' rel='bookmark' title='Permanent Link: Papervision3D training in New York City!'>Papervision3D training in New York City!</a></li>
<li><a href='http://sebleedelisle.com/2010/06/2-days-of-papervision3d-and-flash-games-training-for-249/' rel='bookmark' title='Permanent Link: 2 days of Papervision3D and Flash games training for £249!'>2 days of Papervision3D and Flash games training for £249!</a></li>
<li><a href='http://sebleedelisle.com/2010/02/more-training-courses-in-cologne-minneapolis-new-york-and-san-francisco/' rel='bookmark' title='Permanent Link: More training courses in Cologne, Minneapolis, New York and San Francisco'>More training courses in Cologne, Minneapolis, New York and San Francisco</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/03/new-york-city-training-course-announced/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Predicting circle line collisions</title>
		<link>http://sebleedelisle.com/2010/01/predicting-circle-line-collisions/</link>
		<comments>http://sebleedelisle.com/2010/01/predicting-circle-line-collisions/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 07:00:08 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sebleedelisle.com/?p=710</guid>
		<description><![CDATA[In my previous collision detection post (in what I expect will become a series), I talked about predicting whether two objects would collide in between frames. This is to avoid the situation where the objects are moving so fast that they pass through each other before you&#8217;ve had a chance to see if they&#8217;re overlapping. [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2008/12/smooth-circles-in-papervision/' rel='bookmark' title='Permanent Link: Smooth circles in Papervision'>Smooth circles in Papervision</a></li>
<li><a href='http://sebleedelisle.com/2008/03/drawing-3d-perspective-lines-in-flash/' rel='bookmark' title='Permanent Link: Drawing 3D perspective lines in Flash'>Drawing 3D perspective lines in Flash</a></li>
<li><a href='http://sebleedelisle.com/2010/01/predictive-collision-detection-techniques/' rel='bookmark' title='Permanent Link: Predictive collision detection techniques'>Predictive collision detection techniques</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2010%252F01%252Fpredicting-circle-line-collisions%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2Fc9Zn0D%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Predicting%20circle%20line%20collisions%20%23%22%20%7D);"></div>
<p><a href="http://sebleedelisle.com/2010/01/predicting-circle-line-collisions/"><img src="http://farm3.static.flickr.com/2224/4284624320_ff2b06d4e1.jpg" width="500" height="333" alt="IMG_8179" /></a></p>
<p>In <a href="http://sebleedelisle.com/2010/01/predictive-collision-detection-techniques/">my previous collision detection post</a> (in what I expect will become a series), I talked about predicting whether two objects would collide in between frames. This is to avoid the situation where the objects are moving so fast that they pass through each other before you&#8217;ve had a chance to see if they&#8217;re overlapping. This is often known as a sweep test (amongst other things!)</p>
<p>And I showed how you could predict collisions between a 2D circle and a vertical line but what about lines that aren&#8217;t vertical? How do you work out collisions between circles and lines of any angle? </p>
<p><span id="more-710"></span></p>
<p>Here is where vector maths comes in, so if you haven&#8217;t looked at it since school, <a href="http://processing.org/learning/pvector/">here&#8217;s a great article that will tell you the basics</a> (based around Processing but you&#8217;ll get the jist). And for further study you can look at <a href="http://chortle.ccsu.edu/VectorLessons/vectorIndex.html">this very comprehensive guide from the CCSU</a>.</p>
<p>So we have our circle flying around and we want to test whether it&#8217;s colliding with the line, in other words are they overlapping? Logic dictates that if the distance from the line to the centre of the circle is less than the circle&#8217;s radius then it must be penetrating (stop giggling at the back!). But how do we find this distance? </p>
<p>When I started solving these sort of problems I&#8217;d use trigonometry: right angled triangles and sine cosine and tan. But I later learned that you can use some magic vector maths to do the same thing much much faster. But first there are some things you need to know about : </p>
<p><strong>Dot product</strong></p>
<p>The dot product of 2 vectors is a number that varies depending on the angle between them. It&#8217;s called the dot product because it&#8217;s sometimes represented with a &#8216;˙&#8217; symbol. It&#8217;s calculated by multiplying the various elements of the two vectors together. Use this interactive demo to see how the dot product changes as you move the vectors around. </p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_DotProduct_1124554083"
			class="flashmovie"
			width="560"
			height="400">
	<param name="movie" value="http://sebleedelisle.com/uploads/physicstutorials/DotProduct.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://sebleedelisle.com/uploads/physicstutorials/DotProduct.swf"
			name="fm_DotProduct_1124554083"
			width="560"
			height="400">
	<!--<![endif]-->
		
<p>To view flash content<a href="http://sebleedelisle.com/2010/01/predictive-collision-detection-part-2"> visit the original post</a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>In particular, notice how the dot product is negative when the angle between the vectors is greater than 90º and positive when the angle is less than 90º. Also note that the dot product is 0 when the vectors are perpendicular to each other. This will be very useful to us later on. </p>
<p><strong>Normals</strong></p>
<p>Simply put, a normal is a vector that is at a right angle to a line, and it&#8217;s usually a unit vector, ie a vector that is 1 unit long. </p>
<p><strong>Shortest distance between a line and a circle</strong></p>
<p>Let&#8217;s say we have a line defined by two points P1 and P2, the line normal is N, and our circle&#8217;s centre point is C. We also have the vector between P1 and C, called (rather unimaginatively) P1C.  </p>
<p>To find out the distance between C and the line you simply get the dot product between P1C and N. So if this distance is less than the radius of the circle then we know we&#8217;ve got an overlap and therefore the circle is colliding with the line!</p>
<p>You can see it here in this example, click to drag the points and the circle around. </p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_PointLineDistance_2018066231"
			class="flashmovie"
			width="560"
			height="400">
	<param name="movie" value="http://sebleedelisle.com/uploads/physicstutorials/PointLineDistance.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://sebleedelisle.com/uploads/physicstutorials/PointLineDistance.swf"
			name="fm_PointLineDistance_2018066231"
			width="560"
			height="400">
	<!--<![endif]-->
		
<p>To view flash content<a href="http://sebleedelisle.com/2010/01/predictive-collision-detection-part-2"> visit the original post</a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><strong>Predicting collisions between a circle and a line</strong></p>
<p>So you know the distance between the line and where the circle is now (lets call it d1), and what the distance will be in the next frame (d2), but what we need to know is how far along were we between frames when (and if) there will be a collision. A collision occurs when the distance is equal to the radius, and we&#8217;re trying to find a value for t (time) where t = 0 now and t = 1 in the next frame. </p>
<p>We can use this formula : </p>
<pre>current distance = d1 + (d2-d1) * t </pre>
<p>so when d = the radius r : </p>
<pre>r = d1 + (d2-d1) * t </pre>
<p>and with some algebra even I can just about manage we can extract t : </p>
<pre>r-d1 = (d2-d1)*t
(r - d1) / (d2-d1) = t </pre>
<p>So if t is between 0 and 1 we know we collided between frames! </p>
<p>Whew. This blog post is getting epic. But we&#8217;re not quite there yet, we still need to work out where the circle is at the point of collision: we take the vector between C1 and C2, multiply it by t and add it to C1. </p>
<p>Here&#8217;s an example that shows this all in action : </p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_CircleLinePredictive_1941722138"
			class="flashmovie"
			width="560"
			height="400">
	<param name="movie" value="http://sebleedelisle.com/uploads/physicstutorials/CircleLinePredictive.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://sebleedelisle.com/uploads/physicstutorials/CircleLinePredictive.swf"
			name="fm_CircleLinePredictive_1941722138"
			width="560"
			height="400">
	<!--<![endif]-->
		
<p>To view flash content<a href="http://sebleedelisle.com/2010/01/predictive-collision-detection-part-2"> visit the original post</a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>I&#8217;ll continue this series further to explain : </p>
<ul>
<li>collision reactions</li>
<li>collisions between moving circles</li>
<li>and all the same for 3D &#8211; spheres and planes!</li>
</ul>
<p>I really hope this is useful, it&#8217;s actually really hard to explain this in writing, so let me know if any of it is unclear. And of course I&#8217;ll be explaining this in more detail in my <a href="http://sebleedelisle.com/training/">upcoming Flash Game Programming training course. </a>  </p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2008/12/smooth-circles-in-papervision/' rel='bookmark' title='Permanent Link: Smooth circles in Papervision'>Smooth circles in Papervision</a></li>
<li><a href='http://sebleedelisle.com/2008/03/drawing-3d-perspective-lines-in-flash/' rel='bookmark' title='Permanent Link: Drawing 3D perspective lines in Flash'>Drawing 3D perspective lines in Flash</a></li>
<li><a href='http://sebleedelisle.com/2010/01/predictive-collision-detection-techniques/' rel='bookmark' title='Permanent Link: Predictive collision detection techniques'>Predictive collision detection techniques</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2010/01/predicting-circle-line-collisions/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
