home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / 3d / irit / grapdrvs / drawptvc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-20  |  2.0 KB  |  55 lines

  1. /*****************************************************************************
  2. *   Default point/vector drawing routine common to graphics drivers.         *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.1, June 1993.  *
  5. *****************************************************************************/
  6.  
  7. #include "irit_sm.h"
  8. #include "iritprsr.h"
  9. #include "cagd_lib.h"
  10. #include "symb_lib.h"
  11. #include "iritgrap.h"
  12.  
  13. /*****************************************************************************
  14. * DESCRIPTION:                                                               M
  15. * Draw a single Point/Vector object using current modes and transformations. M
  16. *                                                                            *
  17. * PARAMETERS:                                                                M
  18. *   PObj:     A point/vector object to draw.                                 M
  19. *                                                                            *
  20. * RETURN VALUE:                                                              M
  21. *   void                                                                     M
  22. *                                                                            *
  23. * KEYWORDS:                                                                  M
  24. *   IGDrawPtVec                                                              M
  25. *****************************************************************************/
  26. void IGDrawPtVec(IPObjectStruct *PObj)
  27. {
  28.     static PointType
  29.     Zero = { 0.0, 0.0, 0.0 };
  30.     int i;
  31.     PointType Ends[6];
  32.     RealType
  33.     *Pt = PObj -> U.Pt;
  34.  
  35.     for (i = 0; i < 6; i++)
  36.     PT_COPY(Ends[i], Pt);
  37.  
  38.     Ends[0][0] -= IG_POINT_WIDTH;
  39.     Ends[1][0] += IG_POINT_WIDTH;
  40.     Ends[2][1] -= IG_POINT_WIDTH;
  41.     Ends[3][1] += IG_POINT_WIDTH;
  42.     Ends[4][2] -= IG_POINT_WIDTH;
  43.     Ends[5][2] += IG_POINT_WIDTH;
  44.  
  45.     for (i = 0; i < 6; i += 2) {
  46.     IGMoveTo3D(Ends[i]);
  47.     IGLineTo3D(Ends[i+1]);
  48.     }
  49.  
  50.     if (IP_IS_VEC_OBJ(PObj)) {
  51.     IGMoveTo3D(Pt);
  52.     IGLineTo3D(Zero);
  53.     }
  54. }
  55.