ripplebumpmap.cpp

Go to the documentation of this file.
00001 
00002 #include "ripplebumpmap.h"
00003 
00004 // This actually makes the static init work.
00005 RippleBumpMap::StaticInit RippleBumpMap::m_init;
00006 
00007 Ray RippleBumpMap::perturb_normal(const Ray& normal, const Point3D& intersection_point)
00008 {
00009     Vector dir(normal.direction() );
00010 
00011     dir.x += sin(intersection_point.x * 12.0  ) / 15.0;
00012     dir.y += cos(intersection_point.y * 12.0  ) / 15.0;
00013     dir.z += cos(intersection_point.z * 12.0  ) / 15.0;
00014 
00015     return Ray(normal.origin(), dir);    
00016 }
00017 

Generated on Tue Oct 30 22:12:15 2007 for mbrt by  doxygen 1.5.2