turbowarp.org/1270308530?hqpen working triangle rasterizer using area-comparison method - v.2 now with retro-style texture rendering using 8-color palettes might make something 3d with this eventually 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, as well as local textures (by "local" i mean the bounds of the texture is determined by the bounds of the triangle) v.3 updates: -can render textures with 8-color palettes and any size texture grid pattern -checking for highest and lowest x/y coords now uses a more efficient algorithm -removed vert/horiz triangle filling, since it makes textures much harder and doesn't save that many resources