Particles are flipping direction (just like gimbal lock)

   3268   3   2
User Avatar
Member
245 posts
Joined: Sept. 2011
Offline
I have created a flocking simulation using POPs in DOPs and when I instance my models on my particles, at some point they suddenly flip 180 degrees..

I've tried alot to fix this.

Using vopsop comparing directions a few frames apart and trying to average these out. (might be incorrect the way I did this)

Tried using Slerp in vopsop, also no succes.. (also might be incorrect the way I did this)

Assigning up vector to be always up also does not work.

Anyone else have an idea how to prevent the flipping effect?

Maybe a simple vopsop solution?

Too bad I cant share the scene file because of NDA
User Avatar
Member
1529 posts
Joined: July 2005
Offline
I don't really know the particulars of your scene, but generally speaking, you'll need two vectors (from which a third can easily be constructed to create a local frame) on each point in order to prevent said ‘flipping’…

In more concrete terms you are most likely looking at N and up (or possibly, v, and up) – and you are looking to bring about a condition in which they are orthogonal – whether it's procedural, or simulated.

If I had to take a guess as what is most likely happening in your scene at the moment, is that N and up are pointing in the same direction, which results in badness in attempting to align geometry to it.

Also, have a look at this post which presents a thorough explaination:

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=6679 [sidefx.com]

G
User Avatar
Member
8579 posts
Joined: July 2007
Offline
just prepare simple scene with your problem
usually it's a good idea tho use orient quaternion attribute to describe rotation, since you can manipulate it as you want
or since it respects angular velocity and torque in your sim you should even use those to introduce some spinning forces
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
1529 posts
Joined: July 2005
Offline
Tamte is 100% correct – orient quaternions (also discussed in Wolfwood's post) are the ‘black belt’ version of this exercise, and provide the greatest flexibility in many cases.

As one might expect from a ‘black belt’ version, there is a few more details involved. :wink:

Cheers,

G
  • Quick Links