home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex152.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
2KB
|
43 lines
// Example: 152 from Library Reference
#include "..\3D-Ware\dddware.h"
short VXpos=0, VYpos=-20, VZpos=0;
short Xpos=0, Ypos=0, Zpos=900;
short Xangle=0, Yangle=0, Zangle=0;
short ShapeHandle;
char Semaphores;
short main(void)
{
dddInitAll();
ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
while (dddkeycode!=_ESC)
{
if (dddkeypressed[_LF_ARROW])
{
VXpos += 0x10; // Move the viewers X position.
}
if (dddkeypressed[_RT_ARROW])
{
VXpos -= 0x10; // Move the viewers X position.
}
if (dddkeypressed[_UP_ARROW])
{
VZpos += 0x10; // Move the viewers Z position.
}
if (dddkeypressed[_DN_ARROW])
{
VZpos -= 0x10; // Rotate the viewer in the Y plane.
}
dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D engine.
dddHorizon(0,0); // Clear the graphics screen.
dddDotGrid();
dddClearObjects(); // Clear the viewing table.
dddSetViewAngles(0,0,0); // 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.
}
dddRestoreAll();
return 0; // Bye.
}