Well its linear interpolation Not much to add you could make this account for the Y to make a fancy square but I don't need that are the moment for my 3D engine. ----------What is linear interpolation Also if you have no idea what it is, basically its mixing two numbers to based on the alpha which is the pixel in this case for my square so lets say Starting x is 0 and ending x is 100 and my Current x is 45 which in the formula would be Alpha and basically based on the formula you get a percentage which is the mixed version of the Starting x and ending x and also it dosen't have to be x, it can be any thing
credit to me i guess