Question
Are we supposed to implement a program which uses rayPolygon intersection?
Answer
The code I have put up is for reference. You can use any part of the code you find useful.
You only need to implement ray-polygon intersection for your raytracer, not as a separate program.
Question
Is there an input to the program or is it showing graphic objects of my choice ?
Answer
As I said in the class, you can chose which way you will set up the scene:
(a) Hardcode the objects of your choice
(b) Provide an interface that can read a simple text file with the scene
description.
Option (b) requires more work so I suggest you use option (a). If you use (a) then you can create a function:
void setUpScene()
{
// create a sphere radius 10.0
MySphere *s1 = new MySPhere(10.0) ;
// position the sphere somewhere
s1->translate(3,4,2) ;
AllObj->Add(s1) ; // add the object in the object databaseMySphere *s2 = new MySphere(3.0) ;
s2->translate(1,2,1) ;
AllObj->Add(s2) ;// create a cube 1x1x1 ;
MyCube *c1 = new MyCube ;
// make it 2x2x2 ;
c1->Scale(2,1,3) ;
c1->Rotate(0,45) ;
AllObj->Add(c1) ;
......
}that sets up the scene. This is an example, it is not complete and you do not have to follow it exactly.