Spring/Mass Cameras, Skyboxes

The Spring/Mass Camera is an awesome example of math in action.

If you rigidly fix the camera to the character, it feels like the world moves and he stands still (or gives the feeling like those helmet cams in the Worlds Fartiest Race).

A Spring/Mass Camera lets you get out a little before the camera starts following.  Take note of it next time you play a 3rd person game.

I like to implement it as two spring/masses one for where the camera is, and one for what the camera is looking at.

Check out the video:

http://www.youtube.com/watch?v=7CswJKqefM4

Look at this awesometown math:

float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

#region MATH_ALERT

//well, physic, whatever.

// Calculate spring force

Vector3 stretch = ActualPosition – DesiredPosition;

Vector3 force = -Stiffness * stretch – Damping * Velocity;

// Apply acceleration

Vector3 acceleration = force / Mass;

Velocity = Velocity + (acceleration * elapsed);

// Apply velocity

ActualPosition = ActualPosition + (Velocity * elapsed);

#endregion

Also, I got skyboxes, turning characters and multiple characters going

Skinned Animation

Woots.  I got the skinned model animation tutorial integrated.  It is very hard to find free useable models with baked in animations.   I’m about as far as possible from being able to make my own models/animations, so hopefully someone will come along to help me with that.  I think if i get far enough with the rest of it, someone will.  It looks pretty chump to use the content from the demo.

Walk Hard  <– Check out the sweet video. I forgot that Fraps records the sound from iTunes, but it synched up so perfectly, I had to leave it in.

Now to find someone who wants to work for free <G>

Math is a Means

I’ve started working on a project to use my love/ability for video games and my hatred/love/fear/admiration for math and my guilt-based feeling that I should make the world a better place.

The fundamental thrust is this:  Calculators don’t make learning math a waste of time:  Tons of cool stuff is built on math.  The parts of math that are fun and interesting are exactly the parts a calculator can’t help you with.  Math is taught as “STFU and do long division mechanics” as opposed to Math as a means to an end.  When you see math as the thing that enables you to make mp3s, or Shrek, or Halo, then math sounds pretty worthwhile.

So I’m writing a simple video game w/ pluggable math components (and corresponding teaching aids) to motivate children to learn math (obviously the motivation to learn math is a pre-req to actually learning the mechanics.).

A video game is basically all math.  From simple to crazy-hard.  Furthermore, it is stuffed to the gills with little modular math parts which can be removed, yielding a way less awesome game.  Now we can add the missing parts, using math, and make awesomeness.

I’ve got the framework, procedural terrain (hello math!) going.

Random model illustrates Terrain Clamping, thanks interpolation.

I could build a summer on the math required to get to this point