﻿<?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"
	>
<channel>
	<title>Comments on: getting 2d coords from displayobject3d</title>
	<atom:link href="http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d/feed" rel="self" type="application/rss+xml" />
	<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d</link>
	<description>technology, politics, armchair philosophy</description>
	<pubDate>Thu, 20 Nov 2008 16:48:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: jkozniewski</title>
		<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-585</link>
		<dc:creator>jkozniewski</dc:creator>
		<pubDate>Thu, 12 Jun 2008 14:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-585</guid>
		<description>Hi...
@Slaymantis
I've recently wrote a method to do the reverse ( 2d-&#62;3d coords ):

private function setScreenCoords( do3d:DisplayObject3D, camera :CameraObject3D, x:Number, y:Number ) : void {
			
			var persp:Number = (camera.focus * camera.zoom) / (camera.focus + do3d.view.n34);
			
			
			
			do3d.x = x / persp; 
			do3d.y = -y / persp;
			
			
			
		}</description>
		<content:encoded><![CDATA[<p>Hi&#8230;<br />
@Slaymantis<br />
I&#8217;ve recently wrote a method to do the reverse ( 2d-&gt;3d coords ):</p>
<p>private function setScreenCoords( do3d:DisplayObject3D, camera :CameraObject3D, x:Number, y:Number ) : void {</p>
<p>			var persp:Number = (camera.focus * camera.zoom) / (camera.focus + do3d.view.n34);</p>
<p>			do3d.x = x / persp;<br />
			do3d.y = -y / persp;</p>
<p>		}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Slaymantis</title>
		<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-494</link>
		<dc:creator>Slaymantis</dc:creator>
		<pubDate>Wed, 21 May 2008 18:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-494</guid>
		<description>how would you write a function  convertTo3DCoords then.
so you can input 2d coords and get them in relation to the 3d coords? I tried the .screen fix but doesnt seem to move the object around</description>
		<content:encoded><![CDATA[<p>how would you write a function  convertTo3DCoords then.<br />
so you can input 2d coords and get them in relation to the 3d coords? I tried the .screen fix but doesnt seem to move the object around</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maciek</title>
		<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-387</link>
		<dc:creator>Maciek</dc:creator>
		<pubDate>Wed, 07 May 2008 01:28:52 +0000</pubDate>
		<guid isPermaLink="false">http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-387</guid>
		<description>To make this work again open this file branches\GreatWhite\src\org\papervision3d\objects\DisplayObject3D.as

Then go to empty line 756 and put this extra line of code: 

calculateScreenCoords( renderSessionData.camera ); 

right above this two lines:

var screenZs :Number = 0;
var children :Number = 0;</description>
		<content:encoded><![CDATA[<p>To make this work again open this file branches\GreatWhite\src\org\papervision3d\objects\DisplayObject3D.as</p>
<p>Then go to empty line 756 and put this extra line of code: </p>
<p>calculateScreenCoords( renderSessionData.camera ); </p>
<p>right above this two lines:</p>
<p>var screenZs :Number = 0;<br />
var children :Number = 0;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Mostafa</title>
		<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-361</link>
		<dc:creator>Joshua Mostafa</dc:creator>
		<pubDate>Mon, 28 Apr 2008 23:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-361</guid>
		<description>Because it didn't work - at least against the bleeding edge of Great White in SVN at my last checkout.</description>
		<content:encoded><![CDATA[<p>Because it didn&#8217;t work - at least against the bleeding edge of Great White in SVN at my last checkout.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Manh</title>
		<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-360</link>
		<dc:creator>Mike Manh</dc:creator>
		<pubDate>Mon, 28 Apr 2008 17:25:20 +0000</pubDate>
		<guid isPermaLink="false">http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-360</guid>
		<description>Why not use object.screen.x and object.screen.y?</description>
		<content:encoded><![CDATA[<p>Why not use object.screen.x and object.screen.y?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barbara</title>
		<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-293</link>
		<dc:creator>barbara</dc:creator>
		<pubDate>Thu, 17 Apr 2008 14:35:23 +0000</pubDate>
		<guid isPermaLink="false">http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-293</guid>
		<description>Hi!
Just for info, if your viewport doesn't fill the whole stage, it's just a matter of adding the viewport.width/2 and the viewport.height/2 to the Point's x and y coordinates respectively. 
Cheers!</description>
		<content:encoded><![CDATA[<p>Hi!<br />
Just for info, if your viewport doesn&#8217;t fill the whole stage, it&#8217;s just a matter of adding the viewport.width/2 and the viewport.height/2 to the Point&#8217;s x and y coordinates respectively.<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-266</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Tue, 08 Apr 2008 20:17:06 +0000</pubDate>
		<guid isPermaLink="false">http://joshua.almirun.com/tech/ria/flash/getting-2d-coords-from-displayobject3d#comment-266</guid>
		<description>Great find! Now, do you happen to know how to reverse it? 

Starting a pv3d project where I'm going to have to be jumping back and forth between 3d and MCs, and thought I would ask before spending the better part of the day figuring out how to reverse it. 

If not, I'll share my results (when I figure it out). Thanks</description>
		<content:encoded><![CDATA[<p>Great find! Now, do you happen to know how to reverse it? </p>
<p>Starting a pv3d project where I&#8217;m going to have to be jumping back and forth between 3d and MCs, and thought I would ask before spending the better part of the day figuring out how to reverse it. </p>
<p>If not, I&#8217;ll share my results (when I figure it out). Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
