<?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 for Random Meditations</title>
	<atom:link href="http://blog.melihelibol.com/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.melihelibol.com</link>
	<description>on pertinent substance, and persistent deliberation on quaint curiosities.</description>
	<lastBuildDate>Fri, 04 Jun 2010 23:27:14 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Plane Scaling and Positioning with Papervision by H</title>
		<link>http://blog.melihelibol.com/?p=3&#038;cpage=1#comment-12001</link>
		<dc:creator>H</dc:creator>
		<pubDate>Fri, 04 Jun 2010 23:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=3#comment-12001</guid>
		<description>Hey Matt,

Let&#039;s call the parent of the target element the &quot;branch element&quot; and the actual target element the &quot;leaf element.&quot; We will also refer to the viewport as the &quot;root.&quot;

The branch element&#039;s transform must be recalculated relative to the root&#039;s transform. The leaf element&#039;s transform must be recalculated relative to the branch element&#039;s transform. Perhaps there are multiple leaf elements that we want to leave unchanged. One solution is to apply the calculations that would occur between the root and branch element to the leaf element, as well as the branch and leaf element calculations. In this scenario, we take two passes to compute the target leaf element&#039;s transform, one with the root and branch element&#039;s transforms, and one with the branch and *the original* target leaf element&#039;s transform.

Sample algorithm:
Create a copy of the target leaf element&#039;s transform.
Apply root to branch calculations to the copied transform.
Apply branch to leaf calculations using the original leaf element&#039;s transform to the copied transform.
Set the target leaf element&#039;s transform to the copied transform.
Force render if needed.

