Lab 7 Viewing.

Slides:



Advertisements
Similar presentations
© 2004, Tom Duff and George Ledin Jr1 Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma.
Advertisements

Viewing and Transformation
1 CSC461 Lecture 7: 3D Programming in OpenGL Objectives: Develop 2D and 3D examples -- Sierpinski gasket: a fractal Develop 2D and 3D examples -- Sierpinski.
Sierpinski Gasket Program
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Introduction to OpenGL Pipeline From Programmer View Tong-Yee Lee.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Write a Simple Program with OpenGL & GLUT. Books and Web Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible.
OpenGL A Brief Overview. What is OpenGL?  It is NOT a programming language.  It is a Graphics Rendering API consisting of a set of function with a well.
Computer Graphics, KKU. Lecture 131 Transformation and Viewing in OpenGL.
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
GRAFIKA KOMPUTER ~ M. Ali Fauzi. Drawing 2 D Graphics.
Write a Simple Program with OpenGL & GLUT. Books OpenGL Programming Guide (Red-book) OpenGL Reference Manual (Blue-book) OpenGL Super Bible
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.
10/7/04© University of Wisconsin, CS559 Fall 2004 Last Time Transformations Homogeneous coordinates Directions Rotation Geometry 101 – Points, edges, triangles/polygons.
2D Coordinate Systems and Drawing
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Intro to OpenGL (Version 2) Geb Thomas. Setting Up GLUT You will need GLUT for opening windows We can use the version made by Nate Robins: –
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
CGGM Lab. Tan-Chi Ho 2001 Viewing and Transformation.
Projections. Viewports Windows can have separate viewports void glViewport(GLint x, GLint y, GLsizei width, GLsizei height ) x, y - Specify the lower.
OpenGL: The Open Graphics Language Introduction By Ricardo Veguilla.
NoufNaief.net 1 TA: Nouf Al-Harbi.
Viewing Korea Univ. Computer Graphics Lab. Hong, Jin Kyung.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Chap 3 Viewing and Transformation
Drawing and Coordinate Systems. Coordinate Systems Screen Coordinate system World Coordinate system World window Viewport Window to viewport mapping.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
CS559: Computer Graphics Lecture 12: OpenGL - Transformation Li Zhang Spring 2008.
CS559: Computer Graphics Lecture 12: OpenGL: ModelView Li Zhang Spring 2010.
Implement of transformation,projection, viewing Hanyang University Jungsik Park.
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
OpenGL LAB III.
CS380 LAB II OpenGL Donghyuk Kim Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Computer Graphics Lecture 41 Viewing Using OpenGL Taqdees A. Siddiqi
Outline 3D Viewing Required readings: HB 10-1 to 10-10
OpenGL: The Open Graphics Language Technology and Historical Overview By Ricardo Veguilla.
3 DIMENSIONAL VIEWING Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
CSC Graphics Programming
Viewing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Navigating in 3D MAX V part 1.
Transformations Introduction to Computer Graphics and Animation
Courtesy of Drs. Carol O’Sullivan / Yann Morvan Trinity College Dublin
Introduction to the Mouse
3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3
Normalizing Transformation (I)
Reference1. [OpenGL course slides by Rasmus Stenholt]
Multiple-pass Reflection Depth of Field
“Computer Science is no more about computers than astronomy is about telescopes.” Professor Edsger Dijkstra.
Advanced Graphics Algorithms Ying Zhu Georgia State University
Lecture 08 and 09 View & Projection
Lighting and Shading Lab 8:.
Computer Graphics, KKU. Lecture 13
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
LAB 5 Drawing Objects Lab 5 Drawing Objects.
Type of View Perspective View COP(Center of Plane) Diminution of size
Technical drawings! Please update your TOC.
2D Graphics Lecture 4 Fri, Aug 31, 2007.
Computer Graphics 3Practical Lesson
Lighting and Shading Lab 8:.
Chapter 3 Viewing.
THREE-DIMENSIONAL VIEWING II
S1 Orthographic Sketching
Transformation Back-face culling View frustum culling
HW-swgl-1 transformation & projection
CS 352: Computer Graphics Chapter 5: Viewing.
Presentation transcript:

Lab 7 Viewing

Parallel vs. Perspective Projection Parallel projection (Orthographic) glMatrixMode(GL_PROJECTION); glOrtho(xwmin,xwmax,ywmin,ywmax,dnear,dfar); Perspective Projection Two ways to use Perspective Projection: glMatrixMode(GL_PROJECTION); gluPerspective(theta,aspect,dnear,dfar); 1 glMatrixMode(GL_PROJECTION); gluFrustum(left,right,bottom,top,near,far); 2

gluLookAt() Function gluLookAt function: positions and aims the camera towards where the object is drawn. glLookAt(Xeye, Yeye, Zeye, Xat, Yat, Zat, Xup, Yup,Zup); glLookAt(0,0,6,0,0,0,0,1,0) glLookAt(0,0,-6,0,0,0,0,1,0) glLookAt(6,6,6,0,0,0,0,1,0)

glViewport() Function glViewport() function: it let you choose a smaller drawing region in the window. It is set by default to window’s size. glViewport(x, y, width, height); After using viewport to a specific region in the window Default viewport

glViewport() Function

Exercise 1 – drawing object twice using viewport void display(){ glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glLoadIdentity(); gluLookAt(0.0, 0, 5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); glViewport(0, 0, 400, 500); glutWireCube(1); glViewport(400, 0, 400, 500); glFlush(); }