?
Solved

Translation in object space

Posted on 2004-03-26
10
Medium Priority
?
213 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
9 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

830 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