This is perspect.h in view mode; [Download] [Up]
/* perspect.h - matrix algebra definitions * Copyright (C) 1993 Corona Design, Inc. All rights reserved. * * Abstract * Common 3D perspective transformations. Provides an arbitrary * view plane with a center of perspective 1 unit (in VIEW space) * from the view plane. * * Reference: Foley & van Dam, Computer Graphics * C callable. * * RCS path: * $Source: /Users/pkron/Projects/voxel/Pyramid/matrix.subproj/RCS/perspect.h,v $ * Modified: $Date: 93/09/15 12:34:04 $ by $Author: pkron $ * Current State: $State: Exp $ locked by $Locker: $ */ #ifndef _PERSPECT_H #define _PERSPECT_H #include "standard.h" typedef struct _matrix *MATRIX; typedef float POINT[4]; // allocate an identity matrix EXTERN_C MATRIX allocIdentity(); // free an allocated matrix EXTERN_C void freeMatrix( MATRIX matrix); // map a point in a given transform EXTERN_C void map( MATRIX matrix, POINT *aPoint); // orient the view space // normal and up define vectors in world space // from (0,0,0) to the specified point // normal defines the z-axis of the view space // (normal to the view plane) // up defines a vector which will project onto // the positive y-axis of the view plane EXTERN_C void orient( MATRIX matrix, POINT *normal, POINT *up); // project a mapped point onto the view // plane EXTERN_C void project( POINT *aPoint); // concatenate transform with projection // into viewplane EXTERN_C void scaleProjection( MATRIX transform, int width, int height ); // translate the origin to a point in VIEW space EXTERN_C void translate( MATRIX matrix, POINT *to); // set the distance from the Center Of Perspective // to the VIEW space origin. EXTERN_C void viewDistance( MATRIX matrix, float distance); #endif // PERSPECT_H #ifdef _LOG /* * $Log: perspect.h,v $ * Revision 1.1 93/09/15 12:34:04 pkron * Created * */ #endif
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.