This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// nuget package reference with: | |
// - System.IdentityModel.Tokens.Jwt | |
using System; | |
using System.Security.Cryptography; | |
using Newtonsoft.Json; | |
using Microsoft.IdentityModel.Tokens; | |
static void Main(string[] args) { | |
var provider = new RSACryptoServiceProvider(2048); | |
var key = new RsaSecurityKey(provider.ExportParameters(true)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static float Noise3D(float x, float y, float z, float frequency, float amplitude, float persistence, int octave, int seed) | |
{ | |
float noise = 0.0f; | |
for (int i = 0; i < octave; ++i) | |
{ | |
// Get all permutations of noise for each individual axis | |
float noiseXY = Mathf.PerlinNoise(x * frequency + seed, y * frequency + seed) * amplitude; | |
float noiseXZ = Mathf.PerlinNoise(x * frequency + seed, z * frequency + seed) * amplitude; | |
float noiseYZ = Mathf.PerlinNoise(y * frequency + seed, z * frequency + seed) * amplitude; |