Hair simulation with a mass-spring system (punk’s not dead!)

Hair rendering and simulation can be challenging, especially in real-time. There are many sophisticated algorithms for it (based onย particle systems, hair mesh simulation, mass-spring systems and more) that can give very good results. But in this post, I will try to explain a simple and somehow hacky approach I followed in my first attempt to simulate hair (the mohawk hair of the video below) using a mass-spring system.

 

The code can be found here: https://github.com/hikiko/mohawk

Continue reading Hair simulation with a mass-spring system (punk’s not dead!)

Morphing test

So far, I hadn’t try to morph 3D objects to other 3D objects and I thought it’s something tricky to do. Today, I realized how simple and easy it is when I wrote this small test:

If you carefully choose the 3D models to have the same number of polygons, and to meet a few topological requirements, then you only need to interpolate the values of the meshes’ vectors, normals (and materials, textures, whatever you need) and draw the intermediate mesh every time. As interpolation parameter you can choose the values of a positive function that varies from 0 to 1 and backwards (I used (sin(msecs/factor) + 1)/2) to have that continuously changing effect. And that’s all!

The test is here: https://bitbucket.org/eleni-hikiko/morphing and it includes an obj with a scene with 3 meshes that meet the morphing requirementsย  (I only used the first two meshes here).

New Stellarium features

As part of the ESA Summer of Code in Space 2011 I improved Stellarium planet rendering (here is a previous post on the project).

More specifically, the following features were added:

1) Procedural perlin noise (fBm) clouds.
2) Bump mapping with normal maps.

The improved rendering code is implemented with GLSL shaders, and requires shader model 3.0 capable graphics hardware.

The following video that shows the effects… (It looks slow because of bad recording, the effects don’t have any impact on Stellarium performance). But you can see the bump mapping and the clouds! ๐Ÿ™‚

Many thanks to the Stellarium development team and the ESA SOCIS organization team for giving me the opportunity to participate in the project! ๐Ÿ™‚