def start(): ## create scenegraph scenegraph = avango.gua.nodes.SceneGraph(Name = "scenegraph") ## init viewing setup viewingSetup = SimpleViewingSetup(SCENEGRAPH = scenegraph, PARENT_NODE = scenegraph.Root.value, STEREO_MODE = "mono") #viewingSetup = SimpleViewingSetup(SCENEGRAPH = scenegraph, PARENT_NODE = scenegraph.Root.value, STEREO_MODE = "anaglyph") ## init game avatar avatar = Avatar(PARENT_NODE = scenegraph.Root.value) ## init avatar movemer mover = Mover() mover.my_constructor(SCENEGRAPH = scenegraph, START_MATRIX = avango.gua.make_trans_mat(0.1, 0.14, 0.0), VIEWER = viewingSetup.viewer) ## init scene scene = Scene(PARENT_NODE = scenegraph.Root.value) ## init field connections avatar.avatar_transform.Transform.connect_from(mover.sf_mat) # connect mover output matrix to avatar matrix viewingSetup.connect_navigation_matrix(avatar.avatar_transform.Transform) # connect avatar matrix to camera matrix viewingSetup.viewer.DesiredFPS.connect_from(mover.input.sf_max_fps) # change viewer FPS during runtime ## start application/render loop viewingSetup.run(locals(), globals())
def start(): ## create scenegraph scenegraph = avango.gua.nodes.SceneGraph(Name="scenegraph") ## init viewing setup viewingSetup = SimpleViewingSetup(SCENEGRAPH=scenegraph, PARENT_NODE=scenegraph.Root.value, STEREO_MODE="mono") #viewingSetup = SimpleViewingSetup(SCENEGRAPH = scenegraph, PARENT_NODE = scenegraph.Root.value, STEREO_MODE = "anaglyph") ## init game avatar avatar = Avatar(PARENT_NODE=scenegraph.Root.value) ## init avatar movemer mover = Mover() mover.my_constructor(SCENEGRAPH=scenegraph, START_MATRIX=avango.gua.make_trans_mat( 0.1, 0.14, 0.0), VIEWER=viewingSetup.viewer) ## init scene scene = Scene(PARENT_NODE=scenegraph.Root.value) ## init field connections avatar.avatar_transform.Transform.connect_from( mover.sf_mat) # connect mover output matrix to avatar matrix viewingSetup.connect_navigation_matrix( avatar.avatar_transform.Transform ) # connect avatar matrix to camera matrix viewingSetup.viewer.DesiredFPS.connect_from( mover.input.sf_max_fps) # change viewer FPS during runtime ## start application/render loop viewingSetup.run(locals(), globals())
from lib.Mover import Mover import RPi.GPIO as GPIO #Inicio dos GPIO GPIO.setmode(GPIO.BOARD) m = Mover() m.adiante(0.5) m.atrais(0.5) m.rotar_horario(0.5) m.rotar_antih(0.5) m.adiante_dta(0.5) m.quieto() m.atrais_dta(0.5) m.quieto() m.adiante_izq(0.5) m.quieto() m.atrais_izq(0.5) m.quieto() #por si acaso :D m.quieto() #Restauracion dos GPIO GPIO.cleanup()