How to use the TextGeometry function from three

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

29
30
31
32
33
34
35
36
37
38

var makeAxisTextGeometry = function (mappings, options) {
    var labelMeshes = [];

    _.each(mappings, function (axis, name) {
        var geometry = new THREE.TextGeometry(name + (axis ? ' : ' + axis : ''), {
            size: options.legendSize,
            height: textGeometryHeight,
            curveSegments: textCurveSegments,
        });
fork icon17
star icon119
watch icon21

+ 3 other calls in file

169
170
171
172
173
174
175
176
177
178
const threeLigth = addLigth( rgbtoHex(obj.color), 
toGlobalPosition(obj.relativePosition))

spotLights[ligth].obj = threeLigth;

var geometry = new THREE.TextGeometry( ligth, {
    font: font,
    size: 10,
    height: 2,
    curveSegments: 12,
fork icon26
star icon28
watch icon0

+ 2 other calls in file

128
129
130
131
132
133
134
135
136
137
}

function drawMtext(entity, data) {
    var color = getColor(entity, data);

    var geometry = new THREE.TextGeometry(entity.text, {
        // font: font,
        size: entity.height * (4 / 5),
        height: 1
    });
fork icon2
star icon0
watch icon2

+ 3 other calls in file

205
206
207
208
209
210
211
212
213
214
if (obj3d) {
  applyObj3d(obj3d);
} else if (text3d) {
  new THREE.FontLoader().load('https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/fonts/helvetiker_regular.typeface.json',
    (font) => {
      const geometry = new THREE.TextGeometry(text3d, {
        font,
        size: 100,
        height: 1,
        curveSegments: 1,
fork icon1
star icon5
watch icon2

1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
// console.log('loader start');

loader.load('./fonts/helvetiker_regular.typeface.json', function (font) {
    // console.log('loader finished');
    // console.log('font', font);
    var geometry = new THREE.TextGeometry('Teerzo', {
        font: font,
        size: 80,
        height: 1,
        curveSegments: 12,
fork icon1
star icon1
watch icon0

38
39
40
41
42
43
44
45
46
  height: 0,
  curveSegments: 1,
};
const baseGeometries = [
  new THREE.TextGeometry('HELLO', optTextGeometry),
  new THREE.TextGeometry('WORLD', optTextGeometry),
];
const geometry = new THREE.BufferGeometry();
let maxCount = 0;
fork icon0
star icon1
watch icon0

53
54
55
56
57
58
59
60
61
62
if (!font.isFont) {
  fontLoader.parse(font);
}

var size = units.convert(object, 'font-size', 'world');
var geometry = new THREE.TextGeometry(text, {
  font: font,
  size: size,
  /* TODO: implement font-height as CSS property. */
  height: size / FONT_SIZE_HEIGHT_RATIO,
fork icon0
star icon0
watch icon2

+ 3 other calls in file

174
175
176
177
178
179
180
181
182


}

function createText(text) {
    textGeo = new THREE.TextGeometry( text, {
        size: 100,
        height: 20,
        curveSegments: 4,
fork icon0
star icon0
watch icon2

+ 3 other calls in file

53
54
55
56
57
58
59
60
61
62
// Start Creation of DataTexture
// Could it be simplified with THREE.FBOUtils.createTextureFromData(textureWidth, textureWidth, data); ?

data = new Float32Array( width * height * 3 );

var textGeo = new THREE.TextGeometry( TEXT, {

  size: 1,
  height: 0.5,
  curveSegments: 0,
fork icon0
star icon0
watch icon2

71
72
73
74
75
76
77
78
79
80
// let width = 64, height = 64;
let width = 512, height = 512;

data = new Float32Array( width * height * 3 );

let textGeo = new THREE.TextGeometry( "DAT", {

  size: 1,
  height: 0.5,
  curveSegments: 0,
fork icon0
star icon0
watch icon2

Other functions in three

Sorted by popularity

function icon

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