home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / DemoApps / Graphics / 2D_3D / Tester3D / Source / Cube.m < prev    next >
Encoding:
Text File  |  1991-02-27  |  774 b   |  30 lines

  1. /* Cube.m */
  2.  
  3. #import "Cube.h"
  4. #import <stdio.h>
  5. #import "Linear3D.h"
  6. #import <dpsclient/wraps.h>
  7.  
  8. @implementation Cube
  9.  
  10. - render
  11. {
  12.     vector3D back[] = {{.5,.5,.5},{.5,-.5,.5},{-.5,-.5,.5},{-.5,.5,.5}},
  13.         front[]={{.5,.5,-.5},{-.5,.5,-.5},{-.5,-.5,-.5},{.5,-.5,-.5}},
  14.         left[]={{-.5,-.5,-.5},{-.5,.5,-.5},{-.5,.5,.5},{-.5,-.5,.5}},
  15.         right[]={{.5,.5,-.5},{.5,-.5,-.5},{.5,-.5,.5},{.5,.5,.5}},
  16.         top[]={{.5,.5,.5},{-.5,.5,.5},{-.5,.5,-.5},{.5,.5,-.5}},
  17.         bottom[]={{.5,-.5,-.5},{-.5,-.5,-.5},{-.5,-.5,.5},{.5,-.5,.5}};
  18.     PSsetgray(0.0);
  19.     PSsetlinewidth(3.0);
  20.     [self polygon:back howMany:4];
  21.     [self polygon:front howMany:4];
  22.     [self polygon:left howMany:4];
  23.     [self polygon:right howMany:4];
  24.     [self polygon:top howMany:4];
  25.     [self polygon:bottom howMany:4];    
  26.     return self;
  27. }
  28.  
  29. @end
  30.