Jump to content
splegare

Particles along a curve - constraint Z orientation

Recommended Posts

Hi everyone,

I'm trying to do a school of fish with a particle system that would follow a curve. Basically I'm emitting some particles and they move along a curve with a popcurveforce.

By default the particles orientation seem to go along with the curve but since I'm trying to do a school of fish, I would like my particles Z orientation to always be 0 so the fishes don't swim on the back.

So far I've tried with this expression in a popwrangle : p@orient.z = 0; 

The thing is it seems to zero out the orientation of x and y as well.. And I still want the x and y to go along with the curve. I'v tried with a popattract instead of a popcurveforce and I'm still not able to constraint the Z orient.. 

Maybe it has to do with something else than the @orient attribute since I don't see it in my geometry spreadsheet..? There's something I don't get! (Needless to say that I'm new in Houdini :P)

Thanks a lot!

test_fish_school.hiplc

  • Like 1

Share this post


Link to post
Share on other sites

If it can help anyone, I finally ended up switching strategy. Instead of using a popcurveforce, I went back to my first thought of animating a sphere along a spline and use it as a goal object in a popattract

In order to fix my issue with the z orientation, I kind of overrode the particles orientation with the lookat() function so each particle is now aiming at their goal without disturbing their local z-axis..

Here is what I've put in my popwrangle:

matrix3 m = lookat(v@force, {0,0,0});
p@orient = quaternion(m);

I have attached a quicktime if you want to have a look. 

Cheers!

fish_school_v01.mp4

Edited by splegare
  • Like 1

Share this post


Link to post
Share on other sites

Looks nice, thanks for the solution. I took a look at your file and could not figure it out.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×