Line drawing algorithm

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rakesh.Mysore@gmail.com

    #1

    Line drawing algorithm

    Can any one please suggest me a algorithm to draw horizontal and
    vertical line between two points (a right angled line, not a slant
    line).

  • Patrice

    #2
    Re: Line drawing algorithm

    For now it looks like to me you would just want to draw from x1,y1 to x2,y1
    and then to x2,y2 ? If not that simple, please elaborate a bit about what
    you are trying to do....

    --
    Patrice

    <rakesh.Mysore@ gmail.coma écrit dans le message de news:
    1153900030.4239 52.125500@75g20 00...legro ups.com...
    Can any one please suggest me a algorithm to draw horizontal and
    vertical line between two points (a right angled line, not a slant
    line).
    >

    Comment

    • rakesh.Mysore@gmail.com

      #3
      Re: Line drawing algorithm

      Hello Patrice,

      thanks for reply.

      i need to draw Stepped line between two points (x1,y1) and (x2,y2) with
      x1 not equal to x2, (i don't want to draw slant line). (as links drawn
      between blocks in many graphical editor).

      Comment

      • Patrice

        #4
        Re: Line drawing algorithm

        Ok so the basic response should be a start i.e. the principle I mentionned
        will draw an horizontal line from the first point to the x coordinate and
        then a vertical line to the second point.

        Then you can ehance this a bit depending on what you are after (for example,
        the start or destination point could be moved by the user as long as it is
        inside the shape, or you could let the user move the corner point, or add
        adtional points etc.. but basically the idea is just to move from one point
        ot the next by changing one of the coordinates so that you draw only
        vertical or horizontal lines...

        --
        Patrice

        <rakesh.Mysore@ gmail.coma écrit dans le message de news:
        1153902181.9677 64.94810@i3g200 0c...legrou ps.com...
        Hello Patrice,
        >
        thanks for reply.
        >
        i need to draw Stepped line between two points (x1,y1) and (x2,y2) with
        x1 not equal to x2, (i don't want to draw slant line). (as links drawn
        between blocks in many graphical editor).
        >

        Comment

        • rakesh.Mysore@gmail.com

          #5
          Re: Line drawing algorithm

          Hi Patrice

          Thanks a lot,

          I will try out......

          Comment

          Working...