File: 3dgraphics.rst

package info (click to toggle)
python-pyqtgraph 0.13.7-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,072 kB
  • sloc: python: 54,043; makefile: 127; ansic: 40; sh: 2
file content (42 lines) | stat: -rw-r--r-- 1,371 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
3D Graphics
===========

PyQtGraph uses OpenGL to provide a 3D scenegraph system. This system is functional but still early in development. 
Current capabilities include:
    
* 3D view widget with zoom/rotate controls (mouse drag and wheel)
* Scenegraph allowing items to be added/removed from scene with per-item transformations and parent/child relationships.
* Triangular meshes
* Basic mesh computation functions: isosurfaces, per-vertex normals
* Volumetric rendering item
* Grid/axis items

See the :doc:`API Reference <../api_reference/3dgraphics/index>` and the Volumetric (GLVolumeItem.py) and Isosurface (GLMeshItem.py) examples for more information.

Basic usage example::
    
    ## build a QApplication before building other widgets
    import pyqtgraph as pg
    pg.mkQApp()

    ## make a widget for displaying 3D objects
    import pyqtgraph.opengl as gl
    view = gl.GLViewWidget()
    view.show()

    ## create three grids, add each to the view
    xgrid = gl.GLGridItem()
    ygrid = gl.GLGridItem()
    zgrid = gl.GLGridItem()
    view.addItem(xgrid)
    view.addItem(ygrid)
    view.addItem(zgrid)

    ## rotate x and y grids to face the correct direction
    xgrid.rotate(90, 0, 1, 0)
    ygrid.rotate(90, 1, 0, 0)

    ## scale each grid differently
    xgrid.scale(0.2, 0.1, 0.1)
    ygrid.scale(0.2, 0.1, 0.1)
    zgrid.scale(0.1, 0.2, 0.1)