modelscope / richdreamer

Live Demo:https://modelscope.cn/studios/Damo_XR_Lab/3D_AIGC
https://aigc3d.github.io/richdreamer/
Apache License 2.0
362 stars 13 forks source link

how to get camera to world matrix in blender system? #21

Open aaawww222 opened 4 months ago

aaawww222 commented 4 months ago

Hi,

Thanks for the great work! Can I ask how we can get camera to world matrix in blender coordinate convention after this script:

    with open(json_file, 'r', encoding='utf8') as reader:
        json_content = json.load(reader)

    camera_matrix = np.eye(4)
    camera_matrix[:3, 0] = np.array(json_content['x'])
    camera_matrix[:3, 1] = -np.array(json_content['y'])
    camera_matrix[:3, 2] = -np.array(json_content['z'])
    camera_matrix[:3, 3] = np.array(json_content['origin'])

Thanks!