CapsuleGeometry with TextGeometry in one group

I’m trying to make a capsule with text inside with three js, but receiving just a capsule with cube inside instead of text, what is wrong with my code, can anyone help me pls with this one?

 const capsule = new Mesh(new CapsuleGeometry(3, 3, 32), new MeshLambertMaterial({
                    color: 'red',
                    transparent: true,
                    opacity: 0.4

                const text = new Mesh(new TextGeometry('500', {
                    height: 5, curveSegments: 12, bevelEnabled: true, bevelThickness: 10, bevelSize: 8, bevelOffset: 0, bevelSegments: 5
                }), new MeshBasicMaterial({
                    color: 'black',
                    transparent: false,
                    opacity: 1

                const group = new Group();
                return group

You’ve got no font property in parameters for TextGeometry. Have a look:


works like a charm, thx a lot

1 Like