From my understanding, in real world cameras the extrinsic matrix of the camera is the “transformation matrix” that defines xyz position and rotation, and intrinsic matrix is the “projection matrix” that maps 3D space to 2D pixel space.
In 3D graphics there’s the projection matrix that the fragment shader uses to project the clipped space to pixel coordinates (intrinsic?), and the position+rotation+scale of the camera that defines the transformation matrix (I’m guessing extrinsic?)
Question is, are these assumptions correct and if so how do I set them in panda?
I found the MatrixLens.setUserMat(), and base.make_camera() but don’t really know what do to from here
Thanks
UPDATE:
I got the matrices wrong according to this article:
You know the extrinsic matrix corresponds to the modelview matrix and the intrinsic is the projection matrix
So what’s the difference between all the matrices?
To set a custom projection matrix, you can create a new MatrixLens, apply the matrix using the method you found, and then replace the existing lens on the camera using base.cam.node().setLens(lens).
To set the “view” matrix (the modelview matrix includes the transformation of the model currently being rendered) you simply set the transformation of the camera in 3D space, using base.camera.setMat(render, mat)