Attempting to create a chocolate-colored cylinder using the code snippet below:
const cylinder = new THREE.Mesh(new THREE.CylinderGeometry(100, 100, 100, 100, 50, false), new THREE.MeshNormalMaterial({ color: 0xd2691e }));
However, the color doesn't seem to change as expected. When trying the following code:
const cylinder = new THREE.Mesh(new THREE.CylinderGeometry(100, 100, 100, 100, 50, false), new THREE.MeshBasicMaterial({ color: 0xd2691e }));
The color changes, but the top face ends up looking like solid blob along with the sides, rather than giving a true 3D cylindrical shape.
While researching solutions, I came across this helpful question which suggests random color changes for faces. However, I am specifically looking for a way to distinguish colors between the top and the sides of the cylinder.