Jump to content
  • Advertisement
Sign in to follow this  
adam17

Spread around direction vector

This topic is 3837 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

right now im trying to make my particle system more robust, and im adding a rotation function. i can get the particle spray to move along any arbitrary axis that you give it. the problem im having is if i want the particle system to have a spread applied to it, im clueless on how to do it. ex: i have a direction vector of <1,1,0> and i want to have the particles to have a direction somewhere within say 10 degrees on either side of that vector. how would i go about that?

Share this post


Link to post
Share on other sites
Advertisement
Just add very small values to that?

I mean, if your dir. vector is (x,y,z), for the particles, assign vectors like,

(x+rand()%10/100000, ...)

I believe if you tweak around with the value of the denominator a little you could get your desired spread.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!