Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computer Graphics

Similar presentations


Presentation on theme: "Introduction to Computer Graphics"— Presentation transcript:

1 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 3rd party software

4 WhY? Senior Graphics Engineer at Autodesk

5 Why? C/C++ Game Programmer at Addmired

6 Why? Graphics Engineer at LucasArts

7 Early Graphics Das Blinkenlights Dot matrix printers
Shortly after printers came the CRT…

8 Early Graphics The CRT was able to draw more than ASCII characters. It could draw dots!

9 Early Graphics If you can draw a dot, you can draw a line!
Bresenham’s Line Drawing algorithm

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 3rd 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? Passive and active

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

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 Terminology (IMAGE From the OpenGL SuperBible)
Hidden Surface Removal (HSR) – occluded objects can’t be seen Backface culling - drawing only the triangles that are facing the camera

17 Terminology (IMAGE From the OpenGL SuperBible)
Solid shading (this isn’t a definition) – note that everything’s hard-coded red!

18 Terminology (IMAGE From the OpenGL SuperBible)
Flat Shading – simulate lighting

19 Terminology (IMAGE From the OpenGL SuperBible)
Texture mapping – using an image during the rasterization process

20 Terminology (IMAGE From the OpenGL SuperBible)
Blending – mixing colors by rendering more than one thing in one spot The floor is rendered semi-transparent (yes, there are two cubes)

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 +y -x +x -y

24 Coordinate CLipping +75 -100 +100 -75
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) +75 -100 +100 -75

25 Another Example Middle of screen is (75, 100) +150 +200

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
(150, 200) 1900x1200 Window

28 PIP Example (150, 200) 1900x1200 Window

29 3D Coordinate Systems +y -z -x +x +z -y
We live (and think) in 3 dimensions x = horizontal, y = vertical, z = depth (can be RHS or LHS) (0, 0, 0) is origin +y -z -x +x +z -y

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…)
Far clipping plane Near clipping plane

33 Perspective View Volume
Far clipping plane Near clipping plane

34


Download ppt "Introduction to Computer Graphics"

Similar presentations


Ads by Google