Created
January 28, 2015 14:45
-
-
Save rossant/9231499ff251526ab085 to your computer and use it in GitHub Desktop.
Point sprint example with VisPy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import numpy as np | |
from vispy import app, scene | |
canvas = scene.SceneCanvas(keys='interactive') | |
view = canvas.central_widget.add_view() | |
view.set_camera('turntable', mode='perspective', up='z', distance=2, | |
azimuth=30., elevation=30.) | |
pos = .25 * np.random.randn(1000, 3) | |
colors = np.random.uniform(size=(1000, 3), low=.5, high=.8) | |
p1 = scene.visuals.Markers() | |
p1.set_data(pos, face_color=colors) | |
view.add(p1) | |
if __name__ == '__main__': | |
canvas.show() | |
if sys.flags.interactive == 0: | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment