src/scene.cc
branchpyrit
changeset 53 228cb8bfdd54
parent 49 558fde7da82a
child 56 d4481fc43952
equal deleted inserted replaced
52:a6413a3d741d 53:228cb8bfdd54
    73 void Camera::move(const Float fw, const Float left, const Float up)
    73 void Camera::move(const Float fw, const Float left, const Float up)
    74 {
    74 {
    75 	eye = eye + fw*p + left*u + up*v;
    75 	eye = eye + fw*p + left*u + up*v;
    76 }
    76 }
    77 
    77 
    78 Ray Camera::makeRay(Sample *samp)
       
    79 {
       
    80 	Vector3 dir = p + (u*samp->x - v*samp->y)*F;
       
    81 	dir.normalize();
       
    82 	return Ray(eye, dir);
       
    83 }
       
    84 
       
    85 /* http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter3.htm */
    78 /* http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter3.htm */
    86 bool BBox::intersect(const Ray &ray, Float &a, Float &b)
    79 bool BBox::intersect(const Ray &ray, Float &a, Float &b)
    87 {
    80 {
    88 	register Float tnear = -Inf;
    81 	register Float tnear = -Inf;
    89 	register Float tfar = Inf;
    82 	register Float tfar = Inf;