home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Madness / VRMAD96_ONE.ISO / virtek / libex / libex123.c < prev    next >
C/C++ Source or Header  |  1995-08-24  |  2KB  |  37 lines

  1.                                                // Example: 123 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. short    Xpos=0, Ypos=0, Zpos=800;
  4. short    Xangle=0, Yangle=0, Zangle=0;
  5. short    VXpos=0, VYpos=0, VZpos=0;
  6. short    VXangle=0, VYangle=0, VZangle=0;
  7. short    ShapeHandle;
  8. char     Semaphores;
  9. short  main(void)
  10. {
  11.   dddInitAll();
  12.   ShapeHandle = (dddShapeLoad("EXAMPLE.3D"));  // Load the .3D data file.
  13.   dddSetViewPos16(VXpos,VYpos,VZpos);          // Set the viewers angles in the 3D engine.
  14.   dddSetClipArea(0,319,0,199);                 // Set up clipping boundaries.
  15.   while  (!dddkeycode)                         // Loop a few times.
  16.   {
  17.     dddCls();                                  // Clear the graphics screen.
  18.     dddPrint7(2,70,0,"PRESS ANY KEY TO EXIT");
  19.     Yangle += 0x200;                           // Rotate the shape in the Y plane.
  20.     Zangle += 0x200;                           // Rotate the shape in the Z plane.
  21.     dddSetViewAngles(VXangle,VYangle,VZangle); // Set the viewers angles.
  22.     dddClearObjects();                         // Clear the viewing table.
  23.     dddSameOn(4);                              // Draw all polygons in color 4.
  24.     dddInsertObject16(DRW_MOBILE,ShapeHandle,Semaphores,Xpos-300,Ypos,Zpos,Xangle,Yangle,Zangle);
  25.                                                // Insert on object to be rendered.
  26.     dddDrawObjects();                          // Render all 3D objects we have inserted.
  27.     dddClearObjects();                         // Clear the viewing table.
  28.     dddSameOff();                              // Draw polygons normally.
  29.     dddInsertObject16(DRW_MOBILE,ShapeHandle,Semaphores,Xpos+300,Ypos,Zpos,Xangle,Yangle,Zangle);
  30.                                                // Insert on object to be rendered.
  31.     dddDrawObjects();                          // Render all 3D objects we have inserted.
  32.     dddScreenSwap();                           // Flip the real screen and the dummy screen.
  33.   }
  34.   dddRestoreAll();
  35.   return 0;                                    // Bye.
  36. }
  37.