fresnel.interact¶
Overview
View a fresnel Scene in real time |
Details
Interactive Qt widgets.
-
class
fresnel.interact.
SceneView
(scene, max_samples=2000)¶ View a fresnel Scene in real time
SceneView
is a PySide2 widget that displays afresnel.Scene
, rendering it withfresnel.tracer.Path
interactively. Use the mouse to rotate the camera view.- Parameters
scene (
Scene
) – The scene to display.max_samples (int) – Sample until
max_samples
have been averaged.
Left click to pitch and yaw
Right click to roll
Middle click to pan
Hold ctrl to make small adjustments
Using in a standalone script
To use SceneView in a standalone script, import the
fresnel.interact
module, create yourfresnel.Scene
, instantiate theSceneView
, show it, and start the app event loop.import fresnel, fresnel.interact # build Scene view = fresnel.interact.SceneView(scene) view.show() fresnel.interact.app.exec_();
Using with jupyter notebooks
To use SceneView in a jupyter notebook, import PySide2.QtCore and activate jupyter’s qt5 integration.
from PySide2 import QtCore % gui qt
Import the
fresnel.interact
module, create yourfresnel.Scene
, and instantiate theSceneView
. Do not call the app event loop, jupyter is already running the event loop in the background. When the SceneView object is the result of a cell, it will automatically show and activate focus.import fresnel, fresnel.interact # build Scene fresnel.interact.SceneView(scene)
Note
The interactive window will open on the system that hosts jupyter.
See also
- examples/02-Advanced-topics/03-Interactive-scene-view
Tutorial: Interactive scene display