Description

Display of text annotation.

Functions that can be used to annotate the scene visually with text.

Author: Benjamin Eikel

Date: 2013-07-12

Functions

   
   
void displayText( FrameContext & frameContext, const Geometry::Vec3f & worldPos, const Geometry::Vec2i & pinVector, const float pinWidth, const Util::Color4f & backgroundColor, const Rendering::TextRenderer & textRenderer, const std::string & text, const Util::Color4f & textColor)

Documentation

function
MinSG::TextAnnotation::displayText

public
     
     
void displayText( FrameContext & frameContext,
  const Geometry::Vec3f & worldPos,
  const Geometry::Vec2i & pinVector,
  const float pinWidth,
  const Util::Color4f & backgroundColor,
  const Rendering::TextRenderer & textRenderer,
  const std::string & text,
  const Util::Color4f & textColor
)    

Render text to annotate a 3D position. The 3D position is projected to the screen. The projected position marks the beginning of the pin. The pin direction and length is given as parameter. At the end of the pin, the text is shown with a rectangle as background.

Parameters

frameContext
Frame context that is used for projection and rendering
worldPos
3D position in world coordinates that marks the point for annotation
pinVector
2D direction in screen coordinates that defines the length and direction of the pin. If you do not want to have a pin, pass
(0, 0)

.

pinWidth
The line width that is used to draw the pin
backgroundColor
Color of the background rectangle behind the text and of the pin
textRenderer
Renderer that is used to draw the text. The size and appearance of the text can be changed by using a different renderer.
text
The text string that is to be drawn
textColor
Color of the text

Defined in MinSG/Helper/TextAnnotation.h:60