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

  1.                                                // Example: 022 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.   dddReadPcx("EXAMPLE.PCX");                   // Read in a bitmap image.
  13.   dddCopyLogbase2ScreenBuffer2();              // Copy the picture loaded to logbase into the
  14.                                                //  screenbuffer.
  15.   ShapeHandle = (dddShapeLoad("EXAMPLE.3D"));  // Load the .3D data file.
  16.   dddSetViewPos16(VXpos,VYpos,VZpos);          // Set the viewers angles in the 3D engine.
  17.   while  (dddkeycode !=_ESC)                   // Keep going until the ESC key is pressed.
  18.   {
  19.     dddCls();                                  // Clear the graphics screen.
  20.     dddClearObjects();                         // Clear the viewing table.
  21.     Yangle += 0x200;                           // Rotate the shape in the Y plane.
  22.     Zangle += 0x200;                           // Rotate the shape in the Z plane.
  23.     dddSetViewAngles(VXangle,VYangle,VZangle); // Set the viewers angles.
  24.     dddInsertObject16(DRW_MOBILE,ShapeHandle,Semaphores,Xpos,Ypos,Zpos,Xangle,Yangle,Zangle);
  25.                                                // Insert an object to be rendered.
  26.     dddCopyScreenBuffer22Logbase();            // Copy the contents of the screen buffer to the
  27.                                                // logbase screen as a background image.
  28.     dddDrawObjects();                          // Render all 3D objects we have inserted.
  29.     dddPrint7(2,0,0,"ESC KEY TO QUIT.");       // Give some instructions to the user.
  30.     dddScreenSwap();                           // Flip the real screen and the dummy screen.
  31.   }
  32.   dddRestoreAll();
  33.   return 0;                                    // Bye.
  34. }
  35.