Tuesday, July 29, 2008

Background Video??


so after much debate- maybe we can use video for our background.
As we are running to a tight deadline, i.e has to be ready for curator of Taubmans Museum to see August 7 maybe it is our only option at this stage of the game.
It looks nice at full res.
cheers
s

Monday, July 28, 2008

New Everything




Everything is different tonight. The models are a new reduced poly count version, though the textures have been revamped to compensate for that. Simone has worked wonders with the modeling in spite of neither of us knowing the limitations of the work space when we started.

So, where do that leave us? In a lot better shape then last week, actually. By cutting the polygon count by more then half, we've gained a lot of speed. The Boids weigh in under 500 polys each, which is still pretty massive, but they are flying.

The background needs . . . something. The physical shape of the display leads me to think they are swimming, not flying. So, an aqua tinted fog would be ideal. Using Papervision's Fog Filter has proven more difficult then we had hopped. For some reason, it just 'dies'. No trace output, no readable error message. It just stalls, pegging the CPU at 100% and over 1 gig of ram used. Not good at all. I suspect it's because of the large polygon count, as most of the demos I've seen are pretty simple. Instead, we are going to have the image mirror the display. The next detail to be added is a tunnel that the boids are living in. Hopefully, the background will provide some depth to the display, and give some better visual ques to the viewer. The lighting illusion the textures give should help as well.

After that, all that's left is the motion tracking and the sound track. Thankfully, that code is what I spent last term working on, so there is a lot of copy/paste action to be done.

Wednesday, July 23, 2008

bots with eyes and skin



A render of a low poly count model (around 400 triangles) but the normals need to be fixed so that it is a bit smoother. Hopefully response time will be faster with this model -
cheers
s

Sunday, July 20, 2008

Window into the dome




This is getting closer and closer to finished. On my computer, this is pretty jumpy, the Boids tend to jump from place to place. Right now, I'm working without the use of tweens, so hopefully adding those in will smooth out some of the jitters.

Through Friday, I had tried getting several different inheritance patterns working in Flash. I had intended the Main file to extend PaperBase, and import the Flock, the Camera, and the Sound classes that I was writing separately. While this may for for the Camera and Sound objects, it was not going well for the Flock. Making Flock inherit from Sprite worked fine as long as I was working with 2D sprites for the flock, but it doesn't work when using 3D Collada objects, as I expected. However, making Flock inherit from DisplayObject3D just wouldn't work. My guess is that it should, and if I had more time I might go through and try it again just to find what I screwed up, but for now, I moved EVERYTHING into the Main class. All the work I did Wednesday ~ Friday cleaning up the code made it easier, but I still feel that I wasted time cleaning it up.


Also added a timer that delays the start of the flash movie, currently it only delays it for 1 second, which you won't notice with the load time of both the movie and the objects. Later, though, this will allow the movie to auto calibrate it's camera to the display screen, meaning less chance of randomizing the Boid's goal point should the camera get knocked around. It will also give the piece a bit of time to load and set up the sound.


Next on the list, make the Boids swim further away if the mouse isn't moved. Currently I have their vertical distance bounded, as they have this bad tendency to either swim very far back or up 'through' the camera. While they have wings, I do not think they are that kind of Flying Fish.

Friday, July 18, 2008

Another day, another revision



Tonight's main revision is the reduction of the color pallets. The bots have gotten some actual eyes, and had their bodies simplified a lot to streamline both download times and ease the stress on the Papervision engine.

The eyes still have a few polygons showing up in places that they shouldn't. It's small, though, so I'm going to quit worrying with it and just get these critters swimming.

Monday, July 14, 2008

Closeup on a cute couple

Warning: This may take a while to load. The models are over half a meg combined, and parsing them takes a little bit of time when the flash file gets loaded.


Now, as you can see, we finally have textures on the models. Simone and I finally gave up on creating textures in Maya and trying to save them in Collada format, and just textured the Boids inside Papervision. Would you believe that it's as simple as
var warmBody:PhongMaterial;
var warmWings:PhongMaterial;
var warmGlow:PhongMaterial;

warmBody = new PhongMaterial(light, 0xCCCCCC, 0x886600, 64);
warmWings = new PhongMaterial(light, 0xCCCCCC, 0xCC7700, 32);
warmGlow = new PhongMaterial(light, 0xFFFFFF, 0x444466, 0);

var WarmList:MaterialsList = new MaterialsList();
WarmList.addMaterial(warmBody, "body");
WarmList.addMaterial(warmWings, "wings");
WarmList.addMaterial(warmGlow, "glow");

warmFish = new Collada("bot1.dae", WarmList);

The whole mess of trying to load textures from the Collada file just got to be too much of a hassle.

