home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / raytrace / rayshade / etc / rsconver / transfor.h < prev    next >
C/C++ Source or Header  |  1991-07-18  |  2KB  |  69 lines

  1. /*
  2.  * transform.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * $Id: transform.h,v 4.0 91/07/17 14:32:33 kolb Exp Locker: kolb $
  17.  *
  18.  * $Log:    transform.h,v $
  19.  * Revision 4.0  91/07/17  14:32:33  kolb
  20.  * Initial version.
  21.  * 
  22.  */
  23. #ifndef TRANSFORM_H
  24. #define TRANSFORM_H
  25.  
  26. typedef voidstar TransRef;
  27. typedef TransRef TransCreateFunc();
  28.  
  29. /*
  30.  * Transformation 'matrix'.
  31.  */
  32. typedef struct RSMatrix {
  33.     Float matrix[3][3];        /* Rotation matrix */
  34.     Vector translate;        /* Translation */
  35. } RSMatrix;
  36.  
  37. typedef struct {
  38.     TransRef    (*create)();        /* Create it... */
  39.     void        (*propagate)();        /* Propagate changes to parameters */
  40. } TransMethods;
  41.  
  42. /* 
  43.  * Transformation structure
  44.  */
  45. typedef struct Trans {
  46.     TransRef tr;            /* transform data */
  47.     TransMethods *methods;        /* transform methods */
  48.     ExprAssoc *assoc;        /* animated parameters */
  49.     short    animated;        /* is the transformation animated? */
  50.     RSMatrix trans,        /* object space --> world space */
  51.          itrans;    /* worldspace --> object space */
  52.     struct Trans *next, *prev;
  53. } Trans;
  54.  
  55. extern void    MatrixMult(), MatrixCopy(), MatrixInit(), MatrixInvert(),
  56.         TransCopy(), TransInit(), TransInvert(),
  57.         TransCompose(),
  58.         VecTransform(), PointTransform(), NormalTransform();
  59.  
  60. extern Trans    *TransCreate();
  61.  
  62. extern RSMatrix    *MatrixCreate();
  63.  
  64. void        RotationMatrix(), TranslationMatrix(),
  65.         ScaleMatrix(), ArbitraryMatrix(), CoordSysTransform();
  66. extern Float    RayTransform();
  67.  
  68. #endif /* TRANSFORM_H */
  69.