Original Post
Hi All, I am trying to source out how to calculate random points on a 3d quad in a fast an efficient way and was wondering if anyone had an input on the topic. Thanks, Omnipotent
Vector3 RandomPointInParallelogram( Vector3 & a, Vector3 & b, Vector3 & c, Vector3 & d ){// B----C// / /// A----D assert( IsParallel( a - b, d - c ) ); assert( IsParallel( a - d, b - c ) ); // rnd returns a random number in the range [0, 1] return a + ( b - a ) * rnd() + ( d - a ) * rnd();}
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more