Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Particle system

$
0
0
Im trying to do some particle like system of a disc like shape. More of a cube shape comes out though. Vertex vertices[1500]; for (unsigned int i = 0; i < 1500; ++i) { vertices[i].Color = (const float*)&Colors::Red; vertices[i].Pos.x = GenSpherePointCorrect().x; vertices[i].Pos.y = GenSpherePointCorrect().y; vertices[i].Pos.z = GenSpherePointCorrect().z; } s GenSpherePointCorrect() { float r = IvSqrt(rng.RandomFloat()); float theta = kTwoPI*rng.RandomFloat(); float sintheta, costheta; IvSinCos(theta, sintheta, costheta); Vector3 randomPos(2.0f*r*costheta, 2.0f*r*sintheta, 0.0f); return randomPos; }

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>