home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff384.lzh / NorthC / Example1.LZH / cRender / 3d.h < prev    next >
C/C++ Source or Header  |  1990-08-30  |  1KB  |  58 lines

  1. /*
  2.   (c) 1990 S.Hawtin.
  3.   Permission is granted to copy this file provided
  4.    1) It is not used for commercial gain
  5.    2) This notice is included in all copies
  6.    3) Altered copies are marked as such
  7.  
  8.   No liability is accepted for the contents of the file.
  9.  
  10.     3D.h    within        NorthC render
  11. */
  12.  
  13. /*
  14.  Define the size of the screen, for PAL height is 256 otherwise height is
  15. 199
  16. */
  17. /* Uncomment next line for full PAL screen */
  18. /* #define PAL */
  19.  
  20. #define SC_WIDTH  320
  21.  
  22. #ifdef PAL
  23. #define SC_HEIGHT 255
  24. #else
  25. #define SC_HEIGHT 199
  26. #endif
  27.  
  28. #define SC_TOP    10
  29.  
  30. /* Define the data structures for the simple renderer */
  31.  
  32. typedef struct
  33.    {int x,y,z;
  34.     } Vector;
  35.  
  36. typedef struct
  37.    {
  38.     Vector logical;    /* Logical position */
  39.     Vector screen;    /* Screen position */
  40.     int    is_done;    /* True if calculation has been done */
  41.     } Vertex;
  42.  
  43. typedef struct
  44.    {
  45.     Vertex *v1;        /* Corners of the triangle */
  46.     Vertex *v2;
  47.     Vertex *v3;
  48.     Vertex centre;
  49.     Vector normal;
  50.     int    shade;       /* Value between 0..255 for shade */
  51.     } Triangle;
  52.  
  53. /* Set TEST_LIGHTS to make lights move and object stay still */
  54. /* #define TEST_LIGHTS 1 */
  55.  
  56. /* Scale factor for reducing large pictures */
  57. #define SCALE 1
  58.