Jump to content

Cross Product not returning perpendicular axis


BeachBoy

Recommended Posts

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

Link to comment
Share on other sites

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

 

 

image.thumb.png.6eb771ab2239473813a2535797aa8f92.png

  • Like 1
Link to comment
Share on other sites

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 by haggi
  • Like 2
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...