Configuration object for generating the text geometry.
A 3D point (array of 3 numbers) indicating the top-left corner of the text in the 3D space. This sets the initial position for the first character of the text.
The size of each character in the text. Default is 1.
The text string to display. It can include multiple lines (using \n
).
Returns a SceneGeometry object with the wireframe representation of the provided text, including the necessary positions, indices, and primitive type for rendering.
const textGeometry = buildVectorTextGeometry({
size: 1.5,
origin: [0, 0, 0],
text: "Sample Text"
});
letters
object, where each character is mapped to its wireframe geometry (points and width).size
parameter scales the text, and the mag
constant adjusts the scaling factor for the points' positions.The geometry data for the wireframe vector text.
Creates wireframe vector text as a SceneGeometry.
This function generates the geometry data for rendering text as a wireframe. Each character is represented as a series of lines, with the position of each vertex specified in 3D space. The text is provided as input, and the function constructs the wireframe representation for each character. The resulting geometry can be used for rendering text in 3D environments.
Usage
To create wireframe vector text geometry, simply call the function and pass the appropriate configuration object. For example:
This creates a wireframe mesh for the text "Hello, World!" with each character sized at 2 units, centered at the origin.
Parameters: