Simple Mouse Drawing in Quartz Composer

MouseYo

Simple Mouse Drawing in Quartz Composer

Steffen writes:

Hi Surya. I am reading your book “Learning Quartz Composer” (not finished, yet). For a project I urgently need a live light painting effect. How can I do this with Quartz Composer? I experimented with Concert, Psychotic and Trace patches but they don’t meet my needs. Can you help me out? Thank you in advance. Greetings from Germany.

It’s easy to get a basic live light painting effect using the Mouse and Particle System patches:

MouseDrawingEditor

With this patch, we are constantly creating particles, using the x and y positions of the mouse to choose their birth point. By connecting the ‘Left Button’ output from the mouse to the ‘Alpha’ input of the HSL Color generator, we set the particles to be invisible under the mouse when the button is not held down.

You’ll want to play with the settings of the particle system to get a nice long lifetime to the particles and perhaps fade them out using the Opacity delta. I like to put the min and max Z Velocities at around -0.1 to give a little movement to them.

For longer persistence, you could use an Image Accumulator patch to keep the particles around until you specifically clear them.

Please feel free to share your remixes and updates! And check out our book on Quartz Composer for a variety of lessons in realtime motion graphics.

Download example QC Mouse Drawing comp: MouseDrawing.zip

Post your comment