Drawing a vector on an LCD

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm trying to draw a vector/line on an LCD.

Given two points (e.g. (3,5) and (7,7)) - how do I calculate which pixels require "filling in". I've tried working it out myself but my implementation has a number of failings (Negative gradients and gradients > 1).

I'm sure this has already been done, so to save me re-inventing the wheel, can you offer me any advice/guidance?

Ben
-Using IAR (& ocasionally CodeVision)
0.7734
1101111011000000110111101101

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Google for Bresenham line drawing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

While not quite answering my own question..........

Before I posted on here I searched and searched any couldn't solve my problem - eventually I posted on here - almost immediately I've come across Bresenham's line algorithm

Ben
-Using IAR (& ocasionally CodeVision)
0.7734
1101111011000000110111101101

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:
Google for Bresenham line drawing.

Beat me to it!

Ben
-Using IAR (& ocasionally CodeVision)
0.7734
1101111011000000110111101101

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just for interest, can you give more details about your project? An Elite clone for a Tiny13 maybe :wink:
I'm about to start on a graphical LCD serial backpack, hence the noseyness.

Nigel Batten
www.batsocks.co.uk