# LabVIEW

cancel
Showing results for
Did you mean:

## ModelView Matix... I found but what do I do with it?

The 3D picture has a property called "ModelVIew Matrix".

"

Reads or writes a matrix that contains the translation, rotation, and scale values for the 3D scene that appears in the 3D picture control.

This matrix changes when I manipulate the scene, rotating dragging zooming etc.

I have taken that value and wired to a similar porperty of another 3D picture and it will follow the changes applied to the first 3D picture, great!

BUT, My intent is to create a small naviagation window that contains only a XYZ axis that will rotate with the first 3D picture but will NOT ZOOM.

So it looks like I will have to msage the matrix to cancel out any zooming. TO do this, I suspect i will have to pcik apart that matrix and normalize it OR SOMETHING!

So, does anyone out there in Wire-World have an idea how to work with the 4X4 matrix?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 1 of 3
(1,118 Views)

## Re: ModelView Matix... I found but what do I do with it?

index 2,3 seems to be the zoom factor but why is it negative?

Still poking around,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 3
(1,104 Views)

## Re: ModelView Matix... I found but what do I do with it?

I would investigate an OpenGL reference for the specifics of how that matrix relates to the Up, Target and Camera position.  In general, n-D affine transformations are performed with an n+1 x n+1 matrix.  In this case you have a 4x4 matrix.  The upper 3x3 matrix is the combined scale/rotation matrix.  The scaling transformation is diagonal with each axis scale factor on the diagonal.  The rotation transformation is your standard 3x3 rotation matrix.  These are combined via multiplication.  The first three rows of the fourth column are translations, and the fourth row is [0,0,0,1] to maintain affinity.

The devil is in the details which include sign conventions and the order of transformation (matrix multiplication does not commute).  You would have to consult an OpenGL reference, or perhaps with these clues you can sniff it down.

http://www.songho.ca/opengl/gl_transform.html#modelview

Message 3 of 3
(1,099 Views)