• 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.
Sign in to follow this  
Followers 0
Slash-X

Skeletal Animation - Visualizing a Bone

1 post in this topic

Hello everyone! For almost two months I've been trying to solve a small problem. So the situation is this, I have a hierarchy of "joints", each of them representing a local coordinate system, relative to one another (see Figure 1). Every joint has a final (global) and a relative (local) transformation matrices. The line between two joints represents a "bone" (Figure 1 - d). I need to visualize a bone using a 3-D object (for example a box (Figure 2)). The bone object needs to be positionned between the parent and child joints with correct rotation angle (Figure 3). The question is, how can I calculate the transformation matrix for the bone object with the data given? Any ideas are welcome! Thanks in advance! Scheme
0

Share this post


Link to post
Share on other sites
Here's something that I'm using. Granted, I don't have actual bone objects, but for each joint, I simply have a pointer to the parent and a list of children, and the bones are drawn between them.

This was given to me by a guy named "someusername." If you're out there, thanks.


void drawBone( const util::CVector3d& p1, const util::CVector3d& p2, float radius,
const video::CColor& c = video::CColor(0.0f,0.0f,0.0f), float width=1.0f ) const
{
m_boneDraw.generatePoints(p1.distanceBetween(p2), width, radius);

util::CVector3d localZ( p2 - p1 );
localZ.normalize(); // the direction from the start point to end point

// assuming that the up vector for the world is (0,1,0)
util::CVector3d localX;
localX = localZ.crossProduct( util::CVector3d(0,1,0) );

// find the local y axis
util::CVector3d localY;
localY = localX.crossProduct( localZ );

// create the matrix
// http://www.gamedev.net/community/forums/viewreply.asp?ID=2391549
util::CMatrix m;

// normalize, just in case
localX.normalize();
localY.normalize();
localZ.normalize();

m(0,0) = localX.x; m(1,0) = localY.x; m(2,0) = localZ.x;
m(0,1) = localX.y; m(1,1) = localY.y; m(2,1) = localZ.y;
m(0,2) = localX.z; m(1,2) = localY.z; m(2,2) = localZ.z;

m(3,0) = p1.x; m(3,1) = p1.y; m(3,2) = p1.z;


// transform so we have the right rotation, etc
m_sceneManager->getVideoDriver()->pushMatrix();
m_sceneManager->getVideoDriver()->transform(video::WORLD_MATRIX, m);

// draw the bone
m_boneDraw.render(m_sceneManager, c);

// done with drawing bone
m_sceneManager->getVideoDriver()->popMatrix();
}




It does use all my object types, but it shouldn't really be that hard to figure out.
1

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0