Text

The text() function creates 3D text geometry in the scene. Adjust size, direction, and billboard behavior to match your layout.

text("meowshapes");
text("billboard").pos([0, 100]).billboard();

orbit({ autoRotate: 1 });

Returns the Text object:


Text

Example usage:
text.size(18).dir("ltr");
field
mesh: THREE.Mesh<THREE.ShapeGeometry>
The THREE.Mesh instance representing this object.
Example
text.mesh.rotation.z = Math.PI / 12;
method
pos(position: Vec3): Text
Set the position of the object.
param position
A vector-like object representing the position.
Example
text.pos([0, 1, 0]);
method
color(color: THREE.ColorRepresentation): Text
Set the color of the object.
param color
A color input for this object.
Example
text.color("black");
method
material(material: THREE.Material): Text
Set the material of the object.
param material
A THREE.Material instance.
Example
text.material(new THREE.MeshStandardMaterial());
method
shaded(): Text
Configures the object to use a shaded material.
Example
text.shaded();
method
size(size: number): Text
Sets the size of the text.
param size
The size of the text.
Example
text.size(24);
method
dir(direction: "ltr" | "rtl" | "tb"): Text
Sets the direction of the text.
param direction
The direction of the text. Can be `ltr` (left to right), `rtl` (right to left), or `tb` (top to bottom).
Example
text.dir("rtl");
method
billboard(): Text
Makes the text always face the camera.
Example
text.billboard();