I want to show only 1 quarter of a plane, is there any method to do that? I've tried all options of visuals.Plane()
but not successfully. I also tried to change value of vertices['color']
and the result is same. Here is my code:
import vispy
from vispy import geometry
from vispy.scene import visuals, widgets
from vispy.scene.cameras import TurntableCamera
from vispy.scene import SceneCanvas
class Vis():
def __init__(self):
self.canvas = SceneCanvas(keys='interactive', title='vispy', show=True, size=(1280, 720))
self.canvas.events.key_press.connect(self._key_press)
self.grid = self.canvas.central_widget.add_grid()
self.view = widgets.ViewBox(parent=self.canvas.scene,
camera=TurntableCamera(distance=10.0))
self.grid.add_widget(self.view)
visuals.XYZAxis(parent=self.view.scene)
vertices, faces, outline = geometry.create_plane(width=2,
height=2,
direction='+z', width_segments=1, height_segments=1)
self.floor = visuals.Plane(width=2,
height=2,
width_segments=1, height_segments=1,
vertex_colors=vertices['color'], edge_color='k', direction='+z',
parent=self.view.scene)
def run(self):
self.canvas.app.run()
def _key_press(self, event):
if event.key == 'Q':
self.destroy()
def destroy(self):
self.canvas.close()
vispy.app.quit()
if __name__ == "__main__":
vis = Vis()
vis.run()