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,6 +71,8 @@ def draw_model(scene_scale, scene_trans, scene):
for face in mesh.faces: for face in mesh.faces:
for vertex_i in face: for vertex_i in face:
height = scene.vertices[vertex_i][color_axe] height = scene.vertices[vertex_i][color_axe]
color = 1
if max_height != 0:
color = (height - min_height) / max_height color = (height - min_height) / max_height
glColor3f(color, color, color) glColor3f(color, color, color)