* Having two viewboxes that show different scenes * Using the same camera in both scenes, via multiple parenting """ from vispy_experimental import ak_entities as entities from vispy import app from vispy.util import transforms # Create figure with one pixel camera fig = entities.CanvasWithScene() fig.size = 800, 400 fig.show() camera = entities.PixelCamera(fig.viewbox) # @fig.connect def on_mouse_move(event): cam0.on_mouse_move(event) # Create two viewboxes vp1 = entities.ViewBox(fig.viewbox) vp2 = entities.ViewBox(fig.viewbox) vp1.bgcolor = (0,0,0.2) vp2.bgcolor = (0,0.2,0) # Put them next to each-other transforms.scale(vp1.transform, 400, 400) transforms.scale(vp2.transform, 400, 400) transforms.translate(vp1.transform, 0)
You need to move the mouse to initialize the view for now. """ import time from vispy_experimental import ak_entities as entities from vispy import app from vispy.util import transforms # Create a figure fig = entities.CanvasWithScene() fig.size = 600, 600 fig.show() # Create a camera inside a container camcontainer = entities.PixelCamera(fig.viewbox) camera = entities.ThreeDCamera(camcontainer) camera._fov = 90 # or other between 0 and 179 # Explicitly set the second camera, or the ViewBox will pick the second fig.viewbox.camera = camera # Create a points entity inside a container pointscontainer = entities.Entity(fig.viewbox) points = entities.PointsEntity(pointscontainer, 1000) # Count FPS t0, frames, t = time.time(), 0, 0 @fig.connect