From: Andreas K. <and...@we...> - 2004-10-28 13:29:01
|
Hi! > I can't look very deeply at the moment. In any case I think you should > move the SAMPLING2D class into utils, since it is not needed by anything > in kernel/. Yes, that makes sense > There also seems to be some complicated interaction between the renderer > and the sampling object in RAYTRACER::Get_Pixel(). It might be easier > to have a method SAMPLING2d::Calc_Pixel(u,v,du,dv), which in turn calls > Renderer->Trace_Camera_Ray() as often as it needs to, and returns the > final colour. This is possible since the renderer is a public global > variable, and it would make the interfaces and interactions much simpler. This would work for the current use case. But the sampling class is intended to be used in other sampling cases as well. It can be used to sample any 2-dimension function, using the warp functions it can be used e.g. to sample a hemisphere of incoming directions. If you have a suggestion for an easier interface without having the SAMPLING2D class to know abou the current user (the ray tracer in this case) let me know. Andreas |