facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.7k stars 1.3k forks source link

Adding a plane in renderer #1704

Closed santurini closed 9 months ago

santurini commented 9 months ago

Hello, I would like to render a motion with pytorch3d renderer. My motion consists in a folder of .obj files, each containing a body mesh. I would like to place a plane mesh in the environment that has to be present in every frame. How can I achieve that?

Up to now I am able to obtain this results (no plane, just body mesh): motion00-mgpt

But instead I would like to have something like this (underlying plane): 002103_pred_t2m_16

bottler commented 9 months ago

You can construct the plane as a mesh with two triangles. Then each time you want to render the body mesh you will use pytorch3d.structures.join_meshes_as_scene to make a mesh of the body plus the plane and then you render that.

See https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/structures/meshes.py#L1707