There are various ways to change the appearance of a 3D object in a 3D scene, such as applying transformations or configuring a light source for the 3D scene. You also can change the appearance of the surface of a 3D object. A texture is a 2D image that you wrap around a 3D object. Use textures when you want to apply a detailed design to the surface of a 3D object.
Complete the following steps to apply a texture to a 3D object.
- Create a 3D scene, or open a VI that contains a 3D scene.
- Remove the wire that connects the 3D object to the 3D picture control terminal.
- Right-click the reference output of the Set Drawable method and select Create»Property for SceneObject Class»Specials»Texturing from the shortcut menu to create the Specials:Texturing property.
- Place the Specials:Texturing property to the right of the Set Drawable method, right-click the property, and select Change to Write from the shortcut menu.
- Right-click the Specials:Texturing input of the Specials:Texturing property, select Create»Constant from the shortcut menu, and change the value of the constant to On.
 |
Note If you do not set Specials:Texturing to On, you cannot apply texture to a 3D object. If the object to which you want to apply the texture is a child of another object, you can set Specials:Texturing to Inherit Value to inherit the texture settings of the parent object. |
- Right-click the reference output of the Specials: Texturing method and select Create»Method for SceneObject Class»Texture»Set Texture from the shortcut menu to create the Texture:Set Texture method.
- Place the Texture:Set Texture method to the right of the Specials:Texturing method.
- Wire the reference output of the Specials:Texturing method to the reference input of the Texture:Set Texture method.
- Add the Texture VI to the block diagram.
- Wire the image you want to use to the Image input of the Texture VI. You can write an image cluster to wire to this input, use the Graphics Formats VIs to read an image from a file, or use an Invoke Node to get image data programmatically.
- Right-click the New Texture Refnum output of the Texture VI and select Create»Property for SceneObject Class»Apply Mode from the shortcut menu to create the Apply Mode property.
- Place the Apply Mode property to the right of the Texture VI, right-click the property, and select Change to Write from the shortcut menu.
- Right-click the Apply Mode input of the Apply Mode property select Create»Constant from the shortcut menu, and change the value of the constant to select how you want to apply the texture.
 |
Note If you do not set the apply mode for the texture, LabVIEW applies the texture with blending, where the image data blends with the background color of the object. If you want the texture to retain the coloration of the original 2D image, set Apply Mode to As a Decal or As a replacement. |
- Wire the New Texture Refnum output of the Texture VI to the reference input of the Apply Mode property.
- Wire the reference output of the Apply Mode property to the Texture input of the Texture:Set Texture method.
The following block diagram shows a 3D scene that contains one object with a texture applied as a decal. In this example, the Read JPEG File VI gets the image to apply as the texture.

- Wire error in and error out terminals on the block diagram.
- Run the VI to generate the 3D scene. The object appears with the texture applied.
This procedure gives a basic overview of how to apply texture to an object in a 3D scene. Use the SceneTexture properties to set additional configuration settings for a texture, such as the filter mode, horizontal or vertical wrap mode, and transformations to apply to the texture.
Refer to the solarsystem VI in the labview\examples\picture\3D Picture Control directory for an example of a 3D scene that contains objects with textures.