I've successfully generated a flat tube structure using THREE.TubeGeometry with radiusSegments set to 2. However, once added to the scene, it appears perpendicular to the ground:
https://i.sstatic.net/U3qTt.png
Is there a way to rotate each segment of the tube so that they are parallel to the ground?
Check out this example on JSFiddle.
var points = [];
for (var i = 0; i < 5; i++) {
var randomY = i*5/2*10 + -50;
var randomX = 15*Math.sin(5*i);
points.push(new THREE.Vector3(randomX, randomY, 0));
}
var tubeGeometry = new THREE.TubeGeometry(new THREE.SplineCurve3(points), 64, 6, 2, false);
tubeMesh = createMesh(tubeGeometry);
scene.add(tubeMesh);