random size cuboid test

This commit is contained in:
zomseffen 2020-07-25 17:58:00 +02:00
parent e9d573172d
commit 24662a43a9

View file

@ -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)