Align particles to closest Axis

Discussions about SOFTIMAGEs© Interactive Creative Environment©
NNois
Posts: 754
Joined: 09 Jun 2009, 18:33

Align particles to closest Axis

Post by NNois » 01 Apr 2012, 14:36

Hello, i'm trying to blend particle rotation to nulls.
The simulation is a rolling cube style who ends to an end position, aligned to X Y or Z axis.
Since my particles are rolling i can't straight align them when they reach the end rotation/position without having them flipping like 180 degres rapidly.

I want them to align to the closest 90 degres angle...
I know this is a sort of modulo trick but my mind is stucked here...

Do someone can help me ?

NNois
Posts: 754
Joined: 09 Jun 2009, 18:33

Re: Align particles to closest Axis

Post by NNois » 01 Apr 2012, 19:59

Well, like i though using euler isn't working well in certain angles
I think i need to use vectors instead, don't know where to start...
You do not have the required permissions to view the files attached to this post.

iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

Re: Align particles to closest Axis

Post by iamVFX » 01 Apr 2012, 21:29

Ok, since nobody want to answer, I'll take a step and will advise you to use linear or (if it still cause flipping) quaternion interpolate nodes under Tool -> Math -> Basic tab from an ice tree panel

And, sorry, I cannot understand the effect you are looking for. Some of the screenshots or example scene would be very helpful

NNois
Posts: 754
Joined: 09 Jun 2009, 18:33

Re: Align particles to closest Axis

Post by NNois » 01 Apr 2012, 21:59

Hi,
I have a some particles emited randomly who walks (rolls) to a target grid of positions, each particles to a different target position.
Since particles rotates during theres "walk" when they reach te target position I need also them to match the target orientation.
But since they are "walking" in a certain order of rotation when tey reach they're final position they can't for example just at the end rotates in an inverted order just to match the right rotation, so I need to match the closest axis of the target.
Anyway
Now i've something, to orientation is rightly choosed, needs now to also match the third angle because now i'm working with vectors...

Thanks !
You do not have the required permissions to view the files attached to this post.

NNois
Posts: 754
Joined: 09 Jun 2009, 18:33

Re: Align particles to closest Axis

Post by NNois » 02 Apr 2012, 01:18

Well,
Here is the working one this time !!
Please excuse my for my very bad english, and my poor knowing when dealing with rotation... There is no doubt that with some dot/cross product this tree could be reduced to a minimum ...
You do not have the required permissions to view the files attached to this post.