How to use the Font function from three

Find comprehensive JavaScript three.Font code examples handpicked from public code repositorys.

4
5
6
7
8
9
10
11
12
13

geometry = new three.Geometry();
textGeometry = new three.Geometry();
material = new three.LineBasicMaterial({color: 'black'});
object = new three.Object3D();
font = new three.Font(fontData);

function addLabel(x, y, z, label, lColor, lSize, rotation) {
    text = new three.BufferGeometry().fromGeometry(new three.TextGeometry(label, {
        font: font,
fork icon306
star icon0
watch icon10

+ 5 other calls in file

32
33
34
35
36
37
38
39
40
41
parameters = parameters || {};

const font = parameters.font;

if (!(font && font.isFont)) {
  console.error('THREE.TextShapeGeometry: font parameter is not an instance of THREE.Font.');
  return new THREE.Geometry();
}

const shapes = font.generateShapes(text, parameters.size);
fork icon0
star icon0
watch icon2

60
61
62
63
64
65
66
67
68
69
 */
export const createLabel = (text, position) => {
        // 暂时不用loader,因为地址本地不好弄
        // var loader = new THREE.FontLoader();
        // 这里模拟loader后的数据
        let font = new THREE.Font(fontData, true);
        let geometry = new THREE.TextBufferGeometry(text, {
                font: font,
                size: 0.5,
                height: 0.01,
fork icon0
star icon0
watch icon1

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)