hampuseh Posted March 4, 2019 Share Posted March 4, 2019 (edited) Hi. I was wondering if there is a way to align the normals by the edge direction? In the picture below I have the normals aligned almost as I want them. The problem is that the normals are calculated from the edge before and not the actual edge. In my mind I want the normals to be perfectly aligned with the edge flow. Edited March 4, 2019 by hampuseh Quote Link to comment Share on other sites More sharing options...
bonsak Posted March 4, 2019 Share Posted March 4, 2019 (edited) You can try to use the PolyFrame node and set tangent name to N: Edited March 4, 2019 by bonsak Quote Link to comment Share on other sites More sharing options...
hampuseh Posted March 4, 2019 Author Share Posted March 4, 2019 Yeah I have tried that, but somehow I get different results. I don't know how the "first edge" is calculated but it seems like I get 50/50 of what I want. The normals that are aligning upwards are the correct ones. Quote Link to comment Share on other sites More sharing options...
berglte Posted March 4, 2019 Share Posted March 4, 2019 Depends on the input mesh I guess, but I've attached a sample scene that might give you an idea on how to tackle this problem. A wrangle SOP which loops through points neighbours and stores the direction to the one thats most "up" as defined by an up vector. Plus one way to handle the corner case of points with no neighbours above. I've used something very similar to this in an effect in the past. find_upwards_neighbour.hiplc 1 Quote Link to comment Share on other sites More sharing options...
hampuseh Posted March 5, 2019 Author Share Posted March 5, 2019 11 hours ago, berglte said: Depends on the input mesh I guess, but I've attached a sample scene that might give you an idea on how to tackle this problem. A wrangle SOP which loops through points neighbours and stores the direction to the one thats most "up" as defined by an up vector. Plus one way to handle the corner case of points with no neighbours above. I've used something very similar to this in an effect in the past. find_upwards_neighbour.hiplc I will try your approach as soon as I can. Looks very promising since the detail of my trunk is also from a mountain-sop. I do wonder if connected pieces to the trunk will follow the same logic. But I will check back here once I've tested it out Much appreciated! 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.