From 24662a43a93ce71a727c59a99e6b65cc8421d423 Mon Sep 17 00:00:00 2001 From: zomseffen Date: Sat, 25 Jul 2020 17:58:00 +0200 Subject: [PATCH] random size cuboid test --- main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 31c3495..d76acef 100644 --- a/main.py +++ b/main.py @@ -146,7 +146,9 @@ def main(): for y_pos in range(-10, 10): z = random.random() * 2 - 1 struct.addShape(program_id, Cuboid().translate(translate(x_pos, y_pos, z)).setColor( - random.randint(0, 100) / 100.0, random.randint(0, 100) / 100.0, random.randint(0, 100) / 100.0)) + random.randint(0, 100) / 100.0, random.randint(0, 100) / 100.0, random.randint(0, 100) / 100.0).setSize( + random.randint(0, 100) / 100.0, random.randint(0, 100) / 100.0, random.randint(0, 100) / 100.0 + )) struct.buildvertexArrays() @@ -156,7 +158,7 @@ def main(): cstruct = CompoundStructure() cstruct.addStructure(struct) - program3_id = l.getDepthProgram(vertex_shader_id, Cube.GeometryShaderId) + program3_id = l.getDepthProgram(vertex_shader_id, Cuboid.GeometryShaderId) program2_id = glCreateProgram() glAttachShader(program2_id, passthrough_vertex_shader_id) @@ -387,7 +389,7 @@ def display(): glFlush() l.finishDepthMapping() - glClearColor(1, 0, 0, 0) + glClearColor(0, 0, 0, 0) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glUseProgram(program_id)