BeachBoy Posted October 18, 2020 Share Posted October 18, 2020 Hey all, I was working on a tool to instance branches along a curve when I ran into a slight issue with cross products. I'm trying to find the perpendicular axis between the tangent along a curve and a side vector so I could pitch a branch up or downwards but the vector returned by the cross function seems to pointing a weird way. If anyone would be so kind as to take a look at this, I'd greatly appreciate it! Thank you. CrossProd_weirdness.hiplc Quote Link to comment Share on other sites More sharing options...
ikoon Posted October 20, 2020 Share Posted October 20, 2020 Hi Irvin, in the attached picture ... by typing only @tan you cast the vector into the float. You read only @tan[0]. And then you store that float into the vector tan. If you want to read custom vector attribute, you have to type v@tan 1 Quote Link to comment Share on other sites More sharing options...
haggi Posted October 20, 2020 Share Posted October 20, 2020 (edited) Quote vector normal = @N; vector tan = @tan; Instead of using @tan, you should use v@tan. Houdini only recognizes default attributes correctly. So if you use @tan, it is interpreted as one single float for all three axis. Ah.... juse a few minutes too late Edited October 20, 2020 by haggi 2 Quote Link to comment Share on other sites More sharing options...
BeachBoy Posted October 20, 2020 Author Share Posted October 20, 2020 Hey Ikoon & Haggi, Thanks, this does the trick. This is very helpful to keep in mind for the future!! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.