<s> """<STR_LIT>""" <EOL> from vispy import app , gloo , visuals , scene <EOL> import numpy as np <EOL> vertex_shader = """<STR_LIT>""" <EOL> fragment_shader = """<STR_LIT>""" <EOL> class MyRectVisual ( visuals . Visual ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , x , y , w , h ) : <EOL> visuals . Visual . __init__ ( self , vertex_shader , fragment_shader ) <EOL> self . vbo = gloo . VertexBuffer ( np . array ( [ <EOL> [ x , y ] , [ x + w , y ] , [ x + w , y + h ] , <EOL> [ x , y ] , [ x + w , y + h ] , [ x , y + h ] <EOL> ] , dtype = np . float32 ) ) <EOL> self . shared_program . vert [ '<STR_LIT>' ] = self . vbo <EOL> self . shared_program . frag [ '<STR_LIT>' ] = ( <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> self . _draw_mode = '<STR_LIT>' <EOL> def _prepare_transforms ( self , view ) : <EOL> view . view_program . vert [ '<STR_LIT>' ] = view . get_transform ( ) <EOL> MyRect = scene . visuals . create_visual_node ( MyRectVisual ) <EOL> canvas = scene . SceneCanvas ( keys = '<STR_LIT>' , show = True ) <EOL> rects = [ MyRect ( <NUM_LIT:100> , <NUM_LIT:100> , <NUM_LIT:200> , <NUM_LIT> , parent = canvas . scene ) , <EOL> MyRect ( <NUM_LIT> , <NUM_LIT:100> , <NUM_LIT:200> , <NUM_LIT> , parent = canvas . scene ) ] <EOL> tr = visuals . transforms . MatrixTransform ( ) <EOL> tr . rotate ( <NUM_LIT:5> , ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> ) ) <EOL> rects [ <NUM_LIT:1> ] . transform = tr <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import sys <EOL> if sys . flags . interactive != <NUM_LIT:1> : <EOL> app . run ( ) </s>
