home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex136.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
2KB
|
64 lines
// Example: 136 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 clipx=160, clipy=100;
short main(void)
{
dddInitAll();
dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D world.
while (dddkeycode!=_ESC)
{
dddCls();
if (dddkeypressed[ _DN_ARROW ])
{
if (clipy<100)
{
clipy++;
}
}
if (dddkeypressed[ _UP_ARROW ])
{
if (clipy>2)
{
clipy--;
}
}
if (dddkeypressed[ _RT_ARROW ])
{
if (clipx<160)
{
clipx++;
}
}
if (dddkeypressed[ _LF_ARROW ])
{
if (clipx>2)
{
clipx--;
}
}
dddSetClipArea(160-clipx,159+clipx,100-clipy,99+clipy);
// Set up clipping boundaries.
dddSetDotGrid(159,99,clipx,clipy); // Set up the dot grid parameters.
dddHoriFade(VXangle,VZangle); // Clear the graphics screen.
dddPrint6(1,0,0,"PRESS ESCAPE KEY TO EXIT");
VYangle += 0x80; // Rotate the shape in the Y plane.
VYangle = VYangle & 0xFFC0;
// Set up the viewers position in 3D space.
dddLookAt16(Xpos, Ypos, Zpos, VXangle, VYangle, Zangle, 1000);
dddSetViewAngles(VXangle,VYangle,VZangle); // Set the viewers angles in the 3D world.
dddDotGrid();
dddScreenSwap(); // Flip the real screen and the dummy screen.
}
dddRestoreAll();
return 0; // Bye.
}