Processing, curvePoint()用法介绍。
用法
curvePoint(a, b, c, d, t)
参数
a(float)第一个控制点坐标b(float)曲线上第一个点的坐标c(float)曲线上第二点的坐标d(float)第二控制点坐标t(float)0 到 1 之间的值
返回
float
说明
为点 a 、 b 、 c 、 d 评估点 t 处的曲线。参数t 的范围可以是 0(曲线的起点)和 1(曲线的终点)。 a和d是控制点,b和c是曲线上的点。如上例所示,这可以与 x 坐标一起使用一次,然后与 y 坐标一起使用第二次,以获取 t 处的曲线位置。
例子
size(400,400);
noFill();
curve(20, 104, 20, 104, 292, 96, 292, 244);
curve(20, 104, 292, 96, 292, 244, 60, 260);
fill(255);
ellipseMode(CENTER);
int steps = 6;
for (int i = 0; i <= steps; i++) {
float t = i / float(steps);
float x = curvePoint(20, 20, 292, 292, t);
float y = curvePoint(104, 104, 96, 244, t);
ellipse(x, y, 10, 10);
x = curvePoint(20, 292, 292, 60, t);
y = curvePoint(104, 96, 244, 260, t);
ellipse(x, y, 10, 10);
}
相关用法
- Processing curveDetail()用法及代码示例
- Processing curveVertex()用法及代码示例
- Processing curve()用法及代码示例
- Processing curveTightness()用法及代码示例
- Processing curveTangent()用法及代码示例
- Processing cursor()用法及代码示例
- Processing case用法及代码示例
- Processing clip()用法及代码示例
- Processing camera()用法及代码示例
- Processing catch用法及代码示例
- Processing char()用法及代码示例
- Processing ceil()用法及代码示例
- Processing concat()用法及代码示例
- Processing continue用法及代码示例
- Processing color()用法及代码示例
- Processing copy()用法及代码示例
- Processing createFont()用法及代码示例
- Processing cos()用法及代码示例
- Processing circle()用法及代码示例
- Processing char用法及代码示例
- Processing color用法及代码示例
- Processing createImage()用法及代码示例
- Processing createShape()用法及代码示例
- Processing class用法及代码示例
- Processing createInput()用法及代码示例
注:本文由纯净天空筛选整理自processing.org大神的英文原创作品 curvePoint()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
