[NEXT] [UP] [PREVIOUS] . [CONTENTS] [INDEX] . [Quick Ref]
Next: Options Up: Texturing Previous: Image Texturing

Mapping Functions

Mapping functions are used to apply two-dimensional textures to surfaces. Each mapping functions defines a different method of transforming a three dimensional point of intersection to a two dimensional u-v pair termed texturing coordinates. Typically, the arguments to a mapping method define a center of a projection and two non-parallel axes that define a local coordinate system.

The default mapping method is termed u-v mapping or inverse mapping. Normally, there is a different inverse mapping method for each primitive type. When inverse mapping is used, the point of intersection is passed to the uv method for the primitive that was hit.

map uv
Use the uv (inverse mapping) method associated with the object that was intersected in order to map from 3D to determine texturing coordinates.

map planar [^origin ^vaxis ^uaxis]
Use a planar mapping method. The 2D texture is transformed so that its u axis is given by ^uaxis and its v axis by vaxis. The texture is projected along the vector defined by the cross product of the u and v axes, with the (0,0) in texture space mapped to ^origin.

map cylindrical [^origin ^vaxis ^uaxis]
Use a cylindrical mapping method. The point of intersection is projected onto an imaginary cylinder, and the location of the projected point is used to determine the texture coordinates. If given, ^origin and ^vaxis define the cylinder's axis, and ^uaxis defines where u=0 is located.

See the description of the inverse mapping method for the cylinder . By default, the point of intersection is projected onto a cylinder that runs through the origin along the z axis, with ^uaxis equal to the x axis.

map spherical [^origin ^vaxis ^uaxis]
Use a spherical mapping method. The intersection point is projected onto an imaginary sphere, and the location of the projected point is used to determine the texturing coordinates in a manner identical to that used in the inverse mapping method for the sphere primitive. If given, the center of the projection is ^origin, ^vaxis defines the sphere axis, and the point where the non-parallel ^uaxis intersects the sphere defines where u=0 is located.

By default, a spherical mapping projects points towards the origin, with ^vaxis defined to be the z axis and ^uaxis defined to be the x axis.


[NEXT] [UP] [PREVIOUS] . [CONTENTS] [INDEX] . [Quick Ref]
Next: Options Up: Texturing Previous: Image Texturing


Jelle van Zeijl (jvzeijl@iso.estec.esa.nl)
Wed Jun 15 16:19:08 MET DST 1994