Actionscript :: Get Transformations From Transformation Matrix In Flash?

Sep 1, 2010

I have transformation matrix properties (a,b,c,d). How to calculate scaleX, scaleY, scewX, scewY and rotation angle from those values?

When only one type of transformation is applied, I can figure out that:

scaleX = a
scaleY = d
scewX = c
scewY = b
rotation = arccos(a) or -arcsin(c)

But when multiple transformations are applied at once I don't know how to calculate those values.

I need to do this outside of flash so I can't use any flash helper methods.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Matrix Transformations On Textfields?

Sep 1, 2006

I have some problems with doing Matrix transformations on a MovieClip with a Textfield. As soon as I make a matrix transformation the textfield of the movieclip disappears. And I can not get it back.

View 1 Replies

Flash :: Transformation Using MovieClip.transform.matrix ?

Jul 2, 2009

I have problem when dealing with transform in Flash cs4 ....When I rotate my movieclip and trace the output, my movieclip's width also changed....

View 4 Replies

Actionscript 3 :: Use Transformation Table In Matrix Class?

Aug 2, 2011

How can I, if it's even possible, use this transformation table provided in my question's accepted answer here in Actionscript 3 in Flash? I understand it might have something to do with Matrix, but I really have no clue if that transformation provided in the answer is possible to implement there. Is it? If so how?

View 1 Replies

ActionScript 3.0 :: Recalculate Point X / Y Value After Matrix Transformation

Jun 16, 2010

I am doing a matrix transformation on a Display Object. I got this function from another site, but basically it scales a display object around any point.
ActionScript Code:
public static function scaleAroundExternalPoint(m:Matrix, x:Number, y:Number, multiplier:Number):void{
m.translate(-x, -y);
m.scale(multiplier, multiplier);
m.translate(x, y);
}

But my problem is that I have to do multiple scales in a sequence and after scaling, the points defined in the XML no longer correspond. Let me first say that all the points being scaled around are located in an XML file. They are all relative to the display object's registration point (0,0) when it is normal, i.e. a scale of 1. Also, I have created a class that retains the target object's original Matrix so that the percentage you pass in is relative to the original scale instead of the scale after each call. But basically, with the scaleAroundExternalPoint function by itself, if I have an object that I scaled to twice it's size, the multiplier would be 2. but say I want it back to it's original size. The multiplier would NOT be 1 since that would just leave it at a scale of 2x. It would have to be .5. The important parts of the class are below.

