• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
  • entries
    13
  • comments
    15
  • views
    29169

Animating a Skeleton, part 1

Sign in to follow this  
Followers 0
MilchoPenchev

837 views

Ahem, so my first entry on what's essentially going to be my long and tedious work towards a small custom game engine.

The first few entries are just going to be me, playing catchup on what I've done so far.

The first thing I've decided to try to do, is animate a human character. For this purpose I created my own custom human skeleton. I used the measurements from DaVinci's Vitruvian Man to obtain measurements and positioning of each bone. In case you don't know it, the Vitruvian Man is this drawing, of a supposedly ideal man:

300px-Uomo_Vitruviano.jpg




The initial skeleton design was done in Google's free program, sketchup, where I traced over the general bone structure in that drawing:

skeletonofman.jpg

After a somewhat painful manual entry of the positions, lengths, and orientations, I had the base for creating a set of bones. However, a set of bones isn't enough for proper skeleton animation.

Each bone could have 1 parent (potentially NULL) and many children. The next step is figuring out how to represent the rotations. I wanted to be able to access a bone's position and end position without recursive calls. I also wanted rotations to be relative, and to have the ability to move a point "with" the bone. The last requirement was because I know that I would have to animate a model based on that skeleton.

To solve all this, I wrote a class, called Axes. Axes contained 3 vectors, which started off as the XYZ world space vectors. I also wrote several functions for rotation around the Axes in the class, all of which eventually came down to 1 function: rotation of a point around an arbitrary axis.

The rotation of a point around an arbitrary axis, in brief, is done like so:

1. Translate your axis to pass through the origin. In my case, I always assumed my axis was at the origin, though it was actually at the bone's Starting position. To properly rotate then, all you have to do is perform a move of -sp, where sp is a vector representing the bone's starting position.

2. Align your axis with one of the three world axes (X- Y- or Z-) This essentially means undoing the rotation applied to that axis.

3. Perform your desired rotation, now around the world axis with which you aligned.

4. Undo step 2. (apply the rotation of the bone)

5. Undo step 1. (apply the translation to the bone's position)

That was it. After each bone was rotated then, all I had to do is update it's child bones with their new position (the current bone's end position) and their delta-rotation matrix (however much the bone was rotated)

The final result was this:

firstskeleton.jpg

The actual work too a little less than 2 weeks - 4 days or so to write all the necessary code, and about another week to get rid of all the bugs.

All the graphics are drawn with OpenGL, and I didn't quite start from scratch, I had a somewhat ready framework from a previous project.

The next step was to animate the skeleton.


0
Sign in to follow this  
Followers 0


0 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