Jump to content

Use VEX eigenvalues function on 2x2 matrix


GeordieM

Recommended Posts

Hi all, I'm working with flow fields and want to calculate eigen vectors from the flow field values.

I'm working with 2D volumes in ZX plane.  Originally I had 2x vector volumes (I know this is actually 6x float volumes under the hood) representing a vector to the closest point on a curve and vector perpendicular the curve.

I'm now converting this to use a single matrix volume.  This would work well since the only Rank matrix option on a Volume SOP is 3x3 matrix and that's what the VEX eigenvalues function takes.

BUT I'm unclear on how to map 2x 2D vectors (or even 2x 3D vectors for that matter) into the 3x3 matrix so I can just pass it to the eigenvalues function.

hou.Matrix4 class docs has some interesting statements:
http://www.sidefx.com/docs/houdini/hom/hou/Matrix4.html

"Note that Houdini’s matrices are stored in row-major format, and vectors that are multiplied with matrices are treated as row vectors."

"Both VEX and the UT_DMatrix4 class in the Houdini Development Kit (HDK) also store matrices in row-major format."

So I'm guessing something like:

Row major zero matrix:

| x1, y1, 0 |

| x2, y2, 0 |

| 0,  0  , 0 |

Row major unit matrix:

| x1, y1, 0 |

| x2, y2, 0 |

| 0,  0  , 1 |

 

Thoughts?

TNKS!

G

Edited by GeordieM
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...