Exemple #1
0
 void TriangulateRoadSegment(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Vector3 v5, Vector3 v6)
 {
     Roads.AddQuad(v1, v2, v4, v5);
     Roads.AddQuad(v2, v3, v5, v6);
     Roads.AddQuadUV(0f, 1f, 0f, 0f);
     Roads.AddQuadUV(1f, 0f, 0f, 0f);
 }
 private void TriangulateRoadSegment(
     Vector3 v1, Vector3 v2, Vector3 v3,
     Vector3 v4, Vector3 v5, Vector3 v6,
     Color w1, Color w2, Vector3 indices)
 {
     Roads.AddQuad(v1, v2, v4, v5);
     Roads.AddQuad(v2, v3, v5, v6);
     Roads.AddQuadUV(0f, 1f, 0f, 0f);
     Roads.AddQuadUV(1f, 0f, 0f, 0f);
     Roads.AddQuadCellData(indices, w1, w2);
     Roads.AddQuadCellData(indices, w1, w2);
 }
    /// <summary>
    /// Create the two quads of a road segment.
    /// </summary>
    void TriangulateRoadSegment(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Vector3 v5, Vector3 v6, Color w1, Color w2, Vector3 indices)
    {
        Roads.AddQuad(v1, v2, v4, v5);
        Roads.AddQuad(v2, v3, v5, v6);

        // This results in U for the 2 road quads -> 0 ||||| 1 1 ||||| 0
        // This way we can use U in the shader as a measure of how close we are to the center of the road
        Roads.AddQuadUV(0f, 1f, 0f, 0f);
        Roads.AddQuadUV(1f, 0f, 0f, 0f);

        Roads.AddQuadCellData(indices, w1, w2);
        Roads.AddQuadCellData(indices, w1, w2);
    }