Jump to content

Create Attribute Facing A Direction [SOLVED]


Recommended Posts

Just trying some stuff out while I'm learning.. I've managed to have control over where a new attribute is being created, although it's currently using a bounding box set to Y position only.

How would I go about changing this sort of thing from just a Y direction to having control over a vector angle?

hip file attached

giphy.gif

Create_Attribute_Facing_Direction.hip

Edited by GlennimusPrime
Link to comment
Share on other sites

You can "compare" the normals with an arbitrary angle with dot product.
the dot product gives you a number between -1 and 1: from "opposite angles" (=-1) to "parallel angles" (=1)

something like this:

@Cd=0;
if(dot(normalize(chv("angle")),normalize(v@N))>chf("treshold"))@Cd=1;




 

dot.hiplc

  • Like 3
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...