Jump to content

converting normals to tangent space


Recommended Posts

Hi,

I am using Houdini to create a flow map, which is basically a normal map. I am using the normal direction to colour the vertices (there is more information on this here: http://www.valvesoftware.com/publications/2010/siggraph2010_vlachos_waterflow.pdf )

Because I am using an irregular object I need the map to be in tangent space rather than worldspace- again like a normal map.

This is where I am having problems. There doesn't seem to be an easy way to make the conversion in houdini. I have achieved the best results by using polyframe to get tangent, normal and binormal for my original object, then a vopsop with an orient node, using the x,y and z values of the tangent, binormal and normal to orient the normals. This works if I type in the values by hand (for a flat plane) but if I try to use an expression get them on a per point basis:

along the lines of point("../../point2", $PT, "tangentv", 0)

I get zero values for everything

Can anyone come up with a solution for this- or perhaps a better way of doing it?

thanks

Link to comment
Share on other sites

Where are you using the expression? It may not work in every node.

I wanted to use it in the transform matrix for an orient node within the vopsop, but this evidently does not work. If I use a fixed value for the point number

ie: point("../../point2", 1, "tangentu", 0)

then I (sometimes) get an error saying "cannot have channels which depend on time" (which they dont)

if I "delete channels" from the orient node then it replaces them with the correct values, and everything works- but only for a flat plane where the tangents, normals and binormals are the same across all points.

If I use the $PT variable it just doesn't work (no error)

I have attached an image showing the network.

I think the best solution would be to write a script to do this for me, but I am not sure where to start- there seem to be a lot of different options for doing this.

post-7566-132575626543_thumb.jpg

Edited by susiezgreen
Link to comment
Share on other sites

if you use import attribute, you can grab all of your attributes there, vops works per point natively. you can then convert your vectors to floats and your floats to a matrix.

That works! Great, thank you very much. I had tried something similar but I was using 'get attribute', not 'import attribute' so it didn't work

Link to comment
Share on other sites

  • 10 months later...

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