Align pillars so that they stay perpendicular to the road's bed

   2078   4   1
User Avatar
Member
20 posts
Joined: March 2015
Offline
Hi, I have a procedural road that follows any given curve. The road is generated by a simple sweep of two lines.

Now, the road has base pillars under it. These are copied to points belonging to the same curve that generates the road direction/length.

When the road curves the pillars's ends protrude from the road. I believe this is because the pillars are aligned with the points normals of the curve that is at the center of the road and these don't consider the actual generated road's normals.

How do I fix this?

Thanks


Attachments:
RoadScreenshotAnnotated.jpg (690.6 KB)

User Avatar
Member
40 posts
Joined: Oct. 2012
Offline
Are you generating an ‘up’ as well? That helps to align the pillars. Make sure the normal up and tangents are orthogonal to eachother.
User Avatar
Member
20 posts
Joined: March 2015
Offline
som
Are you generating an ‘up’ as well? That helps to align the pillars. Make sure the normal up and tangents are orthogonal to eachother.

Thanks for the reply. Could you please make an example? Sorry - quite a beginner here. I understand the theory of what you are saying but I cannot figure out how to do it in practice.

So far I generated the normals for that copy to points with polyframe, setting the Tangent name to N. Then I reversed them with @N = -@N; This is how I got to this point as depicted in the attached screenshot.
User Avatar
Member
40 posts
Joined: Aug. 2018
Offline
Hi,
As som said, in such cases it's essential to keep orthogonal vectors between ‘up’ and ‘N’.
Since you already set up your polyframe correctly, I'd say that you just need to adjust your “final” backbone path N attribute in Y only (presupposing the usual default of up being 0,1,0 and your pillar Y effectively being their verticals). Unless I'm missing something… but try it with an attrib create, or wrangle, on points.

I added a pic to hopefully clarify my non-native verbosity…

this will keep your N.y flat, so the pillars will not bank anymore. Now if your road itself would bank, you might get some clipping again, so… just FYI.
Edited by Herve - Sept. 27, 2019 23:50:57

Attachments:
polyfrex001.jpg (76.8 KB)

User Avatar
Member
20 posts
Joined: March 2015
Offline
Herve
Hi,
As som said, in such cases it's essential to keep orthogonal vectors between ‘up’ and ‘N’.
Since you already set up your polyframe correctly, I'd say that you just need to adjust your “final” backbone path N attribute in Y only (presupposing the usual default of up being 0,1,0 and your pillar Y effectively being their verticals). Unless I'm missing something… but try it with an attrib create, or wrangle, on points.

I added a pic to hopefully clarify my non-native verbosity…

this will keep your N.y flat, so the pillars will not bank anymore. Now if your road itself would bank, you might get some clipping again, so… just FYI.

This worked. Thank you!
  • Quick Links