random size cuboid test
This commit is contained in:
parent
e9d573172d
commit
24662a43a9
1 changed files with 5 additions and 3 deletions
8
main.py
8
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)
|
||||
|
|
Loading…
Reference in a new issue