ActionScript 3.0 :: Rotation Is Always Off?

Dec 23, 2010

So I've found numerous tutorials on rotating to face the mouse, and none of the rotation equations work properly for me. I made my own that worked but then it just over complicated things such as bullet direction and the likes so I want to figure out what's going wrong.

Code:
var radians:Number =Math.atan2(mouseY-ME.y,mouseX-ME.x)
var degrees:Number = (radians/Math.PI)*180;

[code].....

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Rotation Center Is In Left Of The Image - Aren't 3D Rotation From Transform Panel

Jan 7, 2010

I have a movieclip and when I do 3D rotation from Transform panel, It rotates perfect, center is in the middle of image, and when I apply mc.rotationY, rotation center is in left of the image, aren't 3D rotation from Transform panel and mc.rotationY from AS same? what's up?

View 2 Replies

Actionscript 3 :: Augmented Reality Flartoolkit Rotation - Trace The Rotation Of The Marker

Mar 23, 2011

I'm trying to do some augmented reality projects with flartoolkit . I can now put simple 3d objects on my marker and it works fine , but I wanna give my project some events that the user can interact with. I'm trying to trace the rotation of the marker. there's a container:DisplayObject3D which my application uses to add the 3d objects , I traced this :"trace(container.rotationZ)" but it's just returning 0 . I studied another AR application's source code and it was using the rotation of it's container object without problem .and I think I should mention that I'm using the exercise file of seb lee delisle papervision3d course from [URL]. anyone has any experience with flartoolkit? the main functions of my my code is as below:

[Code]...

View 1 Replies

ActionScript 3.0 :: 3D Rotation Of Nested Movieclips, Separate Of Parent Rotation?

Aug 11, 2010

Is it possible to have the child movieclip rotate separate of the  rotation  properties assigned to the parent? so ultimately giving the  child  element it's own axis?I've customized Lee Brimelows (gotoandlearn.com) 3D carousel to spin  on  the x axis to make it a vertical carousel. I've also rotated that by 45 degrees on the y axis to see all the items, and wrote a snippet of   code to hide the left portion of the carousel. The entire  carousel is contained within the 'container' movieclip, and  inside of  that are my carousel items (as seen below), with the larger  item being  the item in focus.

On rollover of the item in focus, I want to rotate it so it faces the   viewer (as seen below),basically removing the 45 degree rotation   applied to the container.The problem i'm running into is when you rotate the container (changing   the rotationX of the container), the axis basically rotates with it, so   when i rollover the next item 'in focus', the following happens..(in  the  example where it appears how it want it to, the carousel is at a   rotationX of 0, so it works fine)

View 2 Replies

ActionScript 1/2 :: Inconsistent Rotation - 270 Degrees Of Rotation Disappear?

Apr 21, 2009

Program A has a cannon that aims to line up with where-ever the mouse is pointing, in 360 degrees, and fires when the mouse is is clicked. Program B has an eye instead of a cannon that should in theory do similar functions when the capslock key is toggled, but instead only has a 90 degree range of motion from the Right of the eye toward the bottom (quadrant 4 only). Where did the ther 270 degrees of rotation disappear to?

[Code]...

View 4 Replies

ActionScript 2.0 :: Create A 3d Rotation Much Like The Widely Used Carousel Only The Rotation?

Aug 11, 2006

i.m trying to create a 3d rotation much like the widely used carousel only the rotation i desire consist of four upright(90 degrees) movieclips resting on a slanted, 30 degree plane which rotate onEnterFrame or following a tween on a oval like path - then pause for a given number of seconds at the four movieclips positions equal in distance on the plane

function around() {
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);

[code]....

View 7 Replies

IDE :: Z - Rotation X And Rotation Y Missing In Motion Editor Panel

Feb 23, 2009

Why isn't there the Z, rotation X and rotation Y fields in my motion editor panel?

View 1 Replies

Actionscript 3.0 :: Rotation X Rotation Y Don't Show?

Oct 8, 2009

I am watching the tutorial on the motion editor and when he opens the motion editor to edit the Rotation X and Rotation Y values I'm in trouble.My motion editor now only shows Rotation Z but, no Rotation X or Rotation Y. What am I doing wrong?

View 1 Replies

ActionScript 3.0 :: 3D - Rotation Via MatrixTransformer - Do A "pseudo 3D" Rotation Of A Movie Clip

Dec 2, 2008

