hi, im rendering 3d model with 2d canvas using TDSLoader with below code
const canvas = document.createElement("canvas")
canvas.height = 256
canvas.width = 256
const ctx = canvas.getContext("2d")
ctx.fillStyle = '#2e3b51'
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.font = `bold 80px Montserrat`
ctx.textAlign = "center"
ctx.textBaseline = "middle"
ctx.fillStyle = '#22aabc'
ctx.fillText(legend.toUpperCase(), canvas.width / 2, canvas.height / 2)
const texture = new THREE.Texture(canvas)
texture.needsUpdate = true
const kc = geometry.clone()
// apply texture on keycap
const material = new THREE.MeshStandardMaterial({
map: texture,
metalness: 0.5,
roughness: 0.6,
})
kc.traverse(function(child) {
if (child instanceof Mesh) {
child.material = material
}
})
scene.add(kc)
the result like below image (black text). but i want the text display at the position like red P. i tried to test with some options for Texture but unable to re-position to the expected one. pls help me