flash中位图倾斜的解决方法 [英] Solution to skew bitmaps in flash

查看:31
本文介绍了flash中位图倾斜的解决方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找倾斜图像的解决方案.Flash 只允许倾斜基于矢量的对象.我尝试使用矩阵,但无法获得适当的解决方案.我们的目标是做一些类似于三折小册子的东西,它可以分两步折叠.

有人对此有提示或示例代码吗?

<小时>

更新!

也许我的信息措辞有点错误.例如,Flash 允许将矩形倾斜为菱形.

 ------- -------|| ||=> || ------- -------

这不是我的意思.对于矢量和位图,我可以像这样进行 WYSIWYG 倾斜.我需要做这样的事情:

 ------- |`|||`|||=>|||||´------- |´

根据 Bryan Grezeszak 的回答,我在链接页面上播放了转换影片剪辑.当我说不可能用矩阵来做到这一点时,我是对的吗?如果是,是否还有其他可能来实现这一目标?

谢谢 =)

解决方案

根据您的更新进行您指定想要的转换正是在 Flash 10 中使用 Matrix3D 完成的.他们将其从 3x3 矩阵更改为4x4 矩阵以允许您尝试进行倾斜.如果您使用的是 Flash 10,Matrix3D 就是您的答案.如果没有,请尝试 AS3 3D 引擎,例如 Papervision 或 Away3D.

如果您使用的是 Flash 10,则查找它的 Matrix3D 对象(仅在 Flash 10 中),因为它允许对象的更多倾斜、实际 3D 透视等,这正是您要查找的内容:)

除此之外,对象的变换矩阵是做什么的.它是一个 flash.geom.Matrix 对象,可以使用 your_object.transform.matrix 在任何 DisplayObject(包括位图)上访问;

习惯它可能很棘手,但这是我所知道的处理它的最全面的来源:感官矩阵文章

那篇文章是针对 Flash 8 的,但功能几乎没有改变到 AS3,所以它仍然是一个宝贵的资源.

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.

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.

 -------         -------
|       |              
|       |   =>          
|       |                
 -------            -------

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:

 -------         |`
|       |        |  `|
|       |   =>   |   |
|       |        |  ´
 -------         |´

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?

Thanks =)

解决方案

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.

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 :)

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;

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

That article is for Flash 8, but the functionality has changed almost none into AS3, so it is still a valuable resource.

这篇关于flash中位图倾斜的解决方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