-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|375|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Graphical Effects


 
Pakz
Created : 06 July 2017
 
System : Browser Based
Language : Monkey-X

Filled Triangle

Fill triangles using bresenham algorithm

Flash applet with the triangle fill routine.

Latest Update

I was reading on the javagaming forum and noticed someone describing how you could fill triangles by filling it with lines. Basically you use the bresenham line algorithm and with every step there you store the x coordinates at either the left or right side. When they are stored you then loop through the array where they are stored and use these x coordinates with the drawline command.

I spend a while thinking on how I would do this and I was able to rather quickly make it work in monkey.

 

Comments