• 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
lucky6969b

Do I have to copy the frames over if I do IK?

9 posts in this topic

Let me first describe my situation. I have an IK solver, which updates the upper arm of the agent. But it finishes updating, the character goes back to the original pose (T-pose). I don't like that to happen, I want the character to stay in that pose after the IK finishes, now I am trying to resolve it, I think the problem lies in that the frame root belongs to the master copy of the mesh, I clone the animation controller for each instance but just making a shallow copy of the skinned mesh. If I also clone the frames over, I don't think it will happen any more. But my question is if I have thousands of such characters, will it consume a lot of computer resources? Could anyone please help me find out the solution?

 

Update:

Could anyone explain how to work this out?

If the animation set has a tick of 500 per second?

And the keyframes lie at 0, 625, 1250, 1875, 2500

And the m_pAnimSet->GetPeriod() returns 5.0f, why does it work out like that?

 

Thanks

Jack

Edited by lucky6969b
0

Share this post


Link to post
Share on other sites


the character goes back to the original pose

 

You haven't provided enough information to help you out with that. And it's not clear what "original pose (T-pose)" is. The bind pose? The pose it was in what the IK started? Just a guess - after the IK has completed you update the animation controller and the animation  controller uses identity matrices for both the offset and animation matrices.

 


If the animation set has a tick of 500 per second?

And the keyframes lie at 0, 625, 1250, 1875, 2500

And the m_pAnimSet->GetPeriod() returns 5.0f, why does it work out like that?

 

The period is the length of time a particular animation takes from beginning to end. The keyframe with a tick count of 2500 is the last frame.

 

2500 ticks / 500 ticks/sec = 5 seconds.

0

Share this post


Link to post
Share on other sites

Hi Buckeye,

The original pose is the T-pose (Bind pose).

However, I run into this problem now, this is quite a priority.

 

These two code snippets return different positions.

D3DXVECTOR3 pos = D3DXVECTOR3(m_pHandBone->CombinedTransformationMatrix._41,m_pHandBone->CombinedTransformationMatrix._42,
            m_pHandBone->CombinedTransformationMatrix._43) + D3DXVECTOR3(0.0f, 3.0f, 3.0f);
D3DXVECTOR3 target(pos.x, pos.y, pos.z);
ApplyArmIK(D3DXVECTOR3(0,0,-1), target);

This returns
-3.594435 15.447500 32.920174 which is right

 

if (m_time <= m_pAnimSet->GetPeriod()) {    
   D3DXVECTOR3 sca, pos;
   D3DXQUATERNION rot;
   m_pAnimSet->GetSRT(m_time, 0, &sca, &rot, &pos);
   D3DXVECTOR3 target(pos.x, pos.y, pos.z);
   ApplyArmIK(D3DXVECTOR3(0, 0, -1), target);

returns 64.055664 124.475006 -0.798272

for the first frame, which is wrong.

I have created an animation set (m_pAnimSet) with keys

Time: 0

Value: _41, _42, _43 of the Combined Transformation of the hand bone

 

Time: 2000

Value: The value at 0 with addition of D3DXVECTOR3(0,3,3) to it.

 

BTW, I have tested 2 sets of keyframes with seemingly no difference to the results of GetSRT();

Hope you can shed some lights on this.

Thanks

Jack

0

Share this post


Link to post
Share on other sites

First, you're highjacking your own post. Bad form. If you have a question not related to the current topic, create a new thread. Just to be clear, this isn't "your" thread - it's for everyone's benefit. The process of keeping discussion within a thread consistent has several advantages:

 

- primarily, it's consistent with forum rules. Review the FAQ.

- for those searching the forums for questions and answers, it keeps information in one place and provides better search results. Your posts aren't just for your own benefit.

- for you, people will see a new topic that they may be able to help you with. They may have looked at your current topic before, and skip it the next day. You'll get better responses by keeping to the topic.

 

With regard to GetSRT: are you, in fact, interested in animation index 0 only? Is that the correct index for what you're trying to do?

 

Commonly, animation sets have an animation for most bones/nodes/frames. If you're targeting a particular bone, do you get an index of 0 when you call GetAnimationIndexByName?

0

Share this post


Link to post
Share on other sites

Short answer: if you only store the model in bind pose, every time you want to render it in any other pose, IK-ed or not, you have to re-pose it as you render (e.g. vertex skinning shader).

 

If you want to render a model in a particular pose without doing this then, yes, you need to make a copy of the model.

 

This is just simple logic, not related to anything specific about what you are doing.

 

Example: shadow mapping requires rendering a model multiple times so (notwithstanding any recent cleverness with API stuff I don't know about) there is a tradeoff between doing the skinning on a bind pose model multiple times to keep the skinning in hardware or doing the skinning CPU side (and paying the memory cost to store it) so you can just render the model multiple times in its current pose without having to repeat the skinning calculations.

 

I've personally found that doing multiple skinning is cheap compared to creating a dynamic vertex buffer, filling it and uploading it to the GPU just to save a few matrix operations per vertex in a shader but YMMV.

Edited by Aardvajk
0

Share this post


Link to post
Share on other sites

IK is a fully solvable instruction over very CPU. You need to supplly those. But in my experience, one cannot separate those data from visible phenomena, as much as it gets. Thisis one unlucky stuff of visulaization.....

0

Share this post


Link to post
Share on other sites

 

I have an IK solver, which updates the upper arm of the agent.

how many elbows?

how many planes of an elbow violation in structure?

an elbow caries a single plane, look at your own.

do you need a procedural behaviour?

ragdoll?

not realy

0

Share this post


Link to post
Share on other sites
In regards to inverse kinematics, which is the only thing I will address in this topic, you have a high-level processing error.
 
There is no reason the model should go back to bind-pose for any reason unless you specifically tell it to do so.  Each joint in the skeleton has a matrix for its current orientation.  This matrix changes when the joint moves as a result of IK, FK (forward kinematics; standard animation), or user-supplied matrix-modifiers (to make a head look at a target for example).
 
The only reason your system would go back to bind-pose after running an animation or performing IK is if you put it into bind-pose each frame and then update from there.
This is not how it works.
 
The proper flow is:
  • Load Model
  • Apply Bind-Pose as Default
  • Update Joint Matrices Based on FK, IK, or Custom Routines
  • Repeat #3 Until Model Unload
 
 
L. Spiro Edited by L. Spiro
0

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