Box3 Particle orientation by UV


#1

Can you set a particles orientation by the UV direction of a nearby object?

For example - I have a curvy spline with 0 to 1 UVs that I have turned into a cylinder. I want to emit a bunch of particles (arrow shaped) within the volume of this object and have them all point in the direction of the UV gradient.

The particles don’t have any speed - they just sit in space, look for the closest face and orient based on the direction of the UVs (or maybe use a ‘black to white’ gradient map on the geo, if that is easier to query?)

Can anyone point me in the right direction? (bad pun, booo!!)

Thanks,
Bob Dyce


#2

Okay! I think I’ve answered my own question:

I used “point color by gradient” which spits out a vector in the direction of the material grad (derived from the UVs) and then I used the point normal, and took those two vectors and created a cross product. Stuffed that into a convert Vector->Matrix, Matrix->Quat and output a rot Quat. Voila!