International
Tables for
Crystallography
Volume B
Reciprocal space
Edited by U. Shmueli

International Tables for Crystallography (2006). Vol. B. ch. 3.3, pp. 370-371   | 1 | 2 |

Section 3.3.1.3.7. Viewports

R. Diamonda*

aMRC Laboratory of Molecular Biology, Hills Road, Cambridge CB2 2QH, England
Correspondence e-mail: rd10@cam.ac.uk

3.3.1.3.7. Viewports

| top | pdf |

The window transformation of the previous two sections[link] [link] has been constructed to yield picture coordinates (X, Y, Z, W) (formerly called x, y, z, w) such that a point having [X/W] or [Y/W = \pm 1] is on the boundary of the picture, and the clipping hardware operates on this basis. However, the edges of the picture need not be at the edges of the screen and a viewport transformation, V, is therefore needed to position the picture in the requisite part of the screen. [{\bi V} = \pmatrix{(r - l)/2 &0 &0 &(r + l)/2\cr \noalign{\vskip3pt} 0 &(t - b)/2 &0 &(t + b)/2\cr \noalign{\vskip3pt} 0 &0 &n &0\cr 0 &0 &0 &n\cr},] where r, l, t and b are now the right, left, top and bottom boundaries of the picture area, or viewport, expressed in screen coordinates, and n is the full-screen deflection value. Thus a point with [X/W = 1] in picture space plots on the screen with an X coordinate which is a fraction [r/n] of full-screen deflection to the right. [Z/W] is unchanged by V and is used only to control intensity in a technique known as depth cueing.

It is necessary, of course, to arrange for the aspect ratio of the viewport, [(r - l)/( t - b)], to equal that of the window otherwise distortions are introduced.








































to end of page
to top of page