Pages

Saturday, July 21, 2012

Jellyfish Modeling Update

Here's the wire sim for the tentacles:


I've also managed to model the frills (thanks to Travis!!!) and revamped my animation solution for the jellyfish propulsion so it works on the subdivided mesh now instead of the curve. Up till now, I've avoided switching to using the subdivided mesh to apply the deformation. However, now I needed a way to copy the tentacles to the bottommost points of the frills created after the mesh has been subdivided.

Speaking of the frills, this was done by using the UV coordinates. For some reason, Houdini's UVs are vectors with 3 components.  But anyway, one of the float components go from 0-1 around the y-axis of the head. Just what we need! What's left is to multiply the value by a certain number and mod it by 1. This way, if it's multiplied by 8 and the modulus is used, it goes from 0-1 8 times, giving us 8 segments. And this is how we can control the number of segments. However, there's one more thing to do.


 The modulus currently gives us a 0-1 range before jumping back to 0 immediately. That's not what we need. On top of that, the edges are too sharp. To solve this, a sine function is used after multiplying by pi, effectively fitting the range from 0-1 to 0-pi. This then gives us a smooth blend from 0 -1 -0.


We then mask the effect with another float component of the UVs that go from top to bottom.

Final Result


On to the problem of the animation. I knew that having the animation occur after the subdivided mesh was a good idea, but I just couldn't figure out how. And apparently it was quite easy. Again thanks to Travis!
Here's what it looks like after plugging my VOP SOP after the subdivided mesh.

To achieve this, center position of the mesh is found by averaging the min and max of the bounding box. We then find the vector from the current point to said point and we now have the direction we want the sine wave to displace in. This might actually be more accurate than my previous solution of displacing along the x-axis. It's that simple. For the rest of the mesh to rotate around the topmost point is slightly more complicated. We find the inverse of the vector position of the top (pivot) point and cross it with a vector from the pivot point to the current point. This gives us the axis of rotation for the rotate node to work. Not that much more complicated. Also, the cross product doesn't like unnormalised vectors.
Annnd here's the end result!

We went for dinner with Steven and his wife again! This time at Simpang Asia, an Indonesian restaurant. Annnd the food was really good!

No comments:

Post a Comment