寻找贝塞尔曲线的控制点
stackoverflow 的用户大家好!
首先,我想说这是我的第一篇文章,我一直在从这个网站上直接挖掘黄金,我喜欢它,每个人都足够聪明,可以给出解决方案。
所以基本上我正在写一个游戏,我有贝塞尔曲线来控制演员移动的位置。我只使用 3 个点(开始、控制 1、结束),一切都很好。
现在我想创建一条在 t = 0.5 处通过某个点 (r1) 的贝塞尔曲线。问题是我有起点、终点和 t=0.5 处的点 (r1),我需要找到控制点。
抱歉,如果我解释得不好,希望大家能够理解。
谢谢您的回复:)
Hi stackoverflow's users !
First i want to say its my first post and i've been diging straight up gold from this site and i love it and everyone out there smart enough to give out solutions.
So basically am writing a game and i have bezier curve that controls where an actor moves. Am using only 3 points (start, control1, end) and everything is fine.
Now i want to create a bezier curve that passes through a certain point (r1) at t = 0.5 . The problem being that i have my start point, my end point and my point (r1) at t=0.5, and i need to find the control point.
Sorry if i explained it badly i hope everyone can understand.
Thank you for any replies : )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看
Asymptote
的文档(此处< /a>) 具有 a 样条的几何解释。对于中点 (t=-.5),该点位于下面的点 m_5 中。如果您使用一个控制点,则 c_0 和 c_1 是重合的,从而简化了数学计算。如果在 (t=0.5) 处,您的 y 值为y_c
并且开始值和结束值分别为z_0
和z_1
则控制点位于对
x
值执行相同的操作。Look into the documentation of
Asymptote
(here) which has a geometrical interpretation of the a spline. For the mid point (t=-.5) the point lies in the point m_5 below. If you are using one control point them c_0 and c_1 are coincident simplifying the math. If at (t=0.5) your y values isy_c
and the beginning and ending values are respectivelyz_0
andz_1
then the control point is atDo the same for the
x
values.查看我几天前提出的问题: 给定f(x)线性函数,如何获得二次贝塞尔曲线控制点。我认为这正是您所需要的。
Check out the question I asked a couple of days ago: Given f(x) linear function, how to obtain a Quadratic Bezier control point. I think it's exactly what you need.