Example Code

Recording 3D Picture Control Interactions

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This code allows the user to understand some fundamental concepts for the 3D Picture by animating an image of the solar system.

 

Description

This example demonstrates some fundamental concepts for the 3D picture. Concepts covered include object creation, texturing, object movement, and object hierarchy. There is a lot of interaction that the user can have with the control, and it may be desirable to record their interactions with the picture control.  Fortunately, there is a property of the control called ModelViewMatrix, which allows one to programmatically monitor the current camera position, in relation to the 3D object being viewed.  Using a property node, one can continuously monitor the position of the camera viewing the 3D picture, and record these movements if desired for playing back at a later time. 

The attached VI is a modified version of a LabVIEW shipping example for observing a solar system.  This one is modified to monitor the ModelViewMatrix property, and record its current values every 2ms.  If the user then wants to play the recording back, they can click the playback button to view the recording camera movement.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI, and press the record button
  2. Use the mouse in the 3D picture control to manipulate the angle of viewing of the picture
  3. Click the record button to turn recording off
  4. Click the Playback button to observe the recorded motions of the camera play back
  5. Proceed to record more or erase the recording

Additional Information or References

5912.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.** 

Chris_G
Sr Test Engineer
Medtronic, Inc.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.