Can we add text to a GLTF model?

This is my first time using three.js. Due to a project requirement I have to show the values of a real machine on a 3D model on web.in real time, I did my research on this topic since yesterday but I am unable to find an answer. I have successfully added GLTF model but unable to add and TEXT (not texture).

What does this mean? Can you show with some diagrams what you want to achieve here?

The glTF file is not going to update itself in realtime – you’ll likely need to load the model, and then (separately) use three.js APIs like TextBufferGeometry to add the text wherever it needs to be on the model.

1 Like

image

Consider this image as a 3d model and the screen, marked red, will show certain values for that machine. This is basically the project requirement, show values on display screen of the machine so that it gives a real life experience.

I am aware of that and why would I even expect it to update itself :thinking: I want to update the text with the data I am getting from an API of the Machine.

Already tried that but I am unable to display text on the GLTF model using TextBuffer that is why I hear for help.

1 Like

There is no need to attach the text to the model. Display the model, and (separately) display some text at the right coordinates so that it appears to be on the screen. You can use the threejs editor to manually position the text until you find the coordinates that look right.

You could also modify the model in Blender, making the screen a separate object you can modify and attach things to after loading it, but this is may be more complicated depending on your model, and the visual result will be the same.

If you’re unable to add any text to your scene, please share your code so we can help you understand the problem.

2 Likes

Okay, i’ll going to try that today and will update here.

It was a success I was able to display text as a separate object on the screen. Thanks for the help!

can you please share the code?? for us to learn?