home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / libray / libobj / blob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  2.8 KB  |  99 lines

  1. /*
  2.  * blob.h
  3.  *
  4.  * Copyright (C) 1990, 1991, Mark Polipec, 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.  * blob.h,v 4.1 1994/08/09 07:58:03 explorer Exp
  17.  *
  18.  * blob.h,v
  19.  * Revision 4.1  1994/08/09  07:58:03  explorer
  20.  * Bump version to 4.1
  21.  *
  22.  * Revision 1.1.1.1  1994/08/08  04:52:06  explorer
  23.  * Initial import.  This is a prerelease of 4.0.6enh3, or 4.1 possibly.
  24.  *
  25.  * Revision 2.1  1992/06/02  14:11:20  mcgregor
  26.  * Installed the individual metaball surface support.  A step up from the
  27.  * individual color specification support.  The structures may be further
  28.  * enhanced by allowing them to refer to an individual, or unique implemetation
  29.  * of a surface.
  30.  *
  31.  * Revision 1.1  1992/04/27  20:18:16  mcgregor
  32.  * Initial revision
  33.  *
  34.  * Revision 4.0  91/07/17  14:36:12  kolb
  35.  * Initial version.
  36.  * 
  37.  */
  38. #ifndef BLOB_H
  39. #define BLOB_H
  40.  
  41. #define GeomBlobCreate(s,t,m,n) GeomCreate((GeomRef)BlobCreate(s,t,m,n), BlobMethods())  /* s == surface; t == treshold; m == metalist; n == nr of points. */
  42.  
  43. #define R_START 1
  44. #define R_END   0
  45.  
  46. #define GOOD 1
  47. /*
  48.  * Blob
  49.  */
  50. typedef struct {
  51.   Float red, green, blue;
  52. } MColor;                /* metaball's individual color spec struct. */
  53.  
  54. typedef struct {
  55.     Float rs;    /* radius */
  56.     Float c4;    /* coeefficient */
  57.     Float c2;    /* coeefficient */
  58.     Float c0;    /* coeefficient */
  59.     Float x;    /* x position */
  60.     Float y;    /* y position */
  61.     Float z;    /* z position */
  62.     Surface *surf;   /* metaball's individual surface */
  63.     /*MColor mcolor;*/  /* Color of the metaball, if provided. */
  64. } MetaVector;   /* Details of the metaball */
  65.  
  66. typedef struct {
  67.     int type,pnt;
  68.     Float bound;
  69.     Float c[5];
  70. } MetaInt;
  71.  
  72. typedef struct {
  73.   Surface *surf;        /* Pointer to surface of the blob */
  74.   int instance;         /* instance count of the blob; an index value */
  75.   Float T;        /* Threshold   */
  76.   int num;        /* number of points */
  77.   int MColor_Flag;      /* TRUE ==> blob has multiple colors active */
  78.   MetaVector *list;    /* list of points */
  79.   MetaInt *ilist, **iarr;
  80. } Blob;
  81.  
  82. typedef struct MetaList {
  83.     MetaVector mvec;
  84.     struct MetaList *next;
  85. } MetaList;
  86.  
  87. /* Declarations of external references for Blob ops. */
  88. /*      External function ref.s */
  89. extern int    BlobIntersect(), BlobNormal();
  90. extern void    BlobBounds(), BlobStats();
  91. extern Blob    *BlobCreate();
  92. extern char    *BlobName();
  93. extern Methods    *BlobMethods();
  94.  
  95. /*      External or Global storage. */
  96. extern Surface init_surf;    /* initial surface parameters: input file */
  97.  
  98. #endif /* BLOB_H */
  99.