Category : Printer + Display Graphics
Archive   : AVRIL11.ZIP
Filename : EXAMPLE2.C

 
Output of file : EXAMPLE2.C contained in archive : AVRIL11.ZIP
/* EXAMPLE2 -- several asteroids, sharing the same geometry */

/* Written by Bernie Roehl, April 1994 */

#include /* needed for rand() */

#include "avril.h"

void main()
{
FILE *infile;
vrl_Light *light;
vrl_Camera *camera;
vrl_Shape *asteroidshape = NULL;
int i;

vrl_SystemStartup();

vrl_WorldSetHorizon(0); /* turn off horizon */
vrl_WorldSetSkyColor(0); /* black sky */
vrl_WorldSetAmbient(float2factor(0.1)); /* low ambient light */

infile = fopen("asteroid.plg", "r");
if (infile)
{
asteroidshape = vrl_ReadPLG(infile);
fclose(infile);
}

light = vrl_LightCreate();
vrl_LightRotY(light, float2angle(45));
vrl_LightRotX(light, float2angle(45));
vrl_LightSetIntensity(light, float2factor(0.9));

camera = vrl_CameraCreate();
vrl_CameraMove(camera, 0, 100, -50);

for (i = 0; i < 10; ++i)
{
vrl_Object *obj = vrl_ObjectCreate(asteroidshape);
vrl_ObjectMove(obj, rand() % 1000, rand() % 1000, rand() % 1000);
}

vrl_SystemRun();
}



  3 Responses to “Category : Printer + Display Graphics
Archive   : AVRIL11.ZIP
Filename : EXAMPLE2.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/