MCPcopy
hub / github.com/ManimCommunity/manim / get_plane_mesh

Function get_plane_mesh

example_scenes/opengl.py:11–70  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

9
10
11def get_plane_mesh(context):
12 shader = Shader(context, name="vertex_colors")
13 attributes = np.zeros(
14 18,
15 dtype=[
16 ("in_vert", np.float32, (4,)),
17 ("in_color", np.float32, (4,)),
18 ],
19 )
20 attributes["in_vert"] = np.array(
21 [
22 # xy plane
23 [-1, -1, 0, 1],
24 [-1, 1, 0, 1],
25 [1, 1, 0, 1],
26 [-1, -1, 0, 1],
27 [1, -1, 0, 1],
28 [1, 1, 0, 1],
29 # yz plane
30 [0, -1, -1, 1],
31 [0, -1, 1, 1],
32 [0, 1, 1, 1],
33 [0, -1, -1, 1],
34 [0, 1, -1, 1],
35 [0, 1, 1, 1],
36 # xz plane
37 [-1, 0, -1, 1],
38 [-1, 0, 1, 1],
39 [1, 0, 1, 1],
40 [-1, 0, -1, 1],
41 [1, 0, -1, 1],
42 [1, 0, 1, 1],
43 ],
44 )
45 attributes["in_color"] = np.array(
46 [
47 # xy plane
48 [1, 0, 0, 1],
49 [1, 0, 0, 1],
50 [1, 0, 0, 1],
51 [1, 0, 0, 1],
52 [1, 0, 0, 1],
53 [1, 0, 0, 1],
54 # yz plane
55 [0, 1, 0, 1],
56 [0, 1, 0, 1],
57 [0, 1, 0, 1],
58 [0, 1, 0, 1],
59 [0, 1, 0, 1],
60 [0, 1, 0, 1],
61 # xz plane
62 [0, 0, 1, 1],
63 [0, 0, 1, 1],
64 [0, 0, 1, 1],
65 [0, 0, 1, 1],
66 [0, 0, 1, 1],
67 [0, 0, 1, 1],
68 ],

Callers 3

constructMethod · 0.85
constructMethod · 0.85
constructMethod · 0.85

Calls 2

ShaderClass · 0.85
MeshClass · 0.85

Tested by

no test coverage detected