Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.

Similar presentations


Presentation on theme: "CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t."— Presentation transcript:

1 CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS

2 WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t know them) The math behind the scenes Shaders Simple and not-so-simple 3D file formats (OBJ and FBX)

3 WHAT YOU WON’T SEE Applications (though they are useful) Photoshop/Gimp/Paint.NET Maya Web graphics Art Character animations Very complex Usually require 3 rd party software

4 WHY? Senior Graphics Engineer at Autodesk – 1/6/2012

5 WHY? C/C++ Game Programmer at Addmired – 1/5/2012

6 WHY? Graphics Engineer at LucasArts – 1/4/2012

7 EARLY GRAPHICS Das Blinkenlights Dot matrix printers Shortly after printers came the CRT… http://james.seng.sg/files/public/starwar-ascii-art.jpg

8 EARLY GRAPHICS The CRT was able to draw more than ASCII characters. It could draw dots! http://www.gamasutra.com/view/feature/3900/the_history_of_pong_avoid_missing_.php

9 EARLY GRAPHICS If you can draw a dot, you can draw a line! Bresenham’s Line Drawing algorithm http://i18.photobucket.com/albums/b106/mspeir/Grid.jpg http://kobi.nat.uni-magdeburg.de/patrick/uploads/BEng/bresenham_line.png

10 THINGS TO NOTE… Everything at this time was 2D Looked really bad, but was playable! was in real time How did the “animation” work?

11 INTO THE 3 RD DIMENSION Add depth dimension How do you perceive depth everyday? You have two eyes The image for your left eye is different than the right Brain extracts the differences to understand depth 3DTVs – how do they work? http://static3.businessinsider.com/image/4b45f3b20000000000533ed7/3d-tv.jpg

12 BUT WAIT! Monitors are one “flat image on a flat surface” How do we perceive depth now? Farther objects are smaller (foreshortening) Subtle lighting changes We’ll use mathematics to do this for us http://www.oceansbridge.com/paintings/artists/c/canaletto/oil- big/perspective_1765_XX_venice.jpg

13 COMMON TERMINOLOGY Rendering: the entire process of drawing an image to the screen Vertex: a single 3D point (x, y, z) Edge: a line between two vertices Face: Most often 3 vertices and their edges Transformations: moving one or more vertices Translate: pushing vertices along the x, y or z axis Rotate: revolving vertices around some 3D point Scale: increasing or decreasing the distance of vertices from their center Model matrix – a mathematical structure for holding transformations (later) View matrix – another used for holding the viewpoint (camera) Projection matrix – another, used to get images on the screen (later) Rasterization – putting the actual pixels on the screen (final phase of rendering)

14 TRANSFORMATIONS Translate Rotate Scale

15 TERMINOLOGY (IMAGE FROM THE OPENGL SUPERBIBLE) Wireframe – rendering only the edges of the model (old games)

16 Hidden Surface Removal (HSR) – occluded objects can’t be seen Backface culling - drawing only the triangles that are facing the camera TERMINOLOGY (IMAGE FROM THE OPENGL SUPERBIBLE)

17 Solid shading (this isn’t a definition) – note that everything’s hard-coded red! TERMINOLOGY (IMAGE FROM THE OPENGL SUPERBIBLE)

18 Flat Shading – simulate lighting TERMINOLOGY (IMAGE FROM THE OPENGL SUPERBIBLE)

19 Texture mapping – using an image during the rasterization process TERMINOLOGY (IMAGE FROM THE OPENGL SUPERBIBLE)

20 Blending – mixing colors by rendering more than one thing in one spot The floor is rendered semi-transparent (yes, there are two cubes) TERMINOLOGY (IMAGE FROM THE OPENGL SUPERBIBLE)

21 WHAT ABOUT THIS? (NON-REAL-TIME)

22 COORDINATE SYSTEMS We have several spaces: Local/Object – the coordinate system the mesh was modeled in World – the coordinate system of the virtual environment View/Camera – the coordinate system relative to the camera Clip – windowing system We use mathematics to transform vertices from one space to another

23 COORDINATE SYSTEMS (FOR WINDOWING SYSTEMS) Because your screen is flat, we must work with 2D Cartesian Coordinates x = horizontal, y = vertical (0, 0) is origin +x -x +y -y

24 COORDINATE CLIPPING When creating a window, we must define where we are in the Cartesian system The window header doesn’t count in this equation Middle of screen is (0, 0) +100 -100 +75 -75

25 ANOTHER EXAMPLE +200 0 +150 0 Middle of screen is (75, 100)

26 SETTING A WINDOW’S VIEWPORT Window size usually doesn’t match clipping size The viewport maps the clipping area to part (or all) of the window Most often, the viewport fills the entire window Sometimes, you want a “Picture in Picture” (PIP) rendering

27 EXAMPLE – ENTIRE WINDOW 0 (150, 200) 0 1900x1200 Window

28 PIP EXAMPLE 0 (150, 200) 0 1900x1200 Window

29 3D COORDINATE SYSTEMS We live (and think) in 3 dimensions x = horizontal, y = vertical, z = depth (can be RHS or LHS) (0, 0, 0) is origin +x -x +y -y +z -z http://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/s2010/ky237_zy49/ky237_zy49/index.html

30 BASIC PROBLEM We need to convert our 3D models and display them on a 2D screen To do this, we use projections by defining a viewing volume These “flatten” the 3D world There are two kinds: Orthographic (aka “parallel”) All objects that have the same dimension are the same size, regardless of distance Viewing volume is rectangular Perspective Objects shrink with distance Viewing volume is shaped like a pyramid

31 EXAMPLE (UPPER-RIGHT IS A PERSPECTIVE VIEW)

32 ORTHOGRAPHIC VIEW VOLUME (YOU CAN SEE THE PARALLEL NOW…) Near clipping plane Far clipping plane

33 PERSPECTIVE VIEW VOLUME Near clipping plane Far clipping plane

34


Download ppt "CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t."

Similar presentations


Ads by Google