<?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: Calculating the Projected Bounds using Utils3D.projectVector()</title>
	<atom:link href="http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/feed/" rel="self" type="application/rss+xml" />
	<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/</link>
	<description>Evtim on Flex SDK</description>
	<lastBuildDate>Thu, 17 Nov 2011 17:57:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Bart</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11620</link>
		<dc:creator>Bart</dc:creator>
		<pubDate>Wed, 11 May 2011 16:22:50 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11620</guid>
		<description>Thanks, you saved the day.

Note for others: this works by &#039;mimicking&#039; Flash native 3D on DisplayObjects (so you have a actionscript Vector3D that matches with the way Flash transforms DisplayObjects. I took me a bit to strip your function to just single vectors, so here a stripped-down snippet:

//the projection (grab from your perspective container)
var pp:PerspectiveProjection; 

//a 3D coordinate in world space (= same space as the perspective container)
var world:Vector3D;

//the magic bit
var mat:Matrix3D = new Matrix3D();
mat.appendTranslation(-pp.projectionCenter.x, -pp.projectionCenter.y, pp.focalLength);
mat.append(pp.toMatrix3D());

//project your world vectors so screen has the 2D coordinate in its x/y
var screen:Vector3D = Utils3D.projectVector(mat, world);</description>
		<content:encoded><![CDATA[<p>Thanks, you saved the day.</p>
<p>Note for others: this works by &#8216;mimicking&#8217; Flash native 3D on DisplayObjects (so you have a actionscript Vector3D that matches with the way Flash transforms DisplayObjects. I took me a bit to strip your function to just single vectors, so here a stripped-down snippet:</p>
<p>//the projection (grab from your perspective container)<br />
var pp:PerspectiveProjection; </p>
<p>//a 3D coordinate in world space (= same space as the perspective container)<br />
var world:Vector3D;</p>
<p>//the magic bit<br />
var mat:Matrix3D = new Matrix3D();<br />
mat.appendTranslation(-pp.projectionCenter.x, -pp.projectionCenter.y, pp.focalLength);<br />
mat.append(pp.toMatrix3D());</p>
<p>//project your world vectors so screen has the 2D coordinate in its x/y<br />
var screen:Vector3D = Utils3D.projectVector(mat, world);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evtim</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11616</link>
		<dc:creator>Evtim</dc:creator>
		<pubDate>Wed, 20 Apr 2011 03:06:53 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11616</guid>
		<description>The source link is at the bottom of the post. Here it is again &lt;a href=&quot;http://evtimmy.com/wordpress/wp-content/uploads/2009/12/projectedbounds.mxml&quot; rel=&quot;nofollow&quot;&gt; :)</description>
		<content:encoded><![CDATA[<p>The source link is at the bottom of the post. Here it is again <a href="http://evtimmy.com/wordpress/wp-content/uploads/2009/12/projectedbounds.mxml" rel="nofollow"> <img src='http://evtimmy.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evtim</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11602</link>
		<dc:creator>Evtim</dc:creator>
		<pubDate>Fri, 17 Dec 2010 07:14:39 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11602</guid>
		<description>There is a link to the source at the bottom of the post, here&#039;s the url http://evtimmy.com/wordpress/wp-content/uploads/2009/12/projectedbounds.mxml</description>
		<content:encoded><![CDATA[<p>There is a link to the source at the bottom of the post, here&#8217;s the url <a href="http://evtimmy.com/wordpress/wp-content/uploads/2009/12/projectedbounds.mxml" rel="nofollow">http://evtimmy.com/wordpress/wp-content/uploads/2009/12/projectedbounds.mxml</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shenshouer</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11600</link>
		<dc:creator>shenshouer</dc:creator>
		<pubDate>Thu, 16 Dec 2010 05:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11600</guid>
		<description>gmail:shenshouer51@gmail.com</description>
		<content:encoded><![CDATA[<p>gmail:shenshouer51@gmail.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shenshouer</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11599</link>
		<dc:creator>shenshouer</dc:creator>
		<pubDate>Thu, 16 Dec 2010 05:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11599</guid>
		<description>how could i get this example code?
when i view the application and right click to view the source code

report 404?
can you send me the code to my gmail? thanks</description>
		<content:encoded><![CDATA[<p>how could i get this example code?<br />
when i view the application and right click to view the source code</p>
<p>report 404?<br />
can you send me the code to my gmail? thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11597</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Sun, 28 Nov 2010 10:45:46 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11597</guid>
		<description>Thanks Evtim!

I assumed it was something to do with that. To be honest this is my first venture into 3D and perspectives so I&#039;m not totally sure of what I am doing, but understand what your saying about the center changing. I guess setting it to something global should work, so will have a look at that next.

It would be great to get your feedback on my posts about layout, incase I have got anything wrong :)

http://www.pixelbox.net/?p=440

Thanks again

Rob</description>
		<content:encoded><![CDATA[<p>Thanks Evtim!</p>
<p>I assumed it was something to do with that. To be honest this is my first venture into 3D and perspectives so I&#8217;m not totally sure of what I am doing, but understand what your saying about the center changing. I guess setting it to something global should work, so will have a look at that next.</p>
<p>It would be great to get your feedback on my posts about layout, incase I have got anything wrong <img src='http://evtimmy.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.pixelbox.net/?p=440" rel="nofollow">http://www.pixelbox.net/?p=440</a></p>
<p>Thanks again</p>
<p>Rob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evtim</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11596</link>
		<dc:creator>Evtim</dc:creator>
		<pubDate>Sun, 28 Nov 2010 02:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11596</guid>
		<description>Hi Rob,
I took a quick look - looking good!  I think the issue you pointed out is due to the way you initialize the projection.  If your application is using the default stage projection (not setting any custom projection or using the maintainProjectionCenter property), then you&#039;d need to use that in your calculations.  I think you&#039;d also need to convert the bounds to global coordinates (because you&#039;re projecting relative to the stage) and once you get the projected bounds, convert them back to your container&#039;s coordinates.

On the other hand, if you plan to use the &quot;maintainProjectinoCenter&quot; property on your container, then things will be more tricky - now Flex will keep the projection centered to the container, which means it will re-calculate and update the container&#039;s projection at updateDisplayList time by setting up the center to be the container&#039;s center.  In measure(), you&#039;d need to calculate width and height such that when used as center of the projection the bounds of the projected elements end up being the same width and height... I can&#039;t think of anything smart here off the top of my head, so probably I&#039;ll do some iterations and see if things converge.  Hope this helps.</description>
		<content:encoded><![CDATA[<p>Hi Rob,<br />
I took a quick look &#8211; looking good!  I think the issue you pointed out is due to the way you initialize the projection.  If your application is using the default stage projection (not setting any custom projection or using the maintainProjectionCenter property), then you&#8217;d need to use that in your calculations.  I think you&#8217;d also need to convert the bounds to global coordinates (because you&#8217;re projecting relative to the stage) and once you get the projected bounds, convert them back to your container&#8217;s coordinates.</p>
<p>On the other hand, if you plan to use the &#8220;maintainProjectinoCenter&#8221; property on your container, then things will be more tricky &#8211; now Flex will keep the projection centered to the container, which means it will re-calculate and update the container&#8217;s projection at updateDisplayList time by setting up the center to be the container&#8217;s center.  In measure(), you&#8217;d need to calculate width and height such that when used as center of the projection the bounds of the projected elements end up being the same width and height&#8230; I can&#8217;t think of anything smart here off the top of my head, so probably I&#8217;ll do some iterations and see if things converge.  Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://evtimmy.com/2009/12/calculating-the-projected-bounds-using-utils3dprojectvector/comment-page-1/#comment-11595</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Wed, 24 Nov 2010 11:21:52 +0000</pubDate>
		<guid isPermaLink="false">http://evtimmy.com/?p=173#comment-11595</guid>
		<description>Hi Evtim,

I am trying to use this in order to measure the width of my layout as I&#039;m transforming it&#039;s elements in 3D.

If you look at http://www.pixelbox.net/demos/customLayout3/CustomLayout3.html you can see the width is slightly off (view source enabled). The only thing I can think of is that the perspective is wrong in measure().

Would you be able to have a look and see if it&#039;s something obvious that I am doing wrong?

Thanks

Rob</description>
		<content:encoded><![CDATA[<p>Hi Evtim,</p>
<p>I am trying to use this in order to measure the width of my layout as I&#8217;m transforming it&#8217;s elements in 3D.</p>
<p>If you look at <a href="http://www.pixelbox.net/demos/customLayout3/CustomLayout3.html" rel="nofollow">http://www.pixelbox.net/demos/customLayout3/CustomLayout3.html</a> you can see the width is slightly off (view source enabled). The only thing I can think of is that the perspective is wrong in measure().</p>
<p>Would you be able to have a look and see if it&#8217;s something obvious that I am doing wrong?</p>
<p>Thanks</p>
<p>Rob</p>
]]></content:encoded>
	</item>
</channel>
</rss>

