2012-11-02 53 views
1

我一直在试图理解顶点纹理是如何工作的,但不明白参数的作用。顶点纹理通常是这样的:带OBJ文件的顶点纹理

vt 0.000000 0.000000 

VT 0.010000 0.000000 VT 0.020000 0.000000 VT 0.030000 0.000000

,我首先想到的,他们的纹理图像pixils(X,Y)值,但这对vt中的小数是没有意义的。

vt u v w 多边形和自由几何几何体的顶点声明。

Specifies a texture vertex and its coordinates. A 1D texture 
requires only u texture coordinates, a 2D texture requires both u 
and v texture coordinates, and a 3D texture requires all three 
coordinates. 

u is the value for the horizontal direction of the texture. 

v is an optional argument. 

v is the value for the vertical direction of the texture. The 
default is 0. 

w is an optional argument. 

w is a value for the depth of the texture.The default is 0. 

是VT的最详细的解释,我能找到,但无法理解。

回答

1

取代x和y,它被称为U和V.(0,0)是图像的一个角,而(1,1)是对角,无论纹理的大小如何。

在大多数情况下的2D纹理坐标(U,V)被用于

你可能会超过1或0以下的值。在大多数情况下,纹理只是包装,所以(0,0)到(1, 1)与(1,1)至(2,2)或(-1,88)至(0,89)等相同。

+0

因此将类似于 'vt 0.01 0.5' 平均1/100宽度和纹理的1/2高度? – eosd441

+0

是的,你明白了! – MadcoreTom