Page 1 of 2 12 LastLast
Results 1 to 15 of 27

Thread: How to set an object Y position according to its X distance of another one ?

  1. #1
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616

    How to set an object Y position according to its X distance of another one ?

    Hi there,

    I'm looking for a simple way to move an object according to the distance of another one.
    I need to do this crossing different axis, means that A object should have its Y value increasing when X distance value of B object (from A) will change.
    In fact just like you can displace a map by putting a based on distance gradient (to another object) but I need to do this on object's position.

    Any help please ? Help.
    Motion Options Panel does not seem to provide any Modifier that can do this.
    Follower, especially, sounds similar but actually does not do the same thing.

    Thanx !

    (PS : I'm a long time LW user but absolutely newbie with nodes)

  2. #2
    Medical Animator mummyman's Avatar
    Join Date
    Aug 2009
    Location
    Connecticut
    Posts
    1,070
    Under Motion options for "A" and pick controllers and limits. Your Y of "A" can be controlled and offset using the X of "B" Not exactly sure if this is what you need it to do.

  3. #3
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616
    No, it's not what I'm triying to do. I exactly need that the motion is controled by the DISTANCE between A and B.

  4. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,987
    Press m to open Motion Options. Add Motion Node Editor. Add Item Info and pick up item from drop down. World Position plug to Distance node or Vector Scalar to get one of axis alone. Second item position get the same way. Use distance as input to Gradient node to map from one range to another range and output plug to Make Vector Y axis.
    If you need item to be dynamically evaluated (e.g. if you want to clone item ) get my Node Library 2020 from http://www.trueart.eu
    and use Extended Spot Info with Extended Item Info to get item parameters instead of native Item Info node.
    Last edited by Sensei; 02-21-2020 at 09:03 AM.

  5. #5
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616
    Thank you very much Sensei, this is great help.

    I gave a try at your tip but few things still don't work correctly.
    1/ I can't find out how to set exact values. When I move the "parent" (sphere) on X axis it correctly make the "children" (cube) move on Y axis but whith no control on distances. Actually whatever values I put in my gradient start / end, the "children" only goes from Y = 0 m to 1 m, even if I drag the "parent" hundred meters away.Its a good thing there is a limit but I did not set it myself and how can I for example set the values from 0 m to 2,5 m ?

    2/ This node stuff locked the X and Z of my "children", I can't place it where I want. And of course if I want to make few copies of it they will all remain at the same place.

    3/ Even stranger : X and Z are locked but not Y ! The children is influenced by the "parent" but it can also be freely moved (on the 0 to 1 m scale) while I'd need it to be completely locked on this axis to avoid mistake.

    (sorry, so many questions but I firstly said I'm newbie with nodes… they are still strange for me)


    Click image for larger version. 

Name:	Capture d’écran 2020-02-21 à 17.56.13.png 
Views:	15 
Size:	1.32 MB 
ID:	146910

  6. #6
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,987
    1. Gradient output is color. 0,0,0 for black 255,255,255 for white. In floating point it is 1,1,1.
    You can't easily enter values above white this way, as you are picking colors.
    Try alpha instead. Gradient allows entering alpha values without limiting them to 0..1 range.

    ..or forget about Gradient node and use math vector nodes manually.

    2. Use Math > Vector > Add node after Make Vector to offset position rather than set position. "Input" node World Position use as a 2nd parameter for Add node.

    Try using World Positions rather than Positions everywhere..
    Last edited by Sensei; 02-21-2020 at 11:30 AM.

  7. #7
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616
    thank you very much

  8. #8
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616
    must say it does'nt work as it should… I'm certainly mistaking in many points. Any one knows about some links towards Nodal Motion tutorials ?

  9. #9
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,987
    Quote Originally Posted by lasco View Post
    must say it does'nt work as it should… I'm certainly mistaking in many points. Any one knows about some links towards Nodal Motion tutorials ?
    Show yours the most up to date nodes..

  10. #10
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616
    Nothing much more than yesterday.
    X and Z of my children object (the cube) are locked. I need to keep them free and at the opposite I'd need to put down and up limit values on its Y axis.
    Where is "Vector offset" stuff ?

    DISTANCE.lws.zip

  11. #11
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,987
    Offsetting vector is not a node but technique. You need to do it using Math Vector Add node by yourself.
    Last edited by Sensei; 02-22-2020 at 06:02 AM.

  12. #12
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,987
    This is what I was talking about:
    Click image for larger version. 

Name:	Grabs 1.png 
Views:	9 
Size:	232.8 KB 
ID:	146915

    Current position of item is offsetted, by adding second vector ("offset"), to its base position.

  13. #13
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616
    Quote Originally Posted by Sensei View Post
    This is what I was talking about:
    Click image for larger version. 

Name:	Grabs 1.png 
Views:	9 
Size:	232.8 KB 
ID:	146915

    Current position of item is offsetted, by adding second vector ("offset"), to its base position.
    Thanks that seems a little better. Btw did you see I purchased your Node Library ?

  14. #14
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,987
    If you need to limit Y axis to some specific range, use Math > Scalar > Min and Math > Scalar > Max nodes. Like here:
    Click image for larger version. 

Name:	Grabs 2.png 
Views:	6 
Size:	238.3 KB 
ID:	146916

    ..or you can use Math > Scalar > Clamp node like here:

    Click image for larger version. 

Name:	Grabs 3.png 
Views:	14 
Size:	270.7 KB 
ID:	146917

  15. #15
    Enhanced Low
    Join Date
    Jun 2003
    Location
    Sesam Street
    Posts
    616
    Min an Max Scalar nodes do nothing.
    I don't understand how they're supposed to work (why they have 2 values each)

    Btw when I reproduce your screen the whole Nodal Motion does not work anymore

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •