//==================================================================================== // lineval2.cpp : uses PixelFlow style linear-expression evaluator to resolve pixel // coverage, uses combined circle and depth tests, uses Qbuffer. //==================================================================================== #include "fbppm.hpp" #include // THE "MOCK" FRAMEBUFFER int WW=256, WH=256; FrameBufferPPM fb(WW,WH); //------------------------------------------------------------------------------------ // Qbuffer : table of precomputed values for each (x,y) pixel location. //------------------------------------------------------------------------------------ int Qbuffer(int x, int y) { return( x*x + y*y ); // FOR NOW, JUST EVALUATE } //------------------------------------------------------------------------------------ // scan-converts sphere given center (a,b) in screen space, pixel radius, // Min and Max depth Z-value (Max is "deeper"). //------------------------------------------------------------------------------------ void BruteForceSphere(int a, int b, float r, float MinZ, float MaxZ) { for (int x=0; x