home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (c) 1991, 1992 by NeXT Computer, Inc as an unpublished work.
- * All rights reserved.
- *
- */
-
- #ifndef _next3dh_
- #define _next3dh_
-
- #import <ri/ri.h>
- #import <objc/hashtable.h>
-
- typedef enum {
- N3D_Perspective,
- N3D_Orthographic
- } N3DProjectionType;
-
- typedef enum {
- N3D_AmbientLight,
- N3D_PointLight,
- N3D_DistantLight,
- N3D_SpotLight
- } N3DLightType;
-
- typedef enum {
- N3D_AllAxes,
- N3D_XAxis,
- N3D_YAxis,
- N3D_ZAxis,
- N3D_XYAxes,
- N3D_XZAxes,
- N3D_YZAxes
- } N3DAxis;
-
- typedef enum {
- N3D_HiddenRendering = 0,
- N3D_InOrderRendering,
- N3D_NoRendering
- } N3DHider;
-
- typedef enum {
- N3D_PointCloud = 0,
- N3D_WireFrame,
- N3D_ShadedWireFrame,
- N3D_FacetedSolids,
- N3D_SmoothSolids
- } N3DSurfaceType;
-
- /*
- * Macros for quick structure copies. Turns into small code when
- * compiled with -O.
- */
-
- #define N3D_CopyMatrix( s_, d_ ) do { \
- struct _cms { RtMatrix _m; }; \
- *((struct _cms *)(d_)) = *((struct _cms *)(s_)); \
- } while (0)
- #define N3D_CopyPoint( s_, d_ ) do { \
- struct _cps { RtPoint _p; }; \
- *((struct _cps *)(d_)) = *((struct _cps *)(s_)); \
- } while (0)
- #define N3D_CopyBound( s_, d_ ) do { \
- struct _cps { RtBound _b; }; \
- *((struct _cps *)(d_)) = *((struct _cps *)(s_)); \
- } while (0)
- #define N3D_ConvertBoundToPoints( b_, p_ ) do { \
- (p_)[0][0] = (b_)[0]; \
- (p_)[0][1] = (b_)[2]; \
- (p_)[0][2] = (b_)[4]; \
- (p_)[1][0] = (b_)[1]; \
- (p_)[1][1] = (b_)[3]; \
- (p_)[1][2] = (b_)[5]; \
- } while (0)
- #define N3D_ConvertPointsToBound( p_, b_ ) do { \
- (b_)[0] = (p_)[0][0]; \
- (b_)[1] = (p_)[1][0]; \
- (b_)[2] = (p_)[0][1]; \
- (b_)[3] = (p_)[1][1]; \
- (b_)[4] = (p_)[0][2]; \
- (b_)[5] = (p_)[1][2]; \
- } while (0)
- /*
- * Single-value macros for accessing point coords.
- */
- #define N3D_XComp( _p ) ((_p)[0])
- #define N3D_YComp( _p ) ((_p)[1])
- #define N3D_ZComp( _p ) ((_p)[2])
- #define N3D_WComp( _p ) ((_p)[3])
-
- void N3DMult3DPoint( RtPoint p, RtMatrix m, RtPoint result );
- void N3DMult3DPoints( RtPoint *p, int count, RtMatrix m, RtPoint *result );
- void N3DIntersectLinePlane( RtPoint *L, RtPoint pnorm, RtPoint ppoint,
- RtPoint *psect );
- void N3DMultiplyMatrix( RtMatrix a, RtMatrix b, RtMatrix result );
- float N3DInvertMatrix( RtMatrix m, RtMatrix inverse_m );
-
- /* Various and sundry useful globals */
- extern NXAtom N3DRIBPboardType;
- extern const RtPoint N3DOrigin;
- extern const RtMatrix N3DIdentityMatrix;
-
-
- #endif _next3dh_
-