pyrender - after adding a new mesh, the camera pose changes to some default values

422 Views Asked by At

in pyrender setting the camera pose does not work in my code.

`Each time I add a new mesh to the pyrender scene, the camera pose is set to default

camera = pyrender.PerspectiveCamera(yfov=np.pi / 2, aspectRatio=1.0)

camera_pose = np.array([
    [ 9.96573965e-01 ,-1.15869471e-02,  8.18906336e-02  ,2.79413330e+00],
 [-1.56784090e-02 , 9.45717360e-01 , 3.24611864e-01 , 1.10758554e+01],
 [-8.12066543e-02 ,-3.24783647e-01 , 9.42295634e-01 , 3.21514133e+01],
 [ 0.00000000e+00 , 0.00000000e+00 , 0.00000000e+00 , 1.00000000e+00]]
)

scene.add(camera, pose=camera_pose)

----
#add a mesh
skeletonMesh = pyrender.Mesh(primitives=linePrimitives)
skeleton_Node = scene.add(skeletonMesh, name = child.name)

#-----------

#viewer._camera_node.matrix = camera_pose
cameraPose = viewer._camera_node.matrix
print("after add mesh:\n", cameraPose)

Problem - the camera pose is now changed

A hint would be nice

0

There are 0 best solutions below