home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex021.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
2KB
|
35 lines
// Example: 021 from Library Reference
#include "..\3D-Ware\dddware.h"
short Xpos=0, Ypos=0, Zpos=800;
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)
{
dddInitAll();
dddReadPcx("EXAMPLE.PCX"); // Read in a bitmap image.
dddCopyLogbase2ScreenBuffer(); // Copy the picture loaded to logbase into the
// screenbuffer.
ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D engine.
while (dddkeycode !=_ESC) // Keep going until the 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.
dddCopyScreenBuffer2Logbase(); // Copy the contents of the screen buffer to the
// logbase screen as a background image.
dddDrawObjects(); // Render all 3D objects we have inserted.
dddPrint7(2,0,0,"ESC KEY TO QUIT."); // Give some instructions to the user.
dddScreenSwap(); // Flip the real screen and the dummy screen.
}
dddRestoreAll();
return 0; // Bye.
}