home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex139.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
2KB
|
49 lines
// Example: 139 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=-0x900, VYangle=0, VZangle=0;
short ShapeHandle;
char Semaphores;
char ha[128];
struct LookAtStructure16 mystruct;
void main(void)
{
dddInitAll();
ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D world.
dddSetDotGrid(159,99,160,100); // Set up the dot grid parameters.
while (!dddkeycode)
{
dddCls(); // Clear the graphics screen.
dddSetLogbase2ScreenBuffer();
dddPrint6(1,0,0,"PRESS ANY KEY TO EXIT");
dddClearObjects(); // Clear the viewing table.
VYangle += 0x80; // Rotate the shape in the Y plane.
mystruct.Xpos = Xpos;
mystruct.Ypos = Ypos;
mystruct.Zpos = Zpos;
mystruct.Xangle = VXangle;
mystruct.Yangle = VYangle;
mystruct.Zangle = VZangle;
mystruct.Distance = 1000;
dddQLookAt16(&mystruct);
dddDotGrid();
dddInsertObject16(DRW_MOBILE,ShapeHandle,Semaphores,Xpos,Ypos,Zpos,0,0,0);
// Insert an object to be rendered.
dddDrawObjects(); // Render all 3D objects we have inserted.
dddCopyLogbase2ScreenBuffer();
dddScreenSwap(); // Flip the real screen and the dummy screen.
}
dddRestoreAll(); // Bye.
}