Perspective in 2D Games

Similar documents
Perspective in 2D Games

Perspective in 2D Games

Classical Viewing. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

ENGINEERING GRAPHICS 1E9

3D Viewing. Introduction to Computer Graphics Torsten Möller / Manfred Klaffenböck. Machiraju/Zhang/Möller

3D Viewing I. Acknowledgement: Some slides are from the Dr. Andries van Dam lecture. CMSC 435/634 August D Viewing I # /27

Reading. Angel. Chapter 5. Optional

Engineering Drawing Lecture 5 PROJECTION THEORY

CS475/CS675 Computer Graphics

Transform 3D objects on to a 2D plane using projections

Introduction to Computer Graphics (CS602) Lecture 19 Projections

I B.TECH- I SEMESTER DEPARTMENT OF MECHANICAL ENGINEERING ENGINEERING DRAWING

Perspective. Announcement: CS4450/5450. CS 4620 Lecture 3. Will be MW 8:40 9:55 How many can make the new time?

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

3D Viewing I. From 3D to 2D: Orthographic and Perspective Projection Part 1

Perspective. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

History of projection. Perspective. History of projection. Plane projection in drawing

CS354 Computer Graphics Viewing and Projections

Reading. Projections. The 3D synthetic camera model. Imaging with the synthetic camera. Angel. Chapter 5. Optional

Exploring 3D in Flash

Lecture 2 of 41. Viewing 1 of 4: Overview, Projections

Lecture 2 of 41. Viewing 1 of 4: Overview, Projections

Tile based games. Piotr Fulma«ski. 8 pa¹dziernika Wydziaª Matematyki i Informatyki, Uniwersytet Šódzki, Polska

DMT113 Engineering Drawing. Chapter 3 Stretch System

3D COMPUTER GRAPHICS

VIEWING 1. CLASSICAL AND COMPUTER VIEWING. Computer Graphics

Chapter 5 Pictorial sketching

11/12/2015 CHAPTER 7. Axonometric Drawings (cont.) Axonometric Drawings (cont.) Isometric Projections (cont.) 1) Axonometric Drawings

Peter Clements Art Studios

Student Name: Teacher: Date: District: Rowan. Assessment: 9_12 T and I IC61 - Drafting I Test 1. Description: Unit C - Sketching - Test 2.

AML710 CAD LECTURE Parallel Projections a) Orthographic Projections b) Axonometric Projections 2. Perspective Transformations and Projections

Introduction to Projection The art of representing a three-dimensional object or scene in a 2D space is called projection.

Projections. Conceptual Model of the 3D viewing process

Visual Imaging in the Electronic Age. Drawing Perspective Images

Visual Imaging in the Electronic Age. Drawing Perspective Images

Chapter 5 Pictorial Projection

Dr. Reham Karam. Perspective Drawing. For Artists & Designers. By : Dr.Reham Karam

Bridge Course On Engineering Drawing for Mechanical Engineers

technical drawing

(Ans:d) a. A0 b. A1 c. A2 d. A3. (Ans:b) (Ans:a) (Ans:d) (Ans:d)

PROJECTIONS PARALLEL CONICAL PROJECTIONS PROJECTIONS OBLIQUE ORTHOGRAPHIC PROJECTIONS PROJECTIONS

Graphic Communications

ORTHOGRAPHIC PROJECTION

Beginning Engineering Graphics 3 rd Week Lecture Notes Instructor: Edward N. Locke Topic: The Coordinate System, Types of Drawings and Orthographic

UNIT 5a STANDARD ORTHOGRAPHIC VIEW DRAWINGS

Chapter 1 Overview of an Engineering Drawing

MULTIPLE CHOICE QUESTIONS - CHAPTER 6

Technical Graphics Higher Level

Indian Institute of Technology Kanpur National Programme on Technology Enhanced Learning (NPTEL) Course Title Engineering Graphics

3D Viewing. Projections. Perspective A B B. Projectors. Center of Projection. Projection Plane

Copyrighted Material. Copyrighted Material. Copyrighted. Copyrighted. Material

Chapter 1 Overview of a Technical Drawing

Orthographic Projection

Projections Computer Graphics and Visualization

Computer Assisted Drafting (CAD) Level I & II

Describing an Angle Bracket

CC3 and Perspectives A Campaign Cartographer 3/3+ Tutorial. Part 1 - Basics

6. Graphics MULTIMEDIA & GRAPHICS 10/12/2016 CHAPTER. Graphics covers wide range of pictorial representations. Uses for computer graphics include:

JUNIOR CERTIFICATE 2009 MARKING SCHEME TECHNICAL GRAPHICS HIGHER LEVEL

60 Most Important Engineering Drawing Questions

Graphical Communication for Engineering ENSC 204 Final Exam

Isometric Projection Drawing CHAPTER 6

ME1105 Engineering Drawing & Design

Extension material for Level 2 Design and Visual Communication Study Guide

Volume 1 - Module 6 Geometry of Aerial Photography. I. Classification of Photographs. Vertical

the gamedesigninitiative at cornell university Lecture 2: Nature of Games

Isometric Drawing Chapter 26

Perspective. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 5

Orthographic Projection


ENGR 1182 Exam 1 First Mid Term Exam Study Guide and Practice Problems

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Viewing. Part I (History and Overview of Projections) Bin Sheng 1 / 46 10/04/2016

Virtual Environments. Ruth Aylett

COMPASS NAVIGATOR PRO QUICK START GUIDE

CE 100 Civil Engineering Drawing Sessional (Lab Manual)

ENGINEERING GRAPHICS UNIT V ISOMETRIC PROJECTION PERSPECTIVE PROJECTION

ENGINEERING DRAWING. 1. Set squares are used to draw different angles. What is the angel a formed by the 45⁰ set square? Give a brief answer.

Engineering Graphics with SOLIDWORKS 2016 and Video Instruction

JUNIOR CERTIFICATE 2008 MARKING SCHEME TECHNICAL GRAPHICS HIGHER LEVEL

Drawing: technical drawing TECHNOLOGY

Multiview Drawing. Definition: Graphical representation of a 3- dimensional object on one plane (sheet of paper) using two or more views.

Photoshop Notes and Application Study Packet

Unit-5 ISOMETRIC PROJECTION

Chapter 2. Isometric Projection and Multi View Drawings. Below are the desired outcomes and usage competencies based on the completion of Chapter 2.

Visual Imaging in the Electronic Age. Drawing Perspective Images

Graphical Communication

Multiviews and Auxiliary Views

Autodesk Inventor. In Engineering Design & Drafting. By Edward Locke

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Viewing. Part I (History and Overview of Projections) Andries van Dam 1 / 46 10/05/2017

CLASS views from detail on a grid paper. (use appropriate line types to show features) - Optional views. Turn in for grading on class 6 (06/04)

Engineering Graphics with SolidWorks 2012

1. When sketching long, narrow objects in OBLIQUE, distortion can be lessened by placing the long dimension along:

the gamedesigninitiative at cornell university Lecture 2: Nature of Games

Lecture #4 MULTIVIEW PROJECTION RES 112E COMPUTER AIDED TECHNICAL DRAWING ITU

GEOMETRY TOOLS. Contents

At the conclusion of this unit you should be able to accomplish the following with a 70% accuracy

the gamedesigninitiative at cornell university Lecture 4 Game Components

Brief Introduction to Engineering Graphics The use of drawings to convey information. Sketching freehand straight edge

CHAPTER 01 PRESENTATION OF TECHNICAL DRAWING. Prepared by: Sio Sreymean

2. Line composed of closely and evenly spaced short dashes in a drawing represents

Transcription:

Lecture 15 in 2D Games

Drawing Images Graphics Lectures SpriteBatch interface Coordinates and Transforms bare minimum to draw graphics Drawing Camera Projections side-scroller vs. top down Drawing Primitives Color and Textures Polygons necessary for lighting & shadows 2 2D Sprite Graphics

Take Away for Today What is game camera? How does it relate to screen space? Object space? How does camera work in a 2D game? 3D? How do we give 2D games depth? Advantages, disadvantages of orthographic view Advantages, disadvantages of axonometric view How does tileability affect art in games? 3

The Game Camera What makes a game 3-D? Everything is shown on a 2-D screen (mostly) 3D game have a user controlled camera Position camera to look at art from all sides 3-D art has enough information to allow this CS/INFO 3152 limits you to a 2-D game The game camera has a fixed perspective You render all art to one visible side 4

Camera in 2D Games World Camera Camera origin 5 World origin

Specifying Camera Camera is a coord space Called eye space Eye position at origin How to move camera? Transforms again! Inverse of scrolling Scrolling: move obj to eye Camera: move eye to obj Two matrices are inverses 6

Cameras in LibGDX LibGDX has a Camera class Stores camera type, and eye location We typically use OrthographicCamera Define as size of screen, with origin at bottom Apply to SpriteBatch with setprojection() Convert camera into a Matrix4 object Use combined field, not projection See GameCanvas.java in Lab 2 7

Cameras in LibGDX SpriteBatch batch = new SpriteBatch(); // Create a camera for game window Camera camera = new OrthogonalCamera(width,height); // Set camera in SpriteBatch Matrix4 matrix = camera.combined; batch.setprojectionmatrix(matrix); // Ready to use SpriteBatch batch.begin(); Convert Camera to transform to use 8

Cameras in LibGDX OrthogonalCamera Used for all 2D games Objects have 2d positions Draws back-to-front Specify viewport The window size The window origin Move origin to scroll Camera Used for all 3D games Objects have 3d positions Draws a picture plane Specify eye coordinates Eye origin Looking direction Up direction 9

Drawing for a 3D Models make it easy Rotate model to position Flatten to jpeg, tiff, etc But 3D modeling is hard Very technical programs Cannot draw by hand How to draw perspective? Artist captures camera Realism creates problems 10

Plane Projection in Drawing 11

Plane Projection in Drawing Problem: Art assets are not invariant under translation. 12

Vanishing Points are Not Our Friend 13

Vanishing Points are Not Our Friend 14

Vanishing Points are Not Our Friend 15

Vanishing Points are Not Our Friend Should not be same 16

Vanishing Points are Not Our Friend 2D games rely on distortional perspectives 17

Orthographic Projection Project perpendicular to an axis Top-down: perpendicular to z-axis Side scrolling: perpendicular to y-axis Very easy to do artistically Art objects are flat tiles Layer tiles via compositing But enforces 2-D gameplay 3rd dimension lost; cannot be seen Distorted: All rays to eye are parallel 18

Orthographic Projection 19

Side-View: Braid 20

Top-Down: Hotline Miami 21

Top-Down: Gauntlet 22

Drawbacks of Orthographic Projection Top-down is extremely limiting Can only see top of avatar Hard to make interesting characters Typically limited to platformers There little no depth to gameplay At best can create gameplay layers 3rd dimension is very discrete (2.5D) Represent 3 rd dimension with parallax 23

Parallax Scrolling Gives depth to orthographic projection Objects in background have distance Rate of scrolling depends on distance Implement with multiple background layers Each layer scrolls at a different rate See course website for sample code Often requires some degree of transparency Composite front layers with back layers 24

Parallax Scrolling 25

Parallax Scrolling 26

Axonometric Projection Off axis view of object View along all 3-axes Once again: distorted Not a true projection 2 axes equal No vanishing point Axes are foreshortened Allows 3-D gameplay all axes equal Cliffs are visible May also hide objects! 27

Axonometric Projection 28

Axonometric Projection 29

Projection Types Isometric All axes are equal If need all dimensions Used in classic RPGs 2 axes equal Dimetric z-axis is very short x, y axes are equal all axes equal Orthographic+depth For aestic reasons only 30

Axes relative to screen z goes into screen x, y are in screen plane Projection Geometry Axonometric coodinates y May not be true coords Meaning of x, y, z? z Isometric x Orthographic substitutes Side-scroller: y is height Top-down: z is height z is artificial dimension 31

Isometric View x, y, z = Axonometric Coords x, y = Screen Coordinates x = x - z y = y + ½(x+z) w h 27 45 30 Game View Top View Side View 32

Isometric View: Zaxxon 33

Dimetric View (Side-Depth) x, y, z = Axonometric Coords x, y = Screen Coordinates x = x +½(z) y = y +¼(z) w h 0.25 75 10 0.5 Game View Top View Side View 34

Dimetric View (Top-Depth) x, y, z = Axonometric Coords x, y = Screen Coordinates x = x +¼(z) y = y +½(z) w h 0.5 78 ~24 0.25 Game View Top View Side View 35

But Gameplay is Still Orthographic 36

But Gameplay is Still Orthographic But formula allow us to fly between layers 37

Dimetric: Black Friday 38

Dimetric: Black Friday Shadow is position 39

Dimetric: Enter Gungeon 40

Dimetric: Enter Gungeon Shadow 41

Drawing for Axonometric View Use boxes shown on slide Tiling boxes is easy Draw shape inside box Complex, large shapes? Glue toger boxes Draw inside box group Objects need many angles Transparency is tricky Standard: 8 compass points Example: LakeHills.ai 42

Drawing for Axonometric View Use boxes shown on slide Tiling boxes is easy Draw shape inside box Complex, large shapes? Glue toger boxes Draw inside box group Objects need many angles Transparency is tricky Standard: 8 compass points Example: LakeHills.ai 43

Isometric Walking Animation 44

Isometric Walking Animation 45

Which Style to Use? Orthographic Advantages Easy to make tiles Easy to composite Disadvantages Movement is 2D Game feels flat Common in this class Axonometric Advantages Sort of easy to tile Some 3-D movement Disadvantages Harder to composite Objects may be hidden Lot of work for artist 46

Combining s 47

Combining s Dimetric Environment Orthographic Characters 48

Summary Camera represents eye space coordinates 3D games have arbitrary camera movement 2D games are limited to scrolling movement 2-D art requires you chose a projection Orthographic is easy, but limits gameplay Axonometric has better gameplay, but harder to draw Axonmetric type depends on style of game Isometric common to classic RPGs Dimetric gives depth to traditional orthographic 49