Introduction to OpenGL Keng Shih-Ling 2003 Spring.

Slides:



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

Chapter 2: Graphics Programming
Computer Graphics CSCE 441
Chapter 2 Using OpenGL Chih-Kuo Yeh.  Addison Wesley OpenGL SuperBible 4 th Edition Jun 2007 Author: Richard S. Wright, Jr. Benjamin Lipchak Nicholas.
What is OpenGL? Low level 2D and 3D Graphics Library Competitor to Direct3D (the rendering part of DirectX) Used in: CAD, virtual reality, scientific.
專案設計步驟圖示 輸入 下拉 下一個 5 設定輸入變數 Inc_Exp 6.
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
OpenGL and Projections
3D Graphics - Current Technologies Open GLOpen GL (Open Graphics Language) –SGI Silicon Graphics Direct 3DDirect 3D –Microsoft Direct X Technology Java3DJava3D.
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.
Lab : OpenMP Programming Parallel Programming (CS5423) Instructor : 鍾葉青 Author : 吳宇宸.
Programming with OpenGL Part 1: Background Mohan Sridharan Based on slides created by Edward Angel CS4395: Computer Graphics 1.
Write a Simple Program with OpenGL & GLUT. Books and Web Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible.
Reference1. [OpenGL course slides by Rasmus Stenholt]
CS380 LAB I OpenGL Donghyuk Kim Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Using Graphics Libraries Lecture 3 Mon, Sep 1, 2003.
Computer Graphics Bing-Yu Chen National Taiwan University.
Programming in OpenGL Ryan Holmes CSE 570 February 12 th, 2003.
CAP4730: Computational Structures in Computer Graphics Introduction to OpenGL.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
Using OpenGL in Visual C++ Opengl32.dll and glu32.dll should be in the system folder Opengl32.dll and glu32.dll should be in the system folder Opengl32.lib.
CSC 461: Lecture 41 CSC461: Lecture 4 Introduction to OpenGL Objectives: Development of the OpenGL API OpenGL Architecture -- OpenGL as a state machine.
Graphics Programming using OpenGL. OpenGL is a software interface that allows the programmer to create 2D and 3D graphics images. This interface consists.
2001 by Jim X. Chen: Professor Jim X. Chen Department of Computer Science George Mason University Fairfax, VA
Computer Graphics Tz-Huan Huang National Taiwan University.
OpenGl Graphics Programming. Introduction OpenGL is a low-level graphics library specification. It makes available to the programmer a small set of geomteric.
Lecture 1: Introduction. Pick Your Version of GLUT OpenGL and the GLUT are available for Windows, Linux and many other Operating Systems and platforms.
Install and Setup VC++ and OpenGL Introduction to Computer Graphics and Animation (Principle of Computer Graphics) Rattapoom Waranusast.
Programming with OpenGL Part 1: Background
Write a Simple Program with OpenGL & GLUT. Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
CS 450: COMPUTER GRAPHICS INSTALLING GLUT AND GLEW SPRING 2015 DR. MICHAEL J. REALE.
 “OpenGL (Open Graphics Library) is a standard specification defining a cross- language cross-platform API for writing applications that produce 2D and.
Introduction to OpenGL 1. 2 OpenGL A Graphics rendering API introduced in 1992 by Silicon Graphics Inc Provide the low-level functions to access graphics.
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,
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.
CPSC 453 Tutorial Xin Liu Sep 23, OpenGL An open standard of rendering pipeline A software interface to graphics hardware A useful set of APIs for.
Introduction to Computer Graphics 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Draw a Simple Object. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture blending.
1 Chapter 2 Graphics Programming. 2 Using OpenGL in Visual C++ – 1/3 Opengl32.dll and glu32.dll should be in the system folder Opengl32.lib and glu32.lib.
Chun-Yuan Lin Introduction to OpenGL 2015/12/19 1 CG.
CS 470 Computer Graphic Getting Started with OpenGL.
NoufNaief.net TA: Nouf Al-harbi.
CGGM Lab. Tan-Chi Ho Introduction to OpenGL.
Computer Graphics Lab 1 OpenGL.
1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set.
CS 490 GRAPHICS COMPUTER Lecture 1: Introduction Computer Science Department 1.
Introduction to OpenGL & HW1 Announcement 劉軒銘, 網媒所 碩二 ICG 2012 Fall.
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
Introduction to OpenGL Muhammad Aamir Khan Lecturer, DCS, UOP.
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.
Computer Graphics Lecture 5. Graphics Library Graphics Library : There are many graphics library use with program language to draw shape. Example : Graphics.h.
Basic Program with OpenGL and GLUT
Khang Lam Daniel Limas Kevin Castillo Juan Battini
Introduction to OpenGL (IDE: Eclipse)
Programming with OpenGL Part 1: Background
CS380 Lab Spring Myungbae Son.
OpenGL project setup.
גרפיקה ממוחשבת: מבוא ל-OpenGL
Programming with OpenGL Part 1: Background
Introduction to OpenGL
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
Programming with OpenGL Part 1: Background
OpenGL Programming – Day 1
Presentation transcript:

Introduction to OpenGL Keng Shih-Ling 2003 Spring

Example OpenGL example

OpenGL is a Graphics API A software interface for graphics hardware. Provide the low-level functions to access graphics hardware directly. OpenGL / Direct3D OpenGL functions use the prefix gl.

OpenGL is a Graphics API Application GDI Display Device OpenGL Hardware Driver …

OpenGL library Microsoft’s implementation –From Win95 OSR2, Microsoft Windows ship with OpenGL32.DLL. –For old Win95 users, you still can download OPENGL95.EXE via Microsoft website. –Header files and import library files are already included in Win32 Platform SDK.

OpenGL library Microsoft’s OpenGL32.DLL applies a hardware accelerated driver registered in Registry. – HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers –You can search it by using REGEDIT.EXE

API Hierarchy

OpenGL Utility Library The OpenGL Utility Library(GLU) provides many of the modeling features, such as quadric surfaces and NURBS curves and surfaces. GLU is a standard part of every OpenGL implementation GLU routines use the prefix glu. – gluLookAt( … ); –…

Windows system related helper library For every window system, there is a library that extends the functionality of that window system to support OpenGL rendering. –X Window System -> GLX –Microsoft Windows -> WGL –IBM OS/2 -> PGL

OpenGL Utility Toolkit The OpenGL Utility Toolkit (GLUT) is a window system-independent toolkit, written by Mark Kilgard, to hide the complexities of differing window system APIs. GLUT routines use the prefix glut. – glutPostRedisplay(); –…

OpenGL Utility Toolkit You can download this toolkit in the following website –Win32 –Linux We focus on this toolkit

Basic Setup (GLUT) On Microsoft Visual C++ 6: –Put glut.h into /include/GL/ –Put glut.lib into /lib/ –Put glut32.dll into /System32/ On Microsoft Visual C++.NET: –Put glut.h into /platformSDK/include/GL/ –Put glut.lib into /platformSDK/lib/ –Put glut32.dll into /System32

How to Compile (VC6.0) On Microsoft Visual C++ 6: –Create a new Project with Win32 Console Application –Open Project Settings dialog and add opengl32.lib glu32.lib glut32.lib into Link/Objects/library modules. –Writing your OpenGL code. –Compile it.

How to Compile (.NET) On Microsoft Visual C++.NET: – 建立 Win32 專案 – 在應用程式設定,選擇主控台應用程式 – 開啟專案屬性,在連結器 / 輸入 / 其他相依性 中輸入 opengl32.lib glu32.lib glut32.lib 。 –Writing your OpenGL code. –Compile it.

How to Compile (.NET)

The Simplest Program #include void GL_display() { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0f, 1.0f, 1.0f); glutSolidCube(1.0); glFlush(); } void GL_reshape(GLsizei w, GLsizei h) { glViewport(0, 0, w, h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-2.0f, 2.0f, -2.0f, 2.0f, -2.0f, 2.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); }

The Simplest Program void main(void) { glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutCreateWindow("Sample"); glutDisplayFunc(GL_display); glutReshapeFunc(GL_reshape); glutMainLoop(); }

The Simplest Program

Reference Official site of OpenGL – Useful Sites –NeHe’s OpenGL TutorialsNeHe’s OpenGL Tutorials –The Developer’s GalleryThe Developer’s Gallery

Reference Further Reading –OpenGL Programming Guide (Red Book) –OpenGL Reference Manual (Blue Book) –OpenGL Super Bible ( 中文版 )

Any Question? ?