Jump to content
  • Advertisement
  • entries
  • comments
  • views

Multiple animations

Sign in to follow this  


Multiple animations are now supported. Previously, only the animation stored in the model file was playable, so the character had no idle animation (or pose). Because there was no pose for being "idle", I jury rigged the animation code to zero the bone position/orientation if the player didn't want the character moving. This resulted in the character springing back to its "arms-wide and legs straight" modeling "pose", which looked really awkward as you moved around the room.

Each animation is stored in its own model file, so I created another array of models but called them "animations" instead. I also added an animation ID to each instance. Changing the current animation is as simple as changing the animation ID and resetting the animation time to zero.

Now that I have animations more defined, I created separate "skinned" and "not skinned" vertex shaders. I'm not really looking for a speed increase with this change, just trying to separate things more so that I can understand them easier.

I also started researching lighting. Lighting is somewhat confusing, but one interesting thing I learned was the definition of diffuse and specular colors. Diffuse color is from light which has been partially absorbed by the material, bounced around a bit, and finally shot back out. Specular color is from light which has bounced right off the material. I'm a bit confused as to why each material can have its own specular color, since it should be the color of the light which bounced off, but I'm sure I'll figure that out eventually.

[size="1"]Reposted from http://invisiblegdev.blogspot.com/
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!