This is Cube.m in view mode; [Download] [Up]
/* Cube.m */ #import "Cube.h" #import <stdio.h> #import "Linear3D.h" #import <dpsclient/wraps.h> @implementation Cube - render { vector3D back[] = {{.5,.5,.5},{.5,-.5,.5},{-.5,-.5,.5},{-.5,.5,.5}}, front[]={{.5,.5,-.5},{-.5,.5,-.5},{-.5,-.5,-.5},{.5,-.5,-.5}}, left[]={{-.5,-.5,-.5},{-.5,.5,-.5},{-.5,.5,.5},{-.5,-.5,.5}}, right[]={{.5,.5,-.5},{.5,-.5,-.5},{.5,-.5,.5},{.5,.5,.5}}, top[]={{.5,.5,.5},{-.5,.5,.5},{-.5,.5,-.5},{.5,.5,-.5}}, bottom[]={{.5,-.5,-.5},{-.5,-.5,-.5},{-.5,-.5,.5},{.5,-.5,.5}}; PSsetgray(0.0); PSsetlinewidth(3.0); [self polygon:back howMany:4]; [self polygon:front howMany:4]; [self polygon:left howMany:4]; [self polygon:right howMany:4]; [self polygon:top howMany:4]; [self polygon:bottom howMany:4]; return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.