Permalink
Browse files

perlin noise complete

  • Loading branch information...
2 parents 1558954 + fe53705 commit ebc3836aa34719bd05dccf775843206d49df5d18 @linzhp linzhp committed Mar 18, 2012
View
@@ -0,0 +1,152 @@
+# Pre-reqs
+# 1. install dl-rake-latex gem
+# 2. install graffle gem
+# 3. read tutorial for using dl-rake-latex >
+# http://devel.softeng.ox.ac.uk/trac/softeng/wiki/Utilities/RakeLatex
+#
+# Basic usage:
+# The basic usage is to place a Rakefile.rb file in the same directory as your LaTeX source, and to
+# place the appropriate rake task definitions into this rakefile. Once this is done, you can generate
+# DVI, PS, and PDF output, respectively, using the following commands:
+#
+# rake dvi
+# rake ps
+# rake pdf
+#
+# Usage Scenarios
+#
+# 1. Single document
+# The simplest case is that you have a directory containing a single LaTeX document, which has no
+# dependencies on other LaTeX files, figures, or bibliography files. For example, you might have the
+# following directory structure:
+# mydoc/
+# Rakefile.rb
+# mydoc.tex
+#
+# The contents of Rakefile.rb should be:
+# require 'rake-latex'
+# Rake.startfile(__FILE__)
+# # LaTeX document in mydoc.tex.
+# latex('mydoc')
+#
+# Rake.endfile
+#
+# 2. Single document, no references
+# The default LaTeX task generated by the previous example assumes that there are references in the
+# document, and that LaTeX needs to be run twice in order to generate and use the correct mydoc.aux
+# file. If you know that your document contains no references, and want to speed up the generation
+# process by only running LaTeX once, you can modify the properties of the LaTeX task as follows:
+#
+# require 'rake-latex'
+# Rake.startfile(__FILE__)
+# latex('mydoc') do
+# |task|
+# task.need_aux = false
+# end
+# Rake.endfile
+#
+# 3. Single document, with bibliography ¶
+# If you have citations in your document, you will probably have a BibTeX file floating around somewhere
+# containing the references. For instance, you might have:
+#
+# myrefs/
+# refs.bib
+# mydoc/
+# Rakefile.rb
+# mydoc.tex
+# **Note** Notice how the references file does not have to be in the same directory as the LaTeX file!!
+#
+# The rakefile then becomes:
+# require 'rake-latex'
+# Rake.startfile(__FILE__)
+# latex('mydoc') do
+# |task|
+# task.references = ['../myrefs/refs.bib']
+# end
+# Rake.endfile
+#
+# When you run rake pdf, this will execute four commands, giving you a PDF with all references and
+# citations correct:
+#
+# 1. pdflatex
+# 2. bibtex
+# 3. pdflatex
+# 4. pdflatex
+#
+#
+# 4. Single document, with figures
+# The syntax of the rakefile becomes slightly more complex if there are figures in the source document.
+# However, it's not as bad as it could be, since we have the full power of the Ruby language at our
+# disposal. Let's assume that the mydoc example from above now contains two OmniGraffle figures:
+#
+# mydoc/
+# Rakefile.rb
+# mydoc.tex
+# figure1.graffle
+# figure2.graffle
+# The rakefile should now look like this:
+# require 'rake-latex'
+# Rake.startfile(__FILE__)
+# figures = []
+# figures << graffle('figure1')
+# figures << graffle('figure2')
+# latex('mydoc') do
+# |task|
+# task.figures = figures
+# end
+# Rake.endfile
+# 5. Single document in multiple files
+# SEE HOW I DID THIS BELOW ;-)
+#
+# 6. Multiple documents in multiple directories
+# If you have a truly large number of LaTeX documents to keep track of, you will usually have come up with
+# a fairly complicated directory structure for storing them all. For instance,
+#
+# mydocs/
+# Rakefile.rb
+# refs/
+# refs.bib
+# papers/
+# paper1/
+# Rakefile.rb
+# paper1.tex
+# paper2/
+# paper2.tex
+# Rakefile.rb
+#
+# **Note** each subdirectory must contain a Rakefile.rb. These rakefiles are written exactly like one of
+# the previous examples, taking into account only the document in its directory. The root directory
+# contains an additional rakefile that brings them all together:
+#
+# require 'rake-latex'
+# Rake.startfile(__FILE__)
+# require 'papers/paper1/Rakefile'
+# require 'papers/paper2/Rakefile'
+# Rake.endfile
+#
+# And that's it!!!
+#
+
+require 'rake-latex'
+
+Rake.startfile(__FILE__)
+
+# LaTeX document => report.tex with bibliography citations.
+latex('report') do
+ |task|
+ task.references = ['report.bib']
+ task.includes = [
+ 'introduction.tex',
+ 'relatedwork.tex',
+ 'system.tex',
+ 'conclusions.tex',
+ 'futurework.tex',
+ 'problemdescription.tex',
+ 'algorithms.tex',
+ 'architecture.tex',
+ 'demo.tex',
+ 'three.tex'
+ ]
+end
+
+Rake.endfile
View
@@ -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)
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
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 floating 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)
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,15 +1,13 @@
% This file was created with JabRef 2.7.
% Encoding: UTF-8
-@ARTICLE{bowman:reasoning,
- author = {Mic Bowman and Saumya K. Debray and Larry L. Peterson},
- title = {Reasoning About Naming Systems},
- journal = {ACM Trans. Program. Lang. Syst.},
- year = {1993},
- volume = {15},
- pages = {795-825},
- number = {5},
- month = {November}
+@MISC{threeJS,
+ author = {Cabello, Ricardo},
+ title = {Three.js},
+ howpublished = {Github Page},
+ owner = {hsanchez},
+ timestamp = {2012.03.18},
+ url = {http://mrdoob.github.com/three.js}
}
@INPROCEEDINGS{clark:pct,
@@ -22,6 +20,17 @@ @INPROCEEDINGS{clark:pct
organization = {TeX Users Group}
}
+@ARTICLE{fournier:1982,
+ author = {Fournier, Alain and Fussell, Don and Carpenter, Loren},
+ title = {Computer rendering of stochastic model},
+ journal = {Commun. ACM},
+ year = {1982},
+ volume = {25},
+ pages = {371-384},
+ number = {6},
+ month = {June}
+}
+
@BOOK{Lamport:LaTeX,
title = {LaTeX User's Guide and Document Reference Manual},
publisher = {Addison-Wesley Publishing Company},
@@ -40,24 +49,25 @@ @BOOK{Lengyel2012
isbn = {978-1-4354-5886-4}
}
-@ARTICLE{Perlin2002,
+@MISC{perlin:2001,
+ author = {Perlin, Ken},
+ title = {Noise Hardware},
+ note = {[Online; accessed Mar 18, 2012; In Real-Time Shading SIGGRAPH Course
+ Notes]},
+ owner = {hsanchez},
+ timestamp = {2012.03.18},
+ url = {http://www.csee.umbc.edu/~olano/s2002c36/}
+}
+
+@ARTICLE{perlin:2002,
author = {Perlin, Ken},
title = {Improving noise},
journal = {ACM Trans. Graph.},
year = {2002},
volume = {21},
- pages = {681--682},
+ pages = {681-682},
number = {3},
- month = jul,
- acmid = {566636},
- address = {New York, NY, USA},
- doi = {10.1145/566654.566636},
- issn = {0730-0301},
- issue_date = {July 2002},
- keywords = {procedural texture},
- numpages = {2},
- publisher = {ACM},
- url = {http://doi.acm.org/10.1145/566654.566636}
+ month = {July}
}
@MISC{learningWebGL,
View
@@ -2,15 +2,16 @@
\usepackage{listings}
\usepackage{color}
+\usepackage{subfigure}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
\lstdefinelanguage{JavaScript}{
- keywords=[1]{typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
+ keywords=[1]{typeof, new, catch, function, return, for, switch, var, if, in, while, do, else, case, break},
keywordstyle=[1]\color{blue}\bfseries,
- keywords=[2]{this, document, window},
+ keywords=[2]{this, document, window, null, true, false},
keywordstyle=[2]\color{green}\bfseries,
identifierstyle=\color{black},
sensitive=false,
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ebc3836

Please sign in to comment.