创建“分数”贝塞尔样条?
我有一条 4 控制点贝塞尔曲线,代表一些计时内容。第一个控制固定为 (0, 0),最后一个控制固定为 (1, 1)。中间的两个点定义了一条贝塞尔曲线,指定如何从 0 到 1。
现在我需要根据第一条曲线创建第二条曲线。第二条曲线也需要从 (0, 0) 到 (1, 1)。但我想要第一条曲线的某个分数的形状,例如它应该看起来像第一条曲线的前 0.75。
换句话说,如果我将这些曲线用于计时目的,并且我跟踪曲线#1 10 秒,同时跟踪曲线#2 7.5 秒,则它们在被跟踪期间遵循相同的路径。 (有意义吗?)
考虑到小数(本例中为 0.75)参数,有没有办法获取第一条曲线的控制点并将它们“缩放”到第二条曲线中?
谢谢。
I have a 4-control-point bezier curve that represents some timing stuff. The first control is fixed at (0, 0) and the last control is fixed at (1, 1). The two points in between define a bezier curve that specifies how I get from 0 to 1.
Now I need to create a second curve, based off the first one. This second curve also needs to go from (0, 0) to (1, 1). But I'd like to to have the shape of some fraction of the first curve, for example it should look like the first 0.75 of the first curve.
In other words, if I'm using these curves for timing purposes, and I trace curve #1 for 10 seconds, and simultaneously trace curve #2 for 7.5 seconds, they follow the same path during the time they're both being traced. (Make sense?)
Is there a way to take the control points of the first curve and "scale" them into the second curve, given that fractional (0.75 in this example) parameter?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这会有所帮助: 细分贝塞尔曲线。您不会“缩放”控制点,而是计算新的控制点。
此页面有一些很好的小程序演示该算法。
Perhaps this will help: Subdividing a Bezier curve. You don't "scale" the control points, you calculate new ones.
This page has some nice applets demonstrating the algorithm.