Hi;
I want to retrieve distance between two geometry, and apply the result to rotation of one of them.
I tried to use “distance” expression function but it gives me the absolute value (cause I need +|- of the rotation).
Is there any function for this purpose?
Thanks.
I need distance between two geometry...
1082 3 0- Masoud
- Member
- 407 posts
- Joined: Aug. 2015
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Hi Masoud,
just subtract the current distance and it will go above or below 0 as soon as you move the objects.
just subtract the current distance and it will go above or below 0 as soon as you move the objects.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Masoud
- Member
- 407 posts
- Joined: Aug. 2015
- Offline
Konstantin Magnus
Hi Masoud,
just subtract the current distance and it will go above or below 0 as soon as you move the objects.
You mean something like this? :
distance(chw(“tx”),ch(“ty”),ch(“tz”), ch(“../sph/tx”),ch(“../sph/ty”),ch(“../sph/tz”)) - {ch(“tx”),ch(“ty”),ch(“tz”}
It make error!
Masoud Saadatmand (MSDVFX)
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
You got a bracing error and some unnecessary ‘w’:
90 means degrees per 1 unit distance
1.5 is the initial distance to start with 0 degrees rotation
Also look into CHOP constraints in case you need more control.
90 * (1.5 - distance(ch("tx"),ch("ty"),ch("tz"), ch("../sph/tx"),ch("../sph/ty"),ch("../sph/tz")) )
90 means degrees per 1 unit distance
1.5 is the initial distance to start with 0 degrees rotation
Also look into CHOP constraints in case you need more control.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
-
- Quick Links