home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextDeveloper / Examples / 3Dkit / Simple / SimpleShape.m < prev   
Encoding:
Text File  |  1993-01-10  |  693 b   |  28 lines

  1. #import "SimpleShape.h"
  2. #import <ri/ri.h>
  3.  
  4. /*
  5.  *  You may freely copy, distribute and reuse the code in this example.
  6.  *  NeXT disclaims any warranty of any kind, expressed or implied,
  7.  *  as to its fitness for any particular use.
  8.  */
  9.  
  10. static const RtFloat eightByEight[] = {8, 8, 8};
  11.  
  12. @implementation SimpleShape:N3DShape
  13. - renderSelf:(RtToken)context
  14. {
  15.   RiGeometricApproximation( RI_TESSELATION, RI_PARAMETRIC,
  16.                 eightByEight, RI_NULL );
  17.   // generate a Torus
  18.   RiTorus(0.8, 0.3, 0.0, 360.0, 360.0, RI_NULL);
  19.   
  20.   // comment out the above and uncomment the following lines to render a Teapot
  21.   // RiScale(0.4, 0.4, 0.4);
  22.   // RiGeometry("teapot", RI_NULL);
  23.   
  24.   return self;
  25. }
  26. @end
  27.   
  28.