theta = fRand( 2*M_PI ); tMin = cos( randomAngle * M_PI_180 ); - randomAngle is the "threshold angle" t = fRand( tMin, 1 ); phi = acos( t ); sinPhi = sin( phi ); return Vector3( sinPhi * cos( theta ), sinPhi * sin( theta ), cos( phi ) );Also, it uses a lot of trig functions. Is there any more efficient ways of doing this that work with any vector? Thanks.