Day 4 of the “Engineering a Paintbrush Made of Light” UCSD Extension Summer Course

Today was a lot of work.  We were working with Processing again, but doing things a tad bit more difficult.  We had to do everything from scratch, no source codes for me. 😛  I left my petal/flower project alone, because rotating it was just too complicated.  So I started to make a fire.  I thought curves would be simple, little did I know they take a lot more effort than anticipated.  I got the hang of it though and things progressed nicely.  However, making the curves join smoothly is another matter entirely. 

The bezier curves I used have a set of 4 coordinates.  The vertex() is the starting point of the curve based on an x, y point.  The following code, bezierVertex(), has a series of 3 points.  The first and second coordinates give the location of the control points.  The control points alter the amplitude, direction, and angularity of the curve.  The final coordinate in the bezierVertex() sequence is the end point of the curve. So coding the points of a bezier curve could appear as so:

vertex(30, 70); //starting point
bezierVertex(25, 25, 100, 50, 50, 100);//(control pt.1, control pt.2, end point)
To make the curve continuous, additional lines of bezierVertex() would be added, the starting point of the next curve being the previous end point.  Making the curves smooth adds another level of complexity.  To make the transition smooth, the second contol point and end point of the first curve must be on the same linear line as the first control point of the second curve.  It took me a while to understand that concept.  And I was hoping I wouldn’t have to do any math this summer…boy was I wrong.  I had to find an online graphing calculator in order to make some some of my curves look pretty.

Meanwhile, Paul tried to play around with a prototype to see if he could put an image inside, but all of our attempts failed so far.  I managed to put fire in the background, but I really want to get it inside.  Maybe tomorrow.  I really can’t wait to make the little monsters.  They look so cute!!