Solved

Translation in object space

Posted on 2004-03-26
10
200 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

15 Experts available now in Live!

Get 1:1 Help Now