Example Code

3D Picture Control - Select Object in Control Using LabVIEW

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 is a reference example for selecting objects in a LabVIEW 3D Picture Control.

 

Description

This VI uses the Pick Point Method and Pick Model Method to allow a user to select objects within the 3D picture control. It uses an event structure to detect the mouse click, calculates the selected coordinates and checks if an object is present at that location. It then returns a reference to that object and simply displays its name.  The reference could also be used to move / delete the object if required.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Run VI.
2. Hit the objects displayed in 3D Picture Control and observe as selected object on frontpanel.

 

Additional Information or Resources

 

2012.PNG

 

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

 

 

------
John.P | Certified LabVIEW Architect | NI Alliance Member

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

Comments
Evan R.
NI Employee (retired)
on

Very cool. If you like this example, you may have some interest in the 3D Object Explorer Example posted here: http://decibel.ni.com/content/docs/DOC-3372

For game programmers, these pick methods are essential for creating any 3D user interface components such as buttons, actors, etc.

one3seven5
Member
Member
on

can i use this VI to for simulation??

JohnMc19
Active Participant
Active Participant
on

Yes you can,

I would also like to point out this similiar example.

John McLaughlin
Academic Account Manager
National Instruments UK & Ireland
JCC_(SK)
Active Participant
Active Participant
on

I've actually just noticed a bug in that example.  The "position" of the 3D picture includes the label.  Instead, the code should use the property "Content Position" instead.

see: http://forums.ni.com/t5/LabVIEW/Pickpoint-doesn-t-hit-objects-in-3D-scene/m-p/2947306#M850755

P.S.: Nice example