So that's working. It can also display a series of images, you just give it a list of textures and a period over which to switch them and off it goes.
And it's smoooth. Why so smooth? Because I do the switching on the rendering thread. And that makes it complex. For me, anyway, not you.
Here's the example code.
// Utility routine to add a texture to the scene
- (SimpleIdentity)makeTexture:(NSString *)name
UIImage *image = [UIImage imageNamed:name];
Texture *theTexture = new Texture(image);
// Add a Marker over Paris
// Description of the marker
NSDictionary *markerDesc =
// Set up a texture for the marker
SimpleIdentity parisArmsTexId = [self makeTexture:@"200px-Grandes_Armes_de_Paris"];
SimpleIdentity parisFlagTexID = [self makeTexture:@"200px-Flag_of_Paris"];
SimpleIdentity frenchArmsTexID = [self makeTexture:@"175px-Armoiries_republique_francaise"];
SimpleIdentity frenchFlagTexID = [self makeTexture:@"320px-Flag_of_France"];
// Set up the marker
WGMarker *parisMarker = [[[WGMarker alloc] init] autorelease];
// Stick it right on top of Paris
GeoCoord paris = GeoCoord::CoordFromDegrees(2.350833, 48.856667);
// We're going to give it four different textures that rotate over a period of 10s
parisMarker.period = 10.0;
// These values are relative to the globe, which has a radius of 1.0
parisMarker.width = 0.01; parisMarker.height = 0.01;
// And add the marker
[self.markerLayer addMarker:parisMarker desc:markerDesc];
That's totally self explanatory. Definitely.
The only thing I don't like about this is how the textures work. That's one texture per image, which means one Drawable per state and that kinda sucks. I may need to expand the TextureAtlas support a bit to help out with this case.
But this is pretty much how it'll work for the WhirlyGlobe 1.2 release.
These are never going to be full desktop graphics particle systems or non-real time animation particle systems. They'll be pretty simple.
Particle System Code
Here's what the code looks like.
// Add a particle system
NSDictionary *partDesc =
// Add a single particle system
ParticleSystem *particleSystem = [[[ParticleSystem alloc] init] autorelease];
GeoCoord washDc = GeoCoord::CoordFromDegrees(-77.036667,38.895111);
[self.particleSystemLayer addParticleSystem:particleSystem desc:partDesc];
Okay, I'm skipping a step, like where I create the particle system layer. Trust me, you'll just copy my example for that anyway. It's easy. This is the interesting bit.
Again, pretty standard stuff. You give it some parameters to control its size, some functions of the particles, a location, and you're off. I'll add a few more parameters to control the distribution and color and maybe another type or two if I'm feeling saucy. Otherwise, that's about how it'll look for 1.2.