We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi Everyone! What would be the most simple way of fetching looping perlin noise values so that the first and last values are also related and is put around a circle gives a smooth transition. Say I need 100 values then the 1st and 100th values are related. Thanks Community. :)
Answers
Maybe use 2d Perlin noise and describe a circle around a point using x + r cos theta, y + r sin theta where theta increases in steps of two pi / 100?
r should be small, like much less than 1 so that the points on the noise circle are close.
What values do I give with noise function noise(x,y) ?
width/2 + r cos theta, height/2 + r sin theta
pleaseFor best results the steps between calls to noise should be small, like .05 small, not half the width of the screen, hence my second comment above.
See reference: https://processing.org/reference/noise_.html
(And please don't post full answers before the OP has posted a single line of code.)
For recent discussions of Perlin noise looping, see:
That works! Thanks @koogs, @chrisir @jeremydouglass.
Further, what if I want to create set of ponts/lines around the circle flat on the same plane with the circle itself (visually like flat graphical sun in center with rays of different length around it).
After that I want stack many of them in Z axis such that each endpoint is related to those above, below, left and right of it. Also the first and last point on each are also related . I am writng code that uses 3-Dimensional noise for implementing above. Would that be a good idea?
Hope, I was able to give enough information to visualize my case.
Thanks a lot :)
You could use 3D noise for this -- or just 2D noise.
A line of noise is 1D. You can wrap that line as wobbly perturbations of a circle -- or as rays of a starburst. Each pixel in the 1D line of noise is a radius value.
Many lines is 2D. You can use each line for a different wobbly circle -- many lines across a 2D Perlin tile may define a stack of circles.
Share your code for more feedback.
yeah, but the end of the 1d line won't match the start of the 1d line - the looping in the original question. so use a circle in 2d noise space as the noise value.
and for a tower of circles use 3d noise space.
@koogs -- re:
That isn't true in the 2D example I gave -- they will match. See:
https://forum.processing.org/two/discussion/26962/how-to-close-a-noisy-circular-shape
If the Perlin noise settings generate a 2D tile then any 1D horizontal or vertical line sampled from the 2D tile will always wrap perfectly, and any set of horizontal or vertical line samples will form the tower.
You could do this with an arbitrary 3D Perlin noise field as well by sampling points in a tube shape out of the field, but the repeating tile is both easier to sample and comes with a nice bonus property -- if the sampled lines are evenly spaced across the tile then the top and bottom circles of the stack also wrap on the z axis -- which I think might be what OP meant by?:
Unless this referred to the beginning and end of each ray line.