Jump to content

Align normal by upwards edge


Recommended Posts

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.

525b6ed91989ee766415fe6f304edad3.png.7d2c85fa50f4ee4ba5292150a3bac248.png

Edited by hampuseh
Link to comment
Share on other sites

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.

 

image.thumb.png.2595c7e932cb00c5f0261ca1c5d4daf0.png

 

find_upwards_neighbour.hiplc

  • Like 1
Link to comment
Share on other sites

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.

 

image.thumb.png.2595c7e932cb00c5f0261ca1c5d4daf0.png

 

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!

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...