Jump to content

attrib reorient


MENOZ

Recommended Posts

Hello,

I was wondering how could be replicated the attribute reorient in vex?

what is the math behind it?

how does it figures out how the geometry is oriented?

 

my guess is that it calculate the normals, and somehow tangent for both geometries, and uses the matrix generated from it to orient the vector attribute.

 

if that's the case, how does it calculate a tangent that is consistent during deformation?

 

thanks

Link to comment
Share on other sites

even if you take direction to first neighbour as tangent you should have consistent results as long as your geos have the same topology

 

so in other words use N as main direction and vector to first neighbour as up vector for your reference frame transform for both geos, then transform your desired attrib from one to another

Edited by anim
  • Like 1
Link to comment
Share on other sites

ah, I was thinking to use the neighbour, but i remembered that with neighbour() the order is not fixed. but then  I looked at the help and it says it's consistent for consistent geometry, so it might be good!

 

neighbour VEX function

Returns the point index of the neighbour of the point. The order is undefined, but will be consistent for consistent geometry. Returns -1 if the neighbournum is out of range for that point, or the point is out of range for that input, or the input doesn’t exist.

 

thank you!

Link to comment
Share on other sites

  • 2 years later...

Were you able to replicate the function? I'm very interested on how it works.

How do u construct the matrix from normal and up vector? and also why would I need an up vector for it to work?

Been spending hours trying to wrap my head around this, would be great if you can shine some light.

Thanks.

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...