How to move an object in any direction?

RK's Avatar

RK

24 Apr, 2021 08:02 AM

Hello.

I have this connection of nodes:

rectangle ---> translate <---- frame

My rectangle then moves ONLY from the center to the right buttom corner of the screen.
How can I make any object move any direction I want?

  1. Support Staff 1 Posted by john on 24 Apr, 2021 08:45 AM

    john's Avatar

    Hello!

    The translate node moves an object in the direction of an X,Y point. To make the object move 20 units to the right and 50 units up, enter 20,-50.

    The frame node produces a single integer. When you feed that integer into the translate node's position port, it uses that integer for both the X and Y values. So when you hit play, it first moves the object 1,1 (1 unit right, 1 unit down), then 2,2, then 3,3, etc. The result is a steady movement to the southeast.

    To gain more control you need to set the X and Y values separately. One way to do this is to use the make_point node. This node has two separate ports, one for X and one for Y.

    If you hook the frame to X port of the make_point node and leave the Y value at 0, then hook make_point into the translate node, the object will move steadily to the right without changing its vertical position. If you hook frame to the Y port instead, the object will move steadily downward.

    There are many other different ways to calculate point values for a translate node. For example, you can:

    • create a circle with the ellipse node
    • feed that circular path into a point_on_path node
    • feed the frame node into the T port of the point_on_path node
    • feed the point_on_path node into the translate node

    When you hit play the object will go around and around. You can change the width and height of the ellipse to change the orbital path of your object.

    There are many, many other ways to control object movement using the translate node. Please let me know if this answers your question. I encourage you to play and come back with more questions!

    Happy Nodeboxing!

    John

  2. 2 Posted by RK on 25 Apr, 2021 09:25 AM

    RK's Avatar

    Thank you for your comprehensive answer. I'll play around with it!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Zwischenablage02.jpg 8.17 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

23 Jun, 2021 01:36 AM
20 Jun, 2021 07:19 AM
13 Jun, 2021 11:19 PM
06 Jun, 2021 09:27 AM
05 Jun, 2021 10:17 AM

 

05 Jun, 2021 07:45 AM
23 May, 2021 10:05 PM
23 May, 2021 10:02 PM
17 May, 2021 12:04 AM
16 May, 2021 01:00 PM
14 May, 2021 03:16 PM