Example #1
0
def start():

    ## init scenegraph
    scenegraph = avango.gua.nodes.SceneGraph(Name="scenegraph")

    ## init solar system
    solarSystem = SolarSystem()
    solarSystem.my_constructor(scenegraph.Root.value)

    ## init navigation technique
    steeringNavigation = SteeringNavigation()
    steeringNavigation.set_start_transformation(
        avango.gua.make_trans_mat(0.0, 0.1,
                                  0.3))  # move camera to initial position

    if NAVIGATION_MODE == "Spacemouse":
        deviceInput = SpacemouseInput()
        deviceInput.my_constructor("gua-device-spacemouse")

        steeringNavigation.my_constructor(
            deviceInput.mf_dof, deviceInput.mf_buttons, 0.15,
            1.0)  # connect navigation with spacemouse input

    elif NAVIGATION_MODE == "New Spacemouse":
        deviceInput = NewSpacemouseInput()
        deviceInput.my_constructor("gua-device-spacemouse")

        steeringNavigation.my_constructor(
            deviceInput.mf_dof, deviceInput.mf_buttons, 0.1,
            1.0)  # connect navigation with spacemouse input

    elif NAVIGATION_MODE == "Keyboard":
        deviceInput = KeyboardInput()
        deviceInput.my_constructor("gua-device-keyboard0")

        steeringNavigation.my_constructor(
            deviceInput.mf_dof,
            deviceInput.mf_buttons)  # connect navigation with keyboard input

    else:
        print("Error: NAVIGATION_MODE " + NAVIGATION_MODE + " is not known.")
        return

    ## init viewing setup
    viewingSetup = SimpleViewingSetup(scenegraph, "mono", False)
    #viewingSetup = SimpleViewingSetup(scenegraph, "anaglyph", False)
    viewingSetup.connect_navigation_matrix(steeringNavigation.sf_nav_mat)
    steeringNavigation.set_rotation_center_offset(
        viewingSetup.get_head_position())

    print_graph(scenegraph.Root.value)

    viewingSetup.run(locals(), globals())
Example #2
0
def start():

  # create scenegraph
  scenegraph = avango.gua.nodes.SceneGraph(Name = "scenegraph")
  
  
  scene_manager = SceneManager(scenegraph.Root.value)

  '''
  # init input device
  gyromouse_device = MouseDevice()
  gyromouse_device.my_constructor("device-gyromouse")
  '''
  
  # init manipulation input devices
  if SPACEMOUSE_MODE == "OLD":
    spacemouse_input = SpacemouseInput1()
    spacemouse_input.my_constructor("device-spacemouse1")  

  elif SPACEMOUSE_MODE == "NEW":
    spacemouse_input = SpacemouseInput2()
    spacemouse_input.my_constructor("device-spacemouse2")

  mouse_input = MouseInput()
  mouse_input.my_constructor("device-mouse")
  
  # init navigation input device
  keyboard_input = KeyboardInput()
  keyboard_input.my_constructor("device-keyboard")


  # init navigation technique
  steering_navigation = SteeringNavigation()
  steering_navigation.my_constructor(keyboard_input.mf_dof, keyboard_input.mf_buttons) # connect navigation with keyboard input
  steering_navigation.set_start_transformation(avango.gua.make_trans_mat(0.0,0.05,0.3))


  # setup viewer
  viewer = SimpleViewingSetup(scenegraph, scenegraph.Root.value, "mono", False)
  #viewer = SimpleViewingSetup(scenegraph, "anaglyph", False)
  viewer.connect_navigation_matrix(steering_navigation.sf_nav_mat)
  steering_navigation.set_rotation_center_offset(viewer.get_head_position())

  # init manipulation techniques
  manipulation_manager = ManipulationManager()
  manipulation_manager.my_constructor(viewer.navigation_node, mouse_input, spacemouse_input)


  viewer.run(locals(), globals())
Example #3
0
def start():

  # create scenegraph
  scenegraph = avango.gua.nodes.SceneGraph(Name = "scenegraph")
  
  
  scene_manager = SceneManager(scenegraph.Root.value)

  '''
  # init input device
  gyromouse_device = MouseDevice()
  gyromouse_device.my_constructor("device-gyromouse")
  '''
  
  # init manipulation input devices
  #spacemouse_input = SpacemouseInput1()
  #spacemouse_input.my_constructor("device-spacemouse1")  

  spacemouse_input = SpacemouseInput2()
  spacemouse_input.my_constructor("device-spacemouse2")

  mouse_input = MouseInput()
  mouse_input.my_constructor("device-mouse")

  
  # init navigation input device
  keyboard_input = KeyboardInput()
  keyboard_input.my_constructor("device-keyboard")


  # init navigation technique
  steering_navigation = SteeringNavigation()
  steering_navigation.my_constructor(keyboard_input.mf_dof, keyboard_input.mf_buttons) # connect navigation with keyboard input
  steering_navigation.set_start_transformation(avango.gua.make_trans_mat(0.0,0.05,0.3))


  # setup viewer
  viewer = SimpleViewingSetup(scenegraph, scenegraph.Root.value, "mono", False)
  #viewer = SimpleViewingSetup(scenegraph, "anaglyph", False)
  viewer.connect_navigation_matrix(steering_navigation.sf_nav_mat)
  steering_navigation.set_rotation_center_offset(viewer.get_head_position())

  # init manipulation techniques
  manipulation_manager = ManipulationManager()
  manipulation_manager.my_constructor(viewer.navigation_node, mouse_input, spacemouse_input)


  viewer.run(locals(), globals())
Example #4
0
def start():

    ## create scenegraph
    scenegraph = avango.gua.nodes.SceneGraph(Name = "scenegraph")
    
    ## init solar system
    solar_system = SolarSystem()
    solar_system.my_constructor(scenegraph.Root.value)

    ## init navigation technique
    steering_navigation = SteeringNavigation()
    steering_navigation.set_start_transformation(avango.gua.make_trans_mat(0.0,0.1,0.3))
  
    if NAVIGATION_MODE == "Spacemouse":
        deviceInput = SpacemouseInput()
        deviceInput.my_constructor("gua-device-spacemouse")
        
        steering_navigation.my_constructor(deviceInput.mf_dof, deviceInput.mf_buttons, 1.0) # connect navigation with spacemouse input
        
    elif NAVIGATION_MODE == "New Spacemouse":
        deviceInput = SpacemouseInput()
        deviceInput.my_constructor("gua-device-spacemouse")
            
        steering_navigation.my_constructor(deviceInput.mf_dof, deviceInput.mf_buttons, 0.2) # connect navigation with spacemouse input

    elif NAVIGATION_MODE == "Keyboard":
        deviceInput = KeyboardInput()
        deviceInput.my_constructor("gua-device-keyboard0")

        steering_navigation.my_constructor(deviceInput.mf_dof, deviceInput.mf_buttons) # connect navigation with keyboard input

    else:    
        print("Error: NAVIGATION_MODE " + NAVIGATION_MODE + " is not known.")
        return


    # setup viewer
    viewingSetup = SimpleViewingSetup(scenegraph, "mono", False)
    #viewingSetup = SimpleViewingSetup(scenegraph, "anaglyph", False)
    viewingSetup.connect_navigation_matrix(steering_navigation.sf_nav_mat)
    steering_navigation.set_rotation_center_offset(viewingSetup.get_head_position())

    viewingSetup.run(locals(), globals())