# <vgl-text-geometry>

A mesh, line, or point geometry representation.

# Example Usage

<template>
  <div>
    <vgl-renderer antialias>
      <template #scene>
        <vgl-scene>
          <vgl-mesh :position-x="-750">
            <template #geometry>
              <vgl-text-geometry :text="text">
                <template #font>
                  <vgl-font :data="font" />
                </template>
              </vgl-text-geometry>
            </template>
            <template #material>
              <vgl-mesh-standard-material />
            </template>
          </vgl-mesh>
          <vgl-ambient-light color="#ffeecc" />
          <vgl-directional-light
            :position-y="1"
            :position-z="2"
          />
        </vgl-scene>
      </template>
      <template #camera>
        <vgl-perspective-camera
          position="spherical"
          :position-radius="1000"
          :position-phi="1.3"
          :position-theta="0.3"
          rotation="lookAt"
        />
      </template>
    </vgl-renderer>
    <aside>
      <label>Text<input v-model="text"></label>
    </aside>
  </div>
</template>

<script>
import * as components from 'vue-gl';

const typeface = require('three/examples/fonts/helvetiker_regular.typeface.json');

export default {
  components,
  data: () => ({
    font: typeface,
    text: 'Text to be displayed.',
  }),
};
</script>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

# Props

  • name : string
    An arbitrary name of the instance.
    Defaults to [object Object]
  • drawRangeStart : number
    The start index of drawn part in the geometry.
    Defaults to [object Object]
  • drawRangeCount : number
    The number of indices to be drawn.
    Defaults to [object Object]
  • groups : array
    An array of objects those represent index groups to be rendered in separate draw calls.
    Defaults to [object Object]
  • curveSegments : number
    The number of points on the curves.
    Defaults to [object Object]
  • steps : number
    The number of segments along to the extruded spline depth.
    Defaults to [object Object]
  • depth : number
    The depth of the extrusion.
    Defaults to [object Object]
  • bevelEnabled : boolean
    Wether to enable beveling or not.
  • bevelThickness : number
    The bevel depth going into the shape.
    Defaults to [object Object]
  • bevelSize : number
    The distance from the shape outline that the bevel extends.
  • bevelOffset : number
    The distance from the shape outline that the bevel starts.
    Defaults to [object Object]
  • bevelSegments : number
    The number of bevel layers.
    Defaults to [object Object]
  • uvGenerator : object
    An object that provides UV generator functions.
  • text : string
    The text to be shown.
    Defaults to [object Object]
  • size : number
    The size of the text.
    Defaults to [object Object]

# Slots

  • Any
    Each attribute in a named slot will be added to the geometry with the same name as the slot.