[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Which way is up?

   Date: Sun, 2 Aug 87 16:43:56 edt
   From: Mike McDonnell <mike@etl.arpa>
   Resent-From: CMP.SLUG@r20.utexas.edu
   Resent-To: ;@slug.arpa

   1.  Why is this "antique" form of coordinate system so persistent
   in computers when major texts no longer use it and we were all
   trained to think in Y-up coordinates?  [I notice that even the
   "new" graphics system X Windows uses Y-down coordinates.]

Y-down is in fact the norm for almost all raster displays. One can
argue that it's intuitive since it matches the way people (and
electron beams, and the cursor/print head of a printer) scan a page,
with the origin in the upper left corner. The texts you mention all
use Y-up as an abstraction. The conversion is trivial in any case.

   2.  What is the best way of transforming window coordinates to
   Y-up while making as few changes to the Symbolics software as

Any point in homogenous screen coordinates [X Y Z 1] can be coverted
to have the reverse Y by the following transformation:

[X Y Z 1]  1  0  0  0
           0 -1  0  0
           0  0  1  0
           0  H  0  1

Where H= (1- screen-height-in-pixels). I.e., for a 1280x1024 screen,
H=1023. If you're doing the 3D transform stuff in Foley&VanDam et al,
you can just add this matrix into the sequence of transformation
matrices you're already using. Similar transform matrices can be
computed for any output device, for example, those with origins in the
center, or those with non-square pixels. By including a generalized
NDC (normalized display coordinates) to screen transform matrix, you
have a far more general system.

At the MIT Media Lab and at Thinking Machines, we have several
rendering systems which use a slightly improved formulation of the
viewing transform (defined by Alvy Ray Smith in "The Viewing
Transformation", Technical Memo no. 84, Lucasfilm Ltd, Revised May 4,
1984.) The discussion of world, normalized, and screen coordinates is
a little more reasonable than what's presented in Foley&VanDam,
Rogers, et al.