RandomSampleGenerator.h

Go to the documentation of this file.
00001 
00007 #ifndef RANDOMSAMPLEGENERATOR_H
00008 #define RANDOMSAMPLEGENERATOR_H RANDOMSAMPLEGENERATOR_H
00009 
00010 #include "SampleGenerator.h"
00011 
00016 class RandomSampleGenerator : public SampleGenerator 
00017 {
00018 public:
00019 
00028     void GetSamples(int n, float* u, float* v, float* weight) const
00029     {
00030         for (int i=0 ; i < n; i++)
00031         {
00032             u[i] = frand();
00033             v[i] = frand();
00034             weight[i] = 1.0 / float(n);
00035         }
00036     }
00037 
00038 };
00039 
00040 #endif

Generated on Thu Jan 31 21:48:49 2008 for RayTracer by  doxygen 1.5.4