关于如何通过输入多个点来概括贝塞尔曲线的问题
我想生成一条通过鼠标输入的几个点的贝塞尔曲线。这些点超过四个,任何人都可以帮助我并给我一些关于如何实现它的建议吗? 更要感谢。 祝你好运!
i want to generate a bezier curve pass through several points i input by mouse.These points are more than four,can anyone help me and give me some suggestions about how to implent it?
More thanks.
Good luck!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需将数学写入程序即可。如果不为您做好功课,我们无法解释任何事情。
您可以在这里开始做一些诚实的工作:维基百科:贝塞尔曲线
Just write the math into a program. There's nothing we can explain without doing your homework for you.
You can start doing some honest work here: Wikipedia: Bezier Curve
你必须首先求解沿曲线的点之间的距离才能得到你的 u & v.
一般来说,点之间的最短弧长约为。最佳曲线。
p0 和 p3 是端点; f 和 g 是曲线上的两个点。
d1是p0和f之间的距离; d2 介于 f 和 g 之间; d3 位于 g 和 p3 之间。
求解控制点 p1 和 p2:
设 u=d1/(d1+d2+d3); v=(d1+d2)/(d1+d2+d3)
这是我将您链接到的位置:
如何查找给定 BezierSegment 的控制点C# 中的起点、终点和 2 个交点 - AKA 三次贝塞尔曲线 4 点插值
You have to solve the distance between points along the curve first to get your u & v.
Generally, the shortest arc lengths between points approx. the best curve.
p0 and p3 are the endpoints; f and g are two points along the curve.
d1 is distance between p0 and f; d2 between f and g; d3 between g and p3.
Solving for control points, p1 and p2:
Let u=d1/(d1+d2+d3); v=(d1+d2)/(d1+d2+d3)
This is where I link you to:
How to find control points for a BezierSegment given Start, End, and 2 Intersection Pts in C# - AKA Cubic Bezier 4-point Interpolation