Orientation question
1105 3 1- wenglish
- 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.
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.
- mrCatfish
- 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.
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
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
CG Supervisor
Machine FX - Cinesite MTL
- wenglish
- 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.
I've attached an image that may convey what I'm trying to do better.
- mrCatfish
- 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
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
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
CG Supervisor
Machine FX - Cinesite MTL
-
- Quick Links