perlin-noise

Generating terrain in C# using perlin noise

寵の児 提交于 2019-12-11 14:12:40
问题 I'm working on civilization game in C# and XNA. I use a two dimensional integer array, populated with a loop, to generate tiles, I've done a ton research and have been unable to find a way to generate earth like terrain. Can anyone explain how to do this or at least give me code that could do it, though I would prefer and explanation? Thank you. 回答1: I use an algorithm similar to this to make my terrain. Basicly it generates some random numbers and uses a sine wave to generate hills, when

How to make a 2d map with perlin noise python

落爺英雄遲暮 提交于 2019-12-11 06:28:10
问题 I have been experimenting on making a random map for a top down RPG I am making in Python. (and Pyglet) So far I have been making island by starting at 0,0 and going in a random direction 500 times (x+=32 or y -=32 sort of thing) However this doesn't look like a real image very much so I had a look at the Perlin Noise approach. How would I get a randomly generated map out of this :/ (preferably an island) and is it better than the random direction method? 回答1: a perlin map can be generated

Perlin Noise 2D: turning static into clouds

…衆ロ難τιáo~ 提交于 2019-12-11 03:15:17
问题 I am trying to wrap my head around Perlin noise. This article has helped and I have been trying to recreate the cloud type images that it provides. My noise code is as follows: #include "terrain_generator.hpp" using namespace std; #define PI 3.1415927; float noise(int x, int y) { int n = x + y * 57; n = (n<<13) ^ n; return (1.0 - ( (n * ((n * n * 15731) + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0); } float cosine_interpolate(float a, float b, float x) { float ft = x * PI; float f =

Any Simplex Noise Tutorials or Resources? [closed]

家住魔仙堡 提交于 2019-12-09 04:05:30
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I want to create a terrain-like 3D noise generator and after doing some research I came to the conclusion that Simplex Noise is by far the best type of noise to do this. I find the name quite misleading though as I have a lot of trouble finding resources on the subject and the resources I find are often not well

Issue with Perlin Noise in Java

廉价感情. 提交于 2019-12-06 07:36:44
问题 So I'm trying to generate perlin noise and save it to an image file. I've got the image being saved correctly but the noise doesn't really look like perlin noise. Here's my code: package com.egs.survivalsim.util; import java.awt.Color; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import com.egs.survivalsim.MainComponent; public class Noise { MainComponent main; public double noise(int x,int y){ x = x + y * 57; x = ((x <<

Using Perlin noise to create lightning?

纵然是瞬间 提交于 2019-12-04 09:34:44
Actually I am having several questions related to the subject given in the topic title. I am already using Perlin functions to create lightning in my application, but I am not totally happy about my implementation. The following questions are based on the initial and the improved Perlin noise implementations. To simplify the issue, let's assume I am creating a simple 2D lightning by modulating the height of a horizontal line consisting of N nodes at these nodes using a 1D Perlin function. As far as I have understood, two subsequent values passed to the Perlin function must differ by at least

Wrapping 2D perlin noise

◇◆丶佛笑我妖孽 提交于 2019-12-04 08:45:39
问题 I'm working with Perlin Noise for a height map generation algorithm, I would like to make it wrap around edges so that it can been seen as continuous.. is there a simple way or trick to do that? I guess I need something like a spherical noise so that either horizontally and vertically it wraps around. I would be happy also with just 1 wrapping axis but two would be better. For now I'm using the classical algorithm in which you can set up how many octaves you want to add and which are the

Procedural generation of a constrained landscape

雨燕双飞 提交于 2019-12-04 08:12:04
问题 I'd like to implement a procedural generation of a terrain. After a thorough research I came up with a conclusion that it should be implemented with one of the gradient (coherent) noise generation algorithms, for instance Perlin Noise algorithm. However, I don't want the generation to be completely random. I'd like to apply some constraints (like where should be a mountain range, or where should be a lowland etc.). Question: For example I have a curve which represents some landscape element.

How is a 3d perlin noise function used to generate terrain?

心不动则不痛 提交于 2019-12-03 23:41:40
I can wrap my head around using a 2D Perlin noise function to generate the height value but I don't understand why a 3D Perlin noise function would be used. In Notch's blog , he mentioned using a 3D Perlin noise function for the terrain generation on Minecraft. Does anyone know how that would be done and why it would be useful? If you are passing x , y , and z values doesn't that imply you already have the height? Marcel Jackwerth Well, Minecraft is about Mines. So, what Notch tried to solve was: "How do I get holes / overhangs in my world?" Since 2D perlin noise generates nice/smooth looking

What's faster for 3D? Perlin or Simplex noise?

∥☆過路亽.° 提交于 2019-12-03 16:33:24
Okay, there are a lot of comparisons between Perlin and Simplex noise to be found on the web. But I really couldn't find one where there was a simple processing time comparison between both for three dimensions, which is what I am mostly interested in. I've read that popular PDF (and even understood most of it - yay!) but I cannot answer the simple question: Which one is faster for 3D, assuming an optimal implementation? This stackoverflow question answer suggests that Simplex is a pretty clear winner for my case. Of course, there are other resources claiming the exact opposite. However, the