## Prototyping a simple feather simulator

July 23rd, 2005 by Andrea Interguglielmi - Viewed 51064 times -

With a minimum of scripting and math knowledge, it is possible to solve big problems just using our imagination (and asking Google for the right things).

The first important step is to dissect our big problem into smaller ones, which will not lead to our half-artistic brain crashing. By following this rule, even a big thing such as a feather simulator can be prototyped without a degree in computer science.

This article is not a tutorial nor is it done to teach how to make the definitive simulator. It will just show a starting point for prototyping a small feather system and, hopefully, it will offer a good topic for discussing alternative solutions and approaches.

With that being said, lets start with our problem to solve: how to cover a mesh with feathers.

Feather instantiation

When I made my prototype I had in my mind one clear thing, it would be so simple to instantiate the feathers on a nurbs surface, it would be just a matter of offsetting each feather along U and V, XSI would then do the rest finding the XYZ cords of a UV point on the surface.

```//Pseudo-code
function InstantiateFeathers()
{
U_steps = 1/N1;
V_steps = 1/N2;

for(u = 0; u &lt; N1; u += U_step)
{
for(v = 0; v &lt; N2; v += V_step)
{
position_vector = GetXYZFromUV(u,v);
CreateFeatherAt(position_vector);
}
}
}```

However, most of the time, the object to be covered is a polygon mesh, so the situation is a bit more complicated, we have to recreate the UV space somehow.

A solution could be to group polygons in rectangular clusters and automatically generate an unwrapped UV map for each cluster.

By doing this it is possible to treat a poly mesh as a parametric surface, but we cannot rely anymore on XSI’s internal UV-to-XYZ function, we have to make our own.

This function will use two edges of a polygon to define a local cords system XY, once a point is located in the polygon’s local UV it is just a matter of tracing the same vector in XY space, maybe the image bellow explains it better.

Now that a way to cover meshes with feathers has been found, it’s time to think about how those feathers are going to be oriented along the mesh, the UV approach came really handy in the development of our next step.

Feather orientation

If the goal is to orient many objects with the minimum amount of work for the final user, then a solution is to control those objects with a small number of sub-controls.

The orientation and the scale of each feather is in fact the result of the interpolation between several control objects, lets call them “control-feathers”, with just a few of them it is possible to orient thousands of elements, even over time which means animated feathers!

Such an interpolation is based on the distance of a feather to its control-feathers, the nearer a feather is to its control the more alike is the feather’s orientation.

The unwrapped UV space used for instancing feathers along the mesh is perfect for calculating the distance between two points, even if the surface is curved as a cylinder, that in the case of a bird is pretty much a good approximation of our target mesh.

This system was used in production with great results, but the concept of separated polygon groups gave many problems.

It was time expensive to set up a mesh for hosting feathers, each cluster had its own control-feather set and it was quite difficult to maintain continuity along the seams, so as it often happens, once you’ve done the job, you find a better way to do it.

An alternative approach.

It is possible to get rid of the UV approach by sacrificing just a bit of control over the feathers’ distribution and bit of precision for the distance calculation between feathers and control-feathers.

In short, the instantiation process would be done on a per-polygon basis by virtually subdividing each polygon for a user defined N number of times, a weight map could scale in proportion this N value to give better control over the density.

To calculate the distance of a feather to its control-feathers we have to get rid of those controls that are too far and on the opposite side of the mesh.

For each feather we have to find the distance to each control-feather and set a tolerance range so that only those controls inside that range will be used for the interpolation, but still those controls on the opposite side of the mesh could be inside our tolerance range, so to get rid of them we have to play a bit around with the dot product and see what’s the angle between the feather and the controls, at this point we can interpolate even without the UV space being sure that only the right controls are going to be used.

Download some shots from the short movie “Tricky & Ducks”.

I’d like to thank Paolo Martella and Daniele Niero, who worked with me to develop this system.
Bird model by Daniele Niero.

### 15 Responses to “Prototyping a simple feather simulator”

1. This is really great work! Thanks for sharing. I have four characters in my film that need feathers, or something like feathers, and this could be a good solution. I was going to try the hair simulator, but I like the visual aesthetic of this approach. Nice shots from “Tricky and Ducks”. Is it possible to display more specific details of this process?

2. DaveMcD says:

Nice solution there. I recently did a much more brute force approach to doing feathers in 3dsMax. It involved painting on feathers to get the correct alignment then writing a script that would cast a ray from each feather to the mesh and attach it to the intersected face. It worked but was pretty slow. If only I”d thought of aligning automatically via the UV”s and orienting based on control feathers….

Makes me think there should be a way to comb fur in XSI based on UV direction…. it would be a much easier way to do that

3. KostasMavromatis says:

A great fresh approach on animating feathers,i was so shocked by the test video,i hate sounding heretic,but a tutorial is more than wellcome!
Cheers!

4. KIN says:

thank

5. Kiaran says:

Brilliant stuff. I”ve been tickling my brain about feather solutions and this one certainly seems to be the best solution I”ve seen.

6. This is a very nice tutorial, all compliments.

I will join from now here.

greets

7. Wajdy Farhan says:

I am working on a similar system on maya . And I have a couple of questions:

1. Did you make the rotation of the feathers only depend on the controllers or on the faces normal too?
2. Is the motion of the feathers real time (while you”re moving the controller) or do you have to playblast?
3. Is every feather connected with a different expression node ?

Thank you a lot

8. Jon V. says:

Hey, this is some really cool stuff. Wajdy I am also using Maya and thinking about trying to create a feather system and was wondering if you would not mind sharing what you had so far.

9. Glenn says:

Dude this is awesome. Other sites or tutes on feather rendering are obscure. Thanks to you my giant turkey will rule with his new fluffy suit! Its also cool for making leafy hoola skirts for pigmys :)

Beers and 3D modelling, what else is there?

10. chul min says:

I have been working for korea CG production.
lately I”m making the feathered wings of bird as a 3D charactor. then this feathers should not get tangled.

I”m in difficlties for making the feathers because I don”t know how can use script exectly.
During I serched examples of the feathered wings, I found a excellent script that can solve my problems from ur XSI blog, that”s ”Simple feder” simulator.

But I know only a few script, i can”t use actively this script.
I need ur help how can i use this script easily to my work.

11. Hi Chul Min,
I”m sorry, but I don”t know how to help you : )

To you and all the other people who writes me asking how to do a feather simulator with a limited scripting knowledge, here is what I can tell you:

When I started that system, my scripting and math knowledge was very limited as well.
A proper programmer was hired to teach me the stuff I needed to develop the simulator.
Working with him I”ve learned so many things and I”m not affraid to say, I could have never done that stuff without his help.
My advice to you guys is to just start doing it! you”ll learn what you need to learn along the way : )

12. Anonymous says:

insurance car quote…

13. Rajiv says:

I remember seeing something like this at an XSI 6.5 event in NY last year, it was done by one of the Korean studios for a feature film.. The film has shots in the XSI reel (00:56 sec) but not listed (http://softimage.com/products/xsi/gallery/default.aspx) I was wondering what it was called?

14. Stupidvampire says:

If only someone had done something similar for maya ;_;