Presentation is loading. Please wait.

Presentation is loading. Please wait.

Viewing Rectangle Coordinates (VRC)

Similar presentations


Presentation on theme: "Viewing Rectangle Coordinates (VRC)"— Presentation transcript:

1 Viewing Rectangle Coordinates (VRC)
VRP is the origin of VRC space. VPN in direction of n vector. VUP, VPN define v-n plane; u is then perpendicular to both. Right handed choice for v. PRP ' is in world coordinates.

2 Point to Viewing Plane Object located at point P.
Point Q is the location on the viewing rectangle where P is projected P is projected in direction d and strikes the viewing rectangle at Q. Parallel Vector d is constant. PRP ' is projected into CW. This defines d. Perspective All lines of projection pass through PRP ' P and PRP ' can define d.

3 Locating Point Q Point Q can be expressed in VRC coordinates as (r,s,0). Equate the definitions of Q. Define w, m for simplicity. Solve for r, s. u, v, n are orthogonal, unit.

4 Finding the Z-value Finding the x, y values (r and s) does not give us the z value! The z value is just the signed distance between P and the viewing plane. Let c be the z coordinate. Compute the distance from point to plane by a vector from P to a point on the plane, projected onto the plane's normal n. The sign is important. If n points towards P, c > 0 Choose VRP as the point on the plane. Point P in has VRC coordinates (r, s, c).

5 VRC to Viewport Map r, s, and c independently, as for 2D.
Viewport extents (commandline): j, k, o, p r: [u, U] to [j, o] s: [v, V] to [k, p] c: [n, N] to [0, 1] Perform clipping in viewport, as for 2D. When depth buffering, anything outside of [0,1] is clipped from view.

6 Implementation & Efficiency
Compute n, u, v, PRP ', CW, d, w, t, m, r, s, c. Computing these intermediate results avoids most (not all!) of the redundant computations. What can be precomputed, before applying the transformation to all points? These: u, v, n, CW, PRP '. Note that d can, but only for parallel. Remember to map (r,s,c) to the viewport!


Download ppt "Viewing Rectangle Coordinates (VRC)"

Similar presentations


Ads by Google