Perlin noise for traffic?

I successfully use Perlin noise to create terrain, clouds, and a few other great things. However, I am now trying to revive a group of flying insects (in particular, fireflies), and I was asked to use Perlin's noise for this. However, I'm not quite sure how to do this.

The first thing that occurred to me was, given such a noise map:

oYgeL.png

  • Assign each firefly a random starting location, speed and acceleration angular.
  • In the frame, advance the position of the flies after its direction vector.
  • Read the noise map in a new place and use it to adjust the angular acceleration, causing it to fly to β€œrotate” to lighter pixels.
  • Adjust angular acceleration in the vicinity of other flies to avoid congestion around local maxima.

However, this does not apply to cases where flies reach the edge of the map, or cases where they can end at only one point. The second case may not be big, but I'm not sure of a reliable way to make them rotate to avoid collisions with the edge of the map.

Suggestions? Textbooks or documents (in English, please)?

+6
source share
2 answers

Here is a very good source for 2D perling noise. You can follow the same principles, but instead of creating a 2D gradient mesh, you can create a 1D array of gradients. You can use this to create your own noise for a specific axis.

Just follow this recipe and you can create similar perlin noise functions for each of your other axes! Combine these movements and you should have a good noise in your arms. (You can also use these noise functions as random accellerations or velocity. Since the Perlin noise function is globally monotonous, your flies will not crack to crazy distances.)

http://webstaff.itn.liu.se/~stegu/TNM022-2005/perlinnoiselinks/perlin-noise-math-faq.html

If you are interested in learning about other types of motion, I would suggest Brownian Motion . This is the same movement as dust particles when they float around your room. This article falls into more interesting math at the end, but if you are familiar with Matlab at all, the first few sets of instructions should be pretty easy to understand. If not, just google funcitons and find your native equivalents for your environment (or create them yourself!). It will be a little more realistic and much faster to calculate than perlin noise.

http://lben.epfl.ch/files/content/sites/lben/files/users/179705/Simulating%20Brownian%20Motion.pdf

Happy flight!

+6
source

Maybe you are looking for boids?

Wikipedia Page

Perlin noise is not present in the original concept, perhaps you can use noise to create attractors or repulsors, since you are trying to do this with a "fly to the lighter."

PS: on the page linked above, there is a link to the Firefly algorithm , maybe this will interest you?

+1
source

Source: https://habr.com/ru/post/897833/


All Articles