Window reshaping, Keyboard interaction, Camera, Drawing objects

Slides:



Advertisements
Similar presentations
OpenGL Open a Win32 Console Application in Microsoft Visual C++.
Advertisements

Chapter 2: Graphics Programming
Basics. OpenGL. “Hello world” George Georgiev Telerik Corporation
Introduction to OpenCV Dr. Chung-Hao Chen Haole Guo Sep 2011.
CS 4731 Lecture 2: Intro to 2D, 3D, OpenGL and GLUT (Part I) Emmanuel Agu.
© by Pearson Education, Inc. All Rights Reserved.
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.
TA: Zhicheng Yan Sushma S Kini Mary Pietrowicz
Using Visual C++ and Pelles C
Write a Simple Program with OpenGL & GLUT. Books and Web Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible.
Introduction to OpenGL Jian Huang This set of slides are extracted from the Interactive OpenGL Programming course given by Dave Shreine, Ed Angel and Vicki.
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.
Using C++ and OpenGL George Georgiev Telerik Corporation
OPEN GL - Bipindra Bir Shrestha. A GENDA Introduction to OpenGL Demo Programming in OpenGL Demo References.
1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Code::Blocks (Extract from Syllabus) Reference:
chap13 Chapter 13 Programming in the Large.
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.
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
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.
FLTK Tutorial.
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.
Lecture 3 OpenGL.
CS 450: COMPUTER GRAPHICS INSTALLING GLUT AND GLEW SPRING 2015 DR. MICHAEL J. REALE.
ZONG Wen Department of Computer Science and Engineering The Chinese University of Hong Kong
 “OpenGL (Open Graphics Library) is a standard specification defining a cross- language cross-platform API for writing applications that produce 2D and.
Programming with Visual C++ A short review of the process.
1 Chapter 12 GUI C/C++ Language Programming Wanxiang Che.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Interactive Computer Graphics CS 418 MP1: Dancing I TA: Zhicheng Yan Sushma S Kini Mary Pietrowicz Slides Taken from: “An Interactive Introduction to OpenGL.
Modeling with OpenGL Practice with OpenGL transformations.
Programming with Visual Studio.NET A short review of the process.
Information and Communication Technology Sayed Mahbub Hasan Amiri Dhaka Residential Model College Higher Secondary.
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
NoufNaief.net TA: Nouf Al-harbi.
Mouse events, Advanced camera control George Georgiev Telerik Corporation
Computer Graphics Lab 1 OpenGL.
Introduction to OpenGL & HW1 Announcement 劉軒銘, 網媒所 碩二 ICG 2012 Fall.
GLUT functions glutInit allows application to get command line arguments and initializes system gluInitDisplayMode requests properties for the window.
Cs423-cotter1 Windows Operating Environment. cs423-cotter2 Windows Operating Environment 32 bit operating environment – Windows XP Microsoft Visual Studio.net,.net2005,
Open project in Microsoft Visual Studio → build program in “Release” mode.
Visualization Recreate the ping pong scene in 3D using ball and racket coordinates.
TA: Ryan Freedman Sushma Kini Chi Zhou.  Due Date: March , 12:30 PM  We want a zip folder named cs418_mp1_{netid}.zip which contains  Source.
Introduction to 3-D Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 27, 2003.
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.
Computational Geometry
Development Environment Setup
ASP.NET AJAX – Basics Svetlin Nakov Telerik Corporation
CS380 Lab Spring Myungbae Son.
Computer Terms Review from what language did C++ originate?
OpenCV Tutorial Part I Using OpenCV with Microsoft Visual Studio .net November 2005 Gavin S Page
2D Graphics and Animations in Unity 3D
OpenGL project setup.
Computer Graphics Lecture 33
Introduction to Events
CMPE 152: Compiler Design ANTLR 4 and C++
Starting to draw dealing with Windows which libraries? clipping
גרפיקה ממוחשבת: מבוא ל-OpenGL
The Power of Calling a Method from Itself
1. Open Visual Studio 2008.
Double click Microsoft Visual Studio 2010 on the Computer Desktop
Programming with OpenGL Part 2: Complete Programs
Starting to draw dealing with Windows which libraries? clipping
Basic OpenGL programming, Geometric objects & User Interaction
Programming with OpenGL Part 2: Complete Programs
Computer Terms Review from what language did C++ originate?
Presentation transcript:

Window reshaping, Keyboard interaction, Camera, Drawing objects OpenGL & GLUT Basics Window reshaping, Keyboard interaction, Camera, Drawing objects George Georgiev Telerik Corporation www.telerik.com

Table of Contents Project using OpenGL & FreeGLUT in MSVC++ Window reshaping Keyboard Interaction Camera Positioning, orientation Drawing objects Coloring Basic Lighting

Project using OpenGL & FreeGLut A reminder…

OpenGL & FreeGLUT Project Step 1 – Creating the project Setup OpenGL & FreeGLUT (done only once) Open Visual Studio, Choose C++ as a language Create a Win32 Console application Tick “Empty project” Add a new .cpp file #include <gl\glew.h> #include <gl\freeglut.h> int main(int argc, char ** argv)

OpenGL & FreeGLUT Project (2) Step 2 - Linking Go to Project > [YourProjectName] Properties From the side menu choose Configuration properties > Linker > Input In the Additional Dependencies type in: glew32.lib freeglut.lib Do this for both Debug and Release configurations (upper left corner in the window) Close the properties window, you’re ready to go

OpenGL & FreeGLUT Project (2) Tip – the faster way to link to the libraries Skip the entire Step 2 In the .cpp file write: #pragma comment (lib, “glew32.lib”) #pragma comment (lib, “freeglut.lib”)

Window reshaping The Reshape function

Window reshaping Reshape function Specified by glutReshapeFunc Defines how your window reshapes Write it once, remember it no more

Window reshaping Live Demo * (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

The Keyboard monitoring functions Keyboard interaction The Keyboard monitoring functions

Keyboard interaction Keyboard monitoring functions Specified by glutKeyboardFunc glutKeyboardUpFunc Monitor key pressing and key releasing Doesn’t receive device information Receives translated windows messages

Keyboard interaction Live Demo * (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Orientation and positioning Camera control Orientation and positioning

Camera control ‘Moving the world’ method Using the gluLookAt function Using the glTranslate* and glRotate* functions You do the things the opposite way around F. e., to move the camera forward, move the objects backward Using the gluLookAt function Specifies camera location Viewed location

GLUT predefined objects, Coloring, Positioning Drawing objects GLUT predefined objects, Coloring, Positioning

Drawing objects GLUT predefined functions Coloring Positioning glutSolid* glutWireframe* Coloring glColor* - defines the current drawing color Positioning glTranslate* - moves the renderer by a vector glRotate* - rotates the renderer by an Euler angle

Camera control & Drawing objects * Camera control & Drawing objects Live Demo (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Basic Lighting Enabling lighting

Basic lighting Enabling lighting glEnable Enabling ‘color material’

Basic Lighting Live Demo * (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

OpenGL Basics ? ? ? ? ? Questions? ? ? ? ? ? ?