fp=fopen("temp.ray","w");
assert(fp);
scene.write(fp);
for(i=0;i<width;i++){
for(j=0;j<height;j++){
ray=Ray(...);
...
if(i%20 ==0 & j%20==0){
Line(Ray(ray.p,ray(5.0)),scene.getMaterial(0)).write(0,fp);
}
...
}
}
fclose(fp);
...
Run "tracer -src
RayFiles/simple_sphere.ray -dst out.bmp".
Now you can call "viewer
-src temp.ray" and after moving around a bit you would get an image that
looks like:
You should
make sure that all of your rays are coming out of a single point and that they
are all heading towards the sphere.