By default, new 3D objects have solid, single-colored surfaces. To change the appearance, you must apply a texture to the 3D object. A texture is a 2D image that you wrap around a 3D object.
Use the following block diagram objects to change the surface appearance of a 3D object:
|Reference to 3D Object||Specials:Texturing Property||Texture VI||Apply Mode Property||Texture:Set Texture Method||3D Picture Control|
|Create single 3D object||
Create the following block diagram to programmatically change the appearance of a 3D object.
Customize the gray sections for your unique programming goals.
The following list describes important details about the previous diagram:
|Obtain a reference to the 3D object whose appearance you want to change. Your programming goals determine how you obtain this reference. The most common way to obtain a 3D object reference is to create a new 3D object. This example obtains a 3D object reference by creating a new 3D box.|
|The Specials:Texturing property enables a 3D object to have a texture. If you do not set the Specials:Texturing property 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 the Specials:Texturing property to Inherit Value to inherit the texture settings of the parent object.|
|Obtain LabVIEW image data that defines the texture you want to appear. Use one of the following ways to obtain LabVIEW image data:
|The Texture VI converts the LabVIEW image data to a SceneTexture reference. You must convert image data to a SceneTexture reference so that you can interact with SceneTexture properties and methods to change the way that the texture appears on a 3D object.|
|The Apply Mode property specifies how the texture appears on a 3D object. 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. This example uses the Apply Mode property of the texture to specify that the texture image appears with its original colors as a decal.|
|The Texture:Set Texture method assigns a texture to the referenced 3D object.|
|Use the SceneObject reference to display or manipulate the new 3D object. You can use this reference to achieve the following goals:
Refer to the 3D Model of Solar System VI in the labview\examples\Graphics and Sound\3D Picture Control directory for an example of a 3D scene that contains objects with textures.