Notifications
Clear all

[Closed] attachment offsets and coordinate systems

I am working on a tool to export the item attachment data for our game.
I am doing this in max script with transform matrix 3 objects.

Essentially , I need to:

1.) get the item’s’ offset position and rotation from its parent bone
2.)convert the results form Max’s Z up right handed coordinates to the engine’s y-up left handed coords.

I was able to find a z-up to y-up matrix in an old thread but I am not sure about the right to left hand thing.

so far I have


--caluculate the offset
zUpOffset=obj.transform*(inverse bone.transform)

--convert the matix form z up to y up
z2yUpMatrix=matrix3[1,0,0][0,0,1][0,-1,0][0,0,0]
yUpOffset=zUpOffset*z2yUpMatrix


--get Pos and Rot values out of xForm

offsetPos=offsetXform.translationpart
offsetRot=offsetXform.rotationpart as Eulerangles

xPos=offsetPos.x 
yPos=offsetPos.z 
zPos=offsetPos.y
	
xRot=offsetRot.x
yRot=offsetRot.y
zRot=offsetRot.z


the results are not working however.
I suspect it’s the missing Right hand to Left hand bit, but I’m not certain.