SOASCIITEXT(3iv)
π SoAsciiText(3IV) π
okay bestie, we're diving into the <Inventor/nodes/SoAsciiText.h> manual page β it's the simple 3D text shape node and it's genuinely so cute. grab a snack, we're doing this π
π INHERITS FROM π
SoBase > SoFieldContainer > SoNode > SoShape > SoAsciiText
the whole glow-up lineage, we love a family tree π
β¨ SYNOPSIS β¨
#include <Inventor/nodes/SoAsciiText.h>
enum Justification {
SoAsciiText::LEFT Left edges of all strings are aligned
SoAsciiText::RIGHT Right edges of all strings are aligned
SoAsciiText::CENTER Centers of all strings are aligned
}
Fields from class SoAsciiText:
SoMFString string
SoSFFloat spacing
SoSFEnum justification
SoMFFloat width
Methods from class SoAsciiText:
SoAsciiText()
static SoType getClassTypeId()
Methods from class SoNode:
void setOverride(SbBool state)
SbBool isOverride() const
SoNode * copy(SbBool copyConnections = FALSE) const
virtual SbBool affectsState() const
static SoNode * getByName(const SbName &name)
static int getByName(const SbName &name, SoNodeList &list)
Methods from class SoFieldContainer:
void setToDefaults()
SbBool hasDefaultValues() const
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
void copyFieldValues(const SoFieldContainer *fc, SbBool
copyConnections = FALSE)
SbBool set(const char *fieldDataString)
void get(SbString &fieldDataString)
virtual int getFields(SoFieldList &resultList) const
virtual SoField * getField(const SbName &fieldName) const
SbBool getFieldName(const SoField *field, SbName &fieldName)
const
SbBool isNotifyEnabled() const
SbBool enableNotify(SbBool flag)
Methods from class SoBase:
void ref()
void unref() const
void unrefNoDelete() const
void touch()
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
virtual void setName(const SbName &name)
virtual SbName getName() const
π¦ DESCRIPTION π¦
So this node is literally just one or more strings of 3D text. that's the whole vibe. π
now, the way that this differs from SoText2 is β and bestie this is the important part β 3D text can be rotated, scaled, lighted, and textured, just like every other 3D shape out here living its truth. but lowkey, in constrast with SoText3, this 3D ascii text cannot be extruded. no extrusion, we don't do that here π
the text origin sits at (0,0,0) after you apply the current transformation. and the scale of the text? that's affected by the size field of the current SoFont plus the current transformation. two things, bestie, both matter.
SoAsciiText uses the current material when it renders. textures get applied to ascii text like this: on the front face of the text, the texture origin is at the base point of the first string. that base point is at the lower left for justification LEFT, at the lower right for RIGHT, and at the lower center for CENTER. the texture is scaled equally in both S and T dimensions, with the font height representing 1 unit. and S increases to the right on the front face. π
π FIELDS π
SoMFString stringβ the text string(s) you wanna display. each string shows up on its own line. multi-string, multi-line, we stan β¨SoSFFloat spacingβ the distance (in the negative y direction) between the base points of successive strings, measured with respect to the current font height. a value of1= single spacing,2= double spacing, and so on forever. the numbers are giving very consistent energy.SoSFEnum justificationβ placement and alignment of the strings, and it comes in three flavors:- With
LEFTjustification, the left edge of the first line is at the (transformed) origin, and all left edges are aligned. RIGHTjustification is similar β same deal, right side.CENTERjustification places the center of the first string at the (transformed) origin, with the centers of all remaining strings aligned under it.
- With
SoMFFloat widthβ the width of each text string. each string gets scaled so that it spans this many units. one width per string, matching set, so satisfying π«Ά
π METHODS π
SoAsciiText()β creates an ascii text node with default settings. the blank canvas, the fresh start, the new era πΈstatic SoType getClassTypeId()β returns the type identifier for this class. that's it, that's the method, and it's doing its job flawlessly.
π₯ ACTION BEHAVIOR π₯
SoGLRenderActionβ draws the text based on the current font, transformation, drawing style, material, texture, complexity, and so on. and so on β she contains multitudes πSoRayPickActionβ performs a pick on the text. the string index and character position are available from theSoTextDetail. so you can literally know exactly which little character got picked, no cap π―SoGetBoundingBoxActionβ computes the bounding box that encloses the text. snug. protected. wrapped up π§SoCallbackActionβ if any triangle callbacks are registered with the action, they will be invoked for each successive triangle used to approximate the text geometry. every single one, one after another, no skipping π¦
π FILE FORMAT/DEFAULTS π
AsciiText {
string ""
spacing 1
justification LEFT
width 0
}
look at those defaults, so clean, so iconic β
π SEE ALSO π
SoFont, SoFontStyle, SoText2, SoText3, SoTextDetail
go read those too bestie, iykyk π
and that's the whole page!! this is SoAsciiText(3IV)() from the SoAsciiText(3IV) manual, page header and all β the footer's got the same SoAsciiText(3IV)() source/version tag on it, no date in sight, just the manual name holding it down. bye bestie, go make some 3D text πβ¨π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms