Jump to content

Orienting Normals correctly

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. 




Share this post

Link to post
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...



Share this post

Link to post
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

Share this post

Link to post
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 !

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now