| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csTextureTrans Class Reference
[Geometry utilities]

This is a static class which encapsulates a few functions that can transform texture information into a texture matrix/vector. More...

`#include <csgeom/textrans.h>`

List of all members.

## Static Public Member Functions
static void | compute_texture_space (csMatrix3 &m, csVector3 &v, float xo, float yo, float zo, float xu, float yu, float zu, float xv, float yv, float zv, float xw, float yw, float zw)
| The most general function.
static void | compute_texture_space (csMatrix3 &m, csVector3 &v, const csVector3 &v_orig, const csVector3 &v_u, const csVector3 &v_v)
| Similar to the previous function but treat as if the lengths are set to 1.
static void | compute_texture_space (csMatrix3 &m, csVector3 &v, const csVector3 &v_orig, const csVector3 &v1, float len1, const csVector3 &v2, float len2)
| Use 'v1' and 'len1' for the u-axis and 'v2' and 'len2' for the v-axis.
static void | compute_texture_space (csMatrix3 &m, csVector3 &v, const csVector3 &v_orig, const csVector3 &v1, float len1, float A, float B, float C)
| Calculate the matrix using two vertices (which are preferably on the plane of the polygon and are possibly (but not necessarily) two vertices of the polygon).

## Detailed Description

This is a static class which encapsulates a few functions that can transform texture information into a texture matrix/vector.

This class makes it easiers to define textures for polygons given various things.

Definition at line 40 of file textrans.h.

## Member Function Documentation

static void csTextureTrans::compute_texture_space | ( | csMatrix3 & | m,
|  | csVector3 & | v,
|  | float | xo,
|  | float | yo,
|  | float | zo,
|  | float | xu,
|  | float | yu,
|  | float | zu,
|  | float | xv,
|  | float | yv,
|  | float | zv,
|  | float | xw,
|  | float | yw,
|  | float | zw |
| ) |  |  | `[static]`

The most general function.

With these you provide the matrix directly.

static void csTextureTrans::compute_texture_space | ( | csMatrix3 & | m,
|  | csVector3 & | v,
|  | const csVector3 & | v_orig,
|  | const csVector3 & | v_u,
|  | const csVector3 & | v_v |
| ) |  |  | `[static]`

Similar to the previous function but treat as if the lengths are set to 1.

static void csTextureTrans::compute_texture_space | ( | csMatrix3 & | m,
|  | csVector3 & | v,
|  | const csVector3 & | v_orig,
|  | const csVector3 & | v1,
|  | float | len1,
|  | const csVector3 & | v2,
|  | float | len2 |
| ) |  |  | `[static]`

Use 'v1' and 'len1' for the u-axis and 'v2' and 'len2' for the v-axis.

Otherwise this function is the same as the previous one.

static void csTextureTrans::compute_texture_space | ( | csMatrix3 & | m,
|  | csVector3 & | v,
|  | const csVector3 & | v_orig,
|  | const csVector3 & | v1,
|  | float | len1,
|  | float | A,
|  | float | B,
|  | float | C |
| ) |  |  | `[static]`

Calculate the matrix using two vertices (which are preferably on the plane of the polygon and are possibly (but not necessarily) two vertices of the polygon).

The first vertex is seen as the origin and the second as the u-axis of the texture space coordinate system. The v-axis is calculated on the plane of the polygon and orthogonal to the given u-axis. The length of the u-axis and the v-axis is given as the 'len1' parameter.

For example, if 'len1' is equal to 2 this means that texture will be tiled exactly two times between vertex 'v_orig' and 'v1'. I hope this explanation is clear since I can't seem to make it any clearer :-)

The documentation for this class was generated from the following file:

- csgeom/textrans.h