View Single Post
Old 29-Mar-2007, 03:42 AM   #1 (permalink)
Iphone
Fixed Error!
 
Iphone's Avatar

Posts: 4,202
Join Date: Mar 2007
Rep Power: 6 Iphone is on a distinguished road

IM:
Default frag grenade Random explode explosion effect c++ opengl

im programming some OpenGL effect in c++.

I want to explode my grenade, and the frags must go in a random (or anything alike) direction.

Problem is that i must generate as many possible random numbers in less time possible. So the 3D direction of the particles are random.

How can I get the fragments/particles going from the center of the grenade to any random direction? Usage of the function rand() causes the fragments to go in 4 directions or so.
Iphone is offline   Reply With Quote