Saturday, June 4, 2011

Its a bird, it's a plane, it's... a tetropter (tetropters IV)

The nice thing about computer animation is that it allows you to actually see thing that you could only dimly imagine beforehand. One image that has been sitting in my mind for many years is the following: you see a dusty plain, and a herd of handlebars (Latifrons imperator) come galloping in from the right hand side of the image in the distance, and then wheel towards the viewer as if they were performing a well-rehearsed cavalry manoeuvre. I can almost hear them too...

Unfortunately I do not see anyone spending a small fortune to make this a reality, so I will have to content myself with what I can do myself, with my PC, at home. Some visions therefore remain locked in my head, but a few more modest ones do find their way out. Making tetropter flight visible is something I thought I worked on for quite some time; today I can show you a near-final result. Near final, because nothing creative is ever truly finished. In this case, the camera should move, the animals should vibrate in rhythm with the wing beats, there should be more details, there should be motion blur, and there absolutely has to be blurring to mimic a limited depth of field and through that create the illusion of small size.

Still, what I can show you is the principle of the thing. It's not a movie, but an illustration of wing movement in slow motion. Tetropters have been described several times on my blog. A summary of the tasks involved in animating them is found here, and entries on their design and wing movement patterns are here, here and here. In short, they are radial flying animals, whose four wings can do a 'double clap and fling', invented by yours truly, and later also by other people in the flying robot business. By the way, the movement of tetropter wings is not all that different from the complex way in which Earth insects move their wings.



This is an animated scheme to show how it all works: the wings are planes that are warped as they cycle through their movement cycle, so their shape is different depending on were they are. Where they are is governed by rotations along the x-, y- and z-axes, and all these paths can be altered and edited. The Matlab programs that do all this in the end write lots of 'obj' files: those are files describing 3D shapes; one is produced for each wing for each frame of the cycle (there are usually 120 frames in a cycle). A script written in Python then loads in a scene containing a body shape without wings in Vue Infinite, adds the appropriate wings per frame and stores the images. These are then used to form an animation, and those are what you see here.
The 3D shapes of the wings consist of 1600 small triangles, which is more than enough to show supple movement. As they are they do not look like wings at all, but there is another trick to take care of that.



The trick in question is to add transparency and colour. The transparency mainly makes unintersting parts invisible, but it is also useful to make the wing itself partly transparent as here. To create the fly-like animal above (Bombilator musca) I used an image of a real insect wing found on the internet, and used that to create a transparency mask. All of a sudden, the boring rectangular 'wings' produced by the Matlab program take on a biological appearance. Please do not look too closely at the body of the animal: it is a simple shape cobbled together in Vue. As you can see the animal has four legs and two sets of eyes: upper ones, presumably to scan for danger, and lower ones, near the food gathering end at the bottom.



A bit of colour makes a lot of difference, so here is a farfalloid, resembling a butterfly in overall appearance (Farfallapter caeruleus). Indeed, I stole its wings from a real Earth butterfly, albeit with some warping and editing. Mind you, quite a bit is lost in the conversion process.

Click to enlarge; copyright Gert van Dijk

To show that, here is a still of the Farfallapter; better, isn't it? Then again, you can see how crudely the wing is linked with the body...

I guess I now no longer have any excuse to put off work on the 'Flying with...' page. It is probably also time to redesign the site. I have already looked at that, but the days where you could learn HTML in two evenings seem to have gone for good.

No comments:

Post a Comment