Hey
I work on a particle system with the following transformation to align the particles with the view point:
vY = viewPointToCameraVec
vX = Vec3( vY.y, -vY.x, 0 )
vZ = cross( vX, vY )
These 3 vectors form the orthogonal basis that the particle sprites are transformed with. As you can see vX is aligned to the XY plane. The benefit from using this setup is that the particles appear to preserve their relative orientation even when the camera rotates. This works all fine except from when viewing the particle system along the Z axis. When panning across the emitter the particle orientation gets rapidly flipped (as vY.x & vY.x is insignificant compared to vY.z).
I've tried to work out the math so that the orientation can be improved when panning along the XY plane while looking in the Z direction but none of my attempts have been fully satisfactory yet.
Does anyone know how to solve this? Or maybe you would have done it differently altogether?
Thanks!
No comments:
Post a Comment