Steering a Shape along a pathway

Hello all,

I want to steer a shape along a pathway. Let’s say a spaceship that first goes along x axis and when at a certain point stops and rotates slowly around its axis and then starts in another direction.

Like a framework with list of timers and different commands for the time periods. Ah, I must have done something like this…

But has anyone an example for this?

Thanks!

Chrisir

Do you want the shape to be locked to the path like a rail, and slide along it, or do you want it to be following a series of waypoints over time like a boid where it can be begin off the path and move onto it?

If you look at previous forum examples like LerpVectorsExample and LerpVectorsSimplified you will find some basic path-following objects.

Those are for objects x,y without orientation. If you wanted them to also turn, store x,y,r in the PVector, and draw the object with orientation r. Then place two nodes on the same path point like this:

0, 0, 0
100, 0, 0
100, 0, PI * 3/2.0
100, 100, PI * 3/2.0

Now the agent moves from point 0 to 1
Then turns in place to orientation 2
Then moves to point 3.

1 Like

I am thinking you are referring to easing? This is an example.

I am thinking along the lines of a ship in the sea, it takes time to make a turn after you gave the command. Is this the concept you want to explore?

Kf

2 Likes

If it’s about easing, here’s another online example: :grinning:
Studio.ProcessingTogether.com/sp/pad/export/ro.9XkJm3bjTAxB2

2 Likes

Thanks everyone for the great help!