GlennimusPrime Posted March 22, 2021 Share Posted March 22, 2021 (edited) 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 Create_Attribute_Facing_Direction.hip Edited March 23, 2021 by GlennimusPrime Quote Link to comment Share on other sites More sharing options...
bunker Posted March 22, 2021 Share Posted March 22, 2021 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 3 Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted March 23, 2021 Author Share Posted March 23, 2021 Perfect, thank you so much @bunker! 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.