Overview
This example makes use of a custom control which reacts to cursor movement.
Description
The custom control is created to represent an eye. Depending on the position of the cursor, an algorithm is created to calculate values that move the eye towards the cursor. This is done by using the mouse move event to determine the position of the mouse cursor. Based on the vertical and horizontal coordinates of the mouse position, the irises of the 2 eyes rotate so that they align the center of the eye to the iris and to the mouse cursor.
Requirements
Steps to Implement or Execute Code
Additional Information or References
Block Diagram
Front Panel
Have a look here for an improved (and hilarious) version of this example: https://decibel.ni.com/content/docs/DOC-5073
Here is another googly eyes example that makes use of the NI Vision libraries: https://decibel.ni.com/content/docs/DOC-25399
**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.