I am trying to do a simple "pseudo 3D" rotation of a movie clip. The clip would "flip" on to the screen. I have created the effect using PaperVision3D, however, the final SWF is about 64k and my project requires a smaller file size. I tried to create the flip effect manually by creating skewed versions of the clip and tweening between them, except this doesn't work because the shape is not tweaked along the vanishing point as it should be. It looks like perhaps I could accomplish what I want to do using the MatrixTransformer but I've not had much luck so far.

View 3 Replies

ActionScript 2.0 :: Pause Rotation On Rollover Of A Movieclip And Restart Rotation On Rollout Of The Movieclip

Oct 3, 2006

I'm trying to pause my rotation on rollover of a movieclip and restart rotation on rollout of the movieclip. Here is my current code,

[Code]...

View 1 Replies

Set Degree Before Rotation

Mar 13, 2009

I have a pointer that rotates with this code (on the MC):

Code:
onClipEvent (enterFrame) {
_rotation += 0.2;
}

This works fine but now I would like to have another pointer but with an starting angle of 60degrees. Is there an easy way to ad a starting degree or angle value on this code?

View 1 Replies

IDE :: 3D Rotation By Code?

Apr 4, 2009

How can I control the center of rotation when manipulating CS4's 3D properties? --I mean in code, that is. I've set the 3D Center Point in the Transform Panel, and if I rotate the MovieClip in the IDE, it rotates correctly... but when I manipulate rotationY via code, that 3D Center Point is not used.

View 3 Replies

IDE :: Set DisplayObject Rotation In IDE?

Oct 13, 2011

I can rotate it, or modify>transform>rotate +/- value

but what is the manual equivilant to simply object.rotation=0;

View 4 Replies

360 Degree Product Rotation

Apr 11, 2007

I have a client that wants a product to rotate around its axis for a full 360 degree view of the product. The final view needs to be draggable - so a user can use their mouse to turn it left or right. I took photos of the product in 10 degree increments and created a movie clip - but I can't figure out how to get it so a user can control the view: turning the product left or right.

View 3 Replies

ActionScript 3.0 :: How To Center A Rotation

Jul 13, 2008

As you can see in my code, I'm trying to adjust on the fly the x and y properties so that the movieclip gives the impression to rotate from its center and not from its corner at 0,0

Code:
var myclip:MovieClip = new MovieClip();
myclip.buttonMode = true;
myclip.graphics.beginFill(0);

[code]....

but it doesn't work and the clip does not rotate well

View 5 Replies

Rotation Circle Menu Using XML?

Jul 2, 2009

I am trying create a rotating circle with buttons/menus around the edges and this would simply rotate around, not like a 3D carousel, just basic rotation of a circle triggered by movement of the mouse on a vertical axis!I have attached a jpg example to give you an idea of what I am trying to create.Would anyone be able to direct me to some tutorial something similar as I can't seem to find anything.

View 1 Replies

Rotation Controlled By Mouse?

Apr 17, 2009

i was wondering if theres a way to link the amount and direction of an objects rotation to the mouse position. I want it so if you move the mouse far to the left the object spins fast anticlockwise but if you move it to the center it stops.

View 2 Replies

ActionScript 1/2 :: Cog Rotation With Buttons?

May 9, 2010

I recently started creating a small banner with a cog positioned half on the canvas in constant rotation and multiple buttons placed on the cog so they spin on and off the canvas. Unfortunatey at a slow rotation something like 400 frames at 25/sec the cog jitters a lot, even more when more buttons are added.

I was wondering if there was anyway to smooth out the tween for a nice non disruptive rotation and if there is anyway to cause the cog to slow down when hovering over a button.I can make it stop completely on a roll over and start again on a roll out but I was hoping for more of a speed decrease and have never worked with altering this before.

View 1 Replies

ActionScript 3.0 :: 3D Like Rotation With Flash?

Dec 8, 2011

Is there a simple AC3 code to make a object rotate? I wish for the object to rotate on the X axis (in other words, if it were a 3D object, it would look like a rotation) Is there a simple AC3 fix for this?
 
Also, to prevent another thread being made; I used Arial text, then I swited to David text, but no matter what I try (Save, republish, simulate download) the text stays Arial text;

View 3 Replies

ActionScript 1/2 :: Remembering The Rotation Value?

Feb 14, 2012

I have a movieclip that rotates 180 degrees in one frame of a flash game using the following code:

