Big update! Changed the geometry to a tube with rounded ends, and some bones animating it. Same ugly heightfield, which also doesn't wrap properly (at the purple parts) - but it copes just fine. You can see what's going on though.
I draw, code, and make memes sometimes.