This section shows how we can draw a crudly textured polygon like I did in 1991. We are going to draw each polygon using a series of lines going down the polygon like so How many lines are we going to draw and how long are they? We can start to think about the start of the vertical line (x,y) by using Linear Interpolation again How do we increment from sx1 to sx2 to obtain (t)? Well we can do this by taking the difference between the 2 points. length=(sx2-sx1), t = i/length, when 0<i<length This would also work for the bottom line (sx3 to sx4), but only if the bottom lines difference between sx3 and sx4 was the same or less. If it was greater then we would get stripes like this. Not that some of the pixels are blank and not processed, creating stripes. So horizontal length has to be the max value of (sx2-sx1) and (sx4-sx3). Like I said before, this just means that we are now repeating calculations on the top line. But I'm not worried at
- Get link
- X
- Other Apps