vcText3DSet

vcText3DSet is a geometry set used for generating 3D text. Unlike 2D text, 3D text is generated using geometry and has both a position and orientation in 3D world.

Inherits: vcGeometrySet

Properties

Name Type Access Description
Matrix vcMatrix RW Defines the position matrix of text.
OffsetX Integer RW Defines an offset (in pixels) for horizontal axis when text is projected on screen.
OffsetY Integer RW Defines an offset (in pixels) for vertical axis when text is projected on screen.
Text String RW Defines a string of characters to render as a one line of 3D text.

Methods

Name Return Type Parameters Description
getTextHeight Integer None Returns the calculated height of text in pixels.
getTextWidth Integer None Returns the calculated width of text in pixels.
update None None Updates the geometry of text in 3D world.

Examples

Example. Create 3D text in component

from vcScript import *
 
app = getApplication()
comp = getComponent()
comp.Name = "Example"
 
gs = comp.Geometry.createGeometrySet(VC_TEXT3DSET)
 
#assign material to 3D text
mat = app.findMaterial("red")
gs.Material = mat
 
#display component name in 3D world
gs.Text = "Name: " + comp.Name
 
#scale 3D text
mtx = gs.Matrix
mtx.scaleAbs(30.0, 30.0, 0)
gs.Matrix = mtx
gs.update()
app.render()