At the beginning of my work with three.js I wanted to see the arrangement of the vertices and faces, so I did something similar, but simpler with THREE.Line.
function vertexFaceNumbersHelper( mesh, mode, size, color ) {
// mode: 0 nothing, 1 vertex, 2 face, 3 vertex & face
Definitively not. Possibilities are very limited (12 chars max). Text is drawn via shader seeking for glyphs in a table texture (atlas). It allows to draw an insane number of texts, but small texts (debugging purposes). The only options are : position, color, size
Hm, i dont know what’s happening here.
But i can notice that the error seems to come from the mesh being “undefined”, so it’s probably not coming from PointTextHelper.
Since the project is one year old, i’ve made some new tests, just to be sure it’s still compatible with the last version of Threejs. It is :
I made a slight improvement (1.0.6): displayVertices accepts BufferGeometry instances, so now the source code of the demo, available here, is quite straight forward :
const knot = new Mesh(
new TorusKnotGeometry(1.2, .5, 400, 64),
new MeshBasicMaterial({ color: '#6cf', wireframe: true }),
)
scene.add(knot)
const pth = new PointTextHelper()
scene.add(pth)
pth.displayVertices(knot.geometry, {
color: '#6cf',
size: .05,
})