private void renderDot ( int cx , int cy , float Z , int rgb ) { for ( int i = - dotRadius ; i <= dotRadius ; i ++ ) { int y = cy + i ; if ( y < 0 || y >= imageRgb . height ) continue ; for ( int j = - dotRadius ; j <= dotRadius ; j ++ ) { int x = cx + j ; if ( x < 0 || x >= imageRgb . width ) continue ; int pixelIndex = imageDepth . getIndex ( x , y ) ; float depth = imageDepth . data [ pixelIndex ] ; if ( depth > Z ) { imageDepth . data [ pixelIndex ] = Z ; imageRgb . data [ pixelIndex ] = rgb ; } } } }
Renders a dot as a square sprite with the specified color