How to use the pyrender.quaternion.multiply function in pyrender

To help you get started, we’ve selected a few pyrender examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github musyoku / gqn-dataset-renderer / opengl / shepard_metzler.py View on Github external
mesh=mesh,
            translation=np.array(([
                position[0] - barycenter[0],
                position[1] - barycenter[1],
                position[2] - barycenter[2],
            ])))
        scene.add_node(node)
        cube_nodes.append(node)

    update_cube_color_and_position(cube_nodes, color_candidates)

    # Place a light
    light = DirectionalLight(color=np.ones(3), intensity=15.0)
    quaternion_yaw = pyrender.quaternion.from_yaw(math.pi / 4)
    quaternion_pitch = pyrender.quaternion.from_pitch(-math.pi / 5)
    quaternion = pyrender.quaternion.multiply(quaternion_pitch, quaternion_yaw)
    quaternion = quaternion / np.linalg.norm(quaternion)
    node = Node(
        light=light, rotation=quaternion, translation=np.array([1, 1, 1]))
    scene.add_node(node)

    return scene, cube_nodes
github musyoku / gqn-dataset-renderer / opengl / shepard_metzler.py View on Github external
def genearte_camera_quaternion(yaw, pitch):
    quaternion_yaw = pyrender.quaternion.from_yaw(yaw)
    quaternion_pitch = pyrender.quaternion.from_pitch(pitch)
    quaternion = pyrender.quaternion.multiply(quaternion_pitch, quaternion_yaw)
    quaternion = quaternion / np.linalg.norm(quaternion)
    return quaternion
github musyoku / gqn-dataset-renderer / shepard_metzler.py View on Github external
mesh=mesh,
            translation=np.array(([
                position[0] - center_of_gravity[0],
                position[1] - center_of_gravity[1],
                position[2] - center_of_gravity[2],
            ])))
        scene.add_node(node)
        cube_nodes.append(node)

    update_cube_color_and_position(cube_nodes, color_candidates)

    # Place a light
    light = DirectionalLight(color=np.ones(3), intensity=15.0)
    quaternion_yaw = pyrender.quaternion.from_yaw(math.pi / 4)
    quaternion_pitch = pyrender.quaternion.from_pitch(-math.pi / 5)
    quaternion = pyrender.quaternion.multiply(quaternion_pitch, quaternion_yaw)
    quaternion = quaternion / np.linalg.norm(quaternion)
    node = Node(
        light=light, rotation=quaternion, translation=np.array([1, 1, 1]))
    scene.add_node(node)

    return scene, cube_nodes
github musyoku / gqn-dataset-renderer / opengl / rooms_ring_camera.py View on Github external
def genearte_camera_quaternion(yaw, pitch):
    quaternion_yaw = pyrender.quaternion.from_yaw(yaw)
    quaternion_pitch = pyrender.quaternion.from_pitch(pitch)
    quaternion = pyrender.quaternion.multiply(quaternion_pitch, quaternion_yaw)
    quaternion = quaternion / np.linalg.norm(quaternion)
    return quaternion