I want to show dimension of grid division in my scene.
I have already added grid helper with size and division in my scene. Also calculated size/length of each division.But i am unable to show that size/length on my scene.
Below are the image what i have done yet
And below image is what i want to show
That 100mm length is what i want to show in my scene.
If you are just going to have a couple of sizes - 10mm, 100mm, 1cm, etc., then the easiest is probably just to create textures in Photoshop or Gimp and add them to a small planar mesh.
If you need it to update dynamically, then a better option would be to use a
CanvasTexture, and draw the text onto that.
Here’s an example showing this approach.
Thanks for suggestion!!
But can we update length label dynamically without adding CanvasTexture in my scene?
There is no way to draw text directly with three.js, if that’s what you mean.
There’s lots of other approaches, but they will probably be more complicated than this.
Here’s an example using FontLoader and TextBufferGeometry:
There are many possibilities to use text.
This is for those that wished they had a document for the many font ways with Three.js.
Maybe you know of another way please participate to this listing if you can think of another way.
My journey on fonts in Three.js to create 3D text at runtime without having to load a typeface.json. CSS3DRenderer looked promising though NOT allowed in generating a mesh ONLY the WebGLRenderer allows this to happen.
Do you know of another way to load a font into Three.js?
I’ve done it this way for some of my examples:
also to be found there
Collection of examples from discourse.threejs.org