hi everyone,
one question:
how can i set points normals to align curve which they belong to?
I have path, and i would like to copy some geometry on every point of this path but it must me aligned to this path. When I create curve it have no such attribute like point normal, so i'm doing this with point sop, but cannot elaborate how to set these normals aligning path.
thanks for help.
PS if there is different way to copy geo on curve points and face it correct - fine, but the question stiil is interesting.
there is a simple trigonometric expression with tangent to find angle (not vector) of movement upon last and next position but it is much longer way i supose to do simple task. So… help!
setting point normals
12076 9 4- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
- stevenong
- Member
- 1631 posts
- Joined: July 2005
- Offline
Hi Symek,
You can create the normals like so:
The Sort SOP is used to shift the point numbers by 1 & in the Point SOP, select “Create Normals” & type the following in the respective parameters:
$TX-$TX2
$TY-$TY2
$TZ-$TZ2
With this setup, we're calculating the vector of the current point from the next & using it as point normal.
However, one thing you might notice is the normal for point 0 is wrong so we'll fix it like so:
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TX-$TX2)
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TY-$TY2)
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TZ-$TZ2)
I used the if() function to check whether the point is point 0 & if true, use the position of point1 to subtract the position of point 0.
I hope the above helps!
Cheers!
steven
You can create the normals like so:
The Sort SOP is used to shift the point numbers by 1 & in the Point SOP, select “Create Normals” & type the following in the respective parameters:
$TX-$TX2
$TY-$TY2
$TZ-$TZ2
With this setup, we're calculating the vector of the current point from the next & using it as point normal.
However, one thing you might notice is the normal for point 0 is wrong so we'll fix it like so:
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TX-$TX2)
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TY-$TY2)
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TZ-$TZ2)
I used the if() function to check whether the point is point 0 & if true, use the position of point1 to subtract the position of point 0.
I hope the above helps!
Cheers!
steven
Edited by - Feb. 4, 2004 16:50:56
- MichaelC
- Member
- 344 posts
- Joined: July 2005
- Offline
And in answer to the PS part of your question, are you using the Sweep SOP? The Sweep SOP can be used to align a copied object on a curve. The object will be aligned with it's Z facing down the Curve, and will allow you to twist and roll objects on the curve. You can make adjustments to the alignment by placing an edit or transform SOP between the Geometry's SOP and the Sweep SOP.
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
If you are using the Copy SOP, then you may also want to supply an up-vector along with your normal. The Copy SOP uses the normal to align the Z-axis and the up-vector aligns the Y-axis. The resultant X-axis is defined by the cross-product of the normal (or velocity) and the up-vector.
You can add and/or access the up-vector using the Point SOP > Particle folder > Up Vector parameter which defaults to $UPX $UPY and $UPZ. Generally one would delete the expressions then use 0 1 0 or whatever your up vector is.
Using a properly formed up-vector will stop your copies from twisting in the wind and your rotate Z in the Copy SOP will start at the up-vector.
The Sweep SOP builds it's own local frame of reference (look-at normal and up-vector). It helps if it has a backbone curve which in essence defines the up-vector so use the same technique for the copy SOP.
You can add and/or access the up-vector using the Point SOP > Particle folder > Up Vector parameter which defaults to $UPX $UPY and $UPZ. Generally one would delete the expressions then use 0 1 0 or whatever your up vector is.
Using a properly formed up-vector will stop your copies from twisting in the wind and your rotate Z in the Copy SOP will start at the up-vector.
The Sweep SOP builds it's own local frame of reference (look-at normal and up-vector). It helps if it has a backbone curve which in essence defines the up-vector so use the same technique for the copy SOP.
There's at least one school like the old school!
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
- adam_glazier
- Member
- 41 posts
- Joined:
- Offline
Just adding some notes too correct stevenong's post.
curve1 should feed into the left Point SOP input and the also feed into the Sort SOP which then feeds into the right input of the Point SOP.
The code needed to create normals within the Point SOP was missing the 0,1,2 within the point() expression. Here is the correct code:
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TX-$TX2)
if($PT==0,(point(“../curve1”,1,“P”,1)-point(“../curve1”,0,“P”,1)),$TY-$TY2)
if($PT==0,(point(“../curve1”,1,“P”,2)-point(“../curve1”,0,“P”,2)),$TZ-$TZ2)
Thanks stevenong for answering the question…it came in handy tonight
curve1 should feed into the left Point SOP input and the also feed into the Sort SOP which then feeds into the right input of the Point SOP.
The code needed to create normals within the Point SOP was missing the 0,1,2 within the point() expression. Here is the correct code:
if($PT==0,(point(“../curve1”,1,“P”,0)-point(“../curve1”,0,“P”,0)),$TX-$TX2)
if($PT==0,(point(“../curve1”,1,“P”,1)-point(“../curve1”,0,“P”,1)),$TY-$TY2)
if($PT==0,(point(“../curve1”,1,“P”,2)-point(“../curve1”,0,“P”,2)),$TZ-$TZ2)
Thanks stevenong for answering the question…it came in handy tonight
~adam
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
- adam_glazier
- Member
- 41 posts
- Joined:
- Offline
- goldfarb
- Staff
- 3455 posts
- Joined: July 2005
- Offline
yep..this thread is so old there is now an HDA on the Exchange:
http://www.sidefx.com/index.php?option=com_wrapper&Itemid=149 [sidefx.com]
“Tangent”
http://www.sidefx.com/index.php?option=com_wrapper&Itemid=149 [sidefx.com]
“Tangent”
-
- Quick Links