00001 #ifndef RANDOMSAMPLEGENERATOR_H 00002 #define RANDOMSAMPLEGENERATOR_H 00003 00004 #include "SampleGenerator.h" 00005 00011 class RandomSampleGenerator : public SampleGenerator 00012 { 00013 public: 00017 void samples(int n, float u[], float v[], float weight[]) const 00018 { 00019 for (int i=0; i < n; i++) 00020 { 00021 u[i] = frand(); 00022 v[i] = frand(); 00023 weight[i] = 1.0 / float(n); 00024 } 00025 } 00026 }; 00027 00028 #endif