Create Advanced User Interfaces with OpenGL Based 3D Visualization
Overview
LabVIEW provides you with a wide selection of options to present your data. With the 3D Picture Control it is now easy to create, import and control 3D graphics for realistic presentation of real world objects.
Table of Contents
History of 3D Graphics in LabVIEW
From the beginning of LabVIEW, users have had the ability to present their data with graphs, but this was initially limited to 2-dimensional graphics. In LabVIEW 5.1, the ability to graphically visualize 3-dimensional data was introduced with the 3D Graphs. These graphs are based on the ComponentWorks ActiveX control and they were especially suitable for point, line, surface and parametric plots.
After the release of LabVIEW 7.1, an online toolkit known as the 3D Picture Control Evaluation Software was available as a free download. This unsupported toolkit had a similar functionality to the new 3D Picture Control. However, the toolkit was less efficient due to heavy data handling, was only supported on Microsoft Windows and did not support hardware accelerated rendering.
What is the 3D Picture Control?
The LabVIEW 3D Picture Control introduced in LabVIEW 8.20 makes it possible to create complex 3D scenes without dealing with the low-level complications of 3D graphics. A simple, yet powerful API is introduced with the 3D Picture Control to handle most common tasks of creating, importing and controlling objects. The 3D Picture Control uses optimized data handling and supports OpenGL hardware acceleration for fast and smooth rendering.
Application Areas for the 3D Picture Control
Many applications can take advantage of the 3D Picture Control. However, two application areas are the most common for the 3D Picture Control:
- Applying measured data to a 3D model of the physical system, to better visualize position, strain, temperature, etc.
- Applying simulated data to a simulated 3D model to visually predict behavior and optimize design.
An example of the first application is the monitoring of the deflection of a plane wing measured from a grid of 1000 strain gauges. Traditionally, you would utilize graphs to display the information at certain points of the wing. While these graphs would accurately display the measured data, they would not give a good visual indication of the position of the deflection area and it would be nearly impossible to get a good overview of all the 1000 channels of data. With the 3D Picture Control, you can now import a 3D model of the wing and apply the measured data to the appropriate positions of the wing to visualize the strain with color changes or deflection of the 3D model.
An example for the second application area is the modeling of a robotic arm and its control algorithm. A robotic arm with several joints has a risk of damage if the arm hits itself at certain positions. A correct calculated control algorithm will prevent such damage by taking into account the absolute position of the arm, only given the rotational value of each joint. Proving a good control algorithm would require proximity graphs, and mathematical equations to show its worth. However, by embedding the control algorithm in LabVIEW and applying the joint rotations to a 3D model of the robotic arm, it is a simple visual task to verify that the robot arm will not get damaged.
How to Use the 3D Picture Control
The main functionality of the 3D Picture Control can be split into four parts:
- Exploring a 3D scene with the mouse
- Creating 3D objects from scratch
- Controlling an object
- Importing a 3D model from file
Exploring a 3D scene with the mouse
With the 3D Picture Control you can intuitively explore your 3D scenes with the mouse. This feature is referred to as the Camera Controller. The interactive Camera Controller does not require any programming and can be easily enabled or disabled by right-clicking the 3D Picture Control and selecting the Camera Controller menu. Run the solarsystem.vi shipping example to try the interactive Camera Controller.

Figure 1 - Enabling interactive Camera Controller
Creating 3D objects from scratch
When creating your object for your 3D scene in LabVIEW, it must be done programmatically as opposed to a CAD environment, such as SolidWorks, where objects can be “drawn” with the mouse.
Here is an example of creating a 3D scene with an object shaped like a cone:
- Create an object with the “Create Object.vi”.
- Create the desired geometry by using the geometry palette, in this case the “Create Cone.vi”.
- Assign the geometry to the object.
- Finally, display the 3D scene, consisting of only the cone shaped object, in the 3D Picture Control on the front panel.
Controlling an object
The ability to control an object in the 3D scene is essential when visualizing dynamic changes in your model. A common way to control an object is to translate or rotate it. However, you can also change properties of an object such as the color, texture, etc.
This example below shows how to control the cone shaped object from previous example. The object is moved/translated to a new location with the Translate Object.vi. The five images of the 3D Picture Control show how the cone is translated.

Figure 3 - Translating an object
Importing a 3D model from file
CAD applications such as SolidWorks, 3D Studio, etc. are ideal for manually building your advanced 3D models. In case you have access to a file of the 3D model from such an application you can import it to LabVIEW and show and control it with the 3D Picture Control. You can import three different 3D file formats in LabVIEW; VRML, STL and ASE.
This example shows how to import a VRML file and show it in the 3D Picture Control.
- Load the specified VRML file with the Load VRML File.vi and returns the object reference to the 3D model in the file.
- Display the 3D model directly in the 3D Picture Control. This is possible, because the VRML model is treated as an object and not as a geometry.

Figure 4 - Importing a 3D-model from file
To access a specific part of the imported model, simply use the Get Object method. This will extract the part you specify by the index.

[+] Enlarge Image
Figure 5 - Accessing a specific part from a 3D-model
Try the 3D Picture Control Right Now
To test-drive LabVIEW and to get a hands-on experience of the 3D Picture Control, try the Online Evaluation version of LabVIEW here:
Download LabVIEW
Reader Comments | Submit a comment »
Third party 3D component for LabView
While excellent for simple 3D graphics
the 3D components are still not
matching advanced visualization
capabilities available today and
desirable for many cases. This does not
mean that potential user has to rule out
LabView and do all the programming
from the scratch. For advanced users of
LabView there are libraries created for
full compatibility with LabView that offer
advanced Geo, multiple layer surface,
Medical Volume, LIDAR data
visualization and lots more.
In the link below advanced multiple
surface data for 3D Earth monitoring
is used in combination with LabView
IDE within easy and fast to develop
interface everyone enjoy in LabView.
http://www.sciencegl.com/3Dsurf/Shots/
GIS_Map_application.jpg
For more information please refer to
www.sciencegl.com
- Igor Malinovsky, ScienceGL, Inc.. info@sciencegl.com - Mar 9, 2007
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).

