Terrains Creating an Island.

Slides:



Advertisements
Similar presentations
Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte.
Advertisements

Chapter 11 Implementing an Assembler and a Linker Using C++ and Java.
Mars and Earth: Curriculum Support Materials and Lessons on Mars Exploration by David V. Black Walden School of Liberal Arts, 2011.
Screen Printing: Posterization of an Image using Adobe Photoshop Graphic Comm. II Mr. Jarrett.
1 Lecture-2 CSIT-120 Spring 2001 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.
 We can use a combination of the File and FileOutputStream to write a series of bytes to a file.
Introduction to Computers and Programming Lecture 7:
Random (1) Random class contains a method to generate random numbers of integer and double type Note: before using Random class, you should add following.
Introduction to Computing Systems (1st Exam). 1. [10] What is the range of decimal integers that can be represented by the following given numbers of.
1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.
Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file).
Introducing Hashing Chapter 21 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Find the period of the function y = 4 sin x
ASCII & Gray Codes.
Aloha Aloha What you see: What the computer sees: binary number columns binary number columns
Chapter 9 1 Chapter 9 – Part 1 l Overview of Streams and File I/O l Text File I/O l Binary File I/O l File Objects and File Names Streams and File I/O.
Creating your own image data files. Simple ASCII file output in Java import java.io.FileOutputStream; import java.io.PrintWriter; … PrintWriter out =
Creating your own image data files. Simple file output in C# using System.IO; … StreamWriter file = new StreamWriter( "c:\\out.txt" ); file.WriteLine(
Comments in Java. When you create a New Project in NetBeans, you'll notice that some text is greyed out, with lots of slashes and asterisks:
Mixing integer and floating point numbers in an arithmetic operation.
Hashing Hashing is another method for sorting and searching data.
The character data type char. Character type char is used to represent alpha-numerical information (characters) inside the computer uses 2 bytes of memory.
CMSC 150 PROGRAM EXECUTION CS 150: Wed 1 Feb 2012.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Objectives ❏ To understand the differences between text and binary files ❏ To write programs that read, write, and/or append binary files ❏ To be able.
Road map char data type Reading –Liang 5: Chapter 2: 2.7.4; 2.9; –Liang 6: Chapter 2: 2.7.4; 2.9 –Liang 7: Chapter 2: 2.7.4; 2.9.
Week 7 : String and photo processing. Today’s Tasks  Practice list and string  Convert Decimal to any radix base number  Between Binary and Hexadecimal.
Comp 335 – File Structures Hexadecimal Dumps Interpreting File Contents.
Java I/O Basics MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh Bajaj,
File I/O. I/O Flags Flags are passed to give some information about how the file is to be used. – Read only file – flag=0x0 – Write only file – flag=0x1.
1 Section 1.3 Binary Number Systems Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Binary Representation in Text
Introduction to Computing Science and Programming I
Data Representation.
Chapter 2 Basic Computation
Game Depth and Complexity
Visual Info Processing Programming Guide (More Details)
Building Java Programs
Chapter 4 – Fundamental Data Types
Chapter 22 – part a Stream refer to any source of input or any destination for output. Many small programs, obtain all their input from one stream usually.
Reading Netpbm Images.
I/O Basics.
Accessing Files in Java
CS1010 Programming Methodology
Invitation to Computer Science, Java Version, Third Edition
Chapter 2 Basic Computation
Introduction to javadoc
Sum and Difference Identities for the Sin Function
Programming in Perl Introduction
Computer Data Types Basics of Computing.
Building Java Programs
Fundamentals of Data Structures
Program Breakdown, Variables, Types, Control Flow, and Input/Output
Binary Numbers.
Suppose I want to add all the even integers from 1 to 100 (inclusive)
Starter answer these questions in your book
Introduction to javadoc
Building Java Programs
Building Java Programs
Building Java Programs
WJEC GCSE Computer Science
Lecture 04: Data Representation (II)
Lecture-Hashing.
Chapter 1 Introduction.
Streams A stream is an object that enables the flow of data between a program and some I/O device or file If the data flows into a program, then the stream.
Online Pogo Game Customer Service
Pogo Game Customer Care Helpline Number

Call Pogo Contact Phone Number and Enjoy Pogo Game
Presentation transcript:

Terrains Creating an Island

Find a map that may contain an island.

Zoom in on an island in a map.

Paste it into GIMP.

Crop & convert to grayscale.

Duplicate the layer and work on the duplicate.

Note water depth is actually a negative value Note water depth is actually a negative value. So we’ll set the land to be above sea level . . .

. . . by setting it to 36 (+5 above the deepest water value of -31).

But it’s difficult to distinguish between the values.

So we’ll use 100 for sea level (to spread out the values).

Make a table of values (using a linear relationship). But keep the gray values between [0..255] inclusive.

Alternative: Creating binary terrains with Java Use FileOutputStream for binary output. (System.out.println produces ASCII text output.) Write a Java program that creates a file of 1000*1000 integer values in the range [0.255]. Be creative. You may wish to use sin, cos, tan, pow, etc. Load your file into GIMP. Send and print your program and a screen dump of the result in GIMP to me.

Extra: Simply check your raw file in GIMP by creating a .pgm file. Add the following to your code right before you write out the raw bytes: String s = “P5\n1000 1000\n255\n"; Using the FileOutputStream, write out the above before you write any raw data.

Bring your new Terrain into Unity Terrain --> Create Terrain Terrain --> Import Heightmap – Raw Then proceed working on Chapter 2: Environments in Unity Game Development Essentials.