private void MakeTriangles() { for (int i = 0; i < clothNodes.Count; i++) { // Not the Left most collumn // Not top row // Grab upper left triangle if ((i % clothWidth != 0) && (i >= clothWidth)) { ClothAeroTriangle tt = new ClothAeroTriangle(); tt.nodeA = clothNodes[i]; tt.nodeB = clothNodes[i - 1]; tt.nodeC = clothNodes[i - clothWidth]; aeroTriangles.Add(tt); } // Not the Right most collumn // Not bottom row // Grab lower right triangle if ((i % clothWidth != clothWidth - 1) && (i < clothNodes.Count - clothWidth)) { ClothAeroTriangle tt = new ClothAeroTriangle(); tt.nodeA = clothNodes[i]; tt.nodeB = clothNodes[i + 1]; tt.nodeC = clothNodes[i + clothWidth]; aeroTriangles.Add(tt); } } }
private void MakeTriangles() { for (int i = 0; i < clothNodes.Count; i++) { // Not the Left most collumn // Not top row // Grab upper left triangle if((i % clothWidth != 0) && (i >= clothWidth)) { ClothAeroTriangle tt = new ClothAeroTriangle(); tt.nodeA = clothNodes[i]; tt.nodeB = clothNodes[i -1]; tt.nodeC = clothNodes[i - clothWidth]; aeroTriangles.Add(tt); } // Not the Right most collumn // Not bottom row // Grab lower right triangle if ((i % clothWidth != clothWidth - 1) && (i < clothNodes.Count - clothWidth)) { ClothAeroTriangle tt = new ClothAeroTriangle(); tt.nodeA = clothNodes[i]; tt.nodeB = clothNodes[i + 1]; tt.nodeC = clothNodes[i + clothWidth]; aeroTriangles.Add(tt); } } }