Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FillTriangle and FillQuad
#1
Two simple little routines to quickly and efficiently fill triangles and quadrilaterals:

Code: (Select All)
SUB FillTriangle (x1, y1, x2, y2, x3, y3, K AS _UNSIGNED LONG)
    $CHECKING:OFF
    STATIC a&, m AS _MEM
    IF a& = 0 THEN a& = _NEWIMAGE(1, 1, 32): m = _MEMIMAGE(a&)
    _MEMPUT m, m.OFFSET, K
    _MAPTRIANGLE _SEAMLESS(0, 0)-(0, 0)-(0, 0), a& TO(x1, y1)-(x2, y2)-(x3, y3)
    $CHECKING:ON
END SUB

SUB FillQuad (x1, y1, x2, y2, x3, y3, x4, y4, K AS _UNSIGNED LONG)
    FillTriangle x1, y1, x2, y2, x3, y3, K
    FillTriangle x3, y3, x4, y4, x1, y1, K
END SUB
Reply


Messages In This Thread
FillTriangle and FillQuad - by SMcNeill - 09-23-2023, 06:03 AM
RE: FillTriangle and FillQuad - by SMcNeill - 09-23-2023, 11:59 AM
RE: FillTriangle and FillQuad - by bplus - 09-23-2023, 01:37 PM
RE: FillTriangle and FillQuad - by SMcNeill - 09-23-2023, 02:46 PM
RE: FillTriangle and FillQuad - by Dav - 09-23-2023, 01:38 PM



Users browsing this thread: 2 Guest(s)