# hsanchez/terrain

perlin noise complete

2 parents 1558954 + fe53705 commit ebc3836aa34719bd05dccf775843206d49df5d18 linzhp committed Mar 18, 2012
 @@ -4,10 +4,33 @@ \subsection{Terrain Generation Algorithms} In this project, we implemented three terrain generation algorithms, namely, Perlin Noise, Simplex Noise and Diamond Square. This section gives an overview of the three algorithms. \subsubsection{Perlin Noise} -Perlin noise is procedurally generated noise proposed by Ken Perlin \cite{Perlin2002}. In 2D space, Perlin noise works as follows: +Perlin noise is procedurally generated noise proposed by Ken Perlin \cite{perlin:2002}. In 2D space, Perlin noise works as follows: \begin{enumerate} - \item Create a grid of vectors, whose \textit{x} and \textit{y} coordinates are all integers. Every point in the 2D space falls into a square in the grid, where four vertexes of the square can be decided by taking the floors and ceilings of its \textit{x} and \textit{y} coordinates. + \item Create a grid of vectors, whose \textit{x} and \textit{y} coordinates are all integers. Every point in the 2D space falls into a square in the grid, where four vertexes of the square can be decided by taking the floors and ceilings of its \textit{x} and \textit{y} coordinates. + \item For each vector on the grid, generate a gradient pointing away from it in a random direction (Figure~\ref{fig:randomGradients}). + \item For any given point, interpolate the value from the surrounding 4 gradients. + \item Sum all values of the interpolations. Some example graphs generated by Perlin noise are show in Figure~\ref{fig:perlinEg}. \end{enumerate} +\begin{figure} + \center + \includegraphics[scale=0.5]{gradients.png} + \caption{Random Gradients} + \label{fig:randomGradients} +\end{figure} +\begin{figure} + \center + \subfigure{ + \includegraphics[scale=0.5]{woodgrain.png} + } + \subfigure{ + \includegraphics[scale=0.5]{marble.png} + } + \subfigure{ + \includegraphics[scale=0.5]{clouds.png} + } + \caption{Perlin Noise Examples} + \label{fig:perlinEg} +\end{figure} \subsubsection{Simplex Noise} \subsubsection{Diamond Square} % subsection algorithms (end)
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
 @@ -1,5 +1,12 @@ \section{Introduction} % (fold) \label{sec:introduction} -% TODO + +In recent years, the advances in processing power of average home computers have made it possible to simulate realistic terrains near-realtime. This paper presents a method that combines three well-known terrain generation algorithms (i.e., Perlin Noise \cite{perlin:2002}, Simplex Noise \cite{perlin:2001}, and Diamond Square \cite{fournier:1982}) and a Javascript 3D engine, called Three.js \cite{threeJS}, for generating natural looking terrains on the Web. With some criteria for applicability in robot designs generation, a Web-based tool for randomly generating terrains is then presented. Finally, to create more interesting and complicated terrains, We mixed the noise and fractal functions of these well-known algorithms. + +We care about procedural terrain generation for different reasons. To name a few, one aspect of our robot design generator project at the Augmented Design Lab is the testing of whether the produced designs are valid. Consequently, performing a drive-test of those design on numerous simulated (procedurally generated) terrains will be a great validity test for our designs. Additionally, art assets such as terrain's textures and geometry are difficult and time consuming to generate. Consequently, by using procedural terrain generation techniques, We will be able to create many such assets with subtle modifications of parameters. Lastly, since this is a Web-based tool, We need to deal with lots of terrain variations and memory/bandwidth requirements. Therefore, We believe the use of procedural terrain generation techniques to satisfy those requirements is the logical choice. + +In the algorithms described in this paper, terrain will be represented by three-dimensional height maps using ﬂoating point values between 0 and 1. Unless otherwise stated, all examples explained in this paper use the respective default noise or fractal functions of the used terrain generation algorithms. All implementations of these algorithms, as well as the overall tool, were done in Javascript. + +This paper is structured as follows: First, We briefly review the related work. Then, We describe the overall terrain generation system and write about the tool's architecture, the specific choices We made in implementing not only the Perlin Noise, Simplex Noise, and Diamond algorithms, but also the overall tool. Finally, We conclude and then talk about the future work. % section introduction (end)