查找沿路径AS3的所有点 [英] Find all points along a path AS3
问题描述
基本上,我想要一个影片剪辑随机添加到沿Bezier曲线的任何一点。有没有办法找到一条路径的所有点?或者,也许有办法找到方程(这是一个二次曲线)?如果一切都失败了,有没有办法找到沿着一条直线的点(即不是完全水平或垂直)?
Basically, I want to randomly add a movie clip to any point along a bezier curve. Is there a way to find all points along a path? Or maybe there's a way to find the equation (it's a quadratic curve)? If all else fails, is there a way to find the points along a straight line (that isn't perfectly horizontal or vertical)?
推荐答案
如果您正在使用钢笔工具,这是创建一个图形
。您可以通过从 Shape.graphics.readGraphicsData读取结果访问这种形状的路径()
If you are using the pen tool, this is creating a Shape
. You can access the path of this shape by reading the result from Shape.graphics.readGraphicsData()
请参阅参考<一href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Graphics.html#readGraphicsData%28%29"相对=nofollow> readGraphicsData A>。
这篇关于查找沿路径AS3的所有点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!