Hi,
I've written a single module to rasterize and shade a triangle. Rasterization works fine but I get some errors when I try to bilinearly interpolate between the vertices.
The module is too big and I rather not post it (unless of course one of you wants me to).
Assuming that the vertices are in an anticlockwise arrangement:
Get length of left edge
Get length of right edge
For every scanline
Interpolate between vertex v0 and v1
Interpolate between vertex v0 and v2
for every pixel in current scaline
Interpolate between values of previous two interpolations
Colour the pixel
That is basically how I did it. I tried but failed in finding any coded examples that weren't heavily optimized. ( usually heavy optimizations affect clarity i.e. inlined assembly modules)
Any help would be appreciated( tutorials, code, personal opinions)
Duetti



LinkBack URL
About LinkBacks


