Point a vector along curve direction

   21761   14   4
User Avatar
Member
859 posts
Joined: Oct. 2008
Offline
How would I point the normal vector of curve-points in the curve direction?

(So that they flow along it rather than all show in one direction)

Like the left three vectors in the picture below:

Attachments:
vec.jpg (17.5 KB)

--
Jobless
User Avatar
Member
8554 posts
Joined: July 2007
Online
try polyframe SOP

entity : Points
style : Two Edges
tangent name : N
make frame orthogonal : off
other fields empty
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
242 posts
Joined: Jan. 2008
Offline
Or…

In point SOP / Force tab, add edge force.
This Will give you a edge_dir attribute pointing along the curve.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Poly Frame with the options above generate tangent vectors at the points.

Use the Point SOP to build vectors that point at the next point:

Point SOP > Force Folder > Add Edge Force

This adds two attributes. Look at edge_dir. It generates normalized vectors that orient to the next point.
There's at least one school like the old school!
User Avatar
Member
1906 posts
Joined: Nov. 2006
Offline
If you use the PolyFrame with Style set to First edge it should give you the same result as adding an Edge Force.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
859 posts
Joined: Oct. 2008
Offline
Thanks for the many tips.
--
Jobless
User Avatar
Member
42 posts
Joined: Jan. 2010
Offline
hi guys .. thanks for all the tips … i have however tried the pointfunction in point sop:
point(“../”+opinput(“.”,0),$PT+1,“P”,0)-$TX … so on and so forth …..

i tried the other 2 methods too and have few doubts. With polyframe the direction of normals is reverse than as what i get using point function.. and somehow don't understand the edgeforce method.

have attached the file … maybe someone could check and explain pls.

thanks

Attachments:
Normals_directions.hip (79.5 KB)

User Avatar
Member
678 posts
Joined: July 2005
Offline
added edge example

Attachments:
normals_directions_fix.hipnc (82.4 KB)

User Avatar
Member
42 posts
Joined: Jan. 2010
Offline
thanks swann… that works .. however i was hoping if you could reverse the normal direction on polyframe

thks
User Avatar
Member
1906 posts
Joined: Nov. 2006
Offline
Append a Reverse SOP before the PolyFrame and you'll get the result you want.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
42 posts
Joined: Jan. 2010
Offline
ohhh great.. thanks for your help graham.
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
As this is a very interesting thread I wondered if I could push it further. I wanted to create a tool that could aim a custom vector using the handle from the line sop to control the direction. I am unable to even via a vop sop control the direction of my custom vector. Can someone give some pointers on the handle aspect and where I am going wrong with my vector.

Rob

I have updated the file with another example this time I have been able rotate the vector. In the details view you can see the aim attributes values.
Edited by - Feb. 9, 2010 20:47:28

Attachments:
vectorAim.hip (130.4 KB)

Gone fishing
User Avatar
Member
859 posts
Joined: Oct. 2008
Offline
I have a related question:

How could I point the normal of a particle in its direction of travel?



Edit: Sorry, I figured it out the second I hit the post button…argh…velocity…
--
Jobless
User Avatar
Member
1906 posts
Joined: Nov. 2006
Offline
Something like this?

I just use a Point SOP and promote the N control in my case and then create a Vector handle and bind the N parms on the asset to it.

Attachments:
vector_pointer.hipnc (50.4 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Graham… Cheers

My contribution. A small tool that can aim a custom vector. I've found it very useful indeed

rob

Attachments:
rse_sop_vector_aimer_v001.otl (18.8 KB)

Gone fishing
  • Quick Links