home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c129 / 1.ddi / HOUSE3D.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-09-20  |  2.0 KB  |  87 lines

  1. # include <stdio.h>
  2. # include <graph.h>
  3. # include "asyncxx.h"
  4. # include "hpplot.h"
  5. # include "worlddr.h"
  6. # include "plot3d.h"
  7.  
  8.  
  9.  
  10. void DrawHouse()
  11. {
  12.  
  13.    Move3Abs(1.0,1.0,1.0);
  14.    Line3Abs(1.0,1.0,-1.0);
  15.    Line3Abs(1.0,-1.0,-1.0);
  16. /*right side*/
  17.    Line3Abs(1.0,-1.0,1.0);
  18.    Line3Abs(1.0,1.0,1.0);
  19.    Move3Abs(-1.0,1.0,1.0);
  20.    Line3Abs(-1.0,1.0,-1.0);
  21.    Line3Abs(-1.0,-1.0,-1.0);
  22. /*left side*/
  23.    Line3Abs(-1.0,-1.0,1.0);
  24.    Line3Abs(-1.0,1.0,1.0);
  25.    Move3Abs(1.0,1.0,1.0);
  26. /*front top*/
  27.    Line3Abs(-1.0,1.0,1.0);
  28.    Move3Abs(1.0,-1.0,1.0);
  29.    Line3Abs(-1.0,-1.0,1.0);
  30. /*front bottom*/
  31.    Move3Abs(1.0,1.0,-1.0);
  32. /*back top*/
  33.    Line3Abs(-1.0,1.0,-1.0);
  34.    Move3Abs(1.0,-1.0,-1.0);
  35. /*back bottom*/
  36.    Line3Abs(-1.0,-1.0,-1.0);
  37.    Move3Abs(1.0,1.0,1.0);
  38.    Line3Abs(0.0,1.5,1.0);
  39. /*roof*/
  40.    Line3Abs(-1.0,1.0,1.0);
  41.    Move3Abs(1.0,1.0,-1.0);
  42.    Line3Abs(0.0,1.5,-1.0);
  43.    Line3Abs(-1.0,1.0,-1.0);
  44.    Move3Abs(0.0,1.5,1.0);
  45.    Line3Abs(0.0,1.5,-1.0);
  46.  
  47. }
  48.  
  49.  
  50. void main()
  51. {
  52.  
  53. int i;
  54.  
  55.    tInit3();
  56.  /****************************************************
  57.     - IF YOU WANT TO CONFIGURE FOR CGA 4 COLORS    
  58.       CHOOSE Init3D(1);                            
  59.     - HERCULES SUPPORT IS NOW INCLUDED IN MICROSOFT
  60.       C VERSION 5.1.  IF YOU WANT TO USE THE         
  61.       HERCULES DRIVER YOU MUST FIRST INSTALL       
  62.       MSHERC.COM FROM DOS BY TYPING  
  63.                   msherc<enter>
  64.       THEN IN YOUR MAIN PROGRAM CALL
  65.                   Init3D(12);
  66.     - REFER TO THE README.DOC FILE - PART 3
  67.       INCLUDED IN YOUR MICROSOFT C 5.1 COMPILER 
  68.       FOR DETAILS ON ADDED HERCULES SUPPORT.
  69.  **************************************************/
  70.  
  71.    Init3D(6);
  72.    SetWorldCoordinates( -10.0,-10.0,10.0,10.0);
  73.    SelectColor(3);
  74.    WorldScale3(1.0,1.0,2.0);
  75.    WorldRotate3(10.0,0);
  76.    WorldRotate3(10.0,1);
  77.    Persp(15.0);
  78.    for ( i=0; i<=10; ++i){
  79.      WorldScale3(1.2,1.2,1.4);
  80.       SelectColor(i+1);
  81.       DrawHouse();
  82.       SelectColor(0);
  83.       DrawHouse();
  84.   }
  85.   Close3DGraphics();
  86. }
  87.