查找沿路径AS3的所有点沿路

2023-09-08 13:52:24 作者:一闪一闪亮晶晶

基本上,我想要一个影片剪辑随机添加到沿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()

请参阅参考 readGraphicsData 。