# Difference between revisions of "Planar Projection"

Tcheeseman1 (talk | contribs) (→Projection Parameters) |
Tcheeseman1 (talk | contribs) (→Orthographic Projection) |
||

Line 35: | Line 35: | ||

:* <math>R_{y} = R_{z} \times R_{x}</math> | :* <math>R_{y} = R_{z} \times R_{x}</math> | ||

− | The components of these vectors (e.g. < | + | The components of these vectors (e.g. R<sub>x</sub> = < r<sub>x1</sub>, r<sub>x2</sub>, r<sub>x3</sub> >) then form the rotation matrix R: |

<math>R = \left[ \begin{array}{cccc} | <math>R = \left[ \begin{array}{cccc} | ||

Line 45: | Line 45: | ||

</math> | </math> | ||

− | The third step is to shear the geometry so the the direction of projection (DOP) is parallel to the VPN. | + | The third step is to shear the geometry so the the direction of projection (DOP) is parallel to the VPN (now aligned with the z axis). The DOP is defines as follows: |

+ | |||

+ | <math>DOP = \left[ \begin{array}{c} | ||

+ | \frac{u_{max} + u_{min}}{2} - prp_{u} \\ | ||

+ | \frac{v_{max} + v_{min}}{2} - prp_{v} \\ | ||

+ | -prp_{n} \\ | ||

+ | 1 | ||

+ | \end{array} \right] | ||

+ | </math> | ||

+ | |||

+ | To shear the DOP, we need to align it with the ''z'' axis. | ||

+ | |||

+ | TODO: define shx and shy | ||

+ | |||

+ | <math>SH_{par} = \left[ \begin{array}{cccc} | ||

+ | 1 & 0 & sh_{x} & 0 \\ | ||

+ | 0 & 1 & sh_{y} & 0 \\ | ||

+ | 0 & 0 & 1 & 0 \\ | ||

+ | 0 & 0 & 0 & 1 | ||

+ | \end{array} \right] | ||

+ | </math> | ||

+ | |||

+ | TODO: add translate (Tpar) and scale (Spar) | ||

The final transformation matrix for orthographic projection is then the result of the following multiplication: | The final transformation matrix for orthographic projection is then the result of the following multiplication: |

## Revision as of 12:06, 17 August 2009

Summary

## Contents

### Projection Parameters

Each of the parameters uses either the *world-coordinate* (WC) or *viewing reference-coordinate* (VRC) system. The WC system uses the standard *x*, *y*, and *z* axes, while the VRC system uses the *u*, *v*, and *n* axes.

- The
**View Reference Point**(VRP) is the point (WC) from which the camera is viewing the 3D geometry. - The
**View Plane Normal**(VPN) is the normal (WC) which, once projected, defines the*n*axis. - The
**View Up Vector**(VUP) is the vector (WC) that defines the orientation of the camera (i.e. which way is up) and, once projected, defines the*v*axis. - The
**Projection Reference Point**(PRP) is the point (VRC) ... - The
**Viewing Window**is the rectangle (VRC) that defines the size of the 2D window upon which the 3D geometry will be projected. It is defined by u_{min}, u_{max}, v_{min}, and v_{max}. - The
**projection type**can be either parallel or perspective.

- The

## Parallel Projection

Summary

### Orthographic Projection

The first step is to translate the VRP to the origin, which can be achieved by multiplying its complement with the following matrix **T**:

The second step is to then rotate VPN to the *z* axis and VUP to the *y* axis. To do this we will calculate the following vectors:

The components of these vectors (e.g. R_{x} = < r_{x1}, r_{x2}, r_{x3} >) then form the rotation matrix R:

The third step is to shear the geometry so the the direction of projection (DOP) is parallel to the VPN (now aligned with the z axis). The DOP is defines as follows:

To shear the DOP, we need to align it with the *z* axis.

TODO: define shx and shy

TODO: add translate (Tpar) and scale (Spar)

The final transformation matrix for orthographic projection is then the result of the following multiplication:

### Oblique Projection

## Perspective Projection

Summary