Notifications
Clear all
[Closed] Help Exporting Bipied to Left Handed System
Oct 06, 2005 8:05 am
Hi,
I am trying to write a script to export a biped to a left handed system (directx game engine). I convert the biped into editable mesh objects and write out the meshes negating the ‘z’ component for vertices and normals. This seems to work fine.
The problem comes when exporting the rotation and translation keyframe information. I am using the exposetm helper as follows…
-- write out number of rotation keyframes
writelong outfile (animationrange.end-animationrange.start+1) #unsigned
-- loop through animation frames
for fr=0 to animationrange.end do
(
-- write out rotation keyframe
at time fr
(
writefloat outfile (fr/framerate)
myquat=(eulerangles conthelper.localeulerx conthelper.localeulery conthelper.localeulerz) as quat
writefloat outfile myquat.x
writefloat outfile myquat.y
writefloat outfile myquat.z
writefloat outfile myquat.w
)
)
-- write out number of translation keyframes
writelong outfile (animationrange.end-animationrange.start+1) #unsigned
-- loop through animation frames
for fr=0 to animationrange.end do
(
-- write out translation keyframe
at time fr
(
writefloat outfile (fr/framerate)
writefloat outfile conthelper.localposition.x
writefloat outfile conthelper.localposition.y
writefloat outfile -conthelper.localposition.z
)
)
When I import this into my engine, the rotations of the various pieces of the model are not coming together as they should. Do I need to do any processing on the quaternion similar to what I have done for the vertices to compensate for the right handed system in max?
Thanks!