home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex131.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
3KB
|
58 lines
// Example: 131 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;
void setup(void); // Declare the 'setup' function prototype.
short main(void)
{
dddInitAll();
ShapeHandle = (dddShapeLoad("EXAMPLE.3D")); // Load the .3D data file.
dddSetViewPos16(VXpos,VYpos,VZpos); // Set the viewers angles in the 3D world.
setup();
setup();
while (!dddkeycode) // Keep looping until a key is pressed.
{
// First, we will produce the left hand side window.
dddSetClipArea(50,149,50,149); // Set up clipping boundaries for left box.
dddSetCenter(100,100,149,149); // Set centre for left hand side box.
dddBox(0,50,50,149,149); // Just clear the area we need to use.
dddClearObjects(); // Clear the viewing table.
Xangle += 0x80; // Rotate the shape in the Y plane.
Yangle += 0x200; // Rotate the shape in the Y plane.
Zangle += 0x100; // 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.
dddDrawObjects(); // Render all 3D objects we have inserted.
// Now we will produce the right hand side window.
dddSetClipArea(161,199,50,149); // Set up clipping boundaries for right box.
dddSetCenter(180,100,199,149); // Set centre for right hand side box.
dddBox(0,161,50,199,149); // Just clear the area we need to use.
dddClearObjects(); // Clear the viewing table.
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.
}
void setup(void)
{
// dddPrint7(2,18,40,"PRESS ANY KEY TO EXIT.");
// Draw the left box boundaries first.
dddLineBox(234,49,49,150,150);
// Draw the right box boundaries last.
dddLineBox(234,160,49,200,150);
dddScreenSwap(); // Flip the real screen and the dummy screen.
}