Results 1 to 10 of 10

Thread: keeping an object between 2 others with nodes?

  1. #1

    keeping an object between 2 others with nodes?

    Hello!
    I'm trying to setup something that seemed extremely easy at first look (easy with expression et least)
    Like keeping the hips between the two feet for instance.
    Tried with the item infos nodes, distance from / to, dividing the result by 2, splitting the vectors to get the x / y and z separately... nothing works.
    All I'm getting is the center mesh to move toward the last moving of the other objects.

    Any advice?

    Thank you

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,875
    Where do you want it to make?
    In Displacement Node Editor?
    or
    In Motion Node Editor?

    Displacement Node Editor is working with deltas, relative offsets, from current position of vertex, to new position of vertex.
    So you can't just take some item position, and plug to Displacement Input. Have to make them relative first.

    ps. Often made mistake is forgetting about double clicking Item Info node to open panel and picking up item from drop-down list.
    You have to use World Position, World Spot,
    not Object coord space.

    ps2. Show screen-shot of your node setup to discuss where is issue.. As always.
    Last edited by Sensei; 11-12-2017 at 01:05 PM.

  3. #3
    I thought of using the node motion for that...
    Here is a screen from my lame attempts...

    Click image for larger version. 

Name:	BetweenNodes.jpg 
Views:	77 
Size:	498.3 KB 
ID:	138526

  4. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,875
    To calculate middle point between two vectors, positions of items,
    take World Position (!), then add vectors together, Math > Vector > Add,
    then use Math > Vector > Scale 0.5 (50%) (for example).

    or use Tools > Mixer 50% opacity (don't bother that they're colors, not vectors, it's the same).

  5. #5
    Ah ah! Works like a charm... of course, dividing by 2 or multiplying by 0.5 isn't going to split the vector by two.
    Thank you for sharing your knowledge and bringing some light.
    I didn't forget to post the video of the tentacle scene from the other post btw, I'm just away from my office for a week. I'll do It when I' back. (just feeling guilty)

  6. #6
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,875
    of course, dividing by 2 or multiplying by 0.5 isn't going to split the vector by two.
    middle_point = ( source_1 + source_2 ) / 2.0
    or
    middle_point = ( source_1 + source_2 ) * 0.5
    or
    middle_point = source_1 * 0.5 + source_2 * 0.5

    f.e. source_1 = 10, source_2 = 100
    10+100=110
    110/2 = 55

  7. #7
    yes, that's what I thought at first and tried with the vectors (both with scalar multiply and vector multiply, distance from / to and add vectors)... but It only moved the middle cube toward the one that was currently moving. Scale on the other hand works just as expected.

  8. #8
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,875
    Quote Originally Posted by marchermitte View Post
    yes, that's what I thought at first and tried with the vectors (both with scalar multiply and vector multiply, distance from / to and add vectors)... but It only moved the middle cube toward the one that was currently moving. Scale on the other hand works just as expected.
    It works for me either way.

    Click image for larger version. 

Name:	Middle Point 2.png 
Views:	78 
Size:	286.1 KB 
ID:	138558

    Click image for larger version. 

Name:	Middle Point 1.png 
Views:	75 
Size:	266.6 KB 
ID:	138559

    Quote Originally Posted by marchermitte View Post
    yes, that's what I thought at first and tried with the vectors (both with scalar multiply and vector multiply, distance from / to and add vectors)...
    Scalar multiply nor distance node should not be touched in this project!


    You could use distance from first item to second item,
    distance from first item to third item,
    then divide 1st by 2nd,
    and receive relative distance between them in 0...100% (1.0) range, use it as f.e. parameter to Gradient changing color of object how close it's to one item than to other item.
    Last edited by Sensei; 11-14-2017 at 11:11 AM.

  9. #9
    Quote Originally Posted by sensei View Post

    You could use distance from first item to second item,
    distance from first item to third item,
    then divide 1st by 2nd,
    and receive relative distance between them in 0...100% (1.0) range, use it as f.e. Parameter to gradient changing color of object how close it's to one item than to other item.
    smart!

  10. #10

    thanks, haven't had the use for it, always wondered how it was done though.

    [saved]
    LW vidz   DPont donate   LightWiki   RHiggit   IKBooster   My vidz

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
  •