C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.

Slides:



Advertisements
Similar presentations
COMPUTERS: TOOLS FOR AN INFORMATION AGE Chapter 3 Operating Systems.
Advertisements

Code Composer Department of Electrical and Computer Engineering
Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
1 CSCI N305 C Language Programming Welcome to CSCI N305! Compiling Your First Program Using Microsoft Visual Studio 2008.
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2010/2011.
Lab 1: OpenGL Tutorial CS 282. What’s the plan for today? Go over our framework code. Learn some basic OpenGL! Reveal Lab 1 Answer questions.
UNIX Chapter 01 Overview of Operating Systems Mr. Mohammad A. Smirat.
Course Introduction and Getting Started with C 1 USF - COP C for Engineers Summer 2008.
Introduction to OpenGL Keng Shih-Ling 2003 Spring.
An ide for teaching and learning prolog
CSE328:Computer Graphics OpenGL Tutorial Dongli Zhang Department of Computer Science, SBU Department of Computer Science, Stony.
Section 6.1 Explain the development of operating systems Differentiate between operating systems Section 6.2 Demonstrate knowledge of basic GUI components.
Lesson 4 Computer Software
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Introduction to VB.NET Tonga Institute of Higher Education.
COMP1070/2002/lec3/H.Melikian COMP1070 Lecture #3 v Operating Systems v Describe briefly operating systems service v To describe character and graphical.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Standard Grade Computing System Software & Operating Systems.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
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
OpenGl Graphics Programming. Introduction OpenGL is a low-level graphics library specification. It makes available to the programmer a small set of geomteric.
Install and Setup VC++ and OpenGL Introduction to Computer Graphics and Animation (Principle of Computer Graphics) Rattapoom Waranusast.
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.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
ZONG Wen Department of Computer Science and Engineering The Chinese University of Hong Kong
CD2012 Principles of Interactive Graphics Lecture 01 Introduction Abir Hussain (Rome: 6.33,Tel , Web:
Active-HDL Interfaces Debugging C Code Course 10.
Introduction to OpenGL Programming Jian-Liang Lin 2002.
Using Xcode A Beginner’s Tutorial Erin Green. This tutorial will walk you through Xcode, a software development tool for Apple’s iOS applications – We.
Hidden Markov Toolkit (HTK) Installation Fang-Hui Chu Department of Computer Science & Information Engineering National Taiwan Normal University.
9/2/ CS171 -Math & Computer Science Department at Emory University.
GumTree Development Environment Setup Windows Only Compatible with Eclipse 3.2 M3 (Last update: 16/11/05)
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.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Software refer to all the programs that can be run on the computer.
Intro to CS ACO 101 Lab Rat. Academic Integrity What does that mean in programming? Log into Blackboard and take the test titled “Applied Computing Course.
CS 470 Computer Graphic Getting Started with OpenGL.
NoufNaief.net TA: Nouf Al-harbi.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
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.
© I-Logix Rhapsody C++ V /01/2004E1-1 “Essential” Tool Training Basic Rhapsody Basic Rhapsody Rhapsody in C++ V /01/04.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Open project in Microsoft Visual Studio → build program in “Release” mode.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
OPERATING SYSTEMS (OS) By the end of this lesson you will be able to explain: 1. What an OS is 2. The relationship between the OS & application programs.
Author: Loh Jianxiong Christopher Contributions: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang, Tong Chun Kit, Tania Chattopadhyay.
Unit 20 – Computer Game Platforms & Technology – Software Technology
Development Environment
Obtaining the Required Tools
OpenGL project setup.
CMPE 152: Compiler Design ANTLR 4 and C++
How to Run a Java Program
Unit 20 Software Part 2.
1. Open Visual Studio 2008.
Introduction to OpenGL
Unit 20 Software Part 2.
Download and Installation of code::blocks
Computer Graphics Practical Lesson 1-
Hidden Markov Toolkit (HTK) Installation
Review of Previous Lesson
Presentation transcript:

C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto

C O M P U T E R G R A P H I C S Jie chen 2 About me Who: Jie Chen What: Teaching assistant, Lab exercises How: TS329

C O M P U T E R G R A P H I C S Jie chen 3 Website: Prerequisite programming skills using C/C++

C O M P U T E R G R A P H I C S Jie chen 4 Tools: OpenGL Task: what OpenGL is and how it enables us to program in 3D. GL: graphic library

C O M P U T E R G R A P H I C S Jie chen 5 What is OpenGL? It's a way to draw stuff in 3D. –It can also be used for 2D drawing, but this course doesn't focus on that. There are better tools for straight 2D drawing, such as SDL and Allegro. The purpose of OpenGL is to communicate with the graphics card about our 3D scene. –The graphics card is where the 3D computation happens. –So why not talk to the graphics card directly? Each graphics card is a little different. In a sense, they all speak different "languages". To talk to them all, we can either learn all of their languages, or find a "translator" that knows all of their languages and talk to the translator, so that we only have to know one language. OpenGL serves as a "translator" for graphics cards.

C O M P U T E R G R A P H I C S Jie chen 6 Some Terminologies OpenGL –GL: graphic library –a software interface to graphics hardware. –This interface consists of about 150 distinct commands.

C O M P U T E R G R A P H I C S Jie chen 7 Some Terminologies GLU (OpenGL Utility Library) –GLU is a standard part of every OpenGL implementation. –A sophisticated library that provides the features could be built on top of OpenGL. –Provides many of the modeling features, such as quadric surfaces and NURBS (Non-Uniform Rational B-Spline) curves and surfaces.

C O M P U T E R G R A P H I C S Jie chen 8 Some Terminologies GLUT (OpenGL Utility Toolkit) –a window system independent toolkit for writing OpenGL programs. –It implements a simple windowing application programming interface (API) for OpenGL. –GLUT makes it much easier to learn about and explore OpenGL Programming. –Controlling the IO layer input: mouse and keyboard output: visual windows

C O M P U T E R G R A P H I C S Jie chen 9 Include Files For all OpenGL applications, we need to include the gl.h header file in every file. Almost all OpenGL applications use GLU, which requires inclusion of the glu.h header file. So almost every OpenGL source file begins with –#include If we are using GLUT for managing our window manager tasks, we should include –#include Note that glut.h includes gl.h and glu.h automatically

C O M P U T E R G R A P H I C S Jie chen 10 Getting OpenGL Set Up In following part, we will show how to get OpenGL and GLUT set up on Windows, so that we can get started making 3D programs. we can use OpenGL on other operating systems, but this part doesn't cover how to get it set up on those OSes. –Mac OS X tup_mac_osx/home.php tup_mac_osx/home.php –Linux _opengl_setup_linux/home.php _opengl_setup_linux/home.php

C O M P U T E R G R A P H I C S Jie chen 11 Getting OpenGL Set Up on Windows Explain how to get OpenGL and GLUT set up on Windows (e.g., windows XP). Use the Visual C You can also use other version, such as Visual C , 2005, –CSE: Computer science and engineering laboratory You can find it in our server: \\Samba.ee\i-awims\Microsoft –Other department: you can downloade here: You have to register, which is free, within 30 days.

C O M P U T E R G R A P H I C S Jie chen 12 OpenGL Download –OpenGL installer –GLUT binary Lecture notes ->Lecture 3

C O M P U T E R G R A P H I C S Jie chen 13 OpenGL setup Run the OpenGL installer.

C O M P U T E R G R A P H I C S Jie chen 14 GLUT setup Extract GLUT to the directory of your choice. We can do this by creating a new directory, locating and opening the ZIP file using Windows Explorer, and copying the files to the new directory using copy-paste. Alternatively, We can use a free program like WinZip to extract GLUT.WinZip

C O M P U T E R G R A P H I C S Jie chen 15 GLUT setup In the directory GLUT, make two folders –one called "include" and –one called "lib". File assignment: –In the "include" folder, create another folder called "GL", and move glut.h to that folder (..\Include\GL). –Move all of the other extracted files for GLUT into the "lib" folder.

C O M P U T E R G R A P H I C S Jie chen 16 Setup for Visual C++ glut32.dll (dll: Dynamic-link library)

C O M P U T E R G R A P H I C S Jie chen 17 Setup for Visual C++ Run Visual C++ Go to Tools -> Options-> Directories Adding " GLUT \include", and " GLUT \lib"

C O M P U T E R G R A P H I C S Jie chen 18 Compiling and Running the Test Program To make sure that everything was set up correctly, we're going to see if we can get a test program to work. Download test program and extract it somewhere on your computer. – –Lecture notes ->Lecture 3 ->Cube

C O M P U T E R G R A P H I C S Jie chen 19 Compiling and Running the Test Program Run Visual C++. Go to File -> New -> Project Select Win32 Console applications Set the project file location. Enter in a name for your project (such as “CG") and click ok.

C O M P U T E R G R A P H I C S Jie chen 20 Compiling and Running the Test Program Select “a ‘hello world’ applications” click “Finish” to finish creating the project.

C O M P U T E R G R A P H I C S Jie chen 21 Compiling and Running the Test Program File copy –extracted the downloaded test program – Copy the following files to the current folder

C O M P U T E R G R A P H I C S Jie chen 22 Compiling and Running the Test Program File content modification –Copy the code in main.cpp to replace those in CG.cpp –Add #include "stdafx.h" at the beginning of CG.cpp

C O M P U T E R G R A P H I C S Jie chen 23 Compiling and Running the Test Program Change from "Debug" to "Release".

C O M P U T E R G R A P H I C S Jie chen 24 Compiling and Running the Test Program File adding –Two files: imageloader.h and imageloader.cpp –Press ok

C O M P U T E R G R A P H I C S Jie chen 25 Compiling and Running the Test Program File adding –Lib file: glut32.lib –Press ok

C O M P U T E R G R A P H I C S Jie chen 26 Compiling and Running the Test Program Workspace view

C O M P U T E R G R A P H I C S Jie chen 27 Compiling and Running the Test Program Go to Build -> Build project_name (e.g., Build CG.cpp) to build our project.

C O M P U T E R G R A P H I C S Jie chen 28 Compiling and Running the Test Program Run it!

C O M P U T E R G R A P H I C S Jie chen 29 Compiling and Running the Test Program Take a look at CG.cpp. –Notice that the include directives for OpenGL appear after the #include directives for the normal C++ include files. –If we had them in the opposite order, you'd get a compiler error. So make sure that the include files for the standard C++ stuff appear before the include files for OpenGL. ERROR Correct

C O M P U T E R G R A P H I C S Jie chen 30 Compiling and Running the Test Program Whew! We've finished setting up OpenGL. Now we're ready to learn how to program in 3D.

C O M P U T E R G R A P H I C S Jie chen 31 Demo

C O M P U T E R G R A P H I C S Jie chen 32 OpenGL Programming Guide or ‘The Red Book’ –

C O M P U T E R G R A P H I C S Jie chen 33 The end of this lecture!