working triangle rasterizer using area-comparison method - v.2 now with more efficient bounding box calculations and rendering direction might make something 3d with this eventually i also wanna do texture rendering but im not sure how Explanation: the rasterizer selects 3 points (in this case your mouse coords and 2 randomly determined points). it creates a bounding box around those points, and goes across until it either reaches the edge of the bounding box (failsafe) or detects that it is inside the triangle. If it detects that it is inside the triangle, it continues until it detects that it has left the triangle. It detects whether or not it's in the triangle by creating 3 smaller triangles with each of the main triangle's points and the point that we're trying to determine. If the areas of the 3 sub-triangles sum to the area of the larger triangle (or close enough) then we put the pen down (full link to an explanation in the comments in the project)
every variable labeled "nonessential-" can be deleted if you wanna use this includes: full color and resolution support v.2 updates: -checking for highest and lowest x/y coords now uses a more efficient algorithm -more vertical triangles will now render in a vertical direction to try and slightly save on processing power