LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change the Picture 3D Control mouse handling

I have a Picture 3D Control in my project.

By default, the application will handle the mouse events on the Picture3D Control as follows:

 

Left mouse button = Rotate

SHIFT + Left mouse button = Zoom

CTRL + Left mouse button = Translate

 

However, users of our applications have become familiar with a different mouse mapping:

 

Left mouse button = Rotate

Right mouse button = Translate

Center mouse button or scroll wheel = Zoom

 

I have been unable to find a method or an example (on NI support or Developer Zone) showing me how I can change the mouse behaviour in the Picture 3D control.

I have been able to catch mouse events and handled the scroll wheel, but the other functionality remains as is.

 

Any help would be greatly appreciated. 

 

EDIT: I am using LabView 8.2 on Windows XP 

Message Edited by ccmonter on 11-11-2009 04:47 PM
0 Kudos
Message 1 of 12
(3,908 Views)

Hello ccmonter,

 

It is possible to change the mouse event for Picture 3D control, however, it is not a trivial task.

You would have to use Event Structure for the VI to register the keystroke to setup both Mouse key and Keyboard key.

The use another Even Structure for 3D picture to select the action that you wish to perform.

Andy Chang
National Instruments
LabVIEW Control Design and Simulation
Message 2 of 12
(3,888 Views)

I would be interested in a little more information that would point me in the right direction.  I certainly don't expect a full solution.

 

One thing that I have not found is how to inform the Picture 3D control that a specific action should take place, such as "zoom".

Neither property nodes nor invoke nodes appear to have the necessary actions.

 

For example, if I want to use the scroll wheel to zoom in, I can currently determine when the user performs the action on the mouse, but I have no easy way to send that to the Picture 3D control. 

0 Kudos
Message 3 of 12
(3,878 Views)
if you need to use scrolling you can uses the aquire input data.vi and intialize mouse.vi for scrolling
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 4 of 12
(3,873 Views)

Yes, I can acquire the mouse data.  That's not a problem.

My problem is now forcing the Picture 3D control to scroll based on the captured mouse data.

 

I have not found something such as Picture3D->properties->zoom. 

0 Kudos
Message 5 of 12
(3,868 Views)

Old topic but thought I'd revive it. I have the same issue, how to implement scroll data for 3D picture control, to zoom in/out of objects in 3D picture control using the mousewheel.

0 Kudos
Message 6 of 12
(3,371 Views)

@Nik1 wrote:

Old topic but thought I'd revive it. I have the same issue, how to implement scroll data for 3D picture control, to zoom in/out of objects in 3D picture control using the mousewheel.


 

I don't have a machine up to look at the code but this is what I recall.

 

THe key was to figure out the Model View Matrix.

 

In my case I wanted a small copy of the 3D image to follow the movements of the main 3D image but override all zooming so the small image would function as a navigation guide to help the user understand what they were looking at and from what angle.

 

I think I got away with only having to override a single value in the matrix so my understanding of the matrix is limited. If you do figure out how that matrix works and develop a simple demo, I would very much like to see it so I can learn as well.

 

I hope that helps!

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 12
(3,365 Views)

Ah... I see. Yeah I used the ModelViewMatrix, it gives you translation, scale and rotation values for a 3D scene then extracted only the current camera scene position (x,y,z). I did this by doing what Darin from your thread suggested and found out how the values in ModelViewMatrix are related to (x,y,z). Inversing the matrix then multiplying it by a constant seems to do the trick, then its just a simple matter of converting it to an array and you've got what you need. Check the image below. But I'm still not sure how to integrate zooming capabilities via scroll wheel, maybe the scale values from the modelviewmatrix? Although I'm not confident.

Message 8 of 12
(3,359 Views)

Muddled my words up a bit in that last post. The Z value or 3rd value in the final Matrix is the zoom value and it's positive.

I've read some threads about mouse wheel polling (using scroll information to zoom), but I'm not clear how that works and how to implement it for 3D picture control? Seems like its only possible to use shift + left mouse button to zoom in/out. If anyone could please explain would be greatly appreciated.

0 Kudos
Message 9 of 12
(3,349 Views)

I suggest starting a new thread on the mouse wheel. Only those that know the 3D will look at this thread and the mouse wheel people will never know about your question. If you create a new thread, please update this thread so we can find that thread.

 

Just trying to help!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 12
(3,346 Views)