The models and textures both need a little more fine tuning. You can see some static where polygons overlap and the renderer has to pick which one to draw. Boolean difference operations should fix all of those. The textures just need a little more tuning, maybe we'll try out gouraud shading for the next batch.

Also of interest, tonights flash file is actually built with FlashDevelop. My copy of Flash is about to expire, being the trial version, and I wanted to make sure I could rebuild everything with the free IDE and SDK. While I'll miss the default tweener, I think I can migrate everything else to the completely free system.

Saturday, July 12, 2008

All is Normal . . .

and that's the problem.

The Boids are jumping just a bit too much for my liking, but it's taken me till now to figure out why. There is a hint in the title, but first, the most recent flock of Boids. Move the mouse, they should follow. But they do have minds of their own.



Why are they jumping like manic goldfish when they see a food jar? Well, to make the Boids flock, we have to figure out how to move them and to where. So, I create a somewhat weighted list of vectors for each Boid, to figure out a direction to travel that keeps it near the most friends. Each other Boid that it wants to be near gets the vector normalized to a unit vector, just 1 pixel long according to Flash. When it gets too near another Boid, the vector gets longer the other direction, to keep them apart.

So, when the Boids get too clustered, those 'panic' vectors really outweigh any sane value keeping the flock together. Working in 3 dimensions will help, because the Z value will let them move in ways that just don't appear here, and I hope will disguise the jumpiness. First option is to always re-check my math to see what I can change safely, to better weight the various vectors, because 7 units towards the flock gets swamped by a large value like 20 away.

Numbers above represent actual values of the vector lengths. 1 unit vector towards the flock for each other Boid it wants to join, but when one is too close, the crash warning tells it to swim the opposite direction very quickly, and 20 seems to be the value that keeps showing up.

Last resort, is to give these Boids something to quell their panicy flights away from the flock. I've looked at tuning the numbers to keep them sitting still when they don't need to move far, or just slowing their movements down to make the jumping less erratic. As always, if math fails, try something unusual.

Vector Mathmatics

After a while, working with 3 dimensional math, you get into the habit of just thinking in vectors. This only becomes a problem when, like me, you constantly confuse addition and subtractions.

Below is the simplest flocking I have available. 10 Boids are created and placed randomly across the screen, and they then decide to huddle together. The math is being done in 3 dimensions, though the Z direction is commented out because Flash Sprites don't have a .z property.


I'm tempted to make the Z value change the sphere's size, just to see what would happen. First, though, I need to get these little Boids to follow something, say, a mouse pointer.

Monday, July 7, 2008

monday monday

We still have not solved the texture problem between maya and papervision even after baking the textures.
However I feel confident that tomorrow we will get the answers we seek from the Great OZ (Dane)
Meanwhile Sabrina has worked on 2D flocking objects - very nice!
Her next objective is to get the updated 3D objects to flock.
more soon.
simpat

Sunday, July 6, 2008

Bots in PaperVision3D

Note: When debugging, always assume that the problem you don't know how to fix is what is causing trouble. In this case, it's the Collada files exported by Maya3d. For what ever reason, Papervision3D parses them as invalid. Importing the file into Blender and then exporting back to *.dae works just fine, however.

And now, on with the show.


I haven't applied color or shaders to the object yet, so all we are getting is a wire frame with randomly colored connecting lines. I think the shaders from Maya3D are what is causing the 'invalid file' error, and the next step I'll attempt is using Maya to just bake the textures to image files, and load from those.

Finally, for those who are interested in how this actually works, this demo was constructed from the tutorial located at Papervision2. When the time it takes to get the .dae file corrected is greater then the time it takes to write the code, you know you've found some great resources.

Total time invested in this one demo: 3 hours.
1 hour to find no bugs in Papervision3d while wondering why the file doesn't load.
1 hour to edit .dae files by hand. At least XML is better then a binary file format.
1 hour to install Blender and associated scripts to fix the file, then tune the Flash file for internet distribution.

Thursday, July 3, 2008

Bots flock


Simulated vision of flocking bots

Bot Design


This is the latest bot model
I think it still needs work and I am concerned about how it will operate in papervision in respect to the textures and the model remaining intact.
Any direction here?
regards simone

Wednesday, July 2, 2008

Concept and design




Over the past few months DARC has discussed The Dome concept and design.
We are now in production mode. These are the decisions made yesterday;
1. Papervision 3D will be used to control flocking and interactivity.
2. The interactivity will be driven by audience intervention, i.e by the gesture of hands/arms across the dome or touching the dome.
3. 3D elements will be of high contrast so that they are readable where ever projected on the dome surface.
4. Depth of Field in Papervision will be used to heighten the feeling of dome depth.
5. 3D Bots will be born from reef like structures that float in fog.