Visual3DText
Display 3D camera-oriented text.
Target: Sofa.Component.Visual
namespace: sofa::component::visual
parents:
- VisualModel
Data
Name | Description | Default value |
---|---|---|
name | object name | unnamed |
printLog | if true, emits extra messages at runtime. | 0 |
tags | list of the subsets the object belongs to | |
bbox | this object bounding box | |
componentState | The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). | Undefined |
listening | if true, handle the events, otherwise ignore the events | 0 |
enable | Display the object or not | 1 |
text | Test to display | |
position | 3d position | 0 0 0 |
scale | text scale | 1 |
color | text color. (default=[1.0,1.0,1.0,1.0]) | 1 1 1 1 |
depthTest | perform depth test | 1 |
Links
Name | Description | Destination type name |
---|---|---|
context | Graph Node containing this object (or BaseContext::getDefault() if no graph is used) | BaseContext |
slaves | Sub-objects used internally by this object | BaseObject |
master | nullptr for regular objects, or master object for which this object is one sub-objects | BaseObject |
Examples
Visual3DText.scn
<?xml version="1.0" ?>
<Node name="root" >
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [Visual3DText VisualStyle] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<DefaultAnimationLoop/>
<VisualStyle displayFlags="showVisualModels"/>
<Visual3DText text="hello world!" position="1 1 1" color="red" scale="2" depthTest="false"/>
<MeshOBJLoader name="meshLoader_0" filename="mesh/dragon.obj" handleSeams="1" />
<OglModel src="@meshLoader_0"/>
</Node>
def createScene(root_node):
root = root_node.addChild('root')
root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
root.addObject('RequiredPlugin', name="Sofa.Component.Visual")
root.addObject('RequiredPlugin', name="Sofa.GL.Component.Rendering3D")
root.addObject('DefaultAnimationLoop', )
root.addObject('VisualStyle', displayFlags="showVisualModels")
root.addObject('Visual3DText', text="hello world!", position="1 1 1", color="red", scale="2", depthTest="false")
root.addObject('MeshOBJLoader', name="meshLoader_0", filename="mesh/dragon.obj", handleSeams="1")
root.addObject('OglModel', src="@meshLoader_0")