This just hit me today from out of the blue. I think it's fast enough to be called fast-filled.
REM ***********************************************
REM * 2D Filled Triangle on DBC - Ashingda27 *
REM ***********************************************
REM This program demonstrates this function drawing
REM a filled triangle moveing about on the screen.
sync on
sync rate 0
Rem - Using these arrays as global variables. This is
Rem required for the function to work.
dim TriX(0)
dim TriY(0)
Rem - Set the XY position and Size
x# = 300
y# = 200
s# = 150
Rem - This bitmap method is used to speed up 2D drawing
Rem and it is NOT required for the function to work.
create bitmap 1,640,480
do
Triangle(x#,y#,s#)
if x# < 340 then x# = x#+1 else x# = 300
if y# < 230 then y# = y#+1 else y# = 200
text 0,0,str$(screen fps())
copy bitmap 1,0
sync : cls
loop
Function Triangle(x#,y#,s#)
TriX(0) = x#
TriY(0) = y#
TriangleRLoop(0.0,0.0,s#)
TriX(0) = x#-s#
TriY(0) = y#
TriangleLLoop(0.0,0.0,s#)
EndFunction
Function TriangleRLoop(x#,y#,s#)
box TriX(0)+x#,TriY(0)+y#,TriX(0)+x#+s#,TriY(0)+y#+s#
if s# => 1
TriangleRLoop(x#,y#-s#/2.0,s#/2.0)
TriangleRLoop(x#+s#,y#+s#/2.0,s#/2.0)
endif
EndFunction
Function TriangleLLoop(x#,y#,s#)
box TriX(0)+x#,TriY(0)+y#,TriX(0)+x#+s#,TriY(0)+y#+s#
if s# => 1
TriangleLLoop(x#+s#/2.0,y#-s#/2.0,s#/2.0)
TriangleLLoop(x#-s#/2.0,y#+s#/2.0,s#/2.0)
endif
EndFunction