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