home *** CD-ROM | disk | FTP | other *** search
- // Example: 079 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;
- short main(void)
- {
- dddLoadColors("EXAMPLE.COL"); // Load in the color palette called 'example.col'
- dddInitVideo(); // Sets up video to mode 19 VGA 320*200 256 cols.
- dddSetPal(dddstandardpal); // Set up the palette.
- dddInit3d(); // MUST be before any calls to 3D-Ware libraries
- dddInitKeybd();
- ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
- VXangle = VYangle = VZangle = 0; // Set viewers angles to 0,0,0
- VXpos = VYpos = VZpos = 0; // Set viewer to centre of 3D world scene.
- dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D world.
- dddSetViewAngles(VXangle,VYangle,VZangle); // Set the viewers position in the 3D world.
- while (!dddkeycode) // Loop until the user hits a key.
- {
- dddCls(); // Clear the graphics screen.
- dddPrint6(1,20,2,"PRESS ANY KEY TO QUIT.");
- dddClearObjects(); // Clear the viewing table.
- Yangle += 0x80; // Rotate the shape in the Y plane.
- dddInsertObject16(DRW_MOBILE,ShapeHandle,Semaphores,Xpos,Ypos,Zpos,Xangle,Yangle,Zangle);
- // Insert on object to be rendered.
- dddDrawObjects(); // Render all 3D objects we have inserted.
- dddScreenSwap(); // Flip the real screen and the dummy screen.
- }
- dddRestoreKeybd();
- dddRestoreVideo(); // Reset video mode to original.
- dddClose3d(); // Clean up behind ourselves.
- return 0; // Bye.
- }
-