noise3D()
属于 @remotion/noise 软件包的一部分.
🌐 Part of the @remotion/noise package.
创建三维噪声。
🌐 Creates 3D noise.
应用编程接口
🌐 API
该函数接受四个参数:
🌐 The function takes four arguments:
seed
传入任何 string 或 number。如果种子相同,对于相同的 x、y 和 z 值,你将得到相同的结果。更改种子以获得 x、y 和 z 值的不同结果。
🌐 Pass any string or number. If the seed is the same, you will get the same result for same x, y and z values. Change the seed to get different results for your x, y and z values.
x
number
第一个维度值。
🌐 The first dimensional value.
y
number
第二维度的值。
🌐 The second dimensional value.
z
number
第三维度值。
🌐 The third dimensional value.
返回值
🌐 Return value
-1 和 1 之间的一个值,会随着你的 x、y 和 z 值的变化而波动。
🌐 A value between -1 and 1, swinging as your x, y and z values change.
示例
🌐 Example
import { noise3D } from "@remotion/noise";
const x = 32;
const y = 40;
const z = 50;
console .log (noise3D ("my-seed", x , y , z ));鸣谢
🌐 Credits
使用 simplex-noise 依赖
🌐 Uses the simplex-noise dependency
另请参阅
🌐 See also