首页 > 文档 > textureMode()纹理模式
2017
08-09

textureMode()纹理模式

Name

textureMode()纹理模式

   

Examples

textureMode()纹理模式 - 第1张  | Processing编程艺术textureMode()纹理模式 - 第2张  | Processing编程艺术textureMode()纹理模式 - 第3张  | Processing编程艺术

size(100, 100, P3D);

noStroke();

PImage img = loadImage(“laDefense.jpg”);

textureMode(IMAGE);

beginShape();

texture(img);

vertex(10, 20, 0, 0);

vertex(80, 5, 100, 0);

vertex(95, 90, 100, 100);

vertex(40, 95, 0, 100);

endShape();

textureMode()纹理模式 - 第4张  | Processing编程艺术textureMode()纹理模式 - 第5张  | Processing编程艺术textureMode()纹理模式 - 第6张  | Processing编程艺术

size(100, 100, P3D);

noStroke();

PImage img = loadImage(“laDefense.jpg”);

textureMode(NORMAL);

beginShape();

texture(img);

vertex(10, 20, 0, 0);

vertex(80, 5, 1, 0);

vertex(95, 90, 1, 1);

vertex(40, 95, 0, 1);

endShape();

Description

Sets the coordinate space for texture mapping. The default mode is IMAGE, which refers to the actual coordinates of the image. NORMAL refers to a normalized space of values ranging from 0 to 1. This function only works with the P2D and P3D renderers.

With IMAGE, if an image is 100 x 200 pixels, mapping the image onto the entire size of a quad would require the points (0,0) (100, 0) (100,200) (0,200). The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1).

设置纹理映射的坐标空间。默认模式是图像, 它指的是图像的实际坐标。正常指的是介于01之间的规范化的值空间。此函数仅适用于 P2D P3D 器。

 

对于图像, 如果图像是 100 x 200 像素, 则将图像映射到四个数字的整个大小将需要点 (00) (1000) (100200) (0200)。同一映射在法线是 (00) (10) (11) (01)

Syntax

textureMode(mode)

Parameters

mode

int: either IMAGE or NORMAL

 

图像或正常

Returns

void

Related

texture()
textureWrap()



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

留下一个回复

你的email不会被公开。