my_mc.onRelease=function(){
my_mc._rotation=my_mc._rotation+180;
if(my_mc._rotation==360){

[code].....

View 6 Replies

Flash - How To Get Rotation In FLARToolKit

Sep 30, 2010

How do you get the rotation of the marker in FLARToolKit? All that I can find is how to do it with papervision3D but since I am using Unity3 for the 3D, this is not optimal.

View 1 Replies

Flash :: Get Positioning After Rotation?

Nov 28, 2011

I built an app in flash where you can rotate objects and save positions and rotation to xml.... that xml then feeds html to produce a layout that is then rendered the a pdf It seems that every time it goes to the html, a rotated object in positioned a little to the lower right then the position in flash.

I know the rotation in css in different, but I think if I can find the true top left of the rotated object in flash and pass that it will solve the issue.

I tried this

newx = imageHolder.parent.localToGlobal(new Point(imageHolder.x,0)).x;
newy = imageHolder.parent.localToGlobal(new Point(0,imageHolder.y)).y;
also this imageHolder.parent.globalToLocal(imageHolder.localToGlobal(imageHolder.getBounds(imageHolder).topLeft));

neither work. Is there something else?

View 1 Replies

ActionScript 3.0 :: Absolute 3D Rotation In CS4?

Aug 26, 2009

Is there any way to rotate a 3D object in AS3 using absolute axes rather than the x, y and z axes of the object itself?For instance, increasing the value of rotationZ will make a movieclip rotate clockwise, but if the movieclip is first rotated 180 degrees around its y axis, increasing rotationZ will now rotate the movieclip counter-clockwise instead. Add rotation along the x axis, and things get really complicated.In my code, I simply want to flip a cube (consisting of four movieclip faces) 90 degrees around the default x and z axes, no matter what its current values of rotationX, rotationY and rotationZ are. My naive initial assumption was that it is only a matter of increasing rotationZ with 90 degrees to flip the cube left, or decrease rotationX to flip the cube "into" the screen

View 3 Replies

ActionScript 3.0 :: 3d Rotation And Text?

Jan 17, 2010

I am using flash cs4 and flash player 10 to flip a card using rotaionY and rotationZ.Its a movieclip with a dynamic textfield inside, font is embeded and antialias for readability is set.Textfield is on full pixels as usuall, but the problem is that after rotation text becomes smudged.

View 1 Replies

ActionScript 3.0 :: CS5 IK Rotation Value To Variable?

Sep 8, 2010

I have a simple 4 bone IK setup, and I want to get the current rotation value of each joint and store it in a variable (and update a dynamic text box).I see there is a public function get rotation():Number property, but how do I use it?

View 9 Replies

ActionScript 3.0 :: Rotation For MovieClip Always Off?

Dec 23, 2010

So I've found numerous tutorials on rotating to face the mouse, and none of the rotation equations work properly for me. I made my own that worked but then it just over complicated things such as bullet direction.
Code:
var radians:Number =Math.atan2(mouseY-ME.y,mouseX-ME.x)
var degrees:Number = (radians/Math.PI)*180;
ME.rotation=degrees;
That is the only code that changes the rotation of my movieclip. and it always seems to be about 45 degrees behind my mouse?

View 3 Replies

Flash 10 :: Rotation On The Object

Jan 22, 2011

I have an object, the center of the object I believe is the rotation point. When I click transform and edit the rotation properties on the right side to like 55 degrees then it works, it rotates from the point it's suppose to and looks great. The problem is when I use AS .rotation on the object, I have no idea where it's rotating from and it's going all over the freaking place. I assumed it would rotate from the same rotation point as the transform tool rotates the object from. I also assumed 0-360 was the options for rotation. What am I doing wrong? from the looks of it's odd rotation I can't even tell where it's centering.

View 3 Replies

ActionScript 2.0 :: How To Set Degree For Rotation

Jan 27, 2011

i want to rotate one line 0-180 how to set that target.i used this code movieclipname._rotation +=2;It is rotated 360 degree and looping.I just want to rotate 0-180 degree only once.

View 1 Replies

ActionScript 3.0 :: Add The Rotation Speed?

Feb 9, 2011

how i can add the rotation Speed?

my code:

var dx:Number = bs.width-mouseX
var dy:Number = bs.height-mouseY
var dm:Number = Math.atan2(dy,dx)*180/Math.PI

p1.rotation = dm-315 // add 315 i will get the direction i want

but i want my rotation to go faster

View 4 Replies

ActionScript 2.0 :: Rotation During The HitTest?

Oct 27, 2011

what would be the code for making a movie clip A face movie clip B when B hits A? I'm at a loss for a proper formula...

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved