ftp.nice.ch/pub/next/tools/screen/backspace/CreepyFace.NIHS.bs.tar.gz#/CreepyFaceView.BackModule/CFWireFrame.h

This is CFWireFrame.h in view mode; [Download] [Up]

#import <appkit/appkit.h>

#define WIREFRAME_COORDLIMIT 1024


// this code is copyright Darcy Brockbank, 1993
//
// You may freely reuse and distribute this code in any way shape or
// form, provided that this notice stays intact.
//
// darcy@hasc.ca, samurai@cs.mcgill.ca
//
// StefView was implemented out of WorldSpaceView and retains some of the
// movement properties...
//
// The code for WorldSpaceView was written by Sam Streeper at CreepyFace, I think,
// and there were two other contributors, but I can't find their names in the
// source for it.
//
// CreepyFaceView shows a simple (ha!) spinning CreepyFace logo, in full 3D. The 3D code
// came from an app I wrote a long time ago called "CFWireFrame", and so the code
// is pretty scary. As well, this thing is only a quick hack, though a nice one.
//
// This thing has room for improvement, and if you do so, send me a copy!
//
// - darcy

typedef enum {
	x=0,y=1,z=2 
} Axis;

typedef enum {
	negative=0,positive=1,nomove=2
} Direction;

typedef struct _Origin {
	float x,y,z;
} Origin;
 
@interface CFWireFrame:Object
{
	int numberOfCoords;
	int numberOfTags;
	int coordsInATag;
	int numberOfMyPS;
	int numberOfTagPS;
	float myCoords[1024];
	float myTags[1024];
	char myPSCommands[1024];
	char myTagPSCommands[1024];
 	float output[WIREFRAME_COORDLIMIT];
	 float bbox[4];
	 int dimension;
	
	struct _Origin myCentre;
	struct anRGBColour {
		float red,blue,green;
	} myTagColour,myFrameColour;
	float myLineWidth;
	double psint;
	double nsint;
	double cost;
	id myTable;
}

- addPoint:(float)x :(float)y :(float)z;
- addMyPS:(char)command;
- free; 
- (int) getNumberOfMyPS;
- (int)getNumberOfPoints;
- init;
- makeCFWireFrame:(const char *)thisFrame;
- readBinaryCodeFrom: (char *) thisFile;
- moveTo:(float )x:(float)y:(float)z;
- getTagColour:(float *) r :(float *)g :(float *)b;
- getFrameColour:(float *)r :(float *)g :(float *)b;
- getCentre:(float*) x:(float *)y :(float *)z;
- setCentre:(float) x :(float)y :(float)z;
- setFrameColour:(float) r :(float)g :(float)b;
- setTagColour:(float) r :(float)g :(float)b;
- setNumberOfTags:(int)count;
- setCoordsInATag:(int)count;
- setNumberOfTagPS:(int)count;
- setNumberOfCoords:(int) count;
- setNumberOfMyPS:(int) count;
- setBoundingBox:(float *)thisBox;
- rotate: (Direction) direction aroundAxis:(Axis) thisAxis atOrigin:(Origin) thisOrigin;
- translate: (Direction) direction alongAxis: (Axis) thisAxis atRate:(float)rate; 
- drawYourself:(float)zoom centeredOn:(float)X :(float)Y;

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.