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 of 1 = 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 LEFT justification, the left edge of the first line is at the (transformed) origin, and all left edges are aligned.
    • RIGHT justification is similar β€” same deal, right side.
    • CENTER justification places the center of the first string at the (transformed) origin, with the centers of all remaining strings aligned under it.
  • 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 the SoTextDetail. 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 πŸ’–βœ¨πŸŽ€