### Set world transform on channel

120   4   1
Member
153 posts
Joined: May 2014
Offline
How can I set the world coordinates on an object's transform?
Here is a simple example : an object would be sliding on the ground, its motion would be constrained to an object flying above, but its translation Y would be always 0.
Where in the docs can I find this kind of info?
Thanks
Gz
Member
4 posts
Joined: March 2016
Offline
If you're trying to access the world coordinates of an object then see this thread:
https://www.sidefx.com/forum/topic/22768/?page=1#post-255947 [www.sidefx.com]

Not sure if this helps
Member
153 posts
Joined: May 2014
Offline
Hello Dan
So here's what I did:
Create a cube and a sphere , positioned the sphere at 4 above the cube.
In the cube's parameters pane > tab “transform” > added these expressions in X and Z : vtorigin(“”, “../sphere_object1”) . Check attached pic.
Now when I move the sphere in X, the cube moves, but in a weird way, it progresses on the grid along a 45° axis.
Moving the cube in Z does nothing.
There must be something missing, I should be able to access the global X and Z translation of the sphere…
Thanks
Gz
Edited by Grendizer - Aug. 12, 2018 11:22:16

Attachments:
global transforms.png (236.5 KB)

Member
3329 posts
Joined: July 2007
Online
Grendizer
In the cube's parameters pane > tab “transform” > added these expressions in X and Z : vtorigin(“”, “../sphere_object1”) . Check attached pic.
vtorigin() returns vector, and since you are not specifying which component to use, both of your parameters use first, so both are controlled by sphere's global X position
so you want to specify components for X and Z respectively like this:

```vtorigin("", "../sphere_object1")[0]
vtorigin("", "../sphere_object1")[2]
```

but you can as well just create Blend Constraint and uncheck TY
Tomas Slancik
FX Supervisor
Method Studios, NY
Member
153 posts
Joined: May 2014
Offline
Thanks a lot !! It works now