UNIT 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS-1

Similar documents
GEOMETRIC OBJECTS AND TRANSFORMATIONS I

Building Models. Objectives. Introduce simple data structures for building polygonal models. OpenGL vertex arrays. Vertex lists Edge lists

Building Models. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Display Lists. Conceptually similar to a graphics file. In client-server environment, display list is placed on server

Building Models. Objectives Introduce simple data structures for building polygonal models. Vertex lists Edge lists

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

Transformation Pipeline

2D/3D Geometric Transformations and Scene Graphs

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

SOURCES AND URLS BIBLIOGRAPHY AND REFERENCES

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

Overview. By end of the week:

CHAPTER 1 Graphics Systems and Models 3

Graphics Pipeline 2D Geometric Transformations

Computer Graphics Seminar

Building Models. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Linear and Affine Transformations Coordinate Systems

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

2D transformations: An introduction to the maths behind computer graphics

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics. Chapter 7 2D Geometric Transformations

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

Computer Graphics CS 543 Lecture 4 (Part 2) Building 3D Models (Part 2)

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

COS340A Assignment 1 I Pillemer Student# March 25 th 2007 p1/15

Lecture 4 of 41. Lab 1a: OpenGL Basics

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

Specifying Complex Scenes

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Notes on Computer Graphics and OpenGL. Thomas Strathmann

OpenGL Transformations

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Lecture 5 2D Transformation

OpenGL refresher. Advanced Computer Graphics 2012

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

CSC 470 Computer Graphics

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

Filled Area Primitives. CEng 477 Introduction to Computer Graphics METU, 2007

GEOMETRIC TRANSFORMATIONS AND VIEWING

Shaders. Slide credit to Prof. Zwicker

3D Viewing Episode 2

Computer Graphics and Visualization SYLLABUS COMPUTER GRAPHICS AND VISUALIZATION

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy

Geometric Transformations

3D Viewing. CS 4620 Lecture 8

COMP3421. Introduction to 3D Graphics

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

Rasterization Overview

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

Learning Log Title: CHAPTER 6: TRANSFORMATIONS AND SIMILARITY. Date: Lesson: Chapter 6: Transformations and Similarity

COMPUTER GRAPHICS AND VISUALIZATION. Subject Code: 10CS65 / 10IS665 I.A. Marks : 25 Hours/Week : 04 Exam Hours: 03 Total Hours : 52 Exam Marks: 100

Viewing with Computers (OpenGL)

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library.

Computer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York

Chapter 3: Modeling Transformation

CS 4620 Midterm 1. Tuesday 22 October minutes

How shapes are represented in 3D Graphics. Aims and objectives By the end of the lecture you will be able to describe

CS 4204 Computer Graphics

CS 465 Program 4: Modeller

Computer Graphics. Chapter 10 Three-Dimensional Viewing

Interaction Computer Graphics I Lecture 3

Game Architecture. 2/19/16: Rasterization

3D GRAPHICS. design. animate. render

CS354 Computer Graphics Viewing and Modeling

CS 112 The Rendering Pipeline. Slide 1

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

MET71 COMPUTER AIDED DESIGN

CS 432 Interactive Computer Graphics

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

Figure 1. Lecture 1: Three Dimensional graphics: Projections and Transformations

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

CS 4204 Computer Graphics

Building Models. Prof. George Wolberg Dept. of Computer Science City College of New York

Lecture 5b. Transformation

Chapter 3 - Basic Mathematics for 3D Computer Graphics

CS 130 Final. Fall 2015

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

CS 184, Fall 1996 Midterm #1 Professor: unknown

An Introduction to 2D OpenGL

Vertex Buffer Objects

Vertex Buffer Objects. Vertex Buffer Objects: The Big Idea

5.8.3 Oblique Projections

THE VIEWING TRANSFORMATION

Review of Thursday. xa + yb xc + yd

Modeling with Transformations

CS 184, Fall 1996 Midterm #1 Professor: unknown

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Fundamental Types of Viewing

Lecture 2 2D transformations Introduction to OpenGL

COMP3421. Introduction to 3D Graphics

Transcription:

UNIT 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS-1 1. Explain the complete procedure of converting a world object frame into camera or eye frame, using the model view matrix. (Jun2012) 10M Ans: World Space Object space for a particular object gives it no spatial relationship with respect to other objects. The purpose of world space is to provide some absolute reference for all the objects in your scene. How a world-space coordinate system is established is arbitrary. For example, you may decide that the origin of world space is the center of your room. Objects in the room are then positioned relative to the center of the room and some notion of scale (Is a unit of distance a foot or a meter?) and some notion of orientation (Does the positive y-axis point "up"? Is north in the direction of the positive x-axis?). The Modeling Transform The way an object, specified in object space, is positioned within world space is by means of a modeling transform. For example, you may need to rotate, translate, and scale the 3D model of a chair so that the chair is placed properly within your room's world-space coordinate system. Two chairs in the same room may use the same 3D chair model but have different modeling transforms, so that each chair exists at a distinct location in the room. You can mathematically represent all the transforms in this chapter as a 4x4 matrix. Using the properties of matrices, you can combine several translations, rotations, scales, and projections into a single 4x4 matrix by multiplying them together. When you concatenate matrices in this way, the combined matrix also represents the combination of the respective transforms. This turns out to be very powerful, as you will see. If you multiply the 4x4 matrix representing the modeling transform by the object-space position in homogeneous form (assuming a 1 for the w component if there is no explicit w component), the result is the same position transformed into world space. This same matrix math principle applies to all subsequent transforms discussed in this chapter. Eye Space Ultimately, you want to look at your scene from a particular viewpoint (the "eye"). In the coordinate system known as eye space(or view space), the eye is located at the origin of the coordinate system. Following the standard convention, you orient the scene so the eye is looking down one direction of the z-axis. The "up" direction is typically the positive y direction.

