Jump to content

Orienting Normals correctly


logix1390

Recommended Posts

Hello again,

So I have come across an issue. It is probably better to just explain with pictures... 

<a href="http://s480.photobucket.com/user/vaz13/media/Picture_2_wrong_Normal_zpszysblp9h.jpg.html" target="_blank"><img src="http://i480.photobucket.com/albums/rr169/vaz13/Picture_2_wrong_Normal_zpszysblp9h.jpg" border="0" alt=" photo Picture_2_wrong_Normal_zpszysblp9h.jpg"/></a>
<a href="http://s480.photobucket.com/user/vaz13/media/Picture_3_correct_Normals_zpsbdmo3vo1.jpg.html" target="_blank"><img src="http://i480.photobucket.com/albums/rr169/vaz13/Picture_3_correct_Normals_zpsbdmo3vo1.jpg" border="0" alt=" photo Picture_3_correct_Normals_zpsbdmo3vo1.jpg"/></a>

Basically I am making a procedural house. I am at a part where I am making the wooden pillars on the inside walls. I have an outline of my house where I resample each line and copy the pillars onto them. However , the problem is the orientation of each pillar. Since my house is an irregular shape, when I try to orient and scale them inwards toward the center , each pillar scales incorrectly on some sides of the house.

I put an expression so that the normals face towards the center, but the way I have my house setup, the center is at the origin grid and not the origin of the house.

It's a bit tricky to explain, I have attached my scene file for anyone who wants to take a look. 

 

 

Orienting_Pillars_along_normals.hip

Link to comment
Share on other sites

just a noob having a go...so I read up on various posts...found that you can just rename the tangent from Polyframe (from tangent u to N)...but I thought..why not do it from the Resample...my attribvop is hardcoded with Y as the up vector...so might not be ideal...maybe a pro could point the way...

TIA

Curve_Normals.hipnc

Link to comment
Share on other sites

It can be computed by PolyFrame. You need proper geometry for it. The shape in scene has overlapped primitives, which does not deleted automatically when you fuse points. You need to use Clean node to fix overlaps. Then you can use Join node and create single primitive from the thing. After proper fusing, you can add PolyFrame and everything will work.

Turn on point and primitive numbers and normals to see what's going on: Orienting_Pillars_along_normals_fix.hipnc

It's better to make proper input from the beginning, by doing something like this: polyframe_pillars.hipnc

Link to comment
Share on other sites

Thank you for the replies. This put me on the right path. I needed to find the cross product of the poly frame normal you guys showed me,  and an up vector on Y axis. I then changed the new vector to N and I got the direction i was looking for. Thank you for all the help guys !

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