Forum

How to make a curved line for an object to follow along

Hello

I try to make a 2d line which resembles a form in a texture to move an object along this path from start to finish and then loop again from the start. The path itself should/can be invisible.
The object is a textured quad which should change its texture according to the movement on the path. For example if it moves to the left the texture should be different than if it is moving to the right. I don’t know how to do this so I started with the path thing.
I had a look for examples within the docs and forum and found helpful stuff like b-spline (value), b-spline (3d) and rope.
Tried to do it with b-spline (value) but I struggle and don’t know if it is the right way. So I thought I just ask for help here.
In my example I tried to overlap the b-spline with the texture by moving the control points. I noticed that the helper line behaves different than the actual input objects on the b-spline and don’t know why this happens. It is also quite difficult for me to mimic the path in the texture. I used setslice to get single slices and change their position but I think I need a lot of them and assume it is not the best way to achieve my goal.
So is this reasonable to do? Is there a better way? I’m very thankful for any help.

My example was made with vvvv 45beta34.2 addons installed.

Example patch with b-spline and texture (36.7 kB)

hei sthag,

since you seem to have such good-quality input image you may as well try to track the path automatically instead of editing it manually. please see attached patch using the Contour (Freeframe DShow9) (this will only work in x86 versions of vvvv!). hope that helps…

EDIT: added file now!

pathtracker.v4p (79.3 kB)

Thank you joreg for your fast reply. I’ll try the Contour tracking. I hoped there would be another way because I find it a little bit extra complicated to work with freeform tracking nodes :D. But I will do my best and post a result of it here ifthis is OK.
By the way. What do you mean by attached patch?

Another idea I have is to use a SVG form. Would it also be possible to use a premade SVG path and to have an object follow along it?

https://vvvv.org/contribution/pathvectors-(3d)