# How to use VEX coding to achieve the same result as transform function in primitive sop node

## Recommended Posts

The question is same as the title shows, I tried serval ways in vex, but all fail, so I'm so curious that how to make that happen in vex?

Anyone knows?

##### Share on other sites

You can use maketransform(): http://www.sidefx.com/docs/houdini/vex/functions/maketransform

Put this in a pointwrangle and make sure to set all scale values to 1.

```int trs  = chi('transformation_order');
int xyz  = chi('rotation_order');
vector t = chv('translation');
vector r = chv('rotation');
vector s = chv('scale');
vector p = chv('pivot');

matrix m = maketransform(trs, xyz, t, r, s, p);
@P *= m;```

##### Share on other sites

• 1 year later...
On 20.8.2017 at 6:20 PM, konstantin magnus said:

You can use maketransform(): http://www.sidefx.com/docs/houdini/vex/functions/maketransform

Put this in a pointwrangle and make sure to set all scale values to 1.

```
int trs  = chi('transformation_order');
int xyz  = chi('rotation_order');
vector t = chv('translation');
vector r = chv('rotation');
vector s = chv('scale');
vector p = chv('pivot');

matrix m = maketransform(trs, xyz, t, r, s, p);
@P *= m;```

Thanks konstantin Magnus! This is something I was searching for:-)

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×