Download presentation
Presentation is loading. Please wait.
Published byKory Liliana Haynes Modified over 9 years ago
1
Graphics OpenGL OpenGL Introduction 컴퓨터 그래픽스 김 창 헌
2
OpenGL 2 Graphics Contents oWhat is OpenGL ? oOpenGL 의 역사 oOpenGL 의 특징 oOpenGL 의 구성 oOpenGL Command Syntax oSimple Example oOpenGL-related Libraries
3
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
4
OpenGL 4 Graphics OpenGL 의 역사 IRIS GL 에서 시작 SGI 의 워크스테이션 IRIS 에서 구현된 그래픽 라이 브러리인 IRIS GL 에서 시작 이식성을 위해 기계에 종속적인 부분을 제거 OpenGL 1.0 속도를 위해 IRIS GL 의 기능을 일부 축소하여 1992 년 7 월 OpenGL 1.0 을 발표 개방형 + 그래픽라이브러리
5
OpenGL 5 Graphics OpenGL 1.1 OpenGL ARB(Architecture Review Board) SGI, DEC, IBM, 인텔, 마이크로소프트 3D 그래픽 라이브러리의 표준으로 OpenGL 1.1 (1995 년 12 월 ) 텍스처 매핑을 개선 RGBA 모드에서 논리연산 가능 윈도우용 오픈 GL
6
OpenGL 6 Graphics OpenGL 의 구성 OpenGL(Gl) 오픈 GL 의 핵심 오픈 GL 을 제어하는 기본적인 함수들의 집합체 오픈 GL 의 렌더링과 관련된 기능들을 제공 OpenGL Utility (Glu) OpenGL Auxiliary (Glaux)
7
OpenGL 7 Graphics Utility(Glu) GL 사용 시 발생하는 많은 반복작업 간소화 ( 예 ) 구, 실린더, 디스크 등의 Object 생성 GLUquadricObj 꼭지점을 일일이 계산하여 각 점을 glVertex 함수로 하나하 나 찍어야 함. GLUquadricObj *pObj; pObj = gluNewQuadric(); gluSphere(pObj, 30.0, 10, 10); gluDeleteQuadric(pObj); // 객체를 삭제
8
OpenGL 8 Graphics AUX Library Aux(Glaux) 오픈 GL 과 wgl 함수를 이용해 선을 하나 렌더링하는 프로그램 : 많은 양의 코드 필요 플랫폼에 독립적인 윈도우 제어기능 Glu 를 능가하는 물체 생성기능을 가지는 툴킷 라이 브러리 오픈 GL 프로그램을 처음 작성하는 사람 윈도생성, 입력제어, 3 차원 물체 생성, 더블버퍼링, 텍스처 매핑용 이미지의 로딩
9
OpenGL 9 Graphics OpenGL Command Syntax glColor3f Gl library Root Command Number of Arguments Type of Arguments
10
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
11
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
12
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(); }
13
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 등
14
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)
15
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.