3D MATLAB noise (continued)

As an Amazon Associate I earn from qualifying purchases.

So, I have figured out a way to generate some nice, 3D noise that wraps in all 3 dimensions offline, which allows it to be read into a 3D texture in OpenGL. Here is an example video of slices of the 3D texture:



Continue after the break to see how this 3D noise was generated.

The noise was generated using a (relatively) simple function:

This is similar to the code that I posted yesterday for 2D and 3D Perlin Noise in MATLAB; however, it basically creates a matrix that is a cube of 9 identical noise fields (i.e., a 3x3x3 cube of mxmxm cubes) and only extracts the central cube when returning the texture. Simple, but it creates seamless wrapping “Perlin-esque” noise fields that look pretty darn good as 3D textures for my stimuli. Since they can take a long time to generate, here’s some pre-generated matrices:

256x256x256 pixels with a 23 pixel convolution kernel. The MAT file contains 2 matrices that were independently generated, “noiseStandard” and “noiseComparison”. (MAT file)



192x192x192 pixels with a 23 pixel convolution kernel. The MAT file contains 2 matrices that were independently generated, “noiseStandard” and “noiseComparison”. (MAT file)



128x128x128 pixels with a 23 pixel convolution kernel. The MAT file contains 2 matrices that were independently generated, “noiseStandard” and “noiseComparison”. (MAT file)



64x64x64 pixels with a 23 pixel convolution kernel. The MAT file contains 2 matrices that were independently generated, “noiseStandard” and “noiseComparison”. (MAT file)



And just for the heck of it, here’s the MATLAB code I used to generate the AVIs and GIFs from the matrices (messy and uncommented but it worked):

Amazon and the Amazon logo are trademarks of Amazon.com, Inc, or its affiliates.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.