home *** CD-ROM | disk | FTP | other *** search
- // Example: 036 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;
- char palette[768*3]; // A buffer for the new palette.
-
- void rotate_shape(void); // Prototype definition.
-
- short main(void)
- {
- dddInitAll();
- ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
- dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D engine.
- rotate_shape(); // Rotate a shape in the first palette.
- dddkeycode = 0;
- dddOpenReadClose("EXAMPLE1.COL",palette);
- dddFadeTo(palette); // Fade from the old palette to the new palette.
- rotate_shape(); // Rotate a shape in the new palette.
- dddRestoreAll();
- return 0; // Bye.
- }
- void rotate_shape(void)
- {
- while (!dddkeycode)
- {
- dddClearObjects(); // Clear the viewing table.
- dddHoriFade(VXangle, VZangle);
- dddPrint6(15,40,2,"PRESS ANY KEY.");
- Yangle += 0x100; // 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.
- dddScreenSwap(); // Flip the real screen and the dummy screen.
- }
- }
-