-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Hello I'm trying to create a 3D TEXT object which will replace the red cube.
I loaded a font and create a 3D Text and add into the scene but I got 2 issues.
- Text Size is too big and only visible if I do geometry.center()
- Text is visible by default and not didn't hide or unhide.
Sample code
const fontLoader = nftAddTJS.getFontLoader();
fontLoader.load(`./fonts/${fontName}`, (font) => {
var material = new THREE.MeshStandardMaterial({ color: new THREE.Color(obj.color).convertSRGBToLinear(), side: THREE.DoubleSide })
material.transparent = true;
**// TextGeometry exported from nftAddTJS**
const geometry = nftAddTJS.createTextGeometry(obj.resource.title, {
font: font,
size: parseInt(obj.resource.size) * 0.000001, **//ISSUE: Size need to provide in decimal or else it create a large text**
height: 1,
curveSegments: 12
})
geometry.center()
var mesh = new THREE.Mesh(geometry, material);
mesh.scale.set(obj.scale.x, obj.scale.y, obj.scale.z)
mesh.rotation.set(obj.rotation.x, obj.rotation.y, obj.rotation.z)
mesh.position.set(1000, 200, 90) **// If I change the position from (x:0, y:0, z:0) text is not visible on the canvas**
nftAddTJS.add(mesh, '3dText', false)
})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed