javascript - How to add text into along the object using three.js -


i have added text object (a shirt model) using text geometry. here code:

var canvas = document.getelementbyid('mycanvas'); var ctx = canvas.getcontext('2d'); ctx.font = 'italic 18px arial'; ctx.textalign = 'center'; ctx. textbaseline = 'middle'; ctx.fillstyle = 'red';  ctx.filltext('your text', 150, 50);` 

my output looks this:

enter image description here

the text not fit shirt model. if rotate shirt model means text showing irrelevant view. want fit text shirt model this:

enter image description here

how can fit dynamic text shirt model using three.js.

simply drawing text 2d canvas never give satisfactory result. have 3 possibilities tackle issue.

1) using textures loaded three.textureloader.

2) using three.textgeometry:

3) using css3d solution.


check ui example on three.textgeometry documentation page:

enter image description here


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -