# How to get world coordinates at the geometry level?

## Recommended Posts

I have a Geometry object and a Null object. I want to get the world coordinate position of the Null object that will always be at the position of the Null no matter the transformation of the Geometry object.

Currently I use origin expression but I get the position that's offset by the transformation of the Geometry object.

Any ideas?

Thanks

##### Share on other sites

in a vopnetwork, use the `optransform("path to object")` it gives you a matrix, that you can use to multiply the pointpostion to get it in global space

another thing would be (easier) use a object merge SOP and merge in the point of the null, and set it to transform into this object

this gives you the point in global space

##### Share on other sites

Thanks sanostol. Do you mean using optransform in VEX? How can I use it in VOPs since you said in a vopnetwork?

I was gonna try the Object Merge, but it can be any object, i.e. very high res mesh, so that's why I didn't want to merge it just for this.

##### Share on other sites

You'll need to multiply by the transform of the null and the invert transform of your geometry object. It's definitely easy enough to do in Python so that might be a better bet. You can do this with 2 of the operators I posted in your other thread connected together.

##### Share on other sites

Thanks Graham, in VEX/VOPs how would you get the transform matrix of an object? I looked at VOPs just to see but didn't see anything matrix related that has an object/operator path.

I will give your operator a try for this problem as well. origin expression also works, just had to figure out the path issue there

##### Share on other sites

The help has two listings for optransform, one is VEX and one is an expression. Occasionally you'll run into VEX functions that aren't mapped into VOPS, this appears to be one of them. You can just pop it into an inline code node to use it in VOPS.

opxform_vops.hip

##### Share on other sites

Thanks tjeeds, very helpful. I think that also happens when you go from VOPs into VEX, like there is no sign function in VEX.

## 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.

×
×