butler1970 Member
Joined: 08 Feb 2011 Posts: 7
|
Posted: Mon Feb 14, 2011 4:33 pm Post subject: RotateAboutPoint |
|
|
One of the challenges I encountered while integrating the skeleton / joint data contained within a DXS file and the bone transform construct within XNA was that all of the primitives as described within a single DXS scene file are represented as absolute values from the model origin.
Since there is a local coordinate space transformation associated to each bone in a XNA composite model I had considered several approaches to translating the data from the native DXS format to a form which would be easier to manipulate within an XNA skeleton / bone framework. The methods considered included processing the model with an importer/processor to translate the positions to points relative to the joint to which the privitive was bound.
Ultimately I devised a much simpler mechanism which works with either absolute or relative mesh point collections that allows me to rotate any mesh (i.e. local coordinate system) about an arbitrary point in space simply by knowing the point's coordinates in a parent coordinate space and the rotation vector represented as a quaternion. Using the unique property of quaternions to be conjugated, I'm able to mechanically animate skeleton frameworks described by DeleD as well as other 3D modelling systems. I've successfully demonstrated this capability with DXS and FBX files which work equally well.
Although the source for this method is already available in my BetaSDK, I just thought I'd share this particularly useful method with the DeleD CE community in case it could be useful for future development on the DeleD CE project.
I don't know if this solution is actually an innovation or if it's just my interpretation of an existing algorithm, but in several days of researching the problem I found only a reference to a purely matrix oriented transformation wich requires 6-8 matrix multiplications. My solution however, using a quaternion only requires 2 matrix operations (a rotation matrix and a translation matrix).
Check it out and let me know what you think.
http://sites.google.com/site/helloworldbutler1970/welcome/betasdk/rotateaboutpoint |
|