开发者

Creating a "fractional" bezier spline?

开发者 https://www.devze.com 2023-01-13 19:57 出处:网络
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 t

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开发者_如何学C.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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号