Given one obj file, corresponding camera extrinsics (R T) and intrinsics, I want to render the image with Pytorch3D. Using pyrender which is based on OpenGL, I could get the right rendered results. However, the results of OpenGLPerspectiveCameras of pytorch 3D seems wrong.
Reuslts of pyrender :

Results of OpenGLPerspectiveCameras :

The origin objects:

It seems that the coordinates are all right-hand based, so currently I am a little confused what should I do to solve this problem. I also have tried the OpenGLRealPerspectiveCamera, which allow me to set the intrinsics, but the results still don's seem right:

When using rendering engines one question you should always ask yourself and figure out is what the world coordinate system is for that engine. Different engines make different conventions and you can't just plug and play different engines hoping it will work. Our world coordinate system is different than OpenGL. You should figure out the transformation and reflect that in the R,T.
Here is a reference for the coordinate system conventions in PyTorch3D: 
If you no longer need help, please close this issue.
@gkioxari @nikhilaravi
Thanks for your responses. I have fixed this issue :)
Hi @raywzy , how did you fix this issue?
Hi @raywzy , how did you fix this issue?
@wangg12 Hi Gu, I solve the problem by using your provided projection function :)
Most helpful comment
When using rendering engines one question you should always ask yourself and figure out is what the world coordinate system is for that engine. Different engines make different conventions and you can't just plug and play different engines hoping it will work. Our world coordinate system is different than OpenGL. You should figure out the transformation and reflect that in the R,T.