Solved

Translation in object space

Posted on 2004-03-26
10
201 Views
Last Modified: 2013-12-26
I have a mesh, divided into subsets, where each subset contains a part of a human body.
Now I want this human to move. For example put the arm in the air.
The rotation axis will be the axis of the entire model and not go through the point around which
the the arm must rotate.

So I wanted to translate the model in object space, so the point around which the arm turns would
be in the origin of the object space.

Is there a way to do this?

EGSOC
0
Comment
Question by:egsoc
  • 4
  • 4
10 Comments
 

Author Comment

by:egsoc
ID: 10686532
What I generaly mean is:
Can I rotate the arm around the shoulder without affecting the other subsets?
0
 
LVL 2

Expert Comment

by:Jas001
ID: 10781196
Well, I thought subsets were usually used to organize geometry by material.  Atleast thats how I use them.

Do your subsets have its own transformation matrix?  If not, you should rethink your subsets and create a hierarchy for rendering your character.  Look in the SDK under "Matrix Stack."

OR...
You can generate all of your animation outside of your application.  Load them up in your buffer and swap them every frame to simulate realtime movement.
0
 

Author Comment

by:egsoc
ID: 10781876
For now I just splitted the mesh into different files and use offsets to put them together.
That works, but it gives a lot of files.
With subsets I could approuch the bodyparts seperatly.

A matrix is calculated for each part, but when those are in subsets, I can't get the rotations right.
0
 
LVL 2

Expert Comment

by:Jas001
ID: 10784846
So, it sounds to me like you do have a transformation matrix for each piece of the body.  If you apply each subsets matrix before rendering that should allow you to keep everything together.

It would look like this:

//APPLY TORSO MATRIX...
  //RENDER TORSO.
    //APPLY UPPERARM MATRIX..
      //RENDER UPPERARM.
        //APPLY LOWERARM MATRIX...
          //RENDER LOWERARM.
         

//so, if you updated the matrix for the upperarm, the lower arm would still be attached appropriately.

Is that what happens with your test?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:egsoc
ID: 10785756
There's what causes my problem: the matrix treates the subset as if it was still the entire mesh. For the translations that's not a problem if I use my offsets, but the rotations are wrong. You see, the axis of the rotation is the axis of the mesh which spreads the differents subsets around.
0
 
LVL 2

Expert Comment

by:Jas001
ID: 10786146
0
 

Author Comment

by:egsoc
ID: 10789477
My main question here would be:
is each bodypart a separate object (mesh/vertexbuffer) or can this be done with subsets?
0
 
LVL 2

Expert Comment

by:Jas001
ID: 10979272
Sorry, I didn't realize no one commented on this...

subsets are used for organizing things by material.  That wouldn't give you the freedom of moving an arm with a matrix.  You need to use a new mesh for each body part.  A few of the DirectX books by Andre LaMothe explain this kind of animation.

Your other option is to output all of your animations from a 3d editor and just swap them.  In which case it would be one mesh.

Happy Programming!
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 11020137
PAQed, with points refunded (125)

GhostMod
Community Support Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now