WWW.CODEMUSE.NET
HOME IMAGES MUSIC LINKS CONTACT
  PlayWithMozart
  hairSynth
  cutNwatch
  Copacabana
  KaleidoDrums
  PixelPluck
     
 
hairSynth
  Click here to play with hairSynth. You will be able to draw a bunch of hair, but you will not be able to save the resulting vector file. To save files (which you can then print), download the application at the bottom of this page.
 
Instructions for drawing hair
Resolution and instructions for viewing and printing drawings

You may run the program right away in your browser by clicking here, or even here for a larger version if you happen to be sitting in front of a really large display screen.

There are only 3 steps needed in order to draw a bunch of hair (a "bunch" has a little bit more than 1000 strands).

Step 1 - set the shape of the master hair strand, which serves as a model for the bunch of hair. Changing the shape is accomplished by dragging the three small disks that control the ondulation of the master hair strand (a fourth disk controls the orientation).

Step 2 - select the hair color and the background color for the drawing. Here you can also re-center the drawing on the canvas, and select the center of the area to zoom into (the actual zooming is done in Step 3).

Step 3 - select whether to view the full bunch of hair or whether to zoom into the area previously selected in Step 2. Step 3 is also where you can increase the vector resolution (e.g. increase the number of polygons used to draw the strands) and save the resulting vector drawing to a Postscript file. However you cannot save to file using the applet; you will need to download the full application to do this. If you have downloaded the application, this is the point where you can to increase the vector resolution and save the drawing to a Postscript file. Increasing the vector resolution slows down the program and worsens the appearance on screen. Therefore, if you are running the application in your browser, you may want to leave the resolution unchanged.

You can go back and forth between these 3 steps by clicking on the Step buttons on the screen. Except for the resolution bit (explained later), everything else should be relatively obvious.

Other than the Exc key, used to quit the downloaded application, there are no other keyboard commands; everything is controlled by clicking and dragging the mouse.

Vector resolution - The strands of hair are drawn with color-filled four-sided polygons (facets); actually plenty of them. The program automatically calculates the number of facets needed so that, longitudinally (e.g. along the local direction of the strand of hair), no facet is wider than 1/100 of an inch, no matter how large the selected zoom magnification, assuming the drawing is printed on paper 8 and 1/2 inches wide.

The number of facets can be increased, by clicking on the "Higher resolution" toggle button, so that no facet is wider than 1/300 of an inch (again, assuming a printout 8 and 1/2 inches wide). Where the brightness changes steeply (e.g. on the edges of the hair strand), the resolution is even higher so that the effective resolution is better than 300 vectors per inch. This allows for huge enlargements without one beeing able to notice lines where the colors transition. The downside of using the 300 resolution is that the vector files increase threefold in size and files of 100MB are not uncommon for low magnifications (the effect of more area being covered at low magnifications is only partially offset by the smaller number of polygons needed per strand). Large files do not take long to produce by hairSynth but your Postscript viewing/printing program may choke on them.

How to view and print your Postscript files - To save your drawing to file, you will need to download and run the application (details below).

PostScript files writen will be saved in the same directory as the application The files will have names similar to hairSynth_Swat3x_12052007at0930. Swat3x means the drawing was produced as a Swatch with a 3x magnification. Zoo10x would mean that is was magnified 10x and produced to fill the screen (and the page).

You can view and print PostScript files using Illustrator, Distiller, as well as the free program Ghostscript (also GSview for Windows). You can also rasterize the Postricpt vector file (e.g. convert it to a JPEG file) in Photoshop. When rasterizing the vector file, try using a resolution of 300dpi (or proportionately higher, if you later intend to blow up the image to a very large size).

 

Credits and Licence
Dowloading and running the application

Credits

Processing by Ben Fry, Casey Reas and others - http://www.processing.org/

SimplePostScript library by Marius Watz - http://processing.unlekker.net/SimplePostscript/index.html

Programming enviroment: JAVA on Eclipse as distributed by EasyEclipse

 

 

 

License

hairSynth is Copyright (C) 2007 JM Bara

hairSynth is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

 

DISCLAIMER - THE hairSynth SOFTWARE IS PROVIDED TO YOU "AS IS," AND I MAKE NO EXPRESS OR IMPLIED WARRANTIES WHATSOEVER WITH RESPECT TO ITS FUNCTIONALITY, OPERABILITY, OR USE, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR INFRINGEMENT. I EXPRESSLY DISCLAIM ANY LIABILITY WHATSOEVER FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST REVENUES, LOST PROFITS, LOSSES RESULTING FROM BUSINESS INTERRUPTION OR LOSS OF DATA, REGARDLESS OF THE FORM OF ACTION OR LEGAL THEORY UNDER WHICH THE LIABILITY MAY BE ASSERTED, EVEN IF ADVISED OF THE POSSIBILITY OR LIKELIHOOD OF SUCH DAMAGES.

By downloading and/or using the hairSynth software, you agree to the specified termsof the licence (see License) and to the above disclaimer. To download the hairSynth program and source code click here.

How to run hairSynth

Windows - double click on the file "WINDOWS RUN ME" inside the folder HAIRSYNTH.

Mac - Make sure the unzipped "HAIRSYNTH" directory is on your Desktop. Do not rename this folder or move the executable files out of the folder. Double click on the file "MAC RUN ME" inside the folder.

The program will take over your screen. To quit, press the Esc key

If HairSynth does not run on your computer, it may be because you do not have JAVA 1.4 installed. You can download JAVA 1.4 here: http://java.sun.com/products/archive/ Look for J2SDK/J2RE - 1.4 ... 1.4.2_15 and click on Go. Then Download the J2RE and install it.

Questions or comments?
 
Comments and questions are welcome. You may post them here.