Eye space, which is particularly useful for lighting, will be discussed in Chapter 5. The View Transform The transform that converts world-space positions to eye-space positions is the view transform. Once again, you express the view transform with a 4x4 matrix. The typical view transform combines a translation that moves the eye position in world space to the origin of eye space and then rotates the eye appropriately. By doing this, the view transform defines the position and orientation of the viewpoint. The Model view Matrix Most lighting and other shading computations involve quantities such as positions and surface normals. In general, these computations tend to be more efficient when performed in either eye space or object space. World space is useful in your application for establishing the overall spatial relationships between objects in a scene, but it is not particularly efficient for lighting and other shading computations. For this reason, we typically combine the two matrices that represent the modeling and view transforms into a single matrix known as the modelview matrix. You can combine the two matrices by simply multiplying the view matrix by the modeling matrix. 2. With respect to modeling discuss vertex arrays. (Jun2012) 5M Ans : i) Vertex arrays provide a method for encapsulating the information in data structure such that we can draw polyhedral objects with only few function calls. There are three steps in using vertex arrays (i) Enable the functionality of vertex arrays (ii) Tell opengl, location & format of the array. (iii) Render the object. The first two steps are called initialization part and the third step is called display callback. OpenGL allows many different types of arrays; here we are using two such arrays called color and vertex arrays. The arrays can be enabled as follows. glenableclientstate (GL_COLOR_ARRAY) glenableclientstate (GL_VERTEX_ARRAY). The arrays are same as before. Next, we identify where the arrays are as follows. glvertexpointer (3,GL_FLOAT, 0, Vertices); glcolorpointer (3,GL_FLOAT, 0, COLOR);

3. Explain modeling a color cube in detail. (Dec2011) 10M Ans: We can use the vertex list to define a color cube. We can define a function quad to draw quadrilaterals polygons specified by pointers into the vertex list. The color cube specifies the six faces, taking care to make them all outward facing as follows. GLfloatVertices [8] [3] = {{-1.0, -1.0, -1.0}, {1.0, -1.0, -1.0}, {1.0, 1.0, -1.0}, {-1.0, 1.0, -1.0} {- 1.0, -1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0}} GLfloat color [8] [3] = {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {1.0, 0.0, 1.0}, {1.0, 1.0, 1.0}, {0.0, 1.0, 1.0}}; void quad (int a, int b, int c, int d) { glbegin (GL_QUADS); glcolor3fv (colors[a]); glvertex3fv(vertices[a]); glcolor3fv(colors[b]); glvertex3fv(vertices[b]); glcolor3fv(colors[c]); glvertex3fv (vertices[c]); glcolor3fv (colors[d]); } glvertex3fv(vertices[d]); glend(); Void colorcube () { quad (0,3,2,1); quad (2,3,7,6); quad (0, 4,7,3); quad (1, 2, 6, 5); quad (4, 5, 6, 7); quad (0, 1, 5, 4); 4. Explain affine transformations. (Dec2011) 10M Ans: An affine transformation is an important class of linear 2-D geometric transformations which

maps variables (e.g. pixel intensity values located at position in an input image) into new variables (e.g. in an output image) by applying a linear combination of translation, rotation, scaling and/or shearing (i.e. non-uniform scaling in some directions) operations. The general affine transformation is commonly written in homogeneous coordinates as shown below: By defining only the B matrix, this transformation can carry out pure translation: Pure rotation uses the A matrix and is defined as (for positive angles being clockwise rotations): Here, we are working in image coordinates, so the y axis goes downward. Rotation formula can be defined for when the y axis goes upward. Similarly, pure scaling is: (Note that several different affine transformations are often combined to produce a resultant transformation. The order in which the transformations occur is significant since a translation followed by a rotation is not necessarily equivalent to the converse.) Since the general affine transformation is defined by 6 constants, it is possible to define this transformation by specifying the new output image locations of any three input image coordinate pairs. (In practice, many more points are measured and a least squares method is used to find the best fitting transform.) 5. In a homogenous coordinate system given two frames (v1, v2, v3, P0) and (u1, u2, u3, Q0). Let a and b be two vectors defined in two frames respectively. Derive the expression that represents vector b interms of a. (July2011) 10M

Ans: Need to know The origin (or displacement vector) The basis vectors - The direction and distance for +1 movement along each axis This definition is relative To plot a point Begin at origin Travel along the x basis vector [direction] scaled by x coord, then along the y basis vector scaled by the y coord, then finally along the z basis vector scaled by the z coord.