首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何绘制近似于原始曲线的曲线

如何绘制近似于原始曲线的曲线
EN

Stack Overflow用户
提问于 2011-05-08 22:34:34
回答 2查看 1.5K关注 0票数 3

我有一组点,我想画一条曲线,它应该近似于原始曲线。

比方说,在鹰眼系统(用于板球)中,我有一组球在整个飞行过程中的坐标,现在我如何画出这样一条曲线,穿过球的空间坐标,看起来接近于原来的曲线

我认为有一种方法是获得大量的点数,这样每两个点

彼此非常接近,然后在它们之间画一道直线光

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-05-08 23:06:22

曲线几乎总是在四个步骤中渲染:

使用曲线或样条算法对一组点进行插值或插值(

  1. Approximate )。选项可能包括:

代码语言:javascript
运行
复制
- [Cubic splines](http://en.wikipedia.org/wiki/Spline_%28mathematics%29), which pass through all of the data points and produce a smooth curve
- [Bézier curves](http://en.wikipedia.org/wiki/Spline_%28mathematics%29), which do not pass through all the points, but which lie within the envelope of the consecutive groups of 4 points surrounding each curve section.
- [Hermite curves](http://www.cubic.org/docs/hermite.htm), which are defined by a set of points, and a set of tangent vectors: you would need to generate the set of tangent vectors somehow in order to use this sort of curve.
- (and probably more that I've forgotten)

无论你选择哪种表示法来表示一条曲线:这可以通过从其他曲线到贝塞尔曲线的简单矩阵变换来实现:控制点趋向于近似曲线。

  • 绘制细分曲线的控制点,并由一条直线连接。

如果你直接走贝塞尔曲线,这可能是最简单的,然后有一些非常simple and elegant methods of subdividing it

票数 5
EN

Stack Overflow用户

发布于 2011-05-09 02:53:37

我强烈推荐使用Catmull-Rom样条线,它们基于Hermite曲线。它不使用两个点和两条切线,而是使用四个相邻的数据点进行插值,使其更适合/更简单地进行运动路径上采样。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5928051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档