The MathUtils.randFloatSpread() method is a static method of the THREE library's MathUtils module. It generates a random floating-point number within a specified range.
THREE.MathUtils.randFloatSpread(range)
range
(Number): The range of the random number generation. The generated random number will be in the range -range/2 to range/2.const randomNum = THREE.MathUtils.randFloatSpread(10);
console.log(randomNum); // returns a random number between -5 and 5
This method is useful when you need to generate random numbers within a specified range. The generated number will always be a floating-point number.