projects
/
MicroTrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
solution for 3.1a)
[MicroTrace.git]
/
PointLight.cxx
diff --git
a/PointLight.cxx
b/PointLight.cxx
index
1ce5f0b
..
7b8c8d2
100644
(file)
--- a/
PointLight.cxx
+++ b/
PointLight.cxx
@@
-21,7
+21,12
@@
PointLight::PointLight()
bool
PointLight::Illuminate(Ray& ray, Vec3f& intensity)
{
bool
PointLight::Illuminate(Ray& ray, Vec3f& intensity)
{
+ float dist = ((ray.origin() + ray.direction() * ray.t()) - m_pos).norm();
+ float c1 = 1, c2 = 0.5, c3 = 0;
+ float in = 1 / (c1 + c2*dist + c3*dist*dist);
+
+ intensity = Vec3f(in, in, in);
return false;
}
return false;
}
This page took
0.023405 seconds
and
4
git commands to generate.