Jump to content

Up Vector for Particles Help ( Newbie)


Mogul4200

Recommended Posts

I've been looking all over the place to find a way to make my particles have an up vector perpendicular to the normal it is on. I have the particles flowing around a sphere. I have seen many solutions for this type of thing, but I'm too new to implement this for my situation. 

Thank you for the help. 

 

particlesFlow.hip

Link to comment
Share on other sites

Mathematically speaking, you have an infinite number of vectors that are perpendicular to a given vector. To chose one of them, you usually use a second vector, and make a cross product between your two vectors. The vector you obtain is perpendicular to the two firsts and is unique.

So what you can do is do a cross product (in a POP Wrangle, with VEX function cross(vector 1, vector 2)), and use the normal and a second vector.

I don't know how your normal was build, but when I need to create a frame of vectors on particles, I like to use :

v@up = {0,1,0};

@N = normalize(@vel); (if velocity  != 0)

Then i do the cross product on those 2 vectors, but in my case, up vector is... up :-) So I am not sure if that helps you...

Maybe what you need is :

vector3 tempup = {0,1,0}; (temporary up vector)

vector3 tempz = cross(normalize(@N), v@tempup); (and you can set @N to be normalized speed, if you want, like example above)

v@up = cross(@N, v@temp);

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...