Hope this helps,
Melih</description>
		<content:encoded><![CDATA[<p>Hey Matt,</p>
<p>Let&#8217;s call the parent of the target element the &#8220;branch element&#8221; and the actual target element the &#8220;leaf element.&#8221; We will also refer to the viewport as the &#8220;root.&#8221;</p>
<p>The branch element&#8217;s transform must be recalculated relative to the root&#8217;s transform. The leaf element&#8217;s transform must be recalculated relative to the branch element&#8217;s transform. Perhaps there are multiple leaf elements that we want to leave unchanged. One solution is to apply the calculations that would occur between the root and branch element to the leaf element, as well as the branch and leaf element calculations. In this scenario, we take two passes to compute the target leaf element&#8217;s transform, one with the root and branch element&#8217;s transforms, and one with the branch and *the original* target leaf element&#8217;s transform.</p>
<p>Sample algorithm:<br />
Create a copy of the target leaf element&#8217;s transform.<br />
Apply root to branch calculations to the copied transform.<br />
Apply branch to leaf calculations using the original leaf element&#8217;s transform to the copied transform.<br />
Set the target leaf element&#8217;s transform to the copied transform.<br />
Force render if needed.</p>
<p>Hope this helps,<br />
Melih</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Plane Scaling and Positioning with Papervision by Matt</title>
		<link>http://blog.melihelibol.com/?p=3&#038;cpage=1#comment-11331</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 13 May 2010 09:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=3#comment-11331</guid>
		<description>I know this is a really old thread and chances are nobody checks it anymore but I was wondering how I would modify this to get it to work on planes which are children of other planes. This works great when the child is a direct descendant of the viewport but not once it is reparented. I thought first that adjusting the calculations so that it takes into account the containing plane width and height as opposed to the viewport but I am getting odd results.

Any help would be much appreciated...

Thanks</description>
		<content:encoded><![CDATA[<p>I know this is a really old thread and chances are nobody checks it anymore but I was wondering how I would modify this to get it to work on planes which are children of other planes. This works great when the child is a direct descendant of the viewport but not once it is reparented. I thought first that adjusting the calculations so that it takes into account the containing plane width and height as opposed to the viewport but I am getting odd results.</p>
<p>Any help would be much appreciated&#8230;</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on FileReference &#8211; Can I get an IO Error? by Talmai</title>
		<link>http://blog.melihelibol.com/?p=17&#038;cpage=1#comment-8243</link>
		<dc:creator>Talmai</dc:creator>
		<pubDate>Wed, 20 Jan 2010 16:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=17#comment-8243</guid>
		<description>Try using callLater:

						callLater(fileRef.download, new Array(urlRequest));</description>
		<content:encoded><![CDATA[<p>Try using callLater:</p>
<p>						callLater(fileRef.download, new Array(urlRequest));</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on FileReference &#8211; Can I get an IO Error? by H</title>
		<link>http://blog.melihelibol.com/?p=17&#038;cpage=1#comment-6994</link>
		<dc:creator>H</dc:creator>
		<pubDate>Fri, 20 Nov 2009 20:09:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=17#comment-6994</guid>
		<description>Hi Mike,

Different Flex SDK/Flash IDE version and Flash Player version combinations can produce different results... Try creating a unit test for the process(es), or isolating the code in a clean project and debugging it with traces.</description>
		<content:encoded><![CDATA[<p>Hi Mike,</p>
<p>Different Flex SDK/Flash IDE version and Flash Player version combinations can produce different results&#8230; Try creating a unit test for the process(es), or isolating the code in a clean project and debugging it with traces.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on FileReference &#8211; Can I get an IO Error? by mike</title>
		<link>http://blog.melihelibol.com/?p=17&#038;cpage=1#comment-6513</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Thu, 22 Oct 2009 19:04:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=17#comment-6513</guid>
		<description>I tried this and still got the issue.  Any idea qhy?</description>
		<content:encoded><![CDATA[<p>I tried this and still got the issue.  Any idea qhy?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Coordinate Utility class for Papervision 3D by martial</title>
		<link>http://blog.melihelibol.com/?p=21&#038;cpage=1#comment-6104</link>
		<dc:creator>martial</dc:creator>
		<pubDate>Thu, 01 Oct 2009 08:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=21#comment-6104</guid>
		<description>Hey just a word : It&#039;s really awesome and so useful...

Thanks a lot !</description>
		<content:encoded><![CDATA[<p>Hey just a word : It&#8217;s really awesome and so useful&#8230;</p>
<p>Thanks a lot !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on FileReference &#8211; Can I get an IO Error? by Glenn</title>
		<link>http://blog.melihelibol.com/?p=17&#038;cpage=1#comment-5906</link>
		<dc:creator>Glenn</dc:creator>
		<pubDate>Tue, 22 Sep 2009 04:32:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=17#comment-5906</guid>
		<description>It&#039;s pretty dumb that the second works, but it might be a timing issue. &quot;fileRef&quot; goes out of scope and gets garbage collected in the first example. The second example has fileRef trapped inside the new function&#039;s closure, so it remains in scope for slightly longer, until the GC decides that *both* &quot;fileRef&quot; and &quot;succeed&quot; are out of scope, and cleans them both up. The safest option is to create a local member for fileRef.</description>
		<content:encoded><![CDATA[<p>It&#8217;s pretty dumb that the second works, but it might be a timing issue. &#8220;fileRef&#8221; goes out of scope and gets garbage collected in the first example. The second example has fileRef trapped inside the new function&#8217;s closure, so it remains in scope for slightly longer, until the GC decides that *both* &#8220;fileRef&#8221; and &#8220;succeed&#8221; are out of scope, and cleans them both up. The safest option is to create a local member for fileRef.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Coordinate Utility class for Papervision 3D by H</title>
		<link>http://blog.melihelibol.com/?p=21&#038;cpage=1#comment-5848</link>
		<dc:creator>H</dc:creator>
		<pubDate>Sat, 19 Sep 2009 22:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=21#comment-5848</guid>
		<description>You are very welcome Jairus :) I&#039;m glad it has been so helpful to you!</description>
		<content:encoded><![CDATA[<p>You are very welcome Jairus <img src='http://blog.melihelibol.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m glad it has been so helpful to you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Coordinate Utility class for Papervision 3D by Jairus</title>
		<link>http://blog.melihelibol.com/?p=21&#038;cpage=1#comment-5832</link>
		<dc:creator>Jairus</dc:creator>
		<pubDate>Sat, 19 Sep 2009 06:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=21#comment-5832</guid>
		<description>wow, again i&#039;ve come searching and found the answer in the same place :D thanks for this utility class :D it was again very helpful.</description>
		<content:encoded><![CDATA[<p>wow, again i&#8217;ve come searching and found the answer in the same place <img src='http://blog.melihelibol.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  thanks for this utility class <img src='http://blog.melihelibol.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  it was again very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Coordinate Utility class for Papervision 3D by H</title>
		<link>http://blog.melihelibol.com/?p=21&#038;cpage=1#comment-4028</link>
		<dc:creator>H</dc:creator>
		<pubDate>Tue, 23 Jun 2009 14:27:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.computerelibol.com/?p=21#comment-4028</guid>
		<description>James,

I am posting the answer to your question so that others will have the answer in case they have the same question.

The math for projection in papervision 2.0 is a matter of finding the perspective of the camera object. Once this has been achieved, one can project a 3D object to the screen by doing some basic math on the coordinates of the 3D object in camera space.

The following equation assumes the coordinates are relative to the coordinate space of the camera. This can be achieved by multiplying the objects world transform with the camera transform, but I believe there is a public var for 3D objects in papervision that has this transform already computed. The trick is to look out for optimizations. The public var camera transform may not be updated unless that object has been rendered. I believe this property is screen, but this may have changed or may change with the upcoming version of papervision.

Assume in the following code snippet that cam is the camera object, object is the 3D object, and screen is the objects transform in camera space.

&lt;pre lang=&quot;actionscript&quot;&gt;
var perspective = cam.focus*cam.zoom/screen.z;
var x = object.x*perspective;
var y = object.y*perspective;
&lt;/pre&gt;

That&#039;s it!

The math for this is bit more involved when using a projection matrix.</description>
		<content:encoded><![CDATA[<p>James,</p>
<p>I am posting the answer to your question so that others will have the answer in case they have the same question.</p>
<p>The math for projection in papervision 2.0 is a matter of finding the perspective of the camera object. Once this has been achieved, one can project a 3D object to the screen by doing some basic math on the coordinates of the 3D object in camera space.</p>
<p>The following equation assumes the coordinates are relative to the coordinate space of the camera. This can be achieved by multiplying the objects world transform with the camera transform, but I believe there is a public var for 3D objects in papervision that has this transform already computed. The trick is to look out for optimizations. The public var camera transform may not be updated unless that object has been rendered. I believe this property is screen, but this may have changed or may change with the upcoming version of papervision.</p>
<p>Assume in the following code snippet that cam is the camera object, object is the 3D object, and screen is the objects transform in camera space.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> perspective = cam.<span style="color: #006600;">focus</span><span style="color: #66cc66;">*</span>cam.<span style="color: #006600;">zoom</span><span style="color: #66cc66;">/</span>screen.<span style="color: #006600;">z</span>;
<span style="color: #000000; font-weight: bold;">var</span> x = <span style="color: #0066CC;">object</span>.<span style="color: #006600;">x</span><span style="color: #66cc66;">*</span>perspective;
<span style="color: #000000; font-weight: bold;">var</span> y = <span style="color: #0066CC;">object</span>.<span style="color: #006600;">y</span><span style="color: #66cc66;">*</span>perspective;</pre></div></div>

<p>That&#8217;s it!</p>
<p>The math for this is bit more involved when using a projection matrix.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
