<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: iq¹² creative session #1</title>
	<atom:link href="http://iq12.com/blog/2009/07/02/iq%c2%b9%c2%b2-creative-session-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://iq12.com/blog/2009/07/02/iq%c2%b9%c2%b2-creative-session-1/</link>
	<description>The drooling company</description>
	<lastBuildDate>Mon, 31 Oct 2011 13:35:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: fu</title>
		<link>http://iq12.com/blog/2009/07/02/iq%c2%b9%c2%b2-creative-session-1/comment-page-1/#comment-135</link>
		<dc:creator>fu</dc:creator>
		<pubDate>Tue, 25 Aug 2009 20:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://iq12.com/blog/?p=256#comment-135</guid>
		<description>yes it&#039;s realtime. The algorithm is quite easy if you understand &lt;a href=&quot;http://en.wikipedia.org/wiki/UV_mapping&quot; rel=&quot;nofollow&quot;&gt;UV mapping&lt;/a&gt;

The code is too ugly to post but here&#039;s the important part:
&lt;code&gt;
// this is the indices of the vertices used to draw the triangles: see drawTriangles documentation
private var indices:Vector.&lt;int&gt; = new Vector.&lt;int&gt;([7, 5, 17, 5, 4, 19, 6, 7, 20, 4, 6, 20, 4, 20, 21, 20, 7, 22, 0, 13, 23, 13, 14, 23, 14, 15, 24, 23, 14, 24, 15, 1, 24, 19, 3, 25, 18, 5, 25, 5, 19, 25, 2, 17, 26, 17, 5, 26, 5, 18, 26, 18, 25, 26, 17, 2, 27, 1, 15, 29, 16, 28, 29, 3, 19, 30, 11, 12, 31, 13, 0, 32, 31, 12, 32, 11, 21, 33, 21, 10, 33, 11, 33, 34, 33, 10, 35, 34, 33, 35, 12, 11, 36, 32, 12, 36, 9, 22, 37, 22, 8, 37, 37, 8, 38, 9, 37, 38, 9, 38, 39, 15, 14, 39, 8, 16, 40, 16, 29, 40, 29, 15, 40, 14, 13, 41, 35, 14, 41, 34, 35, 41, 13, 32, 41, 32, 36, 41, 11, 34, 41, 36, 11, 41, 15, 39, 42, 39, 38, 42, 38, 8, 42, 8, 40, 42, 40, 15, 42, 16, 8, 43, 8, 22, 43, 7, 17, 43, 17, 27, 43, 28, 16, 43, 22, 7, 43, 27, 28, 43, 19, 4, 44, 30, 19, 44, 21, 11, 44, 11, 31, 44, 4, 21, 44, 31, 30, 44, 10, 21, 45, 21, 20, 45, 22, 9, 45, 20, 22, 45, 9, 39, 45, 35, 10, 45, 14, 35, 45, 39, 14, 45, 4, 5, 46, 6, 4, 46, 5, 7, 46, 7, 6, 46]);
	
