Your task is to implement a 2D noise function using external hash function and test many hash functions (your own, cryptographic ones, random generators, ..) in it.
You can start with a set of popular hash functions from the RandomStatic class to help implementing deterministic noise functions..
More hash functions can be found here:
Cryptographic hash functions
Thomas Wang: Integer Hash Function
Bob Jenkins: Hash Functions and Block Ciphers
Inverse of a hash function
Chris Wellons: Blowpipe
Chris Wellons: Inspiration from Data-dependent Rotations
Chris Wellons: Prospecting for Hash Functions
Modify the class ImageFunction in the AnimationIF.cs source file. Add your new hash functions to the same source file. The image-function should compute a noise image based on provided hash function. Please insert a hash function into the computing of noise grid points in some reasonable way, e.g. for the hash function long H ( long a ):
// Returns grid value between 0.0 and 1.0 public double getGridPoint ( int x, int y ) { long hashIn = (long)x + 65536L * (long)y; long hashOut = H( hashIn ) & 0x7fffffffffffffffL; return hashOut / (double)0x7fffffffffffffffL; }
You have to implement the complete noise image function based on such grid points. Use simple bilinear interpolation and some nice color mapping, or you can omit the interpolation and display result as a white-noise.
If your ImageFunction needs any additional [shared] data,
you can put it into a support data class SupportData.
Please set the default image resolution and time interval to some
reasonable values – in the InitializeParams() function
(edit your name there as well).
You must send the modified file AnimationIF.cs.
Hand in the assignment until: 30. 6. 2019
Basis: 22 points (reasonable noise function using several hash functions),
up to additional 8 points: bonus for interesting/surprising results and original hash-functions.
Visual Studio project: 063animation.
Modify and hand in the source file: AnimationIF.cs
Edit your name in the InitializeParams() function!
Copyright (C) 2019 J.Pelikán, last change: 2019-10-19 03:41:01 +0200 (Sat, 19 Oct 2019)