geometry.h 650 Bytes

/* geometry.h */
#define DEG2RAD( a) (a*(float)(3.141/180.))

/*
 * Clip codes, assuming x,y,z,w is on VU 0,1,2,3
 */
#define CLIP_PLANE	6
#define CLIP_LEFT       0x1
#define CLIP_RIGHT      0x2
#define CLIP_BOTTOM     0x4
#define CLIP_TOP        0x8
#define CLIP_NEAR       0x10
#define CLIP_FAR        0x20

struct Transform {
	float sx;
	float sy;
	float sz;
	float rx;
	float ry;
	float rz;
	float tx;
	float ty;
	float tz;
	} ;

struct Matrix {
	float m[4][4];
	} ;

struct Image_space {
	float sx;
	float sy;
	float sz;
	float tx;
	float ty;
	float tz;
	};

struct Projection {
	float l;
	float r;
	float b;
	float t;
	float n;
	float f;
	};