Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

PlotOptiX examples

Note, some fresh examples may use features available in the repository head, but not yet in the release submitted to PyPI. Examples compatible with the PyPI release can be downloaded with::

python -m plotoptix.install examples

1. Basic plot making

Collection of short and simple scripts to get started.

Many scripts are using Tkinter GUI, so here is a summary of mouse and keys actions:

  • camera is selected by default, double-click an object/light to select it, double click again to select a primitive within the object, double-click empty area to or double-right-click select camera

With camera selected:

  • rotate eye around the target: hold and drag left mouse button
  • rotate target around the eye (pan/tilt): hold and drag right mouse button
  • zoom out/in (change field of view): hold shift + left mouse button and drag up/down
  • move eye backward/forward (dolly): hold shift + right mouse button and drag up/down
  • change focus distance in "depth of field" cameras: hold ctrl + left mouse button and drag up/down
  • change aperture radius in "depth of field" cameras: hold ctrl + right mouse button and drag up/down
  • focus at an object: hold ctrl + double-click left mouse button
  • select an object: double-click left mouse button

With a light or an object / primitive selected:

  • rotate around camera XY (right, up) coordinates: hold and drag left mouse button
  • rotate around camera XZ (right, forward) coordinates: hold ctrl and drag left mouse button
  • move in camera XY (right, up) coordinates: hold shift and drag left mouse button
  • move in camera XZ (right, forward) coordinates: hold and drag right mouse button
  • move in the normal direction (parallelogram light only): shift + right mouse button and drag up/down
  • scale up/down: hold ctrl + shift + left mouse button and drag up/down
  • select camera: double-click left mouse button in empty area or double-right-click anywhere

You'll find here super-basic examples of displaying data, like scatter plots or line plots below:

screenshots1

...and a bit more on tuning the available options, like the material and light shading modes:

screenshots2

...or usage of material properties such as refraction index and textures:

screenshots3

...or 2D postprocessing algorithms:

screenshots4

...or normal shading with displacement maps:

screenshots5

2. Animations and callbacks

Callbacks in PlotOptiX are widely available throughout the raytracing process. You can provide functions to execute on each frame raytracing start, completion, etc., allowing for progressive image updates, saving output to file or making animated plots. Callbacks designed for heavy compute are executed in parallel to the raytracing, and those intended for accessing image data are synchronized with GPU transfers. That is a really powerfull pattern!

GitHub can render notebooks content, so it is best to look at descriptions inlined in the code there.

screenshots5 screenshots6

3. Projects

Collection of tutorials and artistic projects. Expect this section to grow slowly. Projects are large and need lots of work to prepare. Let's start with the "Making of the Moon".

moon ray_traced

You can’t perform that action at this time.