Adding Text to a 3D Scene

You can add text to a 3D scene that appears when you generate the scene by creating a text object. Complete the following steps to add text to a 3D scene.

  1. Add a 3D picture control to the front panel.

     Add  Find
  2. Add the Create Object VI to the block diagram to the left of the 3D picture control terminal.

     Add  Find
  3. Right-click the Scene:New Object output of the Create Object VI and select Create»Method for SceneObject Class»Set Drawable from the shortcut menu to add the Set Drawable method to the block diagram.
Note  You also can use the Class Browser window to browse for and create properties and methods.
  1. Wire the Scene:New Object output of the Create Object VI to the reference input of the Set Drawable method.
  2. Add the Create Text VI to the block diagram to create a new text object.

     Add  Find
  3. Right-click the Text input of the Create Text VI and select Create»Constant from the shortcut menu to create a new constant.
  4. Enter the text you want to appear in the 3D scene in the constant you created in the previous step.
  5. Right-click the New Text Refnum output of the Create Text VI and select Create»Property for SceneText Class»Character Size from the shortcut menu to add the Character Size property to the block diagram.
  6. Wire the New Text Refnum output of the Create Text VI to the reference input of the Character Size property.
  7. Right-click the Character Size property and select Change To Write from the shortcut menu.
  8. Right-click the Character Size input of the Character Size property and select Create»Constant from the shortcut menu to create a new constant.
  9. Enter a value for the character size in the constant you created in the previous step.
  10. (Optional) Expand the Character Size property node to configure additional SceneText properties.
  11. Wire the reference output of the Character Size property to the Drawable input of the Set Drawable method.
  12. Wire the reference output of the Set Drawable method to the 3D picture control terminal. The following block diagram shows a 3D scene that contains the text My Text. The text is set to a character size of 2.

  1. (Optional) For more configuration options, delete the wire that connects the Set Drawable method to the 3D picture control terminal and wire the reference output of the Set Drawable method to any SceneObject property or method.
Note  You cannot apply texture to a text object.
  1. Wire error in and error out terminals on the block diagram.
  2. Run the VI to generate the 3D scene.