COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) GeoWorks 1992 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		threed.def

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	TS	7/16/92		Initial revision


DESCRIPTION:
	This file contains the description of the 3D graphics utility
	routines and data structures	
		
	$Id: threed.def,v 1.1 97/04/04 14:25:02 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef	__THREED

StartLibrary	threed


;-----------------------------------------------------------------------------
;		Constants & Structures
;-----------------------------------------------------------------------------

;
;  The two flags that determine whether a points will be homogonized
; by ThreeDApplyMatrix.  This allows the ApplyMatrix routine to multiply
; 3D matrixes together while still being able to multiply a list of
; points.

ThreeDMultiplyFlags	etype	word, 0, 1
TDMF_NO_HOMOGONIZE_POINTS	enum	ThreeDMultiplyFlags
TDMF_HOMOGONIZE_POINTS		enum	ThreeDMultiplyFlags


;
;  The current 3D routines use a four coordinate three space representation.
; To all those 3D afficiandos this is called "homogenous" coordinates.
;
;  Like all things dealing with graphics, see Foley and VanDam.
;
Point3D		struct
	P_X	WWFixed		; X coordinate
	P_Y	WWFixed		; Y coordinate
	P_Z	WWFixed		; Z coordinate
	P_N	WWFixed		; Homogonize value (usually 1)
Point3D		ends

;
;  As points are homogonized, the transformation matrices are 4 by 4.
;
;  Notes:  The matrix 	[11 21 31 41]  is stored in col major order:
;			[12 22 32 42]
;			[13 23 33 43]
;			[14 24 34 44]
;
;	Stored as: 11,12,13,14,21,22,23,24,31,32,33,34,41,42,43,44
;
;   This should allow multiplication of point lists very quickly.
;   This is, obviously, assuming points will be stores as row-vectors.
;  

Matrix44	struct
	M_11	WWFixed
	M_12	WWFixed
	M_13	WWFixed
	M_14	WWFixed
	M_21	WWFixed
	M_22	WWFixed
	M_23	WWFixed
	M_24	WWFixed
	M_31	WWFixed
	M_32	WWFixed
	M_33	WWFixed
	M_34	WWFixed
	M_41	WWFixed
	M_42	WWFixed
	M_43	WWFixed
	M_44	WWFixed
Matrix44	ends

global ThreeDApplyMatrix:far
global ThreeDCreateTranslationMatrix:far
global ThreeDCreateXRotationMatrix:far
global ThreeDCreateYRotationMatrix:far
global ThreeDCreateZRotationMatrix:far
global ThreeDCreateScaleMatrix:far
global ThreeDCreatePerspectiveMatrix:far
global ThreeDCreateParallelMatrix:far
global ThreeDCreateIdentityMatrix:far
global ThreeDCreateTransposeMatrix:far
global ThreeDDestroyMatrix:far
global ThreeDDraw3DPolygon:far

EndLibrary	threed






