Friday, February 20, 2009

The Flies Are Swarming

Today's usual meeting at ACCAD was very fruitful.  First and foremost, I was able to get my procedural animation of swarming flies completed.  Here's a video:
As you can see, there are 10 spheres randomly distributed around a locator, and they randomly fly around while remaining within a certain radius of that locator.  I keyframed the locator to move around a bit so that you can see the flies really are attracted to it.  Michael helped me with tweaking a few of the randomness parameters and coefficients, but the basic idea is as described in my previous post.  

The other major task I began today is the modeling of the "world outside" of our main scene.  We will be making use of a second house for part of our animation, and we'd also like to have a
simple neighborhood with some paint effects like grass and trees.  The external shape of this house is the same as our main house, but I applied some 2D textures for aluminum siding and roof shingles, based on images I found online.



Wednesday, February 18, 2009

Progress Report Presentation #2

On Monday we gave our second project progress report in class.  Aside from an issue connecting my laptop to the projector (that's what we get for volunteering to go first...) I think it went quite well.  We demonstrated some new progress that we've made, all of which is detailed on our project website.

I'm in charge of maintaining the project website for our group.  I'm using iWeb, which makes things relatively nice.  Our only real problem along these lines has been some issues with video file formats across multiple platforms/codecs.  This week we collectively decided to only use Quicktime format (.mov) from now on, because it seems to work the best for everybody.

In terms of technical progress, I'm still working on the fly swarming script.  I have a MEL script that creates a locator and randomly distributes some "flies" around it, and an animation expression that controls their basic physics (updates acceleration based on the constraints mentioned in my previous post, updates velocity according to this acceleration, updates position based on this updated velocity).  It isn't producing good-looking results just yet (I'll post a video as soon as it is), but my only real problem along these lines has been the actual syntax of the language.  

I'm familiar with several scripting languages, ranging from the basics like Perl and VBScript to software-specific behemoths like Matlab and LotusScript...but I've never encountered a scripting language as unpredictable as Maya's.  It's still essentially a guessing game for me whether or not an expression needs to be backquoted, or whether or not it is safe to use the return value of some function inside another command, etc.  

One quirk that I had to overcome is that, unlike most other scripting languages, you don't interact with MEL in a REPL.  It doesn't really "print" the results of your commands unless you wrap everything in a "print" command.  This is crucial for debugging.  Much of my coding time thus far has been spent climbing such cliffs in the learning curve.  Thankfully, I now feel relatively proficient and hope to do some more procedural tasks in the near future.

Other upcoming work I'm planning on doing includes adding some 2D textures to the walls of our house and also refining the model for our car.  

Saturday, February 7, 2009

AACAD Meeting Summary


Yesterday all of our group members met at AACAD to work on our project.  After our in-class group-work session on Wednesday, we agreed upon a division-of-labor and a plan of attack for some upcoming animation and modeling tasks.  My responsibilities were to continue working on the car model, model a chandelier for our house's living room, and begin procedural animation of a small swarm of flies.

At AACAD, I first worked on modeling a chandelier.  I originally thought this would be an interesting scripting task...the idea would be to write a script that placed cylinders of varying sizes in a regular pattern along the circumferences of some concentric circles.  Turns out that Maya's "Duplicate Special" option really makes the scripting unnecessary.  

The swarm of flies will be inspired by some various "classic" flocking algorithms.  The basic idea is to first create a locator, then distribute some spheres (placeholders for more detailed models) in a uniform random distribution around that locator, assign them each some random initial velocity, and then update each in accordance with the following rules:

1) If any sphere is beyond some threshold distance away from the locator, then give it acceleration directly towards the locator.

2) If any two spheres are "too close" to each other, according to some threshold, then give them acceleration away from each other.

3) Introduce small random perturbation to the accelerations.

4) Update the velocity in accordance with the acceleration.

5) Update the position in accordance with the velocity.  Repeat.

This script is not yet complete, but its development is well underway and I hope to finalize it in the upcoming week.