HIDIHO!

giving something back to the Flash community

hair / fur

Tags: , , , , , ,



… Bilbo, Bulbous Bilbo
Hairy, Hairy Hobbit Hero …

in The Pimp, The Bitch & The Magic Beans – intestinal fortitude by Nuclear Rabbit

this one might make Andreas Weber smile as I found out during my researches that he is (or was) working on hair simulation algorithms like to handle millions of 3D hairs at a time :)

who cares.

many famous and talented people have given it a try alreday:

plus a couple more I guess :)

Litterally speaking, there’s no algorithm nor is there a complex process whatever.
the Hair class is extremely simple and mostly stores values, it has a process() function that calculates each hair segments coordinates and a render() function to draw the hair.

the most problematic (and interesting) part is how to affect the hair’s growth to give it kind of a “natural” look where there is actually no clue on how it should grow.

here’s what I came up with (FP10 required):

  • browse to use a cutsom picture
  • hair length controls … the hair length
  • curliness controls how much the hair can bend on each segment (should remain quite low)
  • hair steps sets the numaber of segments of the hair
  • base angle gives a big direction to all the hairs, like a wind
  • density is the amount of hairs growing at each pixel location
  • hair size si the hair’s root size (decreasing linearly along the length)
  • output scale is the output scale.
  • render renders the comp with the current params.
  • preview wil perform a rough render skipping lots of hairs to render faster
  • auto edge is quite an important feature ; when checked it computes a Sobel edge detection and uses it as a motion map to influence hair growth (red intensity affect the hair horizontally and green intensity, vertically).
  • click on the original / autoedge button to swap between the original and the render. when auto edge is on it shows the motion map.
  • finally you have a save button to save your piece of art

also, you can drag the comp.
you can play in a bigger window.
if ever you don’t have the flash player, here are some pictures.

those look pretty much like felt.

but we can achieve more graphical stuff:

this is an activator inhibitor pattern:

there are hundreds of possible variations around how to affect the growth. this version is rather fast and clean especially as params can be pushed over the limits I gave.
it made me think of that vector field I did a while ago.

this was a test with some rather small pics ( resized to 200 px ).
it also works on bigger pics but I realized it is a constant in my “work” ; using small pictures and make big drawings :)
small files are faster to load and everybody has an avatar somewhere so I think it’s a good approach…

enjoy :)

Tags: , , , , , ,

© 2009 HIDIHO!. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.