arbitrarily positioning bones Created 4 years ago2019-07-28 06:21:35 UTC by tschumann tschumann

Created 4 years ago2019-07-28 06:21:35 UTC by tschumann tschumann

Posted 4 years ago2019-07-28 06:21:35 UTC Post #342924
I'm wondering whether it's possible to position a model's bones in any position and I'm thinking it might be?
CStudioModelRenderer on the client does a lot of processing of bone positions to implement animation and m_pbonetransform I think stores the positions of the bones, maybe?
It's declaration is
`float (*m_pbonetransform) [ MAXSTUDIOBONES ][ 3 ][ 4 ]`
So each bone has three axes (x, y and z) but I'm not sure what the array of 4 floats at the end is. I think it's a quaternion but I'm not sure what exactly it represents (I never learned quaternions but my understanding was they were a better way of representing positions than the standard vector + angle representation).
Posted 4 years ago2019-07-28 08:49:51 UTC Post #342927
Okay so I've done a bit more reading but I'm still not sure why a bone rotation (I assume) is stored per axis - unless I'm understanding incorrectly a quaternion can represent a rotation in all axes?
It looks like if I take some angles from user input or whatever I can pass them to AngleQuaternion in studio_util.cpp and overwrite the bone rotation in m_pbonetransform after StudioSaveBones.
You must be logged in to post a response.