shinsso Posted May 31, 2017 Share Posted May 31, 2017 Hi guys. I was wondering how I make normal like this image below. there is a cloth surface, and i need to make custom normal direction have any idea? thanks. Quote Link to comment Share on other sites More sharing options...
fencer Posted May 31, 2017 Share Posted May 31, 2017 You just mean directional cross? @N = cross(@N, {1,0,0}); Quote Link to comment Share on other sites More sharing options...
shinsso Posted June 1, 2017 Author Share Posted June 1, 2017 thanks fencer, but it doesn't work. I made a default N with Facet. then I want to make N which is head to down along edges. Quote Link to comment Share on other sites More sharing options...
shinsso Posted June 1, 2017 Author Share Posted June 1, 2017 I tried to use Guide Tangent Space node so I make tangent attribute, then I cross product between my N and tangent, it works!! custom_N.hip Quote Link to comment Share on other sites More sharing options...
f1480187 Posted June 1, 2017 Share Posted June 1, 2017 (edited) Guide Tangent Space didn't compute vectors that necessary looking down, which IMO contradicts with "make N which is head to down along edges". If you won't be happy with GTS output on the real geometry: at first, decide the unique characteristic the target vector will have. Does it points to point's neighbour with least/largest ptnum? Does it points along edge closest to {0, -1, 0} direction? The idea behind choosing one edge over another. That will be a big part of the answer. Edited June 1, 2017 by f1480187 Quote Link to comment Share on other sites More sharing options...
shinsso Posted June 1, 2017 Author Share Posted June 1, 2017 Yes. you're right f1480187. When I applied it to my real geometry, it was not correct. So, I just tried to use Sort node. I sorted points using 'Along Vector' {0, -1, 0}, then I made normal with vop ; I used subtract between position of ptnum and ptnum-1. It's not exactly correct, but it is pretty close to what I want, cuz I just needed velocity for popnet. Thank you for your advised f1480187!! Quote Link to comment Share on other sites More sharing options...
f1480187 Posted June 2, 2017 Share Posted June 2, 2017 Here the snippet which allow to select such down edge more reliably. It works better than height sorting method in cases, where short edges with better "down ratio" may have greater Y than long edges. // Point wrangle. int nbs[] = neighbours(0, @ptnum); // Find edge best aligned with negative Y. float dots[]; foreach (int nb; nbs) { vector pos = point(0, "P", nb); vector dir = normalize(pos - @P); append(dots, dot(dir, {0, -1, 0})); } int best_nb = nbs[find(dots, max(dots))]; vector best_edge = point(0, "P", best_nb) - @P; v@dir = normalize(best_edge); down_edge.hipnc 1 Quote Link to comment Share on other sites More sharing options...
shinsso Posted June 2, 2017 Author Share Posted June 2, 2017 Thank you, f1480187!!!! using dot product then find max value, it would be so useful for me to do procedural animation. Thanks again 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.