@@ -17,12 +17,14 @@ def get_vertices(height_map, width, height, cols, rows):
1717def tesselate_main (surface , vertices , cols , rows , count ):
1818 for i in range (rows - 1 ):
1919 for j in range (cols - 1 ):
20- surface .vectors [count ] [0 ] = vertices [i ] [j ]
21- surface .vectors [count ] [1 ] = vertices [i ] [j + 1 ]
22- surface .vectors [count ] [2 ] = vertices [i + 1 ] [j ]
23- surface .vectors [count + 1 ][0 ] = vertices [i + 1 ] [j + 1 ]
24- surface .vectors [count + 1 ][1 ] = vertices [i ] [j + 1 ]
25- surface .vectors [count + 1 ][2 ] = vertices [i + 1 ][j ]
20+ # Triangle 1
21+ surface .vectors [count ] [0 ] = vertices [i ] [j ]
22+ surface .vectors [count ] [1 ] = vertices [i ] [j + 1 ]
23+ surface .vectors [count ] [2 ] = vertices [i + 1 ][j ]
24+ # Triangle 2
25+ surface .vectors [count + 1 ][0 ] = vertices [i + 1 ][j + 1 ]
26+ surface .vectors [count + 1 ][1 ] = vertices [i ] [j + 1 ]
27+ surface .vectors [count + 1 ][2 ] = vertices [i + 1 ][j ]
2628 count += 2
2729 return count
2830
@@ -33,7 +35,7 @@ def back_vertex(vertex, thickness):
3335# Tesselates the frame mesh by combining all the frame vertices through triangles
3436def tesselate_frame (surface , vertices , cols , rows , count , thickness ):
3537 for i in range (cols - 1 ):
36- # Top row frame
38+ # Top row frame
3739 surface .vectors [count ] [0 ] = vertices [0 ][i ]
3840 surface .vectors [count ] [1 ] = back_vertex (vertices [0 ][i ], thickness )
3941 surface .vectors [count ] [2 ] = vertices [0 ][i + 1 ]
0 commit comments