<?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: Rotating a Sprite around any point</title>
	<atom:link href="http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/</link>
	<description>3D user experience on the web. Design, technology news. A blog by Bartek Drozdz.</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:42:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Lorenz</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-199427</link>
		<dc:creator>Lorenz</dc:creator>
		<pubDate>Tue, 06 Apr 2010 17:38:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-199427</guid>
		<description>Thank you, u saved my life!</description>
		<content:encoded><![CDATA[<p>Thank you, u saved my life!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jairus</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-35856</link>
		<dc:creator>jairus</dc:creator>
		<pubDate>Fri, 28 Aug 2009 05:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-35856</guid>
		<description>opps, didn&#039;t read the 4th paragraph</description>
		<content:encoded><![CDATA[<p>opps, didn&#8217;t read the 4th paragraph</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jairus</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-35855</link>
		<dc:creator>jairus</dc:creator>
		<pubDate>Fri, 28 Aug 2009 05:38:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-35855</guid>
		<description>a simpler solution might be to place the sprite into a container sprite, modify both their x&amp;y properties, and then rotate the container sprite.</description>
		<content:encoded><![CDATA[<p>a simpler solution might be to place the sprite into a container sprite, modify both their x&amp;y properties, and then rotate the container sprite.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ALLeX</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-9792</link>
		<dc:creator>ALLeX</dc:creator>
		<pubDate>Sat, 29 Nov 2008 14:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-9792</guid>
		<description>I&#039;d serch in google for a few hour and finnaly finded you genial post :) This is so simply to rotate sprite around self center.

Ted F.A. - I LIKE YOUR&#039;s solution.

Regards.</description>
		<content:encoded><![CDATA[<p>I&#8217;d serch in google for a few hour and finnaly finded you genial post :) This is so simply to rotate sprite around self center.</p>
<p>Ted F.A. &#8211; I LIKE YOUR&#8217;s solution.</p>
<p>Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bartek drozdz</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-9544</link>
		<dc:creator>bartek drozdz</dc:creator>
		<pubDate>Fri, 21 Nov 2008 20:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-9544</guid>
		<description>@Ted yes, this would be less flexible. If you need to move the center only once - your solution is the simplest and probably the best one for such a case. The one above was designed to change the registration point many times and still keep a fluid movement.</description>
		<content:encoded><![CDATA[<p>@Ted yes, this would be less flexible. If you need to move the center only once &#8211; your solution is the simplest and probably the best one for such a case. The one above was designed to change the registration point many times and still keep a fluid movement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted F.A. van Gaalen</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-9542</link>
		<dc:creator>Ted F.A. van Gaalen</dc:creator>
		<pubDate>Fri, 21 Nov 2008 20:03:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-9542</guid>
		<description>of course this is less flexible</description>
		<content:encoded><![CDATA[<p>of course this is less flexible</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted F.A. van Gaalen</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-9536</link>
		<dc:creator>Ted F.A. van Gaalen</dc:creator>
		<pubDate>Fri, 21 Nov 2008 18:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-9536</guid>
		<description>Hi Bartek 
There is even a much simpler solution,
just define the Sprite, using negative left upper corner coordinate
like this:

// Define and create the inner rectangle:
      innerRect.graphics.lineStyle(1, 0x00FF00, 1);
      innerRect.graphics.beginFill(0xFFFFFF);
      innerRect.graphics.drawRect(-100,-50,200, 100);
      innerRect.graphics.endFill();
			innerRect.alpha = 0.6;
			
      addChild (innerRect);
			innerRectRotationAngle = -180;
			innerRect.x = 300;
			innerRect.y = 200;


This rectangle of w 200 h 100 
will now rotate around its center!

Saw this in another sample somewhere on the web.
Now, why didn&#039;t i think of this before?

Regards</description>
		<content:encoded><![CDATA[<p>Hi Bartek<br />
There is even a much simpler solution,<br />
just define the Sprite, using negative left upper corner coordinate<br />
like this:</p>
<p>// Define and create the inner rectangle:<br />
      innerRect.graphics.lineStyle(1, 0x00FF00, 1);<br />
      innerRect.graphics.beginFill(0xFFFFFF);<br />
      innerRect.graphics.drawRect(-100,-50,200, 100);<br />
      innerRect.graphics.endFill();<br />
			innerRect.alpha = 0.6;</p>
<p>      addChild (innerRect);<br />
			innerRectRotationAngle = -180;<br />
			innerRect.x = 300;<br />
			innerRect.y = 200;</p>
<p>This rectangle of w 200 h 100<br />
will now rotate around its center!</p>
<p>Saw this in another sample somewhere on the web.<br />
Now, why didn&#8217;t i think of this before?</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bartek drozdz</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-519</link>
		<dc:creator>bartek drozdz</dc:creator>
		<pubDate>Thu, 29 May 2008 08:43:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-519</guid>
		<description>Hi, That&#039;s a pretty nice class this MatrixTransformer, and somehow I missed it, and have literally reinvented the wheel here :) 

However this one also needs to be wrapped into a class with a getter/setter function, so it can be used with Tweener, so I will take a look at that. Thanks for the tip, Andrew!</description>
		<content:encoded><![CDATA[<p>Hi, That&#8217;s a pretty nice class this MatrixTransformer, and somehow I missed it, and have literally reinvented the wheel here :) </p>
<p>However this one also needs to be wrapped into a class with a getter/setter function, so it can be used with Tweener, so I will take a look at that. Thanks for the tip, Andrew!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.everyday3d.com/blog/index.php/2008/05/28/rotating-a-sprite-around-any-point/comment-page-1/#comment-517</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 28 May 2008 23:39:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.everydayflash.com/blog/?p=27#comment-517</guid>
		<description>This is a handy class, however you should look into the MatrixTransformer class so that you don&#039;t need to mess with x and y coords of the target object

the relevant methods are rotateAroundExternalPoint() and rotateAroundInternalPoint()

[code]
import fl.motion.MatrixTransformer;

this.addEventListener ( Event.ENTER_FRAME, draw );

var xPoint:int = 200;
var yPoint:int = 200;
var angle:int = 5;

this.stage.addEventListener ( MouseEvent.MOUSE_DOWN, changeRotationPoint );

function changeRotationPoint ( evt:MouseEvent ):void
{
	xPoint = this.stage.mouseX;
	yPoint = this.stage.mouseY;
}

function draw ( evt:Event ):void
{
	var matrix:Matrix = clip.transform.matrix;
	MatrixTransformer.rotateAroundExternalPoint(matrix, xPoint, yPoint, angle );
	
	clip.transform.matrix = matrix;
}
[/code]

cheers,

A.</description>
		<content:encoded><![CDATA[<p>This is a handy class, however you should look into the MatrixTransformer class so that you don&#8217;t need to mess with x and y coords of the target object</p>
<p>the relevant methods are rotateAroundExternalPoint() and rotateAroundInternalPoint()</p>
<p>[code]<br />
import fl.motion.MatrixTransformer;</p>
<p>this.addEventListener ( Event.ENTER_FRAME, draw );</p>
<p>var xPoint:int = 200;<br />
var yPoint:int = 200;<br />
var angle:int = 5;</p>
<p>this.stage.addEventListener ( MouseEvent.MOUSE_DOWN, changeRotationPoint );</p>
<p>function changeRotationPoint ( evt:MouseEvent ):void<br />
{<br />
	xPoint = this.stage.mouseX;<br />
	yPoint = this.stage.mouseY;<br />
}</p>
<p>function draw ( evt:Event ):void<br />
{<br />
	var matrix:Matrix = clip.transform.matrix;<br />
	MatrixTransformer.rotateAroundExternalPoint(matrix, xPoint, yPoint, angle );</p>
<p>	clip.transform.matrix = matrix;<br />
}<br />
[/code]</p>
<p>cheers,</p>
<p>A.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
