BufferGeometryExtrudeGeometry

TextGeometry

A class for generating text as a single geometry. It is constructed by providing a string of text, and a set of parameters consisting of a loaded font and settings for the geometry's ancestor class ExtrudeGeometry. See the Font and TTFLoader pages for additional details.

Code Example

v3d.loadModule('opentype.js', () => { const loader = new v3d.TTFLoader(); loader.load('my_font.woff', function(fontInfo) { const geometry = new v3d.TextGeometry('Hello Verge3D!', { font: new v3d.Font(fontInfo), size: 1, height: 0.1, curveSegments: 12, bevelEnabled: true, bevelThickness: 0.1, bevelSize: 0.1, bevelOffset: 0, bevelSegments: 5 }); const material = v3d.MaterialUtils.createDiffuseMaterial('MyMaterial', new v3d.Color('red'), 1); const mesh = new v3d.Mesh(geometry, material); app.scene.add(mesh); }); });

Constructor

TextGeometry(text : String, parameters : Object)

Procedural geometry is fun. However, in real life applications this feature is rarely needed. It would be more efficient do design text in the preferred modelling suite and export/load to Verge3D via glTF.

Properties

See the base ExtrudeGeometry class for common properties.

.parameters : Object

An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.

Methods

See the base ExtrudeGeometry class for common methods.

See Also

Check out the Text Rendering section in the manual for more info on creating text objects in Verge3D.

Source

For more info on how to obtain the source code of this module see this page.