Painting different colors on each side in the cube

Hi, I want to paint different color on each side in the cube like below picture :

I think there are some functions in Isaac Gym API… but I don’t know how to paint colors on the side like this.

If there are no functions, give me some tips about painting colors like the cube in the picture.


Hi @seong_drgn

There is a function for that in Isaac Gym (set_rigid_body_color) but to specify the colors your object has to be composed of different rigid objects (at least one for each color).

IsaacGymEnvs uses (by inspecting the files in the AllegroHand and ShadowHand examples) a 3D object (with a material file for the colors) imported as a .urdf file.

So, a good starting point is to modify the cube_multicolor.urdf (located at IsaacGymEnvs/assets/urdf/objects), particularly the mesh file (meshes/cube_multicolor.obj) and the material file (meshes/cube_multicolor.mtl). Both are human-readable files.

Create as many colors as you need in the material file by copying other colors and modifying the diffuse color (Kd) with normalized RGB values…
Then, just replace the current color names in the mesh file.

Reed more details about material file here: Wavefront .obj file - Wikipedia

You can visualize the 3D object (the colored cube) by dragging a drop both files (cube_multicolor.obj and cube_multicolor.mtl) to the following online 3D viewer:

1 Like

Thank you for great answer, !

I edited (meshes/cube_multicolor.mtl) file to add other colors.

Then I loaded (cube_multicolor.urdf) file.(located at IsaacGymEnvs/assets/urdf/objects)

Finally, I could create the cube painted various colors!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.