Solved

Translation in object space

Posted on 2004-03-26
10
202 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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