I’ve seen examples of creating infinite tubes using a list of points, converting them to a list of vertices, generating a CatmullRomCurve3 and then using that for a TubeGeometry. But I want to create a “tunnel” that has 4 parts like so (excuse the horrendous sketch):
Through the gaps you can see outside the “tunnel”. The bottom of this tube is a flat plane, to mimic a road. I could give the cylinders a certain theta end like Math.PI / 2 to make it 25% of a circle and position them a certain way, but I’m not sure how to have all of the 4 pieces follow the same curve to make it “feel” like a single tube.
In @PavelBoytchev’s solution, the flat part on which you move always stays down. In @prisoner849’s solution, you rotate in the tube and the flat part is in different positions.
I updated the codepen, found a very interesting solution from @ycw to keep camera stable, so the flat part of the tunnel is always oriented horizontally. Comments are in the code.