Graphics OpenGL OpenGL Introduction 컴퓨터 그래픽스 김 창 헌.

Slides:



Advertisements
Similar presentations
Programming with OpenGL - Getting started - Hanyang University Han Jae-Hyek.
Advertisements

Computer Graphics - Graphics Programming -
OpenGL CMSC340 3D Character Design & Animation. What is OpenGL? A low-level graphics library specification designed for use with the C and C++ provides…
Chapter 2: Graphics Programming
Computer Graphics CSCE 441
Pemrograman OpenGL Dasar
© 2004, Tom Duff and George Ledin Jr1 Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma.
CS 4731 Lecture 2: Intro to 2D, 3D, OpenGL and GLUT (Part I) Emmanuel Agu.
What is OpenGL? Low level 2D and 3D Graphics Library Competitor to Direct3D (the rendering part of DirectX) Used in: CAD, virtual reality, scientific.
OpenGL (Graphics Library) Software Interface to graphics software Allows to create interactive programs that produce color images of moving 3D objects.
Draw a Simple Object. Example 1/4 #include “ glut.h ” void display(); void reshape(GLsizei w, GLsizei h); void main(int argc, char** argv){ glutInit(&argc,
OpenGL (I). What is OpenGL (OGL)? OGL is a 3D graphics & modeling library Can also use it to draw 2D objects.
CSC 461: Lecture 51 CSC461 Lecture 5: Simple OpenGL Program Objectives: Discuss a simple program Discuss a simple program Introduce the OpenGL program.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Computer Science,
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
30/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 1: Introduction.
ITEPC 06 - Workshop on Fractal Creation Chiew-Lan Tai and Oscar Au.
Programming with OpenGL Part 1: Background Mohan Sridharan Based on slides created by Edward Angel CS4395: Computer Graphics 1.
Using Graphics Libraries Lecture 3 Mon, Sep 1, 2003.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP4730: Computational Structures in Computer Graphics Introduction to OpenGL.
Using OpenGL. 2 What is OpenGL? A software interface to graphics hardware It is a Graphics Rendering API (Application Programmer’s Interface) that is.
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
Graphics Architectures & OpenGL API Introduction Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Programming with OpenGL Part 1: Background
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
1. OpenGL/GLU/GLUT  OpenGL v4.0 (latest) is the “core” library that is platform independent  GLUT v3.7 is an auxiliary library that handles window creation,
1 Figures are extracted from Angel's book (ISBN x) The Human Visual System vs The Pinhole camera Human Visual System Visible Spectrum Pinhole.
CD2012 Principles of Interactive Graphics Lecture 01 Introduction Abir Hussain (Rome: 6.33,Tel , Web:
Introduction to GL Geb Thomas. Example Code int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
Introduction to OpenGL Programming Jian-Liang Lin 2002.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Programming with OpenGL Review.
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 43 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 43 Computer Graphics Programming with OpenGL I.
Draw a Simple Object. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture blending.
CA 302 Computer Graphics and Visual Programming Lecture 2: Introduction to OpenGL Aydın Öztürk
Programming With OpenGL
Chun-Yuan Lin Introduction to OpenGL 2015/12/19 1 CG.
NoufNaief.net TA: Nouf Al-harbi.
Graphics: Conceptual Model
Lecture 2: Introduction to OpenGL
Introduction to OpenGL Programming
OpenGL Basic Drawing 2003 Spring Keng Shih-Ling
Lecture 2 Review OpenGL Libraries Graphics Overview Rendering Pipeline OpenGL command structure.
Chap 2 Write a Simple OpenGL Program. Preparing 1/2 environment : Microsoft Visual C 、 Microsoft Visual C++.Net Also need : GLUT
1 Programming with OpenGL Part 2: Complete Programs.
OpenGL API 2D Graphic Primitives Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
OpenGL Basic Drawing Jian-Liang Lin A Smidgen of OpenGL Code #include main() { InitializeAWindowPlease(); glClearColor (0.0, 0.0, 0.0, 0.0); glClear.
Introduction to OpenGL Muhammad Aamir Khan Lecturer, DCS, UOP.
Introduction to Graphics Programming. Graphics API.
Graphics Graphics Korea University kucg.korea.ac.kr Graphics Programming 고려대학교 컴퓨터 그래픽스 연구실.
Introduction to Graphics Programming. Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera.
Computer Graphics I, Fall Programming with OpenGL Part 2: Complete Programs.
OpenGL CS418 Computer Graphics John C. Hart. OpenGL: Event-driven How in OpenGL? Programmer registers callback functions Callback function called when.
OpenGL: The Open Graphics Language Technology and Historical Overview By Ricardo Veguilla.
INTRODUCTION TO OPENGL
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Computer Graphics -practical- Lecture 6. (visual c++) open gl library To use open GL with VC++ we add these files:- 1)Glut.h C:\program files\ Microsoft.
The Human Visual System vs The Pinhole camera
Programming with OpenGL Part 1: Background
Programming with OpenGL Part 2: Complete Programs
OpenGL API 2D Graphic Primitives
OpenGL (Open Graphics Library) Mr. B.A.Swamy Assistant Professor Dept of CSE.
גרפיקה ממוחשבת: מבוא ל-OpenGL
Rendering Pipeline, OpenGL/GLUT
Programming with OpenGL Part 1: Background
Introduction to OpenGL
Programming with OpenGL Part 2: Complete Programs
Programming with OpenGL Part 1: Background
Presentation transcript:

Graphics OpenGL OpenGL Introduction 컴퓨터 그래픽스 김 창 헌

OpenGL 2 Graphics Contents oWhat is OpenGL ? oOpenGL 의 역사 oOpenGL 의 특징 oOpenGL 의 구성 oOpenGL Command Syntax oSimple Example oOpenGL-related Libraries

OpenGL 3 Graphics What is OpenGL?  A low- level graphics rendering and imaging library  Only includes operations which can be accelerated  A layer of abstraction between graphics hardware and an application program  Window system and OS Independent  use with Unix, Microsoft Windows, IBM OS/ 2, Apple Mac Os

OpenGL 4 Graphics OpenGL 의 역사  IRIS GL 에서 시작  SGI 의 워크스테이션 IRIS 에서 구현된 그래픽 라이 브러리인 IRIS GL 에서 시작  이식성을 위해 기계에 종속적인 부분을 제거  OpenGL 1.0  속도를 위해 IRIS GL 의 기능을 일부 축소하여 1992 년 7 월 OpenGL 1.0 을 발표  개방형 + 그래픽라이브러리

OpenGL 5 Graphics OpenGL 1.1  OpenGL ARB(Architecture Review Board)  SGI, DEC, IBM, 인텔, 마이크로소프트  3D 그래픽 라이브러리의 표준으로  OpenGL 1.1 (1995 년 12 월 )  텍스처 매핑을 개선  RGBA 모드에서 논리연산 가능  윈도우용 오픈 GL

OpenGL 6 Graphics OpenGL 의 구성  OpenGL(Gl)  오픈 GL 의 핵심  오픈 GL 을 제어하는 기본적인 함수들의 집합체  오픈 GL 의 렌더링과 관련된 기능들을 제공  OpenGL Utility (Glu)  OpenGL Auxiliary (Glaux)

OpenGL 7 Graphics Utility(Glu)  GL 사용 시 발생하는 많은 반복작업 간소화  ( 예 ) 구, 실린더, 디스크 등의 Object 생성  GLUquadricObj  꼭지점을 일일이 계산하여 각 점을 glVertex 함수로 하나하 나 찍어야 함. GLUquadricObj *pObj; pObj = gluNewQuadric(); gluSphere(pObj, 30.0, 10, 10); gluDeleteQuadric(pObj); // 객체를 삭제

OpenGL 8 Graphics AUX Library  Aux(Glaux)  오픈 GL 과 wgl 함수를 이용해 선을 하나 렌더링하는 프로그램 : 많은 양의 코드 필요  플랫폼에 독립적인 윈도우 제어기능  Glu 를 능가하는 물체 생성기능을 가지는 툴킷 라이 브러리  오픈 GL 프로그램을 처음 작성하는 사람  윈도생성, 입력제어, 3 차원 물체 생성, 더블버퍼링, 텍스처 매핑용 이미지의 로딩

OpenGL 9 Graphics OpenGL Command Syntax glColor3f Gl library Root Command Number of Arguments Type of Arguments

OpenGL 10 Graphics  main: find GL visual & create window initialize GL states (e. g., viewing, color, lighting) initialize display lists check for events (and process them) if window event (window moved, exposed, etc.) — modify viewport, if needed — redraw else if mouse or keyboard — do something, e. g., change states & redraw Structure of a Typical Program

OpenGL 11 Graphics 계속  redraw: clear screen (to background color) change state( s), if needed render some graphics change more states render some more graphics.... swap buffers

OpenGL 12 Graphics A Very Simple OpenGL Program #include int main(int argc, char ** argv) { auxInitDisplayMode( AUX_SINGLE | AUX_RGBA ); auxInitPosition(0, 0, 500, 500 ); auxInitWindow ( "My first OpenGL Program" ); glClearColor ( 0.0, 0.0, 0.0, 0.0 ); glClear(GL_COLOR_BUFFER_BIT); // set clear color glColor3f(1.0, 1.0, 1.0); // clear command glMatrixMode(GL_PROJECTION); glLoadIdentity(); // proceed with drawing before waiting for any more command glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); }

OpenGL 13 Graphics OpenGL as a State Machine  다양한 state(mode) 삽입  사용자가 바꾸기 전까지 유지  ( 예 ) current color (state variable)  color 를 바꾸면, 그 이후의 모든 object 는 바뀐 color 로 색칠됨.  Current color 를 다른 색으로 바꿀 때까지 계속 유지됨.  other state variables  current viewing and projection transformation, polygon drawing modes, positions and characteristics of light 등

OpenGL 14 Graphics State  glEnable (GLenum capability)  glDisable (GLenum capability)  GLboolean glIsEnabled (GLenum cap)  turn on and off OpenGL states  capability can be one of :  GL_ BLEND (alpha blending)  GL_ DEPTH_ TEST (depth buffer)  GL_ FOG  GL_ LIGHTING  GL_ LINE_ SMOOTH (line antialiasing)

OpenGL 15 Graphics OpenGL- related Libraries  GLX  OpenGL Extension to the X Window System  GLUT  windowing utility library for OpenGL  handle keyboard, mouse, and redraw events  Open Inventor  object-oriented developers toolkit