LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you read the camera position in the 3d picture control?

Hello,

There is a method to setup the camera position, but how do you read the current camera position?  e.g. the user uses the mouse, ctrl, and shift, to change the camera position.  How do you read this new camera position?  There don't seem to be any properties to do this.

I've read this thread:

http://forums.ni.com/ni/board/message?board.id=170&message.id=214629&requireLogin=False

but the question was never answered....

From the comments in that thread, even if you had the proper documentation for the "Model Matrix" property, you couldn't get the information necessary to calculation the camera position.


0 Kudos
Message 1 of 6
(5,861 Views)
You can retrieve the camera position by doing some linear algebra on the modelview matrix.  I attached a screenshot of a quick way to pull this information out.  In the future hopefully we can wrap this up in a nice VI and toss it on the palette
Message 2 of 6
(5,853 Views)
Awesome!  Thanks!

Where did you find documentation on the "Model Matrix" property?  I haven't seen it anywhere.

What are the other components of that inverse matrix?  Can you extract the Camera "Target" property from the remaining values?  What about the "Up Direction" property?

Thanks.
0 Kudos
Message 3 of 6
(5,830 Views)
Hi Chris.  I've attached a "live" version of this VI (version 8.20), so that you can experiment with it.  Also, there is documentation on the ModelView Matrix and other properties in the LabVIEW Help, which you can find with a quick search.

Hope that helps!


Lorielle P.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(5,778 Views)
Lorielle,

Thanks for the VI.

Could you point me towards a more detailed description of the "Modelview Matrix" property?  I've attached a screenshot from the online help.  It is not very helpful.

Download All
0 Kudos
Message 5 of 6
(5,771 Views)
I agree.  The Help description could be more explicit. The SceneGraphDisplay Properties dialog gives some more description for the ModelView Matrix:  "Reads or writes the matrix that contains the translation, rotation, and scale values for a model that appears in the 3D Picture Control."

Unfortunately, that's about all that's available in the LabVIEW Help.  If you'd like more description, it would be appropriate to make that request in the Product Suggestion Center.

Lorielle P.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(5,739 Views)