我有一组点,我想画一条曲线,它应该近似于原始曲线。
比方说,在鹰眼系统(用于板球)中,我有一组球在整个飞行过程中的坐标,现在我如何画出这样一条曲线,穿过球的空间坐标,看起来接近于原来的曲线
我认为有一种方法是获得大量的点数,这样每两个点
彼此非常接近,然后在它们之间画一道直线光
发布于 2011-05-08 23:06:22
曲线几乎总是在四个步骤中渲染:
使用曲线或样条算法对一组点进行插值或插值(
- [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。
发布于 2011-05-09 02:53:37
我强烈推荐使用Catmull-Rom样条线,它们基于Hermite曲线。它不使用两个点和两条切线,而是使用四个相邻的数据点进行插值,使其更适合/更简单地进行运动路径上采样。
https://stackoverflow.com/questions/5928051
复制相似问题