Jump to content
CinnamonMetal

Axis channel with maketransform ?

Recommended Posts

One of the arguments for the maketransform() function is T.  How can I specify a channel axis; as seen in this pseudo-code ?

matrix maketransform(x,x,@P.z(ch("../ctrl_panel/depth")*2),x,x);

 

Share this post


Link to post
Share on other sites

Append z to your channel reference (you can see this when hovering over the parameters text with your mouse):

f@whatever = ch("../testgeometry_pighead1/tz");

And better separate a function call like maketransform() from your remaining channel references and calculations.

Try to structure your code into sections like // INPUT, // PROCESSING, // OUTPUT instead of cramming everything into a one-liner

// INPUT
int trs  = chi('transformation_order');
int xyz  = chi('rotation_order');
vector t = vector(0.0); // setting up the vector for completeness sake, it will be overridden later
vector r = chv('rotation');
vector s = chv('scale');
vector p = chv('pivot');

float trans = ch('../test_geo/tz'); // grabbing a single translation value from another node

// PROCESSING
trans *= 2.0; // changing the value
t = set(trans, 0.0, 0.0); // combining the translation vector
matrix m = maketransform(trs, xyz, t, r, s, p); // setting up the transformation matrix, dont put any distracting stuff in here

// OUTPUT
@P *= m; // carry out

To ensure this example works, set the 'scale' parameter to 1, 1, 1 after clicking on the 'create parameters' button.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×