This is a translation of the OpenSimplex2 lib to zig. Didn't see many noise libs in zig so I translated this. There are some translation mistakes to fix with 3D and 4D noise. https://github.com/Very-Blank/ZigOpenSimplex2.git
#OpenSimplex2 noise translation
1 messages · Page 1 of 1 (latest)
OpenSimplex2 noise translation
for about a month ive just been importing the C open simplex. Id love to use something in zig itself. how can i use this in a project? (ive only used C libraries)
@mellow crypt Just add these into the build.zig file: const noise = b.addModule( "Noise", .{ .root_source_file = b.path("libs/ZigOpenSimplex2/src/main.zig"), }, );
exe.root_module.addImport("noise", noise);
Could be wrong I'm typing with my phone currently
As for using the library itself it's super easy ``` const noise2 = try noise.fast.Noise2.init(34434, allocator);
//or const noise2 = try noise.smooth.Noise2.init(34434, allocator);
defer noise2.deInit();
const value = noise2.standard(34.0, 34.0);
wow, nice