I'm sure there is a simpler way of getting this working, which I can not see at the moment, but you could try something like this:
Define a function to determine if your proposed triangle will be backfacing or not with respect to either the camera or better perhaps the "up" vector for your track section. See the archives for backfacing code. If it is going to be backfacing then reverse the order you add the verts to the triangle.
Define a function to determine if your proposed triangle will be backfacing or not with respect to either the camera or better perhaps the "up" vector for your track section. See the archives for backfacing code. If it is going to be backfacing then reverse the order you add the verts to the triangle.