Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Michael_Lee on October 12, 2010, 01:48:31 pm
-
Hi - quickly, could somebody explain how Axe draws lines (as in, how it chooses which pixels to turn on)?
Is there a formula of some kind, and how would the routine-thingy handle turning on multiple dots in the same column or row?
-
Line(X1,Y1,X2,Y2) Draws a black line from point (X1,Y1) to (X2,Y2) on the buffer.
pixel start Top left to X=0 and Y=0, and finish bottom right to X=96 and Y=64.
Next you need dispgraph.
-
Ah - not what I meant. Sorry.
I know about the line command, but I would like to know at a more indepth scale exactly which pixels the command knows to turn on.
(What I will end up trying to do is check along a line to see when it encounters a pixel already on, then draw the line only to that point.)
-
This doesn't answer the question, but what you could do is simply do a pxl-test( loop where you constantly change the position of the pixel. When the test returns a one, store the answer to a variable. Then all you have to do is draw the line to that point.
-
I used this:
http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
-
Doesn't it use an OS b_call? If not, informal feature request: Line()r.