Thanks Joojaa for your reply, but alas i cant get it working properly...
I'll explain what i do precisly...
First of all, i am using Bryan Ewert's MATRIXPLAYGROUND script for all the matrix stuff (which i found on this site), so i dont assume anything is wrong with taking the inverse and stuff like that...
To conceptualize it a bit more, consider pCube1 placed at {5,5,5} without any rotation nor scaling applied and pCube2 placed at {-5,-5,-5}. This means that the result, i.e. the coordinates of pCube2 with respects to pCube1's local coordinate frame should be {-10,-10,-10}
I verify this as follows in MEL:
//get worldMatrix of pCube1
float $worldArrayCube1[] = xform -q -m pCube1
;
//convert this float array to a matrix using Ewerts tool
matrix $worldMatrixCube1[4][4] = doubleToMatrix44($worldArrayCube1);
//take the inverse of this matrix
matrix $inverseOfWMCube1[4][4] = inverse($worldMatrixCube1,4);
//get the world matrix of pCube2
float $worldArrayCube2[] = xform -q -m pCube2
;
matrix $worldMatrixCube2[4][4] = doubleToMatrix44($worldArrayCube2);
//now multiply both matrices, i.e. multiply the inverse worldMatrix of pCube1 with the worldMatrix of pCube2
matrix $multiplied[4][4] = multiplyMatrix($inverseOfWMCube1, $worldMatrixCube2);
Now, in the last row of this matrix should be the coordinates of pCube2 with respect to the local coordinate system of pCube1.
All is fine as long as i dont rotate or scale pCube1. The moment i do scale or rotate pCube1, its all wrong.
Say for instance that i keep the location of both cubes at respectively {5,5,5} and {-5,-5,-5} and i rotate pCube1 over 90degrees around the Y axis. The correct result should be {+10,-10,-10} but instead i get {0,-10-10}...
What is going on here?
Oh, and pointMatrixMult with {0,0,0} or pCube2's translate coordinates does not amount to anything usefull...
thanks for your help!
hope someone can point me out in the correct direction (again).
A