The BeRays Ray Tracer  
by Regan Russell

Listing One
#include <Application.h>
main()
{
   const int left = 10, right = 500, top = 10, bottom = 200;
   // Create applciation, window and view.. 
   BApplication *TheApp = new BApplication( "application/x-vnd.ddj-sample" );
   BWindow *TheWindow = new BWindow(BRect( left, top, right, bottom ),  
              "Rays", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE );
   BView *TheView = new BView( BRect( 100, 100, 200, 200 ), 
              "Rays", B_FOLLOW_ALL_SIDES,  B_WILL_DRAW );    
   // Attach view to window, show the window and run the application.
   TheWindow->AddChild( TheView );
   TheWindow->Show();
   TheApp->Run();
   // Clean up.
   delete TheView;
   delete TheWindow;
   delete TheApp;
}


Listing Two
DIGIT ::= 0|1|2|3|4|5|6|7|8|9
NUMBER::= DIGIT {DIGIT}
SCENE::= OBJECT | SCENE OBJECT
OBJ::= SPHERE_OBJECT | PLANE_OBJECT | BACKGROUND_OBJECT 
BACKGROUND_OBJECT::=   BACKGROUND  NUMBER NUMBER NUMBER
SPHERE_OBJECT::=    SPHERE OPEN_BRACKET_ID  NUMBER NUMBER NUMBER RADIUS 
COLOUR_REF CLOSE_BRACKET
COLOUR_REF::=   { COLOUR_VAL }
COLOUR_VAL::=   COLOUR_ID OPEN_BRACKET_ID NUMBER_ID NUMBER_ID 
NUMBER_ID CLOSE_BRACKET_ID  
RADIUS::=   { NUMBER }  
PLANE_OBJ::=    PLANE OPEN_BRACKET NUMBER NUMBER NUMBER NUMBER 
CLOSE_BRACKET
 



1


