示例#1
0
    def __init__(
        self, title="glutgui_base", cam=None, size=(800, 600),
    ):
        self.title = title
        self.window = None
        self.window_size = size
        self.mouse_last_pos = None
        self.pressed_button = None

        self.time_checker = utils.TimeChecker()
        if cam is None:
            self.cam_cur = camera.Camera(
                pos=np.array([0.0, 2.0, 4.0]),
                origin=np.array([0.0, 0.0, 0.0]),
                vup=np.array([0.0, 1.0, 0.0]),
                fov=45.0,
            )
        else:
            self.cam_cur = cam
示例#2
0
def main(args):
    v_up_env = utils.str_to_axis(args.axis_up)
    if args.bvh_files:
        motions = [
            bvh.load(
                file=filename,
                v_up_skel=v_up_env,
                v_face_skel=utils.str_to_axis(args.axis_face),
                v_up_env=v_up_env,
                scale=args.scale,
            )
            for filename in args.bvh_files
        ]
    else:
        motions = [
            asfamc.load(file=f, motion=m)
            for f, m in zip(args.asf_files, args.amc_files)
        ]

    for i in range(len(motions)):
        motion_ops.translate(motions[i], [args.x_offset * i, 0, 0])
    cam = camera.Camera(
        pos=np.array(args.camera_position),
        origin=np.array(args.camera_origin),
        vup=v_up_env,
        fov=45.0,
    )
    viewer = MocapViewer(
        motions=motions,
        play_speed=args.speed,
        scale=args.scale,
        thickness=args.thickness,
        render_overlay=args.render_overlay,
        hide_origin=args.hide_origin,
        title="Motion Graph Viewer",
        cam=cam,
        size=(1280, 720),
    )
    viewer.run()