Category : Files from Magazines
Archive   : DDJ9407C.ZIP
Filename : RAY2.CPP

 
Output of file : RAY2.CPP contained in archive : DDJ9407C.ZIP
/***********************************************************************/
/*** (C) Copyright A.MANGEN 1994 ***/
/***********************************************************************/
/*** PROJECT : RAY TRACING PROGRAM ***/
/*** PROGRAM NAME: RAY2.CPP ***/
/*** VERSION : 1.1 ***/
/***-----------------------------------------------------------------***/
/*** DESCRIPTION : Ray Tracing Main Program ***/
/*** Generate a full animation in TARGA files on disk ***/
/***********************************************************************/

#include
#include "raysvga.h"
#include "rayobj.h"

#define RD 0.9 // Diffuse reflection factor
#define RS 0.9 // Specular reflection factor
#define RR 0.9 // Reflection factor
#define MAXREF 1 // Maximum number of reflections

extern unsigned _stklen = 16384U;

void main()
{ int i,j;

Color Ambient(40,40,40);

Scene MyScene(320,-150,240,Ambient);

Color CWhite(200,200,200);
Color CGreen(0,200,0);
Color CRed(200,0,0);
Color CBlue(0,0,200);

Vector MyLight(700,-400,800,-0.5,-1,0);
MyScene.AddLight(!MyLight,CWhite);

for(i=2400,j=0;j<26;j++,i-=100)
{ char FileName[20];
sprintf(FileName,"C:\\RAY%03d.TGA",j);
Sphere S0(-1900,2700,240,1300,CRed,RD,RS,RR,MAXREF);
Sphere S1(2400,2700,240,1300,CBlue,RD,RS,RR,MAXREF);
Sphere S2(320,500+i,300,300,CGreen,RD,RS,RR,MAXREF);
Plane P0(0,0,1,1500,CGreen,RD,RS,RR,MAXREF);

MyScene.RayTrace(VESA_640x480x256,640,480,1,FileName);
}
}


  3 Responses to “Category : Files from Magazines
Archive   : DDJ9407C.ZIP
Filename : RAY2.CPP

  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/