首页 > 文档 > textureWrap()纹理重绘
2017
08-09

textureWrap()纹理重绘

Name

textureWrap()纹理重绘

   

Examples

PImage img;

 

void setup() {

size(300, 300, P2D);

img = loadImage(“berlin-1.jpg”);

textureMode(NORMAL);

}

 

void draw() {

background(0);

translate(width/2, height/2);

rotate(map(mouseX, 0, width, -PI, PI));

if (mousePressed) {

textureWrap(REPEAT);

} else {

textureWrap(CLAMP);

}

beginShape();

texture(img);

vertex(-100, -100, 0, 0);

vertex(100, -100, 2, 0);

vertex(100, 100, 2, 2);

vertex(-100, 100, 0, 2);

endShape();

}

Description

Defines if textures repeat or draw once within a texture map. The two parameters are CLAMP (the default behavior) and REPEAT. This function only works with the P2D and P3D renderers.

定义纹理是否在纹理贴图中重复或绘制一次。这两个参数是钳形 (默认行为) 并重复。此函数仅适用于 P2D P3D 器。

Syntax

textureWrap(wrap)

Parameters

wrap

int: Either CLAMP (default) or REPEAT

 

夹钳 (默认) 或重复

Returns

void

Related

texture()
textureMode()



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

留下一个回复

你的email不会被公开。