As3 中的贝塞尔曲线
我是否正确地认为,从 Flash GUI 中只能绘制三次贝塞尔曲线,而从 Actionscript 中只能绘制二次贝塞尔曲线?真的吗?
这似乎是,嗯……我确信它不可能……如果我必须编写一个二次贝塞尔绘图应用程序来计算出一些点坐标,那就太疯狂了。
Am i right in thinking that from the Flash GUI you can only draw Cubic Bezier Curves, and from Actionscript you can only draw Quadratic Bezier Curves ? Really?
This seems, well.. im sure it cant be.. It would be crazy if i had to write a Quadratic Bezier drawing app to work out some point co-ordinates.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用绘图 API,则只能使用 curveTo() 函数绘制二次贝塞尔曲线。
http://help.adobe.com /en_US/FlashPlatform/reference/actionscript/3/flash/display/Graphics.html#curveTo()
对于正确的贝塞尔曲线,这并不难,但您必须自己做。我找到的一些源代码的快速链接:
http://www. paultondeur.com/2008/03/09/drawing-a-cubic-bezier-curve-using-actionscript-3/
http://www.farmcode.org/post/2009/07/06/Fast-2D-Bezier-Library -for-ActionScript-3.aspx
If you're using the drawing API, then you can only draw Quadratic Bezier Curves using the curveTo() function.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Graphics.html#curveTo()
For proper bezier curves, it's not that hard, but you'll have to do it yourself. Some quick links with source code that I found:
http://www.paultondeur.com/2008/03/09/drawing-a-cubic-bezier-curve-using-actionscript-3/
http://www.farmcode.org/post/2009/07/06/Fast-2D-Bezier-Library-for-ActionScript-3.aspx
实际上,从昨天发布的 Flash Player 11 开始,绘图 API 支持三次贝塞尔曲线:(
以及此主要版本的其他改进和添加...)
http://www.adobe.com/devnet/flashplayer/articles/whats-new-flash-player11.html
Actually from Flash Player 11, released yesterday, the Drawing API supports Cubic Bezier curves:
(amongst other improvements and additions on this major release...)
http://www.adobe.com/devnet/flashplayer/articles/whats-new-flash-player11.html
这是一篇使用 fl.motion.BezierSegment 类在 ActionScript 中绘制三次贝塞尔曲线的精彩文章:
http://www.eleqtriq.com/2010/04/cubic-bezier-in-flash/
太棒了 - 我用一小部分代码和类创建了一条包含多个段的完整曲线您需要此页面上的大多数其他链接:
这真是一篇很棒的文章!
This is a great post to draw Cubic Bezier curves in ActionScript using the fl.motion.BezierSegment class:
http://www.eleqtriq.com/2010/04/cubic-bezier-in-flash/
It's awesome - I created a complete curve with multiple segments with a fraction of the code and classes you need for most of the other links on this page:
It's a really great post!