1"""
2Demonstrates use of GLGraphItem
3
4"""
5
6## Add path to library (just for examples; you do not need this)
7import initExample
8
9import pyqtgraph as pg
10import pyqtgraph.opengl as gl
11import numpy as np
12
13app = pg.mkQApp("GLGraphItem Example")
14w = gl.GLViewWidget()
15w.setCameraPosition(distance=20)
16w.show()
17
18edges = np.array([
19    [0, 2],
20    [0, 3],
21    [1, 2],
22    [1, 3],
23    [2, 3]
24])
25
26nodes = np.array(
27    [
28        [0, 0, 0],
29        [1, 0, 0],
30        [0, 1, 0],
31        [1, 1, 1]
32    ]
33)
34
35edgeColor=pg.glColor("w")
36
37gi = gl.GLGraphItem(
38    edges=edges,
39    nodePositions=nodes,
40    edgeWidth=1.,
41    nodeSize=10.
42)
43
44w.addItem(gi)
45
46if __name__ == "__main__":
47    pg.exec()
48