01-16-2018 09:25 AM
Hello dear LV users,
I am using 3d picture to display some data, by default when we press and move a mouse around the control it will rotate the camera, we can press CTRL or SHIFT to change that to zoom or move.
I will display data on a touchscreen and I want to have an option for the user to choose what to do, zoom, rotate or move.
Is there a programmatic way to do that?
Last resort will be to try to use winapi and simulate keyboard inputs but I would like to avoid that.
Has anyone faced that problem?
01-16-2018 12:21 PM
Wow I'm a bit surprised. My first instinct was to tell you to check the Visible Items, and see if there is something similar to the Graph Palette which has tools you can click, and then clicking and dragging would zoom in or out. But 3D controls don't have this.
The only thing I found that might be useful is a few property nodes. One is the Graph >> User Defined View >> View Distance. This can be read and written and is the zoom level. You could make a slider that starts at the center, and sliding it zooms in and out. As for positioning I'm not sure. There is the View Latitude, and View Longitude but I think that can be used more for adjusting rotation. I'm not sure if there are properties for adjusting the image by translating it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-16-2018 12:47 PM
Thanks @Hooovahh for a reply and looking into this 🙂
On the low level, it is probably doable by translation/rotation matrix. If I understand correctly 3d picture is a high-level wrapper around OpenGL , but since there is no documentation at all for this specific module for someone who knows nothing about 3d graphic/scenes/rendering and that kind of stuff I would like to avoid big time waste and not dig into that.
I was thinking if this functionality is available inside 3D control it should be a way to expose it for the user.
01-16-2018 01:10 PM
One of these two links may help you.
The thing you are looking for is the ModelViewMatrix
Ben
01-18-2018 08:40 AM
I made this a long time ago. You might find it helpful.