(self)
| 365 | |
| 366 | class NamedShaderExample(Scene): |
| 367 | def construct(self): |
| 368 | shader = Shader(self.renderer.context, "manim_coords") |
| 369 | shader.set_uniform("u_color", (0.0, 1.0, 0.0, 1.0)) |
| 370 | |
| 371 | view_matrix = self.camera.formatted_view_matrix |
| 372 | shader.set_uniform("u_model_view_matrix", view_matrix) |
| 373 | shader.set_uniform( |
| 374 | "u_projection_matrix", |
| 375 | opengl.perspective_projection_matrix(), |
| 376 | ) |
| 377 | attributes = np.zeros( |
| 378 | 6, |
| 379 | dtype=[ |
| 380 | ("in_vert", np.float32, (4,)), |
| 381 | ], |
| 382 | ) |
| 383 | attributes["in_vert"] = np.array( |
| 384 | [ |
| 385 | [-1, -1, 0, 1], |
| 386 | [-1, 1, 0, 1], |
| 387 | [1, 1, 0, 1], |
| 388 | [-1, -1, 0, 1], |
| 389 | [1, -1, 0, 1], |
| 390 | [1, 1, 0, 1], |
| 391 | ], |
| 392 | ) |
| 393 | mesh = Mesh(shader, attributes) |
| 394 | self.add(mesh) |
| 395 | |
| 396 | self.wait(5) |
| 397 | |
| 398 | |
| 399 | class InteractiveDevelopment(Scene): |
nothing calls this directly
no test coverage detected