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 |
|
||||
Returns |
void |
||||
Related |
texture() |
- 本文固定链接: http://iprocessing.cn/2017/08/09/texturewrap纹理重绘/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表