To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example makes use of the Color Change.vi to change the color and alpha (opacity) value of a 3D object built in LabVIEW.
Description
A cylinder is the 3D object generated for this VI, using Create Cylinder.vi from the geometries palette. You could change this to another shape if desired.
The color and transparency are then set with Color Change.vi. Here, the alpha value refers to the degree of opacity of an object and can be a value between 0 and 1; 0 being completely translucent and 1 being completely opaque. It is necessary for the cylinder to be an 'object' to to allow us to display the cylinder in a 3D picture control, so
Create object.vi is used.
A property node is used to set the Blending.Mode to On, which is required in order for the 'alpha' value to be applied. Then we call the Set Drawable method of the SceneObject invoke node on our cylinder, to allow us to display it in a 3D scene. In the original version of this example, the 'Set Geometry' method was used in this invoke node. However this method is now obsolete, and Set Drawable gives us the same functionality. Finally, the cylinder is displayed in a 3D picture control.
These two front panel screenshots demonstrate the difference between an Alpha value of .8 and .2:
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Additional Information or References
Block Diagram of the VI
**This document has been updated to meet the current required format for the NI Code Exchange. **
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Could you please add ascreenshot of your front panel.