首页 > 文档 > curveTightness()曲线松紧度
2017
07-29

curveTightness()曲线松紧度

Name

curveTightness()曲线松紧度

   

Examples

// Move the mouse left and right to see the curve change

 

void setup() {

size(100, 100);

noFill();

}

 

void draw() {

background(204);

float t = map(mouseX, 0, width, -5, 5);

curveTightness(t);

beginShape();

curveVertex(10, 26);

curveVertex(10, 26);

curveVertex(83, 24);

curveVertex(83, 61);

curveVertex(25, 65);

curveVertex(25, 65);

endShape();

}

Description

Modifies the quality of forms created with curve() and curveVertex(). The parameter tightnessdetermines how the curve fits to the vertex points. The value 0.0 is the default value for tightness(this value defines the curves to be Catmull-Rom splines) and the value 1.0 connects all the points with straight lines. Values within the range -5.0 and 5.0 will deform the curves but will leave them recognizable and as values increase in magnitude, they will continue to deform.

修改用曲线 () curveVertex () 创建的窗体的质量。参数 tightnessdetermines 曲线如何适应顶点点。值0.0 是密度的默认值 (此值定义了要为卡特莫尔的曲线), 而值1.0 则用直线连接所有点。范围-5.0 5.0 内的值将变形的曲线, 但将离开他们可辨认的, 随着价值的增加, 他们将继续变形。

Syntax

curveTightness(tightness)

Parameters

tightness

float: amount of deformation from the original vertices浮点数: 从原始顶点的变形量

Returns

void

Related

curve()
curveVertex()



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

留下一个回复

你的email不会被公开。