创建“分数”贝塞尔样条?

发布于 2024-09-16 18:37:11 字数 354 浏览 4 评论 0原文

我有一条 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我三岁 2024-09-23 18:37:11

也许这会有所帮助: 细分贝塞尔曲线。您不会“缩放”控制点,而是计算新的控制点。

此页面有一些很好的小程序演示该算法。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文