Friday, July 10, 2015

Computer Graphics : DDA Algorithm Implementation


Now this is revisiting for those who saw the old post or just saw the lab exercise Q, and tried something in DDA and got some output. For others, it's totally new and an easy road, since I am giving a part of the code. But seriously, I recommend you try something at least, before seeing my code, or else...it's like you telling yourself that you can't code it. So, have some self-respect.

DDA Code

It's just a part of the code. I was actually thinking to put up the simple math, using which I arrived at this implementation. Then I felt that you can do it yourself. Just in case you have problems with the math, the equations, the conditions and how they are justified, just mail me. I will explain it.

Besides, you might think DDA is just too simple and that these many posts might not be needed, remember, even these small things matter, if you can understand this, you can move forward to Bresenham with some confidence. It's all about math and understanding. And if you understand Bresenham, then Circle and Ellipse will follow one by one. It will be like a piece of cake. I will try putting up an explanation for all the equations.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.