0

So, I am trying to plot abstract shapes that change with time using openGL. For that, I want to use the Perlin noise function. This code (http://www.sorgonet.com/linux/noise_textures/) is a just perfect start for me, except for the fact that the function found here takes only two coordinates. I want one that takes two spacial coordinates, and a third one, that will change with time.

My question is: is it possible to adapt this function to work with one more coordinate?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
bluewhale
  • 167
  • 3
  • 13

2 Answers2

1

Yes, it is possible.

You can treat the time dimension as a spatial dimension without any problems.

For 2D noise, you will use 2D interpolation like this, using bilinear as an example, but the idea should work with bicubic etc.:

First step:

You have 4 outside values, and one point inside them to get the value of.

+    +

  x


+    +

Second step:

Interpolate on the Y axis.

+-+--+

  x


+-+--+

Third step:

Interpolate on the Y axis.

+-+--+
  |
  x
  |
  |
+-+--+

Now we have the interpolated value.

Now, to add an third dimension, we start with 8 values and add an extra step: Interpolate on the Z axis. This will scale to arbitrarily many dimensions.

Kendall Frey
  • 43,130
  • 20
  • 110
  • 148
0

What about 3d perlin noise ? http://webstaff.itn.liu.se/~stegu/aqsis/DSOs/DSOnoises.html

Use 2 coordinates for your geometry, one for time.

Monkey
  • 1,838
  • 1
  • 17
  • 24