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;
}
↧