move/rotate a object along path

I can not find out how can I move/rotate a object(like box) along with path(drawn in Illustrator and imported through .ai) in TouchDesigner. Please show me examples, related operators, or python methods.

I have made an exampe.
11moon.com/TouchDesigner/sam … ine120.zip

In where I converted a 3D path to 100 anchor points in CINEMA 4D, then put them to tab separated text.

Then import them into TD with Table DAT, DAT to CHOP and Script CHOP.

Then the Script CHOP calculates interporated position and rotation from the anchor points, also the Script CHOP is driven by Timer CHOP.

Then Transform SOP is reading output channel of the Script CHOP, and move Box SOP.

This was possible, but not smart. Are there any better ways?

In a DAT to CHOP you can say each column of your DAT represents a channel of samples. Using that you’ll get a CHOP filled with 4 channels (your tx ty tx ry) with your 100 samples.
Using a Lookup CHOP to find the right samples from your CHOP (or row from your DAT) , you can drive a Geo COMP instance.

see example with your data attached.

And if you want to smoothen your animation, add a Lag CHOP or Filter CHOP between the Lookup CHOP and the Null CHOP.
animate_along_datapoints_v2.tox (3.08 KB)

At first, thanks for your advice, and very interesting flow of data processing.
However there are some problems in your project.

  1. ry does not work.

  2. There may not be conversion from radian to degree.

  3. There may not be way to handle “360 to 0 degree problem”. The 0 in one turn up or down rotation should be converted to 360 or -360 degrees.

And I coud not fix the problems, because I am 2 or 3 days beginner.


Also now I am making a game type project like this.
www2.11moon.com/sample_files2018 … pper_s.mov

This test was done in CINEMA 4D, and I am trying to port all functions to TD, because the C4D does not have real time viewer.

For such reasons, simple or smooth running of object motion is useless. I have to add joystick or keyboard input and make different story or ending for each game play with Python code.
So if it is possible, I want to import path itself (not text data) as FBX, and get position and direction (tangents) on the path with Python methods directly.

sorry for the typo, v2 now posted with ry working

True there is none - I only built a quick version to help you on your way, I did not have time to implement all your script code.
But you can apply math to CHOP channels just the same - for instance if you need to convert a CHOP channel from radians to degrees insert a Math CHOP (use the Scope under the Common tab to select which channel it operates on) and multiply your channel with 180/math.pi

Hmm if you want to build a game with physics, I would advise you to use a free game engine like godotengine.org/ or maybe Unity - you will be done quicker and will be more flexible.

@nettoyeur This is a great example thank you. I’m trying to do almost the same but using a technique to interpolate between a few values rather than having such a long table of values to precisely tell my geo (in my case camera angles).

Any ideas would be great. In my initial attempt below I’ve used a filter CHOP which I believe there is a better way to do this. Also if I wanted to randomly jump between each row in my table I would like the same results. Camera_Move_Data_TableSave.toe (7.2 KB)