private function render(src1:Face, src2:Face, morphRatio:Number)
{
	var inverseMorphRatio:Number = 1 - morphRatio;
	
	// Face.vertices contains triangles summits coordinates (vertices) in the bitmapData space: use them to compute the target coordinates
	// Face.uvtData contains the same coordinates within a [0.0,1.0] x,y space: use them as source coordinates
	
	// the target vertices are a mix between the two faces
	var vertices:Vector.&lt;Number&gt; = new Vector.&lt;Number&gt;;
	for (var i:int = 0; i &lt; src1.vertices.length; i++)
		vertices.push ( src1.vertices[i] * inverseMorphRatio + src2.vertices[i] * morphRatio);
		
	// draw the first face with 1-alpha
	r1.alpha = inverseMorphRatio;
	r1.graphics.clear();
	r1.graphics.beginBitmapFill(src1.bmd);
	r1.graphics.drawTriangles(vertices, indices , src1.uvtData);
	
	// draw the second face
	r2.alpha = morphRatio;
	r2.graphics.clear();
	r2.graphics.beginBitmapFill(src2.bmd);
	r2.graphics.drawTriangles(vertices, indices , src2.uvtData);
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>yes it&#8217;s realtime. The algorithm is quite easy if you understand <a href="http://en.wikipedia.org/wiki/UV_mapping" rel="nofollow">UV mapping</a></p>
<p>The code is too ugly to post but here&#8217;s the important part:<br />
<code><br />
// this is the indices of the vertices used to draw the triangles: see drawTriangles documentation<br />
private var indices:Vector.<int> = new Vector.</int><int>([7, 5, 17, 5, 4, 19, 6, 7, 20, 4, 6, 20, 4, 20, 21, 20, 7, 22, 0, 13, 23, 13, 14, 23, 14, 15, 24, 23, 14, 24, 15, 1, 24, 19, 3, 25, 18, 5, 25, 5, 19, 25, 2, 17, 26, 17, 5, 26, 5, 18, 26, 18, 25, 26, 17, 2, 27, 1, 15, 29, 16, 28, 29, 3, 19, 30, 11, 12, 31, 13, 0, 32, 31, 12, 32, 11, 21, 33, 21, 10, 33, 11, 33, 34, 33, 10, 35, 34, 33, 35, 12, 11, 36, 32, 12, 36, 9, 22, 37, 22, 8, 37, 37, 8, 38, 9, 37, 38, 9, 38, 39, 15, 14, 39, 8, 16, 40, 16, 29, 40, 29, 15, 40, 14, 13, 41, 35, 14, 41, 34, 35, 41, 13, 32, 41, 32, 36, 41, 11, 34, 41, 36, 11, 41, 15, 39, 42, 39, 38, 42, 38, 8, 42, 8, 40, 42, 40, 15, 42, 16, 8, 43, 8, 22, 43, 7, 17, 43, 17, 27, 43, 28, 16, 43, 22, 7, 43, 27, 28, 43, 19, 4, 44, 30, 19, 44, 21, 11, 44, 11, 31, 44, 4, 21, 44, 31, 30, 44, 10, 21, 45, 21, 20, 45, 22, 9, 45, 20, 22, 45, 9, 39, 45, 35, 10, 45, 14, 35, 45, 39, 14, 45, 4, 5, 46, 6, 4, 46, 5, 7, 46, 7, 6, 46]);</p>
<p>private function render(src1:Face, src2:Face, morphRatio:Number)<br />
{<br />
	var inverseMorphRatio:Number = 1 - morphRatio;</p>
<p>	// Face.vertices contains triangles summits coordinates (vertices) in the bitmapData space: use them to compute the target coordinates<br />
	// Face.uvtData contains the same coordinates within a [0.0,1.0] x,y space: use them as source coordinates</p>
<p>	// the target vertices are a mix between the two faces<br />
	var vertices:Vector.<number> = new Vector.</number><number>;<br />
	for (var i:int = 0; i < src1.vertices.length; i++)<br />
		vertices.push ( src1.vertices[i] * inverseMorphRatio + src2.vertices[i] * morphRatio);</p>
<p>	// draw the first face with 1-alpha<br />
	r1.alpha = inverseMorphRatio;<br />
	r1.graphics.clear();<br />
	r1.graphics.beginBitmapFill(src1.bmd);<br />
	r1.graphics.drawTriangles(vertices, indices , src1.uvtData);</p>
<p>	// draw the second face<br />
	r2.alpha = morphRatio;<br />
	r2.graphics.clear();<br />
	r2.graphics.beginBitmapFill(src2.bmd);<br />
	r2.graphics.drawTriangles(vertices, indices , src2.uvtData);<br />
}<br />
</code></number></int></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Og2t</title>
		<link>http://iq12.com/blog/2009/07/02/iq%c2%b9%c2%b2-creative-session-1/comment-page-1/#comment-134</link>
		<dc:creator>Og2t</dc:creator>
		<pubDate>Tue, 25 Aug 2009 19:15:21 +0000</pubDate>
		<guid isPermaLink="false">http://iq12.com/blog/?p=256#comment-134</guid>
		<description>RIP Michael! Is the morphing realtime? What algorithm are you using? It&#039;s very fast!</description>
		<content:encoded><![CDATA[<p>RIP Michael! Is the morphing realtime? What algorithm are you using? It&#8217;s very fast!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iq¹² creative session #1 &#8211; appel à participations &#124; iq¹²</title>
		<link>http://iq12.com/blog/2009/07/02/iq%c2%b9%c2%b2-creative-session-1/comment-page-1/#comment-85</link>
		<dc:creator>iq¹² creative session #1 &#8211; appel à participations &#124; iq¹²</dc:creator>
		<pubDate>Thu, 02 Jul 2009 21:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://iq12.com/blog/?p=256#comment-85</guid>
		<description>[...] tous ceux qui voudraient participer à cet hommage/pitrerie sont les [...]</description>
		<content:encoded><![CDATA[<p>[...] tous ceux qui voudraient participer à cet hommage/pitrerie sont les [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Faites entrer l'accusée</title>
		<link>http://iq12.com/blog/2009/07/02/iq%c2%b9%c2%b2-creative-session-1/comment-page-1/#comment-84</link>
		<dc:creator>Faites entrer l'accusée</dc:creator>
		<pubDate>Thu, 02 Jul 2009 13:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://iq12.com/blog/?p=256#comment-84</guid>
		<description>Ulu &gt; tudutudu, ne m&#039;accuse pas et post ton Michael, assume !</description>
		<content:encoded><![CDATA[<p>Ulu &gt; tudutudu, ne m&#8217;accuse pas et post ton Michael, assume !</p>
]]></content:encoded>
	</item>
</channel>
</rss>

