The magazine of the Melbourne PC User Group

Spline Fever
Myles Strous

When drawing in two-dimensional (2D) painting software I've never been able to get lines drawn exactly the way I want using a mouse, and I find even using a graphics tablet is a struggle for precise smooth lines (see Figure 1). Later I usually want to tweak and adjust the lines. Clearly what I need is a drawing program rather than a paint program.

 


Figure 1. Faces created using various drawing tools

Drawing programs are all about editable lines (or vectors), as opposed to paint programs which are about splashing pixels onto a virtual canvas. Many people will be have heard of drawing programs such as CorelDRAW, Adobe Illustrator, and Macromedia Freehand. Some of you may have heard of Expression from Metacreations (formerly Fractal Design), soon to be updated to version 2.0 by the original company, Creature House. Others may have heard of CorelXARA, and seen some of its features appear in later versions of CorelDRAW. A new version, Xara X, will soon be released directly from the original company, Xara Ltd.

One of the basic features I particularly like about such drawing programs is the ability to use splines, also known by the less technical name of "curved lines".

Splines enable me to easily create smooth curved "organic" shapes, rather than the hard sharp regular shapes of lines and polygons, the inflexible shapes of circles and ellipses, or the wobbly uncontrolled lines that are my shaky attempts at sketching with a mouse or graphics tablet. I can go back later and adjust their curvature, position, thickness, colour, etc. as I see fit, without redoing major portions of an image. This ability to change things at a later time applies to most vector-based drawing programs, but not necessarily the spline tools present in some paint programs.

There are several different types of splines, mathematically speaking, and the experts will talk about Bezier splines, B-splines, cardinal splines, cubic splines, NURBS (Non-Uniform Rational B-Splines), Catmull-Rom splines, Hermite splines, and probably several more.

However, when it comes down to the user interface level they are all basically curved lines passing through user-controlled points, which may be called knots, nodes, anchors, control-points, or something else depending on your software. There may also be other points, not lying on the spline itself, which enable you control the shape and sharpness of the curve (see Figure 2).

Advanced spline tools enable you to create splines that are variable in thickness (as if drawn with a calligraphy pen, for example), or that look as if they were drawn using natural media tools such as paintbrushes or chalk, and some even allow you to paint with shapes and images. This enables you to draw something that looks as if it were created in a paint program, but still allows you to later manipulate the shape, position and painting style of your brush strokes (see Figure 3).

 


Figure 2. Spline control points


Figure 3. Splines displayed as natural media strokes.


Figure 4. Splines forming a patch in 3D software

This is a feature that Adobe Illustrator calls Live Brushes, CorelDRAW calls Artistic Media brushes, and no doubt it is known by other names in other software.

If you want to animate your spline-drawn cartoons, take a look at Moho, a spline-based animation program from Lost Marble. You can see further details and download a fully functional trial version at http://www.lostmarble.com/ (it puts a transparent DEMO stamp on top of animations, and only exports Flash animations in grayscale).

Moho is surprisingly simple to use, and in a couple of afternoons one weekend I was able to start using the demonstration version and the included tutorials to create an original animation I was reasonably happy with (see Figure 5).

Splines are also available in three-dimensional (3D) rendering programs - they can, for example, form paths for animated objects to follow, they can be used for modelling surfaces, and they can form animation timing curves for such things as character movements and colour changes.

When splines are combined in a mesh, similar to a fishnet, the areas they enclose (think of the holes in the fishnet) are known in some software as patches (see Figure 4). 

As in 2D paint and drawing programs, splines in 3D enable you to form curved organic shapes, while retaining complete control over reshaping them later (see Figure 6). These patches render to form a smooth surface that flexes and animates very easily, making splines and patches an excellent choice for character animation work.

 


Figure 5. Frame from a Moho animation


Figure 6. Splines forming a simple head in 3D software

3DS users will no doubt have heard about Surface Tools (see http://www.digimation.com/plugins/surfacetools/bodymain.htm) - this functionality is now provided as part of the latest 3DS release.

Users of the excellent freeware raytracer POV-Ray (Persistence of Vision Raytracer, see http://www.povray.org/) or the RenderMan-compliant shareware raytracer BMRT (Blue Moon Rendering Tools, see http://www.bmrt.org/) are hopefully familiar with the spline/patch modeller HamaPatch (see http://www.crosswinds.net/hamapatch/).

Other software (such as Lightwave, SoftImage, Maya) has spline and patch capability built-in.

My personal preference for 3D spline- and patch-based software is Hash Inc's Animation:Master (see http://www.hash.com/), which has been developed specifically for character animation, although it can also be useful for more general 3D work.

If you are interested in seeing or talking more about splines in two or three dimensions, come along to one of the meetings of the Graphics Special Interest Group, Melbourne PC SIG room, third Monday of the month, 7.30 pm. Beginners welcome. Ask for Myles.

Reprinted from the November 2000 issue of PC Update, the magazine of Melbourne PC User Group, Australia