ActionScript Code:
public function ZoomUIComponent(isKeyboardControlled:Boolean = false, disabledAlpha:Number = .25,
max:Number = 2, min:Number = .5, precision:uint = 2,
seconds:Number = 1, step:Number = .1):void{
this.disabledAlpha = disabledAlpha;
this.inControl = InteractiveObject(getChildByName("zoomIn"));
_isKeyboardControlled = isKeyboardControlled;
[Code] .....

It's retaining the original matrix and then calculating based on that EACH TIME. So how would I find the new X and Y values of the original points so that I can scale around them?

View 1 Replies

Flex :: Animating A Transformation Based On Transform Matrix?

Oct 18, 2010

I have a UI component that I wish to relocate and scale, but in a rather complex way. I've figured out the necessary transformations using the transform matrix, to which I applied several translate and scale operations. I can set the new transform matrix for this UI component to be the above calculated matrix, and the results are accurate; but I need to animate the transition. I can't use the Scale/Move effects alone because they aren't as powerful when it comes to calculating the necessary transformation as the matrices are.So how can I animate the transition of an object given a source and a target transform matrix?Figured it outUsing a tweener and its onUpdate event to reassign the matrix with each intermediate value:

var animMatrix : Matrix = gi.transform.matrix;
TweenMax.to(animMatrix, 1, {
a : m.a,

[code]......

View 1 Replies

Actionscript 3 :: Get An Accurate Reading Of The Pixel Data From A Bitmap With A Matrix Transformation?

Mar 24, 2011

i've filled a circle shape with the bitmap data of a bitmap asset.i need to rotate the circle from the center, so i added the bitmap to the center of the circle and used a matrix transformation to shift the bitmapdata upward and leftward so it appears centered.
now i'm trying to read the bitmap data with getPixel() but the return value is off since it is returning the untransformed position of the bitmap data instead of the visible transformed bitmapdata.

Bitmap(Sprite(evt.currentTarget).getChildAt(0)).bitmapData.getPixel(evt.localX, evt.localY)

how can i get an accurate reading of the pixel data from a bitmap with a matrix transformation? updated with code. assume the redCircleData in my example is more colorful and something worth retrieving pixel data.

var redCircleData:Sprite = new Sprite();
redCircleData.graphics.beginFill(0xFF0000, 1.0);
redCircleData.graphics.drawCircle(0, 0, 100);[code]............

View 2 Replies

Flash 9 :: Reset Transformation Point/Set Transformation Point?

Feb 8, 2008

When I right-click a symbol the options "set transformation point" and "reset transformation point" come up. They don't seem to do anything for me. I thought it would center them or something. This is not the case. I have the white transformation point in one corner in one keyframe and a different corner in another keyframe I click "reset transformation point" on both frames and they don't move.

View 3 Replies

Graphics - Can Flash Perform Complex 'wrap' Transformations

Dec 12, 2011

Possible Duplicate: How can I bend a a display object? Is it possible to use Flash to do more complex 3D transformations?I already found out 3D rotations are possible. Additionally I also need some warp transformation in order to 'wrap' an image around a bottle.

View 1 Replies

ActionScript 2.0 :: Matrix Algebra And Matrix Inverse?

Apr 5, 2003

Has anyone here ever developed a function (or general library of relevant functions) that will allow one to find the inverse of a matrix? I've searched the forum archives, as well as the internet more generally, but haven't found anything. If anyone has some leads, I hope you'll pass them along.

If I don't hear anything within the next few days, I might try to develop something on my own, but I'd hate to do so if someone has already done the dirty work.

A solution to this problem would be very useful for 3-D work or anyone doing mathematical programming more generally.

View 14 Replies

Reverse A Skew Transformation In The Flash IDE?

Sep 6, 2011

Place a 100px by 100px box on the stage (not a movieclip, just a simple shape).

Now apply a vertical skew of 30 degrees. You should get this...

Click outside of the shape to release the transformation data. The degrees for skew resets to 0 (this is expected), see image below

But What skew would you apply to the shape to return it to its original shape. Initially I would've thought it was -30 in the vertical skew, but this seems to return a weird hybrid shape.. See below:

View 2 Replies

ActionScript 3.0 :: BitmapData.draw() And Displayobject With 3D Transformations?

Dec 17, 2009

I have a sprite with some objects in it which are transformed in 3D (positioned and rotated). The objects form a coneshape in such a way that the objects that make up the back are hidden.When I use that sprite as a source for the bitmapData.draw() it is drawn from another viewpoint so it seems. In my case the copy is viewed slightly from the bottom and right.
 
Bottomline:Does anyone know of a way to duplicate the image of a sprite which contains 3D manipulated graphics?

View 2 Replies

Html :: 3D Transformations On Rendered HTML In Flash?

May 17, 2010

I'm trying to figure out if this is possible to execute on a dynamic page.http:[url].....Basically, after all the page has been rendered, Flash needs to take the rendered page and apply 3D transformations to it, and at the end, restore the original rendered page.

View 1 Replies

Actionscript 3 :: Combine Convolution Matrices To Apply Several Transformations At Once?

Dec 20, 2011

Theoretically it should be possible to combine transformation or color matrices, through addition or multiplication (I'm lame when it comes to such math). Is it possible?

View 1 Replies

ActionScript 2.0 :: Have 3 Different Color Transformations Apply To An MC Called MyPic?

Oct 22, 2009

I have figured out how to have 3 different color transformations apply to an MC called myPic. I am trying to figure out how to reverse those changes on rollOut. This is what I have so far. Do I need to use delete this.onEnterFrame? I tried but got errors.

Code:
chip1_mc.onRollOver = function() {
this.onEnterFrame = function() {
myColor = new Color(myPic);
myColorTransform = new Object();

[code]....

View 3 Replies

ActionScript 3.0 :: Bitmap Grab Of Lower Layers / Image Transformations Of Stage?

Jul 20, 2009

I have a number of display objects drawing to the stage, including bitmaps, graphics/shapes, and text. What I want to do is put a layer on top of this that "grabs" or copies the image resulting from all the rendered objects below it.That is, I want to get a bitmap object that contains an image of the all the rendered objects beneath it in the display list. Consider it as taking a screen grab of the stage.The ultimate goal is to be able to then apply transformations on this bitmap, giving the appearance of transforming all the objects that draw under it.Is there a way to get such a bitmap? Or if not, is there a way to apply an image transformation (e.g. rotation, etc.) to the stage after a bunch of objects are drawn onto it?

View 4 Replies

Flash :: Get Scale Of A Matrix Object?

Mar 14, 2011

Most often, questions are asked about how to scale a DisplayObject, and the answer is usually to use a Matrix.

My question is, how to you GET the scale of a Matrix (scaleX and scaleY)?

There's a Matrix.scale method to set the scaleX and scaleY, but it doesn't return a value, and no other properties exist to read it back.

The reason I ask, I'm using object burried deep down into a Display list, and each may be transformed. So I use the child object's sprite.transform.concatenatedMatrix getter, but am stuck at this point on how to read the scale from it.

View 2 Replies

AS3 :: Flash - Simulating RotationX With Matrix?

May 31, 2011

I have to use Flash CS3, so I can't use the properties rotationX, roationY and rotationZ.I have a movieclip, that looks like this. It is now flat, no 3D rotation or shearing But what I want is that this movieclip has a rotationX, or that it is a bit in perspective like this: As I said, I can't use rotationX, so I have been playing around with Matrix. But I can not get it right.Here is how I try to do it

myMC.transform.matrix = new
Matrix(1,0.15,0.35, 1, 0, 0);

And this is the result get the matrix right, or is there another way?

View 3 Replies

Flash - What Are Spaces In AS3 Colour Matrix

Jan 8, 2012

In the 4 * 5 array that makes up a colour matrix, what do ALL the values do? All I have found is basically this:
0, 0, 0, 0, 0 <-R
0, 0, 0, 0, 0 <-G
0, 0, 0, 0, 0 <-B
0, 0, 0, 0, 0 <-A
What does each thing do?

View 1 Replies

Flash :: Intermittent Bitmapdata Draw With Scaling Matrix?

Sep 10, 2009

We have discovered that when we draw one bitmapdata into another bitmapdata using draw, there is an upper bound on the scaling transformAt some point the IBitmapDrawable parameter ceases to be rendered on the target bitmap.Does anyone know what the parameters of this upper bound are? Is this documented somewhere?

View 4 Replies

Flash :: Bitmap Data .draw() With Transform Matrix

Jun 29, 2011

I'm working on a project wherein a user can take a snapshot of themselves using their webcam and then edit this image by transforming scale and rotation and save the result.

I've got most of it working, the user can take a snapshot of themselves, transform the object using Senocular's Transform Tool and i'm using .draw() to then save this transformed object. The problem is .draw() is only grabbing data from the top left corner of the stage. It is drawing the transformed object but only from the top left corner.

Why does it only draw from the top left corner and how can i get set the coordinates to only draw from the area where the captured image is set?

You can view the file as is at: [URL]

And i've zipped the FLA and relevant classes at [URL]

import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;

[Code]....

View 2 Replies

Flash :: BitmapData - Scale And Select Area In One Matrix?

Jun 29, 2011

I'm using a transform matrix as part of a bitmap draw to select an area of my target rather than drawing from 0,0:

var bmd:BitmapData = new BitmapData(target.width,target.height,true,0);
var mat:Matrix = new Matrix(1,0,0,1,-target.x,-target.y);
bmd.draw(this,mat);

[code]......

View 1 Replies

Flash :: Zoom Fit A Flex Component With Transform Matrix?

Jul 8, 2011

someone could tell me how I can zoom a Canvas, with transform.matrix, so that the content of the component fits into the parent container (application), either inward or outward

this function is called Zoomfit(), I have this code:

[Code]...

View 1 Replies

Flash :: Generate A Matrix With Value Of Elements Either 1 Or 0 (filled Randomly)

Aug 22, 2011

I am encountering a strange problem. I am trying to generate a matrix with value of elements either 1 or 0 (filled randomly). I am storing the values into a 2D array. This is code on the first frame. Everything seems to be working fine.

[Code]...

View 2 Replies

ActionScript 2.0 :: Scale Down Flash Images Using BitmapData And Matrix?

Feb 4, 2008

how to scale down flash images using BitmapData and Matrix?? I'm using it for fullscreen so that the images are always perfect. I've been tampering with this, but cannot get it to work properly.

View 3 Replies

ActionScript 3.0 :: Flash - Inspect A Matrix To See If A Display Object Is Skewed?

Jan 11, 2012

I've been working on an FXG Editor, and I'm using the the senocular transform tool to move, rotate, scale and skew an object.

Is it possible to detect if the the Display object has been skewed just from inspecting the matrix of that DisplayObject? even if said object has been move, scaled and rotated as well.

I want to only serialize the matrix of an object to FXG if has been skewed and not if it has just been rotated, moved, or scaled.

View 1 Replies

ActionScript 3.0 :: Flash Matrix Effect In Flash

Sep 18, 2010

I am trying to create a matrix kind of effect when Mouse Roll_Over a particular Movie Clip.[code]The function called by the Motion_finish Event Listener removes the created variable objects.But sometimes randomly some "1" and "0" freeze in between they don't move and don't get removed .. (generally happens after 15-20 seconds).

View 4 Replies

ActionScript 3.0 :: Error 1067 Implicit Coercion Of Matix To Flash.geom.Matrix?

Jan 15, 2009

I keep getting this error. I even pasted the Adobe help example here which is similar to my code and get the error:

ActionScript Code:
package
{
import flash.display.GradientType;

[Code]...

View 9 Replies

IDE :: 3D Transformation Of MovieClip In As2?

Feb 26, 2010

i am looking for script for movie Clip distortion and 3D transformation in action script 2.0

View 1 Replies

IDE :: Faulty 3D Transformation - How To Improve

Jan 31, 2009

I'm playing around with Flash CS4 trial and tried to 'compose' a 3d Box by putting 6 MovieClips as the side elements of the box in one clip which represents the whole box. (only using the Flash Tools, no Actionscript). Within the BoxClip (after doubleclick on the BoxClip on stage), all sides look right, each side is positioned with the correct angles and coordinates. Outside the BoxClip, back on root stage, the box sides are not parallel anymore, the angles are not 90 degrees, there is no 'box' actually. So I guess, one of the problems is the 3D Center point of the objects which is absolute to one point in coordinate space. The other problem is the faulty '3D' display in Flash, that is, changing from inside to ouside a clip changes the view also. So far, the Flash GUI seems quite useless for doing some '3D'. How to improve the workflow?

View 3 Replies







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