File: GLViewWidget.py

package info (click to toggle)
python-pyqtgraph 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,168 kB
  • sloc: python: 54,831; makefile: 128; ansic: 40; sh: 2
file content (29 lines) | stat: -rw-r--r-- 508 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
Very basic 3D graphics example; create a view widget and add a few items.

"""

import pyqtgraph as pg
import pyqtgraph.opengl as gl

pg.mkQApp("GLViewWidget Example")
w = gl.GLViewWidget()
w.show()
w.setWindowTitle('pyqtgraph example: GLViewWidget')
w.setCameraPosition(distance=20)

ax = gl.GLAxisItem()
ax.setSize(5,5,5)
w.addItem(ax)

b = gl.GLBoxItem()
w.addItem(b)

ax2 = gl.GLAxisItem()
ax2.setSize(1.5, 1.5, 1.5)
ax2.setParentItem(b)

b.translate(1,1,1)

if __name__ == '__main__':
    pg.exec()