The SEDRIS Data Representation Model
APPENDIX A - Classes Texture Coordinate |
---|
An instance of this DRM class specifies a {s, t} tuple in image space (also known as texture space) used to specify how a texel from the image space is to be mapped to a location in "object" space.
Each MIP level of a 2D <Image> defines an image that has a width and height specified in texels. Regardless of the actual size of the image, the image space is defined by treating the two-dimensional image as a square, defined by the lower-left coordinate of (0.0, 0.0) and the upper-right coordinate of (1.0, 1.0). A <Texture Coordinate> instance is a coordinate within this image space.
A <Texture Coordinate> instance specifies an exact location within a given image space, and this location is mapped to the "object space" location associated with the <Vertex>, <Point>, or <Tack Point> instance of which the <Texture Coordinate> instance is a component. A textured geometric object generally has a <Texture Coordinate> for each vertex of the object, and the surface of the geometric object is 'painted' or 'covered' with the given <Image>, interpolating what part of the <Image> should be displayed where based on the <Texture Coordinate> components of the object's vertices.
Whether a specified <Texture Coordinate> instance corresponds to exactly one texel in the texture definition, or to a blending of many texel values from the definition, is a decision made by the texture interpolation algorithm used to display the texture. The methods for calculating the interpolated texture values and for blending the texture onto the object are determined by an <Image Mapping Function>. instance (Note that according to <<Image Mapping Functions and Texture Coordinates>>, <Texture Coordinate> instances will only appear within the scope of some <Image Mapping Function>.)
The s, t coordinates to map to the lower left corner of a <Polygon> instance.
The interpretation of the s value of the <Texture Coordinate> depends on the value of the image_wrap_s field of the relevant <Image Mapping Function>.
If image_wrap_s specifies that the <Image> is to be clamped, then any s values less than 0.0 are to be clamped to 0.0, and any s values greater than 1.0 are to be clamped to 1.0. That is, s values less than 0.0 are to be treated as though they had been 0.0, and those greater than 1.0 are treated as though they had been 1.0
If image_wrap_s specifies that the <Image> is to be repeated, then any s less than 0.0 or greater than 1.0 are to be treated as though the <Image> tiles the image space out to infinity.
In practical terms, during repeating, the integer portion of the <Texture Coordinate> is ignored, and copies of the texture map tile the surface.
The interpretation of the <Texture Coordinate>'s t value depends on the value of the image_wrap_t field of the relevant <Image Mapping Function>.
If image_wrap_t specifies that the <Image> is to be clamped, then any t values less than 0.0 are to be clamped to 0.0, and any t values greater than 1.0 are to be clamped to 1.0. That is, t values less than 0.0 are to be treated as though they had been 0.0, and those greater than 1.0 are treated as though they had been 1.0
If image_wrap_t specifies that the <Image> is to be repeated, then any t less than 0.0 or greater than 1.0 are to be treated as though the <Image> tiles the image space out to infinity.
In practical terms, during repeating, the integer portion of the <Texture Coordinate> is ignored, and copies of the texture map tile the surface.
Reference: OpenGL Programming Guide, 3rd edition for more information on clamping and repeating textures.
SE_Long_Float | s; | (notes) |
---|---|---|
SE_Long_Float | t; | (notes) |
The s field specifies the s value of the (s,t) coordinate.
The t field specifies the t value of the (s,t) coordinate.
|