fixed division by 0 error

This commit is contained in:
raphael60650 2021-08-01 21:47:48 +02:00
parent 0d5e94e925
commit a460298a12

View file

@ -71,7 +71,9 @@ def draw_model(scene_scale, scene_trans, scene):
for face in mesh.faces:
for vertex_i in face:
height = scene.vertices[vertex_i][color_axe]
color = (height - min_height) / max_height
color = 1
if max_height != 0:
color = (height - min_height) / max_height
glColor3f(color, color, color)
glVertex3f(*scene.vertices[vertex_i])