Game Programming, Math and the Real World Rolf Lakaemper, CIS, Temple University.

Slides:



Advertisements
Similar presentations
FRACTAL DIMENSION OF BIOFILM IMAGES
Advertisements

40S Applied Math Mr. Knight – Killarney School Slide 1 Unit: Sequences Lesson: SEQ-L3 Drawing Fractal Patterns Drawing Fractal Patterns Learning Outcome.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Computational Geometry II Brian Chen Rice University Computer Science.
CS 551 / CS 645 Antialiasing. What is a pixel? A pixel is not… –A box –A disk –A teeny tiny little light A pixel is a point –It has no dimension –It occupies.
Generated Waypoint Efficiency: The efficiency considered here is defined as follows: As can be seen from the graph, for the obstruction radius values (200,
FRACTALS. WHAT ARE FRACTALS? Fractals are geometric figures, just like rectangles, circles, and squares, but fractals have special properties that those.
Chapter 9: Recursive Methods and Fractals E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Fractals Jennifer Trinh Benoît Mandelbrot, “father of fractal geometry”
∞Exploring Infinity ∞ By Christopher Imm Johnson County Community College.
Fractals Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New.
MAS1302: General Feedback on Assignment 1 Part A (non-computer questions) Generally well done by all those who made a serious effort.
The infinitely complex… Fractals Jennifer Chubb Dean’s Seminar November 14, 2006 Sides available at
Course Website: Computer Graphics 11: 3D Object Representations – Octrees & Fractals.
The Wonderful World of Fractals
Fitting a Model to Data Reading: 15.1,
Notes, part 5. L’Hospital Another useful technique for computing limits is L'Hospital's rule: Basic version: If, then provided the latter exists. This.
CS 4731: Computer Graphics Lecture 5: Fractals Emmanuel Agu.
CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.
Multifractals in Real World
Notes, part 4 Arclength, sequences, and improper integrals.
Approaches To Infinity. Fractals Self Similarity – They appear the same at every scale, no matter how much enlarged.
Modelling and Simulation 2008 A brief introduction to self-similar fractals.
"Clouds are not spheres, mountains are not cones, coastlines are not circles, and bark is not smooth, nor does lightning travel in a straight line."(Mandelbrot,
Amgad Hussein, Maria Tokarska, Edward Grinko, Dimitar Atassanov, Megan Varghese, Emilio Asperti.
WAWERU HANNAH NYAKIO B02/53847/2012. PERSPECTIVE DRAWING  Perspective drawing is a drawing technique used to illustrate dimension through a flat surface.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
CITS4403 Computational Modelling Fractals. A fractal is a mathematical set that typically displays self-similar patterns. Fractals may be exactly the.
1 Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum.
Fractals. Similar Figures Same shape Corresponding angles are congruent Corresponding sides are proportional.
Fractals Nicole MacFarlane December 1 st, What are Fractals? Fractals are never- ending patterns. Many objects in nature have what is called a ‘self-
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
CS 376 Introduction to Computer Graphics 04 / 30 / 2007 Last Lecture :( Instructor: Michael Eckmann.
Model Construction 김 성 남. Contents What is Modeling? Model Construction - Interactive modeling tools - Scanning tools - Computer vision -
Infinities 6 Iteration Number, Algebra and Geometry.
FRACTALS Dr. Farhana Shaheen Assistant Professor YUC.
Random Terrain Generation By Cliff DeKoker. About my project ● Incremental development ● Focus on creating height maps that mimic real terrain ● Allow.
Fractals Douglas reeves.
Fractals smooth surfaces and regular shapes - Euclidean-geometry methods -object shapes were described with equations natural objects - have irregular.
Ground Truth Free Evaluation of Segment Based Maps Rolf Lakaemper Temple University, Philadelphia,PA,USA.
Strategies and Rubrics for Teaching Chaos and Complex Systems Theories as Elaborating, Self-Organizing, and Fractionating Evolutionary Systems Fichter,
Mathematics Numbers: Percentages Science and Mathematics Education Research Group Supported by UBC Teaching and Learning Enhancement Fund Department.
WORKSHOP “Fractal patterns…” Morahalom, May, 2009 Fractal patterns in geology, and their application in mathematical modelling of reservoir properties.
Low-Dimensional Chaotic Signal Characterization Using Approximate Entropy Soundararajan Ezekiel Matthew Lang Computer Science Department Indiana University.
Percolation Percolation is a purely geometric problem which exhibits a phase transition consider a 2 dimensional lattice where the sites are occupied with.
{ Fractals, iterations and the Sierpinski Triangle an iterative approach Central Arizona College Science Night at San Tan Campus.
Self-Similarity Some examples. Self-Similarity in the Koch Curve Fractals usually possess what is called self-similarity across scales. That is, as one.
1 GEM2505M Frederick H. Willeboordse Taming Chaos.
Multiplying Mixed Numbers © Math As A Second Language All Rights Reserved next #7 Taking the Fear out of Math ×
CSE 423 Computer Graphics | MUSHFIQUR ROUF CSE423:
Fractals Ed Angel Professor Emeritus of Computer Science
 Introduction  Definition of a fractal  Special fractals: * The Mandelbrot set * The Koch snowflake * Sierpiński triangle  Fractals in nature  Conclusion.
Fractals Cassi Blum.
Fractals.
Review Design of experiments, histograms, average and standard deviation, normal approximation, measurement error, and probability.
Minimum spanning tree diameter estimation in random sensor networks in fractal dimension Students: Arthur Romm Daniel Kozlov Supervisor: Dr.Zvi Lotker.
Fractals and L-Systems
Iterative Mathematics
Computer Graphics Lecture 40 Fractals Taqdees A. Siddiqi edu
Fractals Project Natalie Rowe.
Chapter 5 Curves and Fractals.
Midpoint Displacement for Terrain
S.K.H. Bishop Mok Sau Tseng Secondary School
The Wonderful World of Fractals
The Mystery of the Fractal
Building Fractal Landscapes
Modeling with Geometry
Infinity and Beyond! A prelude to Infinite Sequences and Series (Ch 12)
Infinity and Beyond! A prelude to Infinite Sequences and Series (Ch 12)
Fractals What do we mean by dimension? Consider what happens when you divide a line segment in two on a figure. How many smaller versions do you get?
Presentation transcript:

Game Programming, Math and the Real World Rolf Lakaemper, CIS, Temple University

The Visual World: Modelling Natural Environments

Modelling Natural Environments Natural environments are needed e.g. in RPG and Strategy Games Gothic 3, Piranha Bytes

Modelling Natural Environments Simulation is needed on different levels: Macro-terrain… Civilization 4, Sid Meier, Firaxis

Modelling Natural Environments …Mid level (mountains, rocks, clouds)… Gothic 3, Piranha Bytes

Modelling Natural Environments …trees, leaves… Gothic 3, Piranha Bytes

Modelling Natural Environments Q.: How can we describe a ‘natural’ environment ? A.: a mathematical description would be helpful

Modelling Natural Environments ‘Visual Math’ = Geometry Geometry = Euclidean Geometry (really?)

Modelling Natural Environments An attempt to model nature using Euclidean geometry Age of Kingdoms (shareware)

Modelling Natural Environments Let’s have a look at nature to see why Euclidean geometry fails. Q.: What makes the appearance of objects in nature ‘natural’ ?

Modelling Natural Environments New Jersey

Modelling Natural Environments New Jersey 1.2 miles1 inch Scale ~1:100000

Modelling Natural Environments Broccoli

Modelling Natural Environments Coastline 1 (computer generated)

Modelling Natural Environments Coastline 2 (computer generated)

Modelling Natural Environments Coastline 3 !

Modelling Natural Environments Observation 1: Nature seems to be self similar on different scales

Modelling Natural Environments Is self similarity sufficient to describe nature ? M.C. Escher: Circle Limits IV

In a certain sense, Eucledian geometry sometimes is self similar, too. self similar not self similar What’s missing is some ‘roughness’ Modelling Natural Environments

Two waterways

Modelling Natural Environments Natural or not ?

Modelling Natural Environments A measure to describe ‘roughness’: Fractal Dimensions

Modelling Natural Environments Motivation: Defining Dimensionality 1D: N=2 parts, scaled down by s = ½ = 1/N^(1/1) 2D: N=4 parts, scaled down by s = ½ = 1/N^(1/2) 3D: N=8 parts, scaled down by s = ½ = 1/N^(1/3)

Fractals We can also state: N= (1/s)^D D results from s, N : D = log(N) / log(1/s)

Fractals D doesn’t have to be integer…

Fractals Fractals are self similar geometric objects, which have not necessarily an integer dimension (though their topological dimension is still integer)

Fractals The simplest: von Koch Snowflake N=4, r=1/3

What ? Von Koch Snowflake

Fractals Von Koch Snowflake Iterating the snowflake algorithm to infinity, the boundary of the 1d snowflake becomes part of the 2d AREA of the plane it is constructed in (take it intuitively !)

Fractals Von Koch Snowflake It therefore makes sense to define its dimensionality BETWEEN one and two !

Fractals N = 4 Scale r = 1/3 D = log(4) / log(3) D = Intuitive ?

Fractals This definition of the dimensionality gives us a direct measure for the roughness of self similar objects.

Fractals Interestingly, studying nature shows that a fractal roughness of ~x.25 (x=1,2,3,…) seems to be found everywhere, and perceived by humans a ‘natural’ Coastlines, clouds, trees, the distribution of craters on the moon, microscopic ‘landscapes’ of molecules, …

Fractals So let’s build fractals with a dimensionality of x.25 !

Fractals Algorithms for Random Fractals

Fractals Random fractals: In contrast to exact self similar fractals (e.g. the Koch snowflake), also termed as deterministic fractals, an additional element of randomness is added to simulate natural phenomena. An exact computation of fractals is impossible, since their level of detail is infinite ! Hence we approximate (i.e we stop the iteration on a sufficient level of detail)

Fractals We will use MIDPOINT DISPLACEMENT

Fractals A 1D example to draw a mountain : Start with a single horizontal line segment. Repeat for a sufficiently large number of times { Repeat over each line segment in the scene { Find the midpoint of the line segment. Displace the midpoint in Y by a random amount. Reduce the range for random numbers. }

Fractals Result:

Fractals Result:

Fractals Extension to 2 dimensions: The Diamond – Square Algorithm (by Fournier, Fussel, Carpenter)

Fractals Data Structure: Square Grid  Store data (efficiently) in 2D Array.  Modification is very trivial.  Not possible to define all terrain features.  Good for Collision detection

Fractals Data Structure: (Square) Grid (“Heightfield”)

Diamond Square The basic idea: Start with an empty 2D array of points. To make it easy, it should be square, and the dimension should be a power of two, plus one (e.g. 33x33). Set the four corner points to the same height value. You've got a square.

Diamond Square This is the starting-point for the iterative subdivision routine, which is in two steps: The diamond step: Take the square of four points, generate a random value at the square midpoint, where the two diagonals meet. The midpoint value is calculated by averaging the four corner values, plus a random amount. This gives you diamonds when you have multiple squares arranged in a grid.

Diamond Square Step 2: The square step: Taking each diamond of four points, generate a random value at the center of the diamond. Calculate the midpoint value by averaging the corner values, plus a random amount generated in the same range as used for the diamond step. This gives you squares again.

This is done repeatedly, but the next pass is different from the previous one in two ways. First, there are now four squares instead of one. Second, and this is main point: the range for generating random numbers has been reduced by a scaling factor r, e.g. r = 1/4 (remember the fractal dimension ?) Diamond Square

Again:

Diamond Square Some steps: taken from

Diamond Square The scaling factor r, determining the range of random displacement R, defines the roughness ( => fractal dimension !) of the landscape. Some examples for diff. r and R R(n+1) = R(n) * 1 / (2^H), 0 < H < 1

Diamond Square Dimension: 2.8

Diamond Square 2.6

Diamond Square 2.5

Diamond Square 2.4

Diamond Square 2.3

Diamond Square 2.2

Diamond Square 2.15

Diamond Square 2.5

Diamond Square 2.8

Diamond Square Some tricks: power law

Diamond Square Some tricks: power law

Fractals Remember ? Simulation is needed on different levels. There are different approaches and algorithms to model nature, all of them fractal, all of them taking care of the correct dimensionality.

Fractals

Genres First Fractals in Games And Movies:

Genres Rescue on Fractalus Activision,1986, Spectrum VersionSpectrum Version

Genres Star Trek II: The wrath of Khan (1982) (movie)

Conclusion: Fractal Geometry helps to analyze and model the visual properties of nature. Breakout