Jon Baker, Graphics Programming

    home

    writings

Dynadraw

  This is an interesting thing I found a while ago, when a friend shared a resource on this site about using matrix operations for contrast/saturation adjustment. Since I saw the little swept caligraphic text on there, I wanted to try porting it over and messing with it. It appears to be written by Paul Haeberli for IRIX in 1989, which has an interesting archaelogical vibe to it. What I can gather, IRIX was a graphical frontend for UNIX machines at the time, like the old SGI workstations.

cases

  The code is modelling a filter on the mouse movement, it's a simple damped spring constraint between your mouse and a drawing cursor, which you can use to trace out intrestingly swept contours. The stroke is represented as a triangle strip, a sequence of quads which widens and shrinks with the instant velocity of the stroke. Faster movement creates thicker segments.

cases

  The original code put together a buffer for 5000 quads and capped at that length. I was messing with passing the four points defining the quad as uniform inputs to a shader, and then doing 2D SDF operations in order to draw the strokes. The original code uses a "fixed angle" toggle, which changes the perpendicular axis of the stroke from a constant to a variable angle. The fixed version does contribute to the more formal caligraphic types of patterns of variations in the stroke.

cases

  Watching Bob Ross paint, I've always been particularly interested in the way he uses the physically different brushes to create the different types of marks on the canvas. This interplay of the form of the tool with the various consistencies of mixed paints forms the basis for his work. I've been thinking about doing a little paint tool, maybe ganging many individual brush elements with small variations in parameterization could make a collection of strokes, representing things like the wide bristled brushes. Would also need to come up with a good model for color mixing and a good model for interaction with the brush, as well.


Last updated 1/24/2025