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
from vispy import scene | |
from vispy.scene.visuals import Plane | |
from vispy.visuals import transforms | |
a = .5 | |
colors = [ | |
(.25, .25, .25, 1), | |
(0, 0, 1, a), | |
(0, 1, 0, a), |
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 numpy as np | |
import vispy | |
from vispy import geometry | |
from vispy import scene | |
canvas = scene.SceneCanvas(keys='interactive', bgcolor='white', | |
size=(800, 600), show=True) | |
view = canvas.central_widget.add_view() |
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 numpy as np | |
import vispy | |
from vispy import scene | |
canvas = scene.SceneCanvas(keys='interactive', bgcolor='white', | |
size=(800, 600), show=True) | |
view = canvas.central_widget.add_view() | |
view.camera = 'arcball' |
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
"""Render a mesh with different texture maps (i.e. materials) on different | |
regions using vispy. | |
Tested on vispy at commit c4f7ef42. | |
""" | |
import argparse | |
import pathlib | |
import numpy as np |
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 logging | |
import os.path | |
import numpy as np | |
from PIL import Image | |
logger = logging.getLogger(__name__) | |
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
"""Basic mesh viewer using vispy.""" | |
import argparse | |
from vispy import app, scene | |
from vispy.io import read_mesh, load_data_file | |
from vispy.scene.visuals import Mesh | |
parser = argparse.ArgumentParser() |
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
#!/bin/bash | |
# Convert ply files in a directory to obj in parallel. | |
# | |
# Requires: gnu parallel, assimp | |
dir=$1 | |
plys=( $(ls $dir/*.ply) ) | |
objs=( "${plys[@]/.ply/.obj}" ) |
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 matplotlib.pyplot as plt | |
import numpy as np | |
speed0 = 10 | |
speed1 = 20 | |
n_speeds = (speed1 - speed0) * 10 | |
speed = np.linspace(speed0, speed1, n_speeds) | |
duration = 21 / (speed / 60) |