Friday, November 11, 2005

limiting random origin motion


double RandOrgRange = 1; // 0 to 2, default is 1
DPOINT RandOrgBias = {0, 0}; // -.5 to .5, default is 0
double ofs = (1 - RandOrgRange) / 2;
m_TargetOrg.x = double(rand()) / RAND_MAX
* RandOrgRange + ofs + RandOrgBias.x;
m_TargetOrg.y = double(rand()) / RAND_MAX
* RandOrgRange + ofs + RandOrgBias.y;

No comments: