-
Notifications
You must be signed in to change notification settings - Fork 123
TextGenerator Tutorial
Viktor Kovacs edited this page Nov 10, 2016
·
2 revisions
Here is the result of this tutorial
JSModeler uses the font specification format generated with Facetype.js. You can generate your own specification, or use the one provided in the font folder next to the build.
The first thing you have to do is to load the font specification json file. When it is loaded, you can generate 3D text using the loaded font specification:
JSM.LoadJsonFile ('font/firasans.json', function (jsonData) {
var model = JSM.GenerateText (text, jsonData, 0.01, 1.5, 10);
var meshes = JSM.ConvertModelToThreeMeshes (model);
viewer.AddMeshes (meshes);
viewer.Draw ();
});