0

Is there a way to show multiple images on the same view with different offsets?

The _build_vertex_data in vispy/visuals/image.py doesn't seem to take any offsets.

For example, I would like to have 3 images side by side, allowing me to zoom in and out of them as a group.

hmaarrfk
  • 417
  • 5
  • 10

1 Answers1

1

You can achieve this by applying a transformation to the visual.

from vispy import scene
from vispy.visuals.transforms import STTransform

...

image1 = scene.visuals.Image(...)

image2 = scene.visuals.Image(...)

# sets y-axis offset to 42
image2.transform = STTransform(translate=[42])
#                = STTransform(translate=[42, 0, 0, 0],
#                              scale=[0, 0, 0, 0])

...
kne42
  • 136
  • 1
  • 3