ScratchData LogoScratchData
Back to gtoal's profile

Triangle Fill by axis-aligned degenerate quads

GTgtoal•Created February 18, 2015
Triangle Fill by axis-aligned degenerate quads
14
7
254 views
View on Scratch

Instructions

My version of a scanline fill. Doesn't yet use Bresenhams - just interpolates using floating-point arithmetic which would be relatively expensive on a real machine. It's a trivial mod to make the fill primitive an axis-aligned quad rather than a pair of triangles. I did originally distinguish between flat top and flat bottom triangles but folded all that into one procedure as it isn't necessary unless you're implementing it with Bresenham's (and that's just to save the use of calculating a step variable containing +1 or -1.)

Description

See the discussion at http://scratch.mit.edu/discuss/topic/90330/ The line-drawing DDA came from tylerbata's http://scratch.mit.edu/projects/2906972/ Quad library available at http://scratch.mit.edu/projects/51273132/

Project Details

Project ID48571128
CreatedFebruary 18, 2015
Last ModifiedMarch 7, 2015
SharedFebruary 18, 2015
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root