home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex081.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
2KB
|
34 lines
// Example: 081 from Library Reference
#include "..\3D-Ware\dddware.h"
long Xpos=0, Ypos=0, Zpos=400;
short Xangle=0, Yangle=0, Zangle=0;
long VXpos=0, VYpos=0, VZpos=0;
short VXangle=-0x900, VYangle=0, VZangle=0;
short ShapeHandle;
char Semaphores;
short main(void)
{
dddInitAll();
ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
dddSetViewPos(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.
dddPrint6(1,0,0,"PRESS ANY KEY TO EXIT");
dddClearObjects(); // Clear the viewing table.
VYangle += 0x80; // Rotate the shape in the Y plane.
VYangle = VYangle & 0xFFC0;
// Set up the viewers position in 3D space.
dddLookAt(Xpos, Ypos, Zpos, VXangle, VYangle, Zangle, 1000);
dddSetViewAngles(VXangle,VYangle,VZangle); // Set the viewers angles in the 3D world.
dddDotGrid();
dddInsertObject(DRW_MOBILE,ShapeHandle,Semaphores,Xpos,Ypos,Zpos,0,0,0);
// 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.
}