Textures in think3 applications comprise of images. Texture mapping applies a pattern of color to an object. A texture, generally speaking, is a function describing an object property as a variable. For example, the color of an object is typically defined as a triplet {R, G, B} value as:
There should not be any confusion between geometry coordinates and texture coordinates.The geometry coordinates exist for the (3D) objects, to which we do the Texture Mapping. The difference between texture coordinates and geometry coordinates are what they measure. The geometry coordinates (x, y, and z) are a reference system for placing geometry in a three dimensional space. An object exists at one set of coordinates. If you move the object, it gets at a new set of x, y and Z values. The same happens when you scale or rotate an object.
The texture coordinates only measure texture repetitions. That's why the upper right corner is (1,1). It will always be (1,1) no matter how you scale or stretch the texture. The space between 0,0 and 1,1 is one repetition of the texture. If you use more than one repetition, you start tiling the texture. Each tile adds 1 to the u and/or the v coordinates (or subtracts 1 if you want to tile it in a negative direction). So a set of texture coordinates from (-2,-2) to (3,3) would be a grid of five tiles of our texture, as shown below:
Texture space is a mathematically perfect, flat surface. That is, it does not have any curvature. However, the surfaces that textures are going to be placed on (surfaces of objects) are seldom going to be flat. That is, texture mapping should consider the mapping of a flat surface (the texture map) onto a curved one. This surface to which the texture space is to be projected, is called a Mapping Surface. So we need yet another coordinate system to define Mapping Surface.
Mapping Surface is defined with the coordinates s and t, with s being the horizontal component and t being the vertical. (s, t) coordinates are functionally equivalent to u, v coordinates but they represent a totally different concept. Since the surface being mapped would be irregular, s, t coordinates let us find a particular spot on the texture map (u, v coordinates) regardless of any stretching or distortion that might have taken place in order to get the 2D texture onto the 3D surface. In other words, the u, v coordinates of the 2D image are referenced by the s, t coordinates on the surface that relate to the x, y, and z coordinates of the 3D object's geometry. So the actual texture coordinates are represented by the (s,t) coordinates. The following image illustrates this transition from the (u,v) coordinates of the texture map to the (x,y,z) coordinates of the object through the (s,t) coordinates of the mapping surface.
Note
It should be clear that the (s,t) coordinates are the actual texture coordinates. Only in the case of UV mapping the (u,v) coordinates are equivalent to (s,t) coordinates. This is due to the fact that a plain surface (texture map) is being mapped to another (of the object) surface by considering that the surface is planar. |