equal
deleted
inserted
replaced
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; |