Orientation question

   1105   3   1
User Avatar
Member
5 posts
Joined: Sept. 2019
Offline
Hi, I am trying to make an HDA that allows a user to draw a curve and create a fence from that.

The part that is hanging me up is getting the fence posts to rotate correctly. I want the posts to always be squared off at right angles from the fence (except when it is impossible because of a sharp bend).

It is important that it work when drawn at non-right angles and when sloping up or down.

I have been trying to use the “tangentu” attribute created by the Resample and PolyFrame SOPs to derive the correct rotation.. but I am having a hard time with it.

Attachments:
fence.hiplc (165.6 KB)

User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
You need an up vector as well.

In the attached file, in the polyframe SOP, toggle between “tangent name” and “bitangent name” to see how you can either have the poles ignore the slope or orient themselves to the slope.
Edited by mrCatfish - July 14, 2020 13:45:32

Attachments:
fence2.hipnc (168.0 KB)

Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Member
5 posts
Joined: Sept. 2019
Offline
oh ok, thanks this is helpful. I was missing that about the up vector. But I'm still confused how I can align the poles so they are perpendicular to the line of the fence. Also I want them to stay straight up and down at all times. Basically I want only rotation on Y to change, so they are aligned more correctly.

I've attached an image that may convey what I'm trying to do better.

Attachments:
idea_orientation.jpg (98.7 KB)

User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
I didn't really notice you had resampled the curve for the posts. You will have to re-calculate up and N as the resample SOP is interpolating the existing up and N.

And just so it's clear why you need both up and N: With only N, the orientation will be correct, but the bearing (rotation) will be ambiguous. Using both up and N resolves this issue. (You can also use the matrix “orient” to do this more robustly.)

Sean
Edited by mrCatfish - July 14, 2020 15:39:11

Attachments:
fence3.hipnc (173.9 KB)

Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
  • Quick Links