- let program = mandelwow_program(&display);
- let bounding_box_program = solid_fill_program(&display);
-
- let bounds = Cube {
- xmin: -2.0,
- xmax: 0.7,
- ymin: -1.0,
- ymax: 1.0,
- zmin: -1.2,
- zmax: 1.2,
- };
-
- mandelwow(&display, &mut frame, &program, model, &camera, &bounds, mandel_w);
+ // Draw the bounding box before the fractal, when the Z-buffer is still clear, so the lines
+ // behind the semi-translucent areas will be drawn.
+ if bounding_box_enabled {
+ let uniforms = uniform! {
+ model: model,
+ view: camera.get_view(),
+ perspective: camera.get_perspective(),
+ };
+ bounding_box(&display, &mut frame, &bounding_box_program, &uniforms, &bounds);
+ }