Pencil
  Points
  Afterimages
  Lines
  Polylines
  Polygons
  Smoothed Polylines
  Smoothed Polygons
  Rainbow Palette
  Hot Iron Palette
Source

Pencil - Points

This first pencil shows two points bouncing around inside a window.

The points are drawn in a Tk canvas widget using the oval item types.

Every pause milliseconds, the coordinates, x and y, of the ovals are updated by adding finite displacements, dx and dy. If any updated coordinate falls outside the bounding box of the window, then we reflect the velocity for that component and adjust the updated coordinate as if it had bounced off the wall.



Roger E Critchlow Jr
Last modified: Fri May 16 19:39:53 MDT 2003
elf.org