home *** CD-ROM | disk | FTP | other *** search
- // Example: 008 from Library Reference
- #include "..\3D-Ware\dddware.h"
- short Xpos=0, Ypos=0, Zpos=400;
- short Xangle=0, Yangle=0, Zangle=0;
- short VXpos=0, VYpos=0, VZpos=0;
- short VXangle=0, VYangle=0, VZangle=0;
- short ShapeHandle;
- char Semaphores;
- void main(void)
- {
- dddInitAll(); // Initialise all the 3D code.
- ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
- dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D engine.
- while (dddkeycode !=_ESC) // Run until ESC key is pressed.
- {
- dddCls(); // Clear the graphics screen.
- dddClearObjects(); // Clear the viewing table.
- Yangle += 0x200; // Rotate the shape in the Y plane.
- Zangle += 0x200; // Rotate the shape in the Z plane.
- dddSetViewAngles(VXangle,VYangle,VZangle); // Set the viewers angles.
- dddInsertObject16(DRW_MOBILE,ShapeHandle,Semaphores,Xpos,Ypos,Zpos,Xangle,Yangle,Zangle);
- // Insert an object to be rendered.
- dddDrawObjects(); // Render all 3D objects we have inserted.
- dddCopyLogbase2ScreenBuffer(); // Copy the screen we have just rendered to the
- // Screenbuffer.
- if (dddkeypressed[_SPACE]) // If the spacebar is pressed clear the screen buffer.
- {
- dddClearScreenBuffer(); // Clear the screen buffer.
- }
- dddCopyScreenBuffer2Logbase(); // Copy whatever is on the screen buffer to the
- // workscreen.
- dddPrint7(2,0,2,"SPACE TO CLEAR SCREEN BUFFER."); // Print some instructions for the user.
- dddPrint7(2,0,9,"ESC KEY TO QUIT.");
- dddScreenSwap(); // Flip the real screen and the dummy screen.
- }
- dddRestoreAll(); // Clean up behind ourselves.
- }
-