home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
- /* Tom Davis -- 1992 */
-
- /* curve types */
-
- #define CURVE_BEZIER 1
- #define CURVE_CARDINAL 2
- #define CURVE_BSPLINE 3
- #define CURVE_PWLINEAR 4
- #define CURVE_CUBIC 5
- #define CURVE_ANALYTIC 6
-
- #define ADD_QUAD 1
- #define ADD_TRI 2
-
- typedef struct Crv {
- long type;
- long *data;
- struct cbl *fctns;
- long *cache;
- } curve_t;
-
- typedef struct cbl {
- void (*point)(struct Crv *, float, float [3]);
- void (*tangent)(struct Crv *, float, float [3]);
- void (*accel)(struct Crv *, float, float [3]);
- void (*cleanup)(struct Crv *);
- } cblock_t;
-
- typedef struct { /* piecewise linear curve */
- long n;
- float *verts; /* x0, y0, z0, x1, y1, z1, ... */
- } pwlin_t;
-
- void error(char *);
- void diff3(float [3], float [3], float [3]);
- void add3(float [3], float [3], float [3]);
- void scalarmult(float, float [3], float [3]);
- float dot3(float [3], float [3]);
- float length3(float [3]);
- float dist3(float [3], float [3]);
- void copy3(float [3], float [3]);
- void crossprod(float [3], float [3], float [3]);
- void normalize(float [3]);
- void print3(float [3]);
- void printmat3(float [3][3]);
- void identifymat3(float [3][3]);
- void copymat3(float *, float *);
- void xformvec3(float [3], float [3][3], float [3]);
- float curvelength(curve_t *);
- static float curvestep(curve_t *, long, long, float, float [3]);
- pwlin_t *newpwlin();
- pwlin_t *makepwlin(long, float *);
- pwlin_t *appendpwlins(pwlin_t *, pwlin_t *);
- void freepwlin(pwlin_t *);
-
- static void pentagon(long, long, long, long, long);
- void quadsphere(long, long, void (*)());
- void doughnut(float, float, long, long, void (*)());
- void elbow(float *, float *, float *,
- float, long, long, void (*)());
- void cylinder(float *, float *,
- float, long, void (*)());
- void trisphere(float [3], float, long, void (*)());
- void icosahedron(float [3], float, void (*)());
- void octahedron(float [3], float, void (*)());
- void tetrahedron(float [3], float, void (*)());
- void dodecahedron(float [3], float, void (*)());
-
- void makepwlworm(curve_t *, pwlin_t *, long, void (*)());
- curve_t *newanalyticcurve(float (*)(float), float (*)(float), float (*)(float),
- float (*)(float), float (*)(float), float (*)(float),
- float (*)(float), float (*)(float), float (*)(float));
- curve_t *newcubiccurve(float [3], float [3], float [3], float [3]);
- curve_t *newbeziercurve(float [3], float [3], float [3], float [3]);
- curve_t *newbsplinecurve(float [3], float [3], float [3], float [3]);
- curve_t *newcardinalcurve(float [3], float [3], float [3], float [3]);
-
- pwlin_t *pwlinfromcurve(curve_t *, long);
- void makesmoothpwlworm(curve_t *, pwlin_t *, long, void (*)());
- void makepwlworm(curve_t *, pwlin_t *, long, void (*)());
- void makeworm(curve_t *, float, long, long, void (*)());
-
- void smoothsave(long, float [3], float [3],
- float [3], float [3], float [3],
- float [3], float [3], float [3]);
- void solidofrevolution(pwlin_t *, long, void (*)());
- void smoothsolidofrevolution(pwlin_t *, long, void (*)());
- void doverts();
- void doquads();
-
- void drawbox(float, float, float, float,
- float, float, void (*)());
- void m_resetmatrixstack();
- void m_xformpt(float [3], float [3], float [3], float [3]);
- void m_xformptonly(float [3], float [3]);
- void m_pushmatrix();
- void m_popmatrix();
- void m_shear(float, float, float);
- void m_translate(float, float, float);
- void m_scale(float, float, float);
- void m_rotate(float, char);
-
- void analyticsurface(float (*)(float, float), float (*)(float, float),
- float (*)(float, float),
- float (*)(float, float), float (*)(float, float),
- float (*)(float, float),
- float (*)(float, float), float (*)(float, float),
- float (*)(float, float),
- long, float, float,
- long, float, float,
- long,
- void (*)());
-
-
-