Jump to content

  • Log In with Google      Sign In   
  • Create Account


Rotating a 3D skeleton


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 w00tguy123   Members   -  Reputation: 107

Like
0Likes
Like

Posted 23 May 2012 - 07:49 PM

The models used in the game, Half-Life, have the Y and Z axes swapped. In my program, there is no swapping, so these models appear sideways. If I go through the .smd file and swap all Y coordinates with Z coordinates, the vertices are displayed correctly (not sideways).

If I do this with the Joints of the skeleton for animation, then it turns into a jumbled mess. I don't understand how this could happen. I figure that it's because the Joints are defined with local coordinates and orientations (relative to parent Joints), but I don't understand why that would be a problem.

Is it possible to rotate the skeletal animations without causing severe distortion? Maybe if I converted each Joint to world coordinates/orientations and then swapped the axes? It's a pain to always have to rotate the model before displaying it, and figuring out where each vertex really is (for collison) requires extra operations.

Sponsor:

#2 jefferytitan   Crossbones+   -  Reputation: 1924

Like
0Likes
Like

Posted 23 May 2012 - 08:28 PM

Could you explain in which way it becomes a jumbled mess? Are joints bending the wrong way, are bones becoming disconnected from their parents, is vertex skinning working incorrectly? It may be some weird world vs local thing, or you may be applying to swap to co-ordinates but not to transformation matrices.

#3 w00tguy123   Members   -  Reputation: 107

Like
1Likes
Like

Posted 23 May 2012 - 08:40 PM

It's just like me to solve the problem as soon as I ask for help... It turns out that swapping the axes for the local coordiantes was the problem. What I did was work on the skeleton with the incorrect axes and then swapped them only after the world coordinates were calculated. Now the vertices attach and display correctly and no rotations are necessary for displaying the model.

Before, the bones were rotated very oddly, causing the mesh to look pretty funny and sometimes scary looking. I'm still curious why swapping the axes at the local level causes so much weirdness, but I don't mind being dumb and happy for now.

Edited by w00tguy123, 23 May 2012 - 08:40 PM.


#4 sevenfold1   Members   -  Reputation: 123

Like
0Likes
Like

Posted 31 May 2012 - 01:29 PM

It's just like me to solve the problem as soon as I ask for help... It turns out that swapping the axes for the local coordiantes was the problem. What I did was work on the skeleton with the incorrect axes and then swapped them only after the world coordinates were calculated. Now the vertices attach and display correctly and no rotations are necessary for displaying the model.

Before, the bones were rotated very oddly, causing the mesh to look pretty funny and sometimes scary looking. I'm still curious why swapping the axes at the local level causes so much weirdness, but I don't mind being dumb and happy for now.


Swapping local coordinates for joints doesn't work because they don't exist in same modelspace.
That's why you have to swap world coordinates, as they do exist in the same modelspace.
Or perhaps you can just swap the root joints.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS