For the right triangle defined by the equation aX + bY <= c for integers
I want to build each pixel (*) in a triangle once and only once, in a pseudo-random order and without saving a list of previously hit points.
I know how to do this with a line segment between 0 and x
select a random point '' 'along the line,
pick' p ', which is coprime with x repeat up to x times: O next = (O cur + P) MOD x
To do this for a triangle, I would like 1. We need to count the number of pixels in the list of sans triangles
2. Match integer 0..points to a pair of x, y, which is a valid pixel inside the triangle
I hope that any solution can be generalized to pyramids and higher dimensional shapes.
(*) I use a CG member pixel for a pair of integer points X, Y for which the equation is executed.
source
share