Create a curved plane surface which dynamically changes its size

You can take a separate strip for the centerline and a simple texture.
20190220-0841-12142

Now you can make the stripes dynamic by changing the values in
d = [ -0.62, -0.6, -0.02, 0.02, 0.6, 0.62]; ( initial).

You can see how this works in my addons, for example.

But there’s another problem. If the dots are not equidistant, there are different line lengths white.

var curve = new THREE.CatmullRomCurve3( [
	new THREE.Vector3( -25, 0.2, -25 ),
	new THREE.Vector3( -24, 0.2, -24 ),
	new THREE.Vector3( -4, 2, -9 ),

One must extend the calculation, e.g. for the uv’s use the possibilities of CatmullRomCurve3 / Curve.
.getLength .getSpacedPoints etc.

This is gonna be a nice racetrack :motorway: , I think.
:traffic_light: :red_car: :blue_car: :minibus: :construction:

I need to take a closer look at this.


addendum: I looked. It’s quite simple.

The uv calculation shifted backwards and changed:

var len = curve.getLength( );
var lenList = curve.getLengths ( ls );

var uvIdxCount = 0;

for ( var j = 0; j < lss; j ++ ) {
		
	for ( var i = 0; i < wss; i ++ ) {

		//g.uvs[ uvIdxCount     ] = j / ls;
		//g.uvs[ uvIdxCount + 1 ] = i / ws;
		
		g.uvs[ uvIdxCount     ] = lenList[ j ] / len;
		g.uvs[ uvIdxCount + 1 ] = i / ws;
		uvIdxCount += 2;
		
	}
	
}

4 Likes