Scaling Second Object depending on First Object’s Matrices
This post has already been read 1568 times!
In this quick tip I would like to show how to scale up or down our second object depending on first object matrix…
Xpresso is so powerful, understanding matrix system can help us greatly in many situations to create our own Xpresso Setups. The main purpose was to create a bounding box (for to use it as a guide or whatever…) As I shared in my previous post, it’s done but the problem is when I rotate the object all point coordinates were changing. So I decided to solve it using matrices.
Create a null object with a xpresso tag and add userdata to this null. We need scaling value so create a userdata for it. Now drag this userdata into your xpresso editor and also drag your cube 2 and cube 1. Add Global Matrix output box in Cube 1 node and Global Matrix input box in Cube 2 node. We will use Global Matrix node for this setup. It is located under System Presets / Matrix / Global Matrix. But we need to change only some of these values but these values are not available by default so we need to drag white gear object operator icon to our xpresso editor in order to add these values. Please check screenshots.
Global Matrix is a default system preset node, it’s basically a C.O.F.F.E.E. script;
var om = GlobalMatrix->GetMulM(InMatrix);
Global Matrix is for our reference object. (In this example it is cube1 ).
And InMatrix input box is our matrices we want to change.