Jump to content
  • Advertisement
Sign in to follow this  

stretching particles along velocity

This topic is 1725 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!