Pytorch3d: Change Color of Mesh Vertices? with torch.ones_like(verts)[None]?

Created on 28 Apr 2020  ·  2Comments  ·  Source: facebookresearch/pytorch3d

Hi! I have a super quick question but somehow I can't figure it out based on the tutorials and forums.

I'm rendering a set of objects that are saved as one set of vertices and faces but are not connected. I'd like to set one of these objects to be not white.

I'd use verts_rgb = torch.ones_like(verts[0:100])[None] to set vertices 0 through 100 to white. How do I set say verts[101:200] to another color?

Thank you so much!

how to

Most helpful comment

Do you want something like

verts_rgb = torch.ones_like(verts)[None]
verts_rgb[0,101:200,:]=torch.tensor([red_level, green_level, blue_level])

All 2 comments

Do you want something like

verts_rgb = torch.ones_like(verts)[None]
verts_rgb[0,101:200,:]=torch.tensor([red_level, green_level, blue_level])

yes thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarkTension picture MarkTension  ·  3Comments

cihanongun picture cihanongun  ·  3Comments

aluo-x picture aluo-x  ·  3Comments

TheshowN picture TheshowN  ·  3Comments

unlugi picture unlugi  ·  3Comments