#!/bin/env python

# file hello_glfw.py

from openvr.glframework.glfw_app import GlfwApp
from openvr.gl_renderer import OpenVrGlRenderer
from openvr.color_cube_actor import ColorCubeActor
from openvr.tracked_devices_actor import TrackedDevicesActor

"""
Minimal glfw programming example which colored OpenGL cube scene that can be closed by pressing ESCAPE.
"""


if __name__ == "__main__":
    renderer = OpenVrGlRenderer(multisample=2)
    renderer.append(ColorCubeActor())
    controllers = TrackedDevicesActor(renderer.poses)
    controllers.show_controllers_only = False
    renderer.append(controllers)
    with GlfwApp(renderer, "glfw OpenVR color cube") as glfwApp:
        glfwApp.run_loop()
#!/bin/env python

# file hello_glfw.py

import OpenGL
OpenGL.ERROR_CHECKING = False
OpenGL.ERROR_LOGGING = False
OpenGL.ERROR_ON_COPY = True

from openvr.glframework.cyglfw3_app import CyGLFW3App
from openvr.gl_renderer import OpenVrGlRenderer
from openvr.color_cube_actor import ColorCubeActor
from openvr.tracked_devices_actor import TrackedDevicesActor
"""
Minimal glfw programming example which colored OpenGL cube scene that can be closed by pressing ESCAPE.
"""

if __name__ == "__main__":
    renderer = OpenVrGlRenderer(multisample=2)
    renderer.do_mirror = True
    renderer.append(ColorCubeActor())
    controllers = TrackedDevicesActor(renderer.poses)
    controllers.show_controllers_only = False
    renderer.append(controllers)
    with CyGLFW3App(renderer, "glfw OpenVR color cube") as app:
        app.run_loop()
Example #3
0
                self.translation_history.popleft()

        return result


if __name__ == "__main__":
    obj = ObjMesh(open("root_997.obj", 'r'))
    # invert up/down, so brain is dorsal-up
    obj.model_matrix *= (
        (1, 0, 0, 0),
        (0, -1, 0, 0),
        (0, 0, -1, 0),
        (-0.5, 1.5, 0.5, 1),
    )
    # obj = ObjMesh(open("AIv6b_699.obj", 'r'))
    renderer = OpenVrGlRenderer(multisample=2)
    renderer.append(SkyActor())
    # renderer.append(ColorCubeActor())
    controllers = TrackedDevicesActor(renderer.poses)
    controllers.show_controllers_only = True
    renderer.append(controllers)
    renderer.append(obj)
    renderer.append(FloorActor())
    interactor = SpatialInteractor()
    with GlfwApp(renderer, "mouse brain") as glfwApp:
        while not glfw.window_should_close(glfwApp.window):
            glfwApp.render_scene()
            # Update controller drag state when buttons are pushed
            interactor.update_controller_states()
            # update_scene_geometry(interactor)
Example #4
0
            while len(self.translation_history) > self.max_history_size:
                self.translation_history.popleft()
        
        return result

if __name__ == "__main__":
    obj = ObjMesh(open("root_997.obj", 'r'))
    # invert up/down, so brain is dorsal-up
    obj.model_matrix *= ((1,0,0,0),
                         (0,-1,0,0),
                         (0,0,-1,0),
                         (-0.5,1.5,0.5,1),
                         )
    # obj = ObjMesh(open("AIv6b_699.obj", 'r'))
    renderer = OpenVrGlRenderer(multisample=2)
    renderer.append(SkyActor())
    # renderer.append(ColorCubeActor())
    controllers = TrackedDevicesActor(renderer.poses)
    controllers.show_controllers_only = True
    renderer.append(controllers)
    renderer.append(obj)
    renderer.append(FloorActor())
    interactor = SpatialInteractor()
    with GlfwApp(renderer, "mouse brain") as glfwApp:
        while not glfw.window_should_close(glfwApp.window):
            glfwApp.render_scene()
            # Update controller drag state when buttons are pushed
            interactor.update_controller_states()
            # update_scene_geometry(interactor)