首页 > 文档 > curve()曲线
2017
07-29

curve()曲线

Name 

curve()曲线

   

Examples 

curve()曲线 - 第1张  | Processing编程艺术

noFill();

stroke(255, 102, 0);

curve(5, 26, 5, 26, 73, 24, 73, 61);

stroke(0);

curve(5, 26, 73, 24, 73, 61, 15, 65);

stroke(255, 102, 0);

curve(73, 24, 73, 61, 15, 65, 15, 65); 

Description 

Draws a curved line on the screen. The first and second parameters specify the beginning control point and the last two parameters specify the ending control point. The middle parameters specify the start and stop of the curve. Longer curves can be created by putting a series of curve() functions together or using curveVertex(). An additional function called curveTightness() provides control for the visual quality of the curve. The curve() function is an implementation of Catmull-Rom splines. Using the 3D version requires rendering with P3D (see the Environment reference for more information).

在屏幕上绘制一条曲线。第一和第二个参数指定起点控制点, 最后两个参数指定结束控制点。中间参数指定曲线的开始和停止。可以通过将一系列曲线 () 函数放在一起或使用 curveVertex () 来创建更长的曲线。一个名为 curveTightness () 的附加函数为曲线的视觉质量提供控制。曲线 () 函数是卡特莫尔样条的实现。使用3D 版本需要用 P3D 进行渲染 (有关更多信息, 请参见环境参考)

Syntax 

curve(x1, y1, x2, y2, x3, y3, x4, y4)

curve(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) 

Parameters 

x1 

float: coordinates for the beginning control point浮点数: 起始控制点的坐标

y1 

float: coordinates for the beginning control point浮点数: 起始控制点的坐标

x2 

float: coordinates for the first point

浮点数: 第一点的坐标

y2 

float: coordinates for the first point

浮点数: 第一点的坐标

x3 

float: coordinates for the second point

浮点数: 第二点的坐标

y3 

float: coordinates for the second point

浮点数: 第二点的坐标

x4 

float: coordinates for the ending control point浮点数:终点控制点的坐标

y4 

float: coordinates for the ending control point浮点数:终点控制点的坐标

z1 

float: coordinates for the beginning control point浮点数: 起始控制点的坐标

z2 

float: coordinates for the first point

浮点数: 第一点的坐标

z3 

float: coordinates for the second point

浮点数: 第二点的坐标

z4 

float: coordinates for the ending control point浮点数:终点控制点的坐标

Returns 

void 

Related

curveVertex()
curveTightness()
bezier()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。