File:  [NeXTSTEP 3.3 examples] / Examples / 3Dkit / Simple / SimpleShape.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:49:03 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

#import "SimpleShape.h"
#import <ri/ri.h>

/*
 *  You may freely copy, distribute and reuse the code in this example.
 *  NeXT disclaims any warranty of any kind, expressed or implied,
 *  as to its fitness for any particular use.
 */

static const RtFloat eightByEight[] = {8, 8, 8};

@implementation SimpleShape:N3DShape
- renderSelf:(RtToken)context
{
  RiGeometricApproximation( RI_TESSELATION, RI_PARAMETRIC,
			    eightByEight, RI_NULL );
  // generate a Torus
  RiTorus(0.8, 0.3, 0.0, 360.0, 360.0, RI_NULL);
  
  // comment out the above and uncomment the following lines to render a Teapot
  // RiScale(0.4, 0.4, 0.4);
  // RiGeometry("teapot", RI_NULL);
  
  return self;
}
@end
  

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.