Sign in to follow this  
quaikohc2

stretching particles along velocity

Recommended Posts

Hi,
In my particle system I am using multiplication by inverse view matrix to align quads to camera(viewport) like this:

 

position.xyz += mul( float3( uvCorner, 0.0f ), (float3x3)cInverseViewMatrix );

 

where pos is in object space and uvConers are passed from cpu: (-1,1) (1,1)(1 -1), (-1 -1).

 

Everything is working fine but now I want to stretch particles along their velocity. What would be the best (easiest) way of doing this? Which space should I use for calculations? Should i do this before or after aligning to screen?

(velocity is passed from cpu for each vertex)

 

TIA

Share this post


Link to post
Share on other sites

I think it doesn't matter which space you perform the calculations in, as long as the stretching is perform accordingly.  So if you apply the stretch in object space, then you need an object space velocity vector to warp the billboard shape prior to transformation.  With that in mind, simply choose the space according to which space is easier to implement into your current model.

 

The alignment with the screen should also not matter, since you are using a 2D shape to start with (a quad I presume) and will end up with a 2D shape after warping (probably a rectangle of some sort).  As long as your alignment process doesn't rely on the square shape, then you can modify it before or after the alignment process.

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

Sign in to follow this