Add textured materials to render context, and refactor mjvGeom to refer to those textures.

PiperOrigin-RevId: 648719103
Change-Id: Idb4425bdeea3cbc1133cda3e4366574ed3bb5ccc
This commit is contained in:
Tom Erez
2024-07-02 08:00:06 -07:00
committed by Copybara-Service
parent af3233f98d
commit 3b73dfe33b
14 changed files with 252 additions and 195 deletions
+1 -8
View File
@@ -258,17 +258,10 @@ class USDPrimitiveMesh:
assert self.prim_mesh
x_scale, y_scale = self.geom.texrepeat
mesh_texcoord = np.array(self.prim_mesh.triangle_uvs)
mesh_facetexcoord = np.asarray(self.prim_mesh.triangles)
x_multiplier, y_multiplier = 1, 1
if self.geom.texuniform:
x_multiplier, y_multiplier = self.geom.size[:2]
mesh_texcoord[:, 0] *= x_scale * x_multiplier
mesh_texcoord[:, 1] *= y_scale * y_multiplier
# TODO(etom): bring back support for rescaling the texture coordinates.
return mesh_texcoord, mesh_facetexcoord.flatten()