I'm looking for a solution to skew images. Flash only allows skewing of vector-based objects. I tried to use matrices but could not get a propriate solution. The goal is to do something like a threefold-brochure which folds out in two steps.
我正在寻找扭曲图像的解决方案。 Flash仅允许倾斜基于矢量的对象。我试图使用矩阵但无法获得适当的解决方案。我们的目标是做一个三折小册子,分两步折叠。
Does someone have a hint or example code for this?
有人有提示或示例代码吗?
UPDATE!
Maybe my message was a little bit wrong verbalised. Flash allows to skew, for example, a rectangle to a rhomboid.
也许我的信息有点错误。 Flash允许将例如矩形倾斜为菱形。
------- -------
| | \ \
| | => \ \
| | \ \
------- -------
That's not the restriction i meant. I'm able to do WYSIWYG skewing like this for vectors and bitmaps. I need to do something like this:
这不是我的意思。对于矢量和位图,我能够像这样做WYSIWYG。我需要做这样的事情:
------- |`
| | | `|
| | => | |
| | | ´
------- |´
Based on Bryan Grezeszak answer, i played with transformation movieclips on the linked page. Am i right when i say that there is no possibility to do this with matrices? If yes, are there other possibilities to achieve this?
根据Bryan Grezeszak的回答,我在链接页面上玩转换动画片段。当我说没有可能用矩阵做这个时,我是对的吗?如果是,还有其他可能实现这一目标吗?
Thanks =)
4 个解决方案
#1
EDIT BASED ON YOUR UPDATE: The transformation you specified that you want is exactly what is accomplished with Matrix3D in flash 10. They changed it from a 3x3 matrix to a 4x4 matrix to allow the skewing you are trying to do. If you are using flash 10, Matrix3D is your answer. If not, try out AS3 3D engines such as Papervision or Away3D.
基于您的更新进行编辑:您指定的转换正是Flash3中Matrix3D所完成的转换。它们将其从3x3矩阵更改为4x4矩阵,以允许您尝试进行的偏移。如果您使用的是Flash 10,Matrix3D就是您的答案。如果没有,请尝试使用Papervision或Away3D等AS3 3D引擎。
If you are using Flash 10, then look up it's Matrix3D object (ONLY in Flash 10), because it allows even more skewing of the object, actual 3D perspective, etc, prolly exactly what you are looking for :)
如果您使用的是Flash 10,那么请查看它的Matrix3D对象(仅限Flash 10),因为它允许更多的对象倾斜,实际的3D透视等,这正是您正在寻找的:)
Other than that the object's transformation matrix is what does it. It is a flash.geom.Matrix object that can be accessed on any DisplayObject (including Bitmaps) using your_object.transform.matrix;
除此之外,对象的变换矩阵就是它的作用。它是一个flash.geom.Matrix对象,可以使用your_object.transform.matrix在任何DisplayObject(包括位图)*问;
It can be tricky to get used to, but this is the most comprehensive source I know of for dealing with it: Senocular Matrix Article
习惯这可能很棘手,但这是我所知道的处理它的最全面的来源:Senocular Matrix Article
That article is for Flash 8, but the functionality has changed almost none into AS3, so it is still a valuable resource.
该文章适用于Flash 8,但功能几乎没有变为AS3,因此它仍然是一个有价值的资源。
#2
pity the year doesnt appear on the date... hope it 2009
可惜今年没有出现......希望它是2009年
an answer is here http://evolve.reintroducing.com/2007/11/18/as3/as3-distortiontweener/
答案在这里http://evolve.reintroducing.com/2007/11/18/as3/as3-distortiontweener/
;-) nobull
#3
fp9 solution: http://www.rubenswieringa.com/blog/distortimage
fp9解决方案:http://www.rubenswieringa.com/blog/distortimage
#4
You can skew any movieclip on the timeline of the Flash IDE, even one containing bitmap images, but there is no skew property. For something more dynamic you can create a movieclip with 200(e.g.) frames of animation going from one extreme of skew to the other, then dynamically add content to this movieclip. Hacky, but it will work. If you can get to grips with the math you can use matrix transformations in Flash Player 10 to achieve the effect.
您可以在Flash IDE的时间轴上扭曲任何动画片段,即使是包含位图图像的动画片段,但也没有偏斜属性。对于更动态的东西,您可以创建一个动画片段,其中包含200个(例如)动画帧,从一个偏斜的极端到另一个极端,然后动态地将内容添加到此动画片段。哈基,但它会奏效。如果您可以掌握数学,则可以在Flash Player 10中使用矩阵变换来实现效果。
#1
EDIT BASED ON YOUR UPDATE: The transformation you specified that you want is exactly what is accomplished with Matrix3D in flash 10. They changed it from a 3x3 matrix to a 4x4 matrix to allow the skewing you are trying to do. If you are using flash 10, Matrix3D is your answer. If not, try out AS3 3D engines such as Papervision or Away3D.
基于您的更新进行编辑:您指定的转换正是Flash3中Matrix3D所完成的转换。它们将其从3x3矩阵更改为4x4矩阵,以允许您尝试进行的偏移。如果您使用的是Flash 10,Matrix3D就是您的答案。如果没有,请尝试使用Papervision或Away3D等AS3 3D引擎。
If you are using Flash 10, then look up it's Matrix3D object (ONLY in Flash 10), because it allows even more skewing of the object, actual 3D perspective, etc, prolly exactly what you are looking for :)
如果您使用的是Flash 10,那么请查看它的Matrix3D对象(仅限Flash 10),因为它允许更多的对象倾斜,实际的3D透视等,这正是您正在寻找的:)
Other than that the object's transformation matrix is what does it. It is a flash.geom.Matrix object that can be accessed on any DisplayObject (including Bitmaps) using your_object.transform.matrix;
除此之外,对象的变换矩阵就是它的作用。它是一个flash.geom.Matrix对象,可以使用your_object.transform.matrix在任何DisplayObject(包括位图)*问;
It can be tricky to get used to, but this is the most comprehensive source I know of for dealing with it: Senocular Matrix Article
习惯这可能很棘手,但这是我所知道的处理它的最全面的来源:Senocular Matrix Article
That article is for Flash 8, but the functionality has changed almost none into AS3, so it is still a valuable resource.
该文章适用于Flash 8,但功能几乎没有变为AS3,因此它仍然是一个有价值的资源。
#2
pity the year doesnt appear on the date... hope it 2009
可惜今年没有出现......希望它是2009年
an answer is here http://evolve.reintroducing.com/2007/11/18/as3/as3-distortiontweener/
答案在这里http://evolve.reintroducing.com/2007/11/18/as3/as3-distortiontweener/
;-) nobull
#3
fp9 solution: http://www.rubenswieringa.com/blog/distortimage
fp9解决方案:http://www.rubenswieringa.com/blog/distortimage
#4
You can skew any movieclip on the timeline of the Flash IDE, even one containing bitmap images, but there is no skew property. For something more dynamic you can create a movieclip with 200(e.g.) frames of animation going from one extreme of skew to the other, then dynamically add content to this movieclip. Hacky, but it will work. If you can get to grips with the math you can use matrix transformations in Flash Player 10 to achieve the effect.
您可以在Flash IDE的时间轴上扭曲任何动画片段,即使是包含位图图像的动画片段,但也没有偏斜属性。对于更动态的东西,您可以创建一个动画片段,其中包含200个(例如)动画帧,从一个偏斜的极端到另一个极端,然后动态地将内容添加到此动画片段。哈基,但它会奏效。如果您可以掌握数学,则可以在Flash Player 10中使用矩阵变换来实现效果。