![]() |
| | #1 |
| Registered User Join Date: Jan 2006
Posts: 14
| Draw dot by dot? I'm trying to implement Brasenham's algorithm, I need to draw a line on a given coordinates (x1,y1,x2,y2). The problem is that when I try to do this in C# (GDI+) I have this function drawLine, but this draws the line itself. I need to construct the line myself, point by point (pixel by pixel), can anyone show me on how to draw only one pixel at the time, not connect two point. I will need to draw the line recursively, one pixel at the time so in the end I end up with the complete line. advice is welcomed in any language C#, Java, C++ ? Thanx in prior |
| fiska is offline | |
| | #2 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,710
| There are a huge number of sites which detail the algorithm - just read a few of them. |
| Salem is offline | |
| | #3 | |
| Registered User Join Date: Jan 2006
Posts: 14
| I know the algorithms perfectly well, I just have problems implementing it. I dont know how to draw a single point so then I can then construct the whole line dot by dot, it is perfectly well described in my thread above. Quote:
Last edited by fiska; 10-11-2006 at 06:39 AM. | |
| fiska is offline | |
| | #4 |
| and the Hat of Clumsiness Join Date: Oct 2002
Posts: 1,101
| Since this is obviously for learning purposes only , why not just use DrawRectangle ( or something like that ) with a width and height of 1 pixel. I know it's not the best solution , but I've looked at msdn Graphics documentation at a glance and didn't see any method to just draw a pixel. C#, Java, C++ >> Java: http://forums.java.net/jive/thread.j...ssageID=111831 Using the windows GDI: http://www.toymaker.info/Games/html/gdi.html Last edited by GanglyLamb; 10-11-2006 at 09:43 AM. |
| GanglyLamb is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Which is the better way to draw? | g4j31a5 | Game Programming | 16 | 01-22-2007 11:56 PM |
| need help making a dot bounce up and down y axis in this prog | redwing26 | Game Programming | 10 | 08-05-2006 12:48 PM |
| draw function HELP!!! | sunoflight77 | C++ Programming | 1 | 05-10-2005 11:28 PM |
| Simple program i cant get (dot moving) | Lupusk9 | C++ Programming | 4 | 09-14-2004 08:04 PM |
| ray casting | lambs4 | Game Programming | 62 | 01-09-2003 06:57 PM |