#If I understood, this is what you want
1 messages ยท Page 1 of 1 (latest)
I think my input is wrong
SCRIPT : vector relativePositionToBone = <522.874084,-400.270599,-3479.268311>
SCRIPT : vector worldPositionFromRelativePosition = <1146.103882,1.778764,3350.357422>
SCRIPT : vector boneMatrix = 0x000000001741C4FC {<-0.885985,0.006159,0.463674>,<-0.046127,0.993782,-0.101339>,<-0.461415,-0.111173,-0.880192>,<0.130304,0.917757,-0.114478>}
SCRIPT : vector position = <1140.009521,1.624070,3350.581543>
My bad, GetBoneMatrix returns model space transform
Do this instead
vector position = /* Some position here */;
vector entityWorldTransform[4];
vector boneTransform[4];
TNodeId boneNodeId;
entity.GetWorldTransform(entityWorldTransform);
entity.GetAnimation().GetBoneMatrix(boneNodeId, boneTransform);
Math3D.MatrixMultiply4(entityWorldTransform, boneTransform, boneTransform);
vector relativePositionToBone = position.InvMultiply4(boneTransform);
vector worldPositionFromRelativePosition = relativePositionToBone.Multiply4(boneTransform);
Thanks!
Works as intended now
That's exactly what I was trying to figure out, how to relate 2 matrixes (char + bone)
Very magical how matrixes work
I can explain you what happens visually even, but tomorrow. Right now I am super sleepy ๐
Okay, that would be awesome to get on the wiki too.
I remmeber arma 3 had a graph for Yaw PItch Roll, where I learned it ๐
Once you understand why it works like that the magic dies 