To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI is an example of using the 3D picture control and the Create Height Field VI to convert an image into a 3D height map.
Description
This VI is an example of using the 3D picture control and the Create Height Field VI to convert an image into a 3D height map.
The original image is analyzed and each pixel is converted to a height based on its colour: pure white will be the highest point on the map, pure black the lowest.
This data is then passed into the Create Height Field VI to create a height map of the original image.
The object and camera are positioned so the object is clearly visible when the program starts
A series of textures are also loaded and depending on a front panel control, different textures can be applied to the object while the program is running.
Requirements
Steps to Implement or Execute Code
Additional Information or References
Front Panel
VI Snippet
The texture is applied on ever iteration of the loop, this is just to keep the example simple but in a larger application it would be worth some additional code to only apply a texture when a new one has been selected.
**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.
Nice example. Thank you.
You could do array division much easier: