3D Graphics and OpenGl. First Steps

Similar documents
Rasterization Overview

Rendering Objects. Need to transform all geometry then

CS451Real-time Rendering Pipeline

Models and Architectures

OpenGL/GLUT Intro. Week 1, Fri Jan 12

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

OpenGL. Toolkits.

Pipeline Operations. CS 4620 Lecture 14

Graphics Hardware and OpenGL

Introduction to Computer Graphics with WebGL

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

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

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

The Graphics Pipeline

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3

CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

CSE4030 Introduction to Computer Graphics

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

CHAPTER 1 Graphics Systems and Models 3

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Precept 2 Aleksey Boyko February 18, 2011

Lectures OpenGL Introduction

Programming with OpenGL Part 2: Complete Programs Computer Graphics I, Fall

Graphics Hardware. Instructor Stephen J. Guy

CS4620/5620: Lecture 14 Pipeline

Meshing and Geometry

Scanline Rendering 2 1/42

Computer Graphics: Programming, Problem Solving, and Visual Communication

Rendering Pipeline/ OpenGL

Graphics Programming

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

2.11 Particle Systems

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Introduction to Shaders.

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Basic Graphics Programming

Graphics Pipeline & APIs

OpenGL Basics I. Seoul National University Graphics & Media Lab

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

Introduction to Computer Graphics with OpenGL/GLUT

Lecture 2. Shaders, GLSL and GPGPU

Pipeline Operations. CS 4620 Lecture 10

Today. Rendering - III. Outline. Texturing: The 10,000m View. Texture Coordinates. Specifying Texture Coordinates in GL

Comp 410/510 Computer Graphics Spring Programming with OpenGL Part 4: Three Dimensions

Teacher Assistant : Tamir Grossinger Reception hours: by - Building 37 / office -102 Assignments: 4 programing using

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

SCIENTIFIC VISUALIZATION ON GPU CLUSTERS PETER MESSMER, NVIDIA

OpenGL SUPERBIBLE. Fifth Edition. Comprehensive Tutorial and Reference. Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak

Lecture 2. Determinants. Ax = 0. a 11 x 1 + a 12 x a 1n x n = 0 a 21 x 1 + a 22 x a 2n x n = 0

Graphics Processing Unit Architecture (GPU Arch)

Spring 2009 Prof. Hyesoon Kim

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

Spring 2011 Prof. Hyesoon Kim

Graphics Pipeline & APIs

CS 4620 Program 3: Pipeline

Information Coding / Computer Graphics, ISY, LiTH. OpenGL! ! where it fits!! what it contains!! how you work with it 11(40)

Using OpenGL with CUDA

1.2 Basic Graphics Programming

Geometry Primitives. Computer Science Department University of Malta. Sandro Spina Computer Graphics and Simulation Group. CGSG Geometry Primitives

The Rendering Pipeline (1)

Computer graphic -- Programming with OpenGL I

RASTERISED RENDERING

Interaction. CSCI 480 Computer Graphics Lecture 3

Sign up for crits! Announcments

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

11/1/13. Basic Graphics Programming. Teaching Assistant. What is OpenGL. Course Producer. Where is OpenGL used. Graphics library (API)

Interaction Computer Graphics I Lecture 3

Computer Graphics I Lecture 11

Ciril Bohak. - INTRODUCTION TO WEBGL

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

CENG 477 Introduction to Computer Graphics. Graphics Hardware and OpenGL

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Exercise 1 Introduction to OpenGL

GL_COLOR_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW

Interaction. CSCI 420 Computer Graphics Lecture 3

Rendering Pipeline/ OpenGL

RECITATION - 1. Ceng477 Fall

Class of Algorithms. Visible Surface Determination. Back Face Culling Test. Back Face Culling: Object Space v. Back Face Culling: Object Space.

The Traditional Graphics Pipeline

Graphics and Interaction Rendering pipeline & object modelling

CS452/552; EE465/505. Clipping & Scan Conversion

GPU Programming EE Midterm Examination

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers

Basic Graphics Programming

Motivation. towards more realism. + Texture Mapping Texture Mapping

HE COMPLETE OPENGL PROGI FOR WINDOW WIND

lecture 18 - ray tracing - environment mapping - refraction

Computer Graphics and Visualization. Graphics Systems and Models

The Traditional Graphics Pipeline

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

+ = Texturing: Glue n-dimensional images onto geometrical objects. Texturing. Texture magnification. Texture coordinates. Bilinear interpolation

An Overview GLUT GLSL GLEW

Computer Graphics. This Week. Meshes. Meshes. What is a Polygon Mesh? Meshes. Modelling Shapes with Polygon Meshes.

1/12/11. Basic Graphics Programming. What is OpenGL. OpenGL is cross-platform. How does OpenGL work. How does OpenGL work (continued) The result

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Transcription:

3D Graphics and OpenGl First Steps

Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space.

Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space. We see surfaces of objects define surfaces.

Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space. We see surfaces of objects define surfaces. Triangles will be the fundamental element.

Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space. We see surfaces of objects define surfaces. Triangles will be the fundamental element.

Rendering of 3D Graphics Main objective: transfer (models built of) triangles from 3D space to 2D screen space. Add colors to the screen pixels covered by triangle (shading).

Rendering of 3D Graphics Main objective: transfer (models built of) triangles from 3D space to 2D screen space. Add colors to the screen pixels covered by triangle (shading). Coordinate systems:

Vertices Core data: vertices of triangles. glbegin(gl_triangles); glvertex3f(20.0, 20.0, 0.0); glvertex3f(80.0, 20.0, 0.0); glvertex3f(80.0, 80.0, 0.0);.. glend(); (Note: legacy code. For shader-based, use VBOs and VAOs.)

Other OpenGL Primitives (Note: last five only in legacy code.)

Geometry Core data: triangles

Geometry Core data: triangles Triangle vertices and associated data: Position Color Normal vector Texture coordinate

Geometry Core data: triangles Triangle vertices and associated data: Position Color Normal vector Texture coordinate Vertex data are interpolated across triangle at rendering time (details of interpolation and other parts of rendering later).

Geometry Core data: triangles Triangle vertices and associated data: Position Color Normal vector Texture coordinate Vertex data are interpolated across triangle at rendering time (details of interpolation and other parts of rendering later).

OpenGL has a state State machine: Long list of set variables affecting rendering. Value fixed after initialization until changed. (Alternative would be to give long list of parameters for all rendering calls).

OpenGL has a state State machine: Long list of set variables affecting rendering. Value fixed after initialization until changed. (Alternative would be to give long list of parameters for all rendering calls). E.g., setting (foreground/vertex) color using glcolor: glbegin(gl_quads); glcolor3f(1.0, 0.0, 0.0); glvertex3f(20.0, 20.0, 0.0); glcolor3f(0.0, 1.0, 0.0); glvertex3f(80.0, 20.0, 0.0); glcolor3f(0.0, 0.0, 1.0); glvertex3f(80.0, 80.0, 0.0); glcolor3f(1.0, 1.0, 0.0); glvertex3f(20.0, 80.0, 0.0); glend() (Note: legacy code.)

Projections Transfer (models built of triangles built of vertex) points from 3D space to 2D screen space.

Projections Transfer (models built of triangles built of vertex) points from 3D space to 2D screen space. Two types: Orthographic Perspective

Orthographic Projection

Orthographic Projection

Perspective Projection

Perspective Projection

Perspective Helix curve: Orthographic:

Perspective Helix curve: Orthographic: Projective:

Clipping before Projection The geometry is clipped against the viewing area planes before projection. Further clipping planes can be specified manually.

Clipping before Projection The geometry is clipped against the viewing area planes before projection. Further clipping planes can be specified manually.

Stretch after Projection The projected image is stretched to the screen/window size after projection.

OpenGL Buffers A buffer is a screensize 2D array of (pixel) data. Several buffers are available in OpenGL (collectively called the framebuffer).

OpenGL Buffers A buffer is a screensize 2D array of (pixel) data. Several buffers are available in OpenGL (collectively called the framebuffer). Two important buffer types: Color buffers. Hold the color values to be shown on screen. Depth buffer. Resolves hidden surface removal.

OpenGL Buffers A buffer is a screensize 2D array of (pixel) data. Several buffers are available in OpenGL (collectively called the framebuffer). Two important buffer types: Color buffers. Hold the color values to be shown on screen. Depth buffer. Resolves hidden surface removal.

(Free)GLUT Library that abstracts away OS-specific interface/libraries between OpenGL and OS (incl. creation of framebuffer and double buffering swaps).

(Free)GLUT Library that abstracts away OS-specific interface/libraries between OpenGL and OS (incl. creation of framebuffer and double buffering swaps). Handles keyboard/mouse input, windowing management.

(Free)GLUT Library that abstracts away OS-specific interface/libraries between OpenGL and OS (incl. creation of framebuffer and double buffering swaps). Handles keyboard/mouse input, windowing management. Event loop.

(Free)GLUT Library that abstracts away OS-specific interface/libraries between OpenGL and OS (incl. creation of framebuffer and double buffering swaps). Handles keyboard/mouse input, windowing management. Event loop. OpenGL programmer associates callback functions with events.

(Free)GLUT Library that abstracts away OS-specific interface/libraries between OpenGL and OS (incl. creation of framebuffer and double buffering swaps). Handles keyboard/mouse input, windowing management. Event loop. OpenGL programmer associates callback functions with events. Animation through timed callbacks (gluttimerfunc()) or idle time callback (glutidlefunc()).

(Free)GLUT Library that abstracts away OS-specific interface/libraries between OpenGL and OS (incl. creation of framebuffer and double buffering swaps). Handles keyboard/mouse input, windowing management. Event loop. OpenGL programmer associates callback functions with events. Animation through timed callbacks (gluttimerfunc()) or idle time callback (glutidlefunc()). Commands for triangles for basic models (cube, cone, sphere, torus, teapot,... ). GLU is a lower level utility library (may also appear as command name prefix).