home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / voglw.zip / getgp.c < prev    next >
C/C++ Source or Header  |  1997-02-13  |  635b  |  36 lines

  1. #include "vogl.h"
  2.  
  3. /*
  4.  * getgp
  5.  *
  6.  *    return the current (x, y, z) graphics position
  7.  */
  8. void
  9. getgp(x, y, z)
  10.     Coord    *x, *y, *z;
  11. {
  12.     *x = vdevice.cpW[V_X];
  13.     *y = vdevice.cpW[V_Y];
  14.     *z = vdevice.cpW[V_Z];
  15. }
  16.  
  17. /*
  18.  * getgpos
  19.  *
  20.  *    Get the current graphics position after transformation by
  21.  *    the current matrix.
  22.  */
  23. void
  24. getgpos(x, y, z, w)
  25.     Coord    *x, *y, *z, *w;
  26. {
  27.     /* Make sure that it's all updated for current spot */
  28.  
  29.     multvector(vdevice.cpWtrans, vdevice.cpW, vdevice.transmat->m);
  30.     *x = vdevice.cpWtrans[V_X];
  31.     *y = vdevice.cpWtrans[V_Y];
  32.     *z = vdevice.cpWtrans[V_Z];
  33.     *w = vdevice.cpWtrans[V_W];
  34. }
  35.  
  36.