<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ActionScript Scraps &#187; dragging</title>
	<atom:link href="http://blog.sitedaniel.com/tag/dragging/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sitedaniel.com</link>
	<description>Flash, Flex and AIR development</description>
	<lastBuildDate>Tue, 07 Sep 2010 21:57:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dragging in Papervision 3D &#8211; example</title>
		<link>http://blog.sitedaniel.com/2009/09/dragging-in-papervision-3d-2/</link>
		<comments>http://blog.sitedaniel.com/2009/09/dragging-in-papervision-3d-2/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 15:51:36 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[as3.0]]></category>
		<category><![CDATA[dragging]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[papervision]]></category>
		<category><![CDATA[papervision3d]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://blog.sitedaniel.com/?p=343</guid>
		<description><![CDATA[UPDATE 29/09/09: This technique is possibly no longer valid with the latest version of Papervision3D. Here is a small example I put together quickly today to demonstrate how to drag in 3D using Papervision and the InteractiveUtils.getMapCoordAtPointDO3D function. Since my last post on this in December last year, the Papervision getMapCoordAtPointDO3D method returned object's x [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE 29/09/09: This technique is possibly no longer valid with the latest version of Papervision3D.</strong></p>
<p><a href="http://blog.sitedaniel.com/demo/3D_dragging/main.swf" rel="shadowbox;height=600;width=900"><br />
<img src="http://blog.sitedaniel.com/wp-content/uploads/2009/09/screenshot.png" alt="Dragging in Papervision example" title="screenshot" width="400" height="270" class="size-full wp-image-345" /></a></p>
<p>Here is a small example I put together quickly today to demonstrate how to drag in 3D using Papervision and the InteractiveUtils.getMapCoordAtPointDO3D function.<br />
Since my <a href="http://blog.sitedaniel.com/2008/12/dragging-in-papervision-3d/">last post</a> on this in December last year, the Papervision getMapCoordAtPointDO3D method returned object's x and y values seemed to have changed by a factor of 36.</p>
<p><strong>UPDATE 29/09/09: This technique is possibly no longer valid with the latest version of Papervision3D.</strong></p>
<pre class="actionscript">&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _updateDrag<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">// get the update position on the plane</span>
    <span style="color: #000000; font-weight: bold;">var</span> obj:<span style="color: #0066CC;">Object</span> = InteractiveUtils.<span style="color: #006600;">getMapCoordAtPointDO3D</span><span style="color: #66cc66;">&#40;</span>_selectedPlane,
                                        _selectedPlane.<span style="color: #006600;">container</span>.<span style="color: #006600;">mouseX</span>,
                                        _selectedPlane.<span style="color: #006600;">container</span>.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #808080; font-style: italic;">// move the dragged plane to the new postion with the offset</span>
    _selectedPlane.<span style="color: #006600;">x</span> = _selectedPlane.<span style="color: #006600;">x</span> + obj.<span style="color: #006600;">x</span> * <span style="color: #cc66cc;">36</span> - _drag_X_offset;
    _selectedPlane.<span style="color: #006600;">y</span> = _selectedPlane.<span style="color: #006600;">y</span> - obj.<span style="color: #006600;">y</span> * <span style="color: #cc66cc;">36</span>  + _drag_Y_offset;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Click <a href="http://blog.sitedaniel.com/demo/3D_dragging/main.swf" rel="shadowbox;height=600;width=900">here</a> to see it in action.</p>
<p>The source files can be downloaded <a href="http://blog.sitedaniel.com/downloads/3D_plane_dragging_example.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sitedaniel.com/2009/09/dragging-in-papervision-3d-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
