Skip to content

Commit

Permalink
Add example script
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewturk committed Dec 5, 2024
1 parent fd8cfd4 commit f7f9de7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/multiview_rendering.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import yt

import yt_idv
from yt_idv.scene_components.particles import ParticleRendering
from yt_idv.scene_data.particle_positions import ParticlePositions

ds = yt.load_sample("IsolatedGalaxy")

rc = yt_idv.render_context(height=800, width=800, gui=True)
sg = rc.add_scene(ds, "density", no_ghost=True)

sg.components[0].display_bounds = (0.0, 0.5, 0.0, 1.0)

dd = ds.all_data()
pos = ParticlePositions(data_source=dd)
pren = ParticleRendering(data=pos)

pren.display_bounds = (0.5, 1.0, 0.0, 1.0)

sg.data_objects.append(pos)
sg.components.append(pren)

rc.run()

0 comments on commit f7f9de7

Please sign in to comment.