Check out this intriguing Codepen showcasing a white, glossy "cup" loaded using Three's GLTFLoader:
https://codepen.io/snakeo/pen/XWOoGPL
However, when I try to add a texture to a section of the mug, the shiny cup mysteriously transforms into a lackluster and patchy version:
You can experiment with applying the texture on the Codepen by uncommenting line 102:
// Create MeshPhongMaterial with the texture
const phongMaterial = new THREE.MeshPhongMaterial({
color: 0xFFFFFF, // White color for the ceramic look
shininess: 30, // Adjust shininess for the ceramic effect
specular: 0x222222, // Specular color
// map: texture // Apply the texture
});
The image is only displayed on the "face" of the cup.
I'm puzzled by this sudden change. As a newcomer in this field, any guidance would be greatly appreciated.
Thank you.
I've experimented with altering texture.wrapS
, texture.wrapT
, and texture.repeat
without success, leading to strange outcomes that do not restore the original white and shiny appearance of the cup.