<?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: Switching parents at runtime</title>
	<atom:link href="http://pv3d.org/2008/11/19/switching-parents-at-runtime/feed/" rel="self" type="application/rss+xml" />
	<link>http://pv3d.org/2008/11/19/switching-parents-at-runtime/</link>
	<description>Papervision3D, ActionScript, and Flex examples and tutorials by John Lindquist</description>
	<lastBuildDate>Fri, 30 Jul 2010 10:38:34 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Quantium</title>
		<link>http://pv3d.org/2008/11/19/switching-parents-at-runtime/comment-page-1/#comment-1184</link>
		<dc:creator>Quantium</dc:creator>
		<pubDate>Mon, 23 Mar 2009 21:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=39#comment-1184</guid>
		<description>Lindquist.

I love you so much for this.

I&#039;ve has a week trying to solve this in a proyect.</description>
		<content:encoded><![CDATA[<p>Lindquist.</p>
<p>I love you so much for this.</p>
<p>I&#8217;ve has a week trying to solve this in a proyect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark mun</title>
		<link>http://pv3d.org/2008/11/19/switching-parents-at-runtime/comment-page-1/#comment-524</link>
		<dc:creator>mark mun</dc:creator>
		<pubDate>Mon, 26 Jan 2009 06:23:30 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=39#comment-524</guid>
		<description>Hah!... that&#039;s pretty good Jeff. Now I can stop wasting time trying to figure out &quot;.world&quot;, &quot;calculateInverse&quot;, &quot;calculateMultiply&quot;, &quot;copyTransform&quot;...</description>
		<content:encoded><![CDATA[<p>Hah!&#8230; that&#8217;s pretty good Jeff. Now I can stop wasting time trying to figure out &#8220;.world&#8221;, &#8220;calculateInverse&#8221;, &#8220;calculateMultiply&#8221;, &#8220;copyTransform&#8221;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Yamada</title>
		<link>http://pv3d.org/2008/11/19/switching-parents-at-runtime/comment-page-1/#comment-498</link>
		<dc:creator>Jeff Yamada</dc:creator>
		<pubDate>Thu, 22 Jan 2009 07:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=39#comment-498</guid>
		<description>Hey John!

Great post! I thought I&#039;d share this little utility I made using your code that I&#039;m using a ton!

package com.jeffyamada.util
{
	import org.papervision3d.core.math.Matrix3D;
	import org.papervision3d.objects.DisplayObject3D;
	
	public class PapervisionUtils
	{
		static public function swapParents( child:DisplayObject3D, fromParent:DisplayObject3D, toParent:DisplayObject3D ):void
		{
			var childWorldMatrix:Matrix3D = child.world;
			
			var inverse:Matrix3D = new Matrix3D();
			var tempParentMatrix:Matrix3D = new Matrix3D();
			
			inverse.calculateInverse( toParent.world );
			tempParentMatrix.calculateMultiply( inverse, childWorldMatrix );
			
			child.copyTransform( tempParentMatrix );
			child.parent.removeChild( child );
			
			toParent.addChild( child );
		}
	}
}</description>
		<content:encoded><![CDATA[<p>Hey John!</p>
<p>Great post! I thought I&#8217;d share this little utility I made using your code that I&#8217;m using a ton!</p>
<p>package com.jeffyamada.util<br />
{<br />
	import org.papervision3d.core.math.Matrix3D;<br />
	import org.papervision3d.objects.DisplayObject3D;</p>
<p>	public class PapervisionUtils<br />
	{<br />
		static public function swapParents( child:DisplayObject3D, fromParent:DisplayObject3D, toParent:DisplayObject3D ):void<br />
		{<br />
			var childWorldMatrix:Matrix3D = child.world;</p>
<p>			var inverse:Matrix3D = new Matrix3D();<br />
			var tempParentMatrix:Matrix3D = new Matrix3D();</p>
<p>			inverse.calculateInverse( toParent.world );<br />
			tempParentMatrix.calculateMultiply( inverse, childWorldMatrix );</p>
<p>			child.copyTransform( tempParentMatrix );<br />
			child.parent.removeChild( child );</p>
<p>			toParent.addChild( child );<br />
		}<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
