To understand how JavaFX 3D defines the color of any given three-dimensional shape, look at the PhongMaterial javadoc (bold is mine):
The PhongMaterial class provides property definitions that represent shaded Phong material. It describes the interaction of light with the surface of the grid to which it is applied. PhongMaterial reflects light from the point of view of the diffuse and mirror component together with ambient and the concept of self-lighting. The color of a point on a geometric surface is a mathematical function of these four components .
This means that you need to provide the material first, and then you need to specify any of these components, such as a diffuse component.
If you copy the image from the above question :

and create a copy of the material with it:
PhongMaterial material = new PhongMaterial(); material.setDiffuseMap(new Image(getClass().getResourceAsStream("bB2jV.png"))); meshView.setMaterial(material);
you can see that this image is used to apply colors to your pyramid:

If you change the texture indices for faces, you will get different colors based on the coordinates of the texture.
To learn more about this, you can check out the FXyz3D library , which provides the TexturedMesh class based on this concept. There you will find many different “textured” 3D form primitives that can use different “modes” of texture. Most of these modes do not even require an image, as it is created internally. This allows you to create, for example, color gradients based on mathematical functions.
This is an example of TetrahedraMesh that uses a three-dimensional function to determine a density map:
TetrahedraMesh tetra = new TetrahedraMesh(10, 5, null); tetra.setTextureModeVertices3D(1530, p -> p.magnitude());
