Computer Graphics Lecture 32 Fasih ur Rehman. 3D Transforms The idea of 3D transforms is the same as that of 2D – A 3D point is represented by (x, y,

Slides:



Advertisements
Similar presentations
Java ThreadsGraphics Programming Graphics Programming: Windows, Viewports & Clipping.
Advertisements

CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Graphics Pipeline.
Computer Graphics Lecture 8 Arbitrary Viewing II: More Projection, Clipping and Mathematics of 3D Viewing.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
1 Clipping. 2 Transformation Sequence X Y Z X Y Z X Y Z X Y Z Object Coords. Eye Coords. Clip Coords. Normalized Device Coords. Screen Coords. Implementation:
Computer Graphics Viewing.
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 2 1.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Interpolation Clipping.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
User interface design Designing effective interfaces for software systems Objectives To suggest some general design principles for user interface design.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Clipping.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Implementation I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
User interface design. Recap User Interface GUI Characteristics (Windows, Icons, Menus, Pointing, Graphics) User Centered Design User Interface Design.
User interface design.
2-Dimension Viewing and Clipping
Objectives Review some advanced topics, including Review some advanced topics, including Chapter 8: Implementation Chapter 8: Implementation Chapter 9:
CS 376 Introduction to Computer Graphics 02 / 12 / 2007 Instructor: Michael Eckmann.
Two-Dimensional Viewing
CSC 480 Software Engineering Lecture 19 Nov 11, 2002.
Computer Graphics Lecture 28 Fasih ur Rehman. Last Class GUI Attributes – Windows, icons, menus, pointing devices, graphics Advantages Design Process.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Week 2 - Wednesday CS361.
Two Dimensional Viewing
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
Software Architecture
CSE Real Time Rendering Week 9. Post Geometry Shaders Courtesy: E. Angel and D. Shreiner – Interactive Computer Graphics 6E © Addison-Wesley 2012.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Windows, Viewports, and Clipping
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation.
Computer Graphics Lecture 02 Fasih ur Rehman. Last Class Introduction to Computer Graphics Areas Application.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Computer Graphics Lecture 20 Fasih ur Rehman. Last Class Clipping – What is clipping – Why we do clipping – How clipping is done.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
Graphics Graphics & Graphical Programming Lecture 23 - Viewing & Clipping.
A.Aruna/Assistant Professor/SNSCE
Computer Graphics Lecture 17 Fasih ur Rehman. Last Class 3D Transforms Inverse Rotation.
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
Computer Graphics Lecture 16 Fasih ur Rehman. Last Class Homogeneous transformations Types of Transformations – Linear Transformations – Affine Transformations.
Graphics Programming. Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program;
6. (supplemental) User Interface Design. User Interface Design System users often judge a system by its interface rather than its functionality A poorly.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
Applications and Rendering pipeline
Computer Graphics Lecture 15 Fasih ur Rehman. Last Class Combining Transformations Affine versus Rigid body Transformations Homogenous Transformations.
Chapter 71 Computer Graphics - Chapter 7 From Vertices to Fragments Objectives are: How your program are processed by the system that you are using, Learning.
Computer Graphics Clipping.
Programmable Pipelines
Transformations contd.
Computer Graphics Shading in OpenGL
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
Lecture 18 Fasih ur Rehman
Implementation I Ed Angel
Graphics Pipeline Clipping
WINDOWING AND CLIPPING
WINDOWING AND CLIPPING
Lecture 13 Clipping & Scan Conversion
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
Clipping University of British Columbia CPSC 314 Computer Graphics
Implementation I Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Computer Graphics Lecture 32 Fasih ur Rehman

3D Transforms The idea of 3D transforms is the same as that of 2D – A 3D point is represented by (x, y, z) – Homogeneous Coordinates are defined as A 4 th Coordinate is added to every 3D point (x, y, z, t) represents (x/t, y/t, z/t) (x, y, z, 0) represents infinity (0, 0, 0, 0) is not allowed

General 3D Homogeneous Transform

Scaling Scaling matrix

Translation Translation matrix

Reflection Reflection Matrix about yz – plane What are other reflection matrices

Rotation Rotation about Z – axis

Rotation Rotation about Y – axis

Rotation Rotation about X – axis

Inverse Rotation

Implementation Tasks Four Major Tasks – Modeling – Geometry Processing – Rasterization – Frame Processing

Modeling The usual results of the modeling process are sets of vertices that specify a group of geometric objects supported by the rest of the system.

Geometry Processing Geometry processing means to determine which geometric objects can appear on the display and to assign shades or colors to the vertices of these objects. Four Tasks – Projection – Primitive assembly – Clipping – Shading Hidden surface removal and visible surface determination are required

Rasterization Calculation of pixel values based upon the previous steps i. e. Projection, Primitive assembly, Clipping and Shading The rasterizer starts with vertices in normalized device coordinates but outputs fragments whose locations are in units of the display—window coordinates. Viewport transformation

Clipping Identification of the portions of geometric primitives by analytical calculations within the view windows

Clipping Not to clip means – Rasterize outside framebuffer – time to convert pixels outside the window will be wasted

Clipping Algorithms For each line segment – for each edge of the window view find intersection points pick nearest points – if anything is left draw it

Line Clipping A clipper decides which primitives, or parts of primitives can possibly be displayed and be passed on to rasterizer. – Primitives that fit within the specified view volume pass through the clipper, or are accepted – Primitives that cannot appear on the display are eliminated, or rejected or culled. – Primitives that are partially within the view volume must be clipped such that any part lying outside the volume is removed

Cohen – Sutherland Line Clipping The view window is divided into regions as shown in the figure Each region is assigned a 4-bit outcode

Liang-Barsky Clipping A line parallel to a clipping window edge has pi = 0 for that boundary. If for that i, qi < 0, the line is completely outside and can be eliminated. When pi 0, the line proceeds inside to outside. For nonzero pi, t = qi/pi gives the intersection point. For each line, calculate t1 and t2. For t1, look at boundaries for which pi 0 (inside view window). Take t2 to be the minimum of (1, qi/pi). If t1 > t2, the line is outside and therefore rejected.

Polygon Clipping Difficult task Polygon clipping may result in – Original Polygon – New polygon – Nothing Trivial Accept Trivial Reject

Sutherland-Hodgman Clipping Consider each edge of the view window individually Clip the polygon against the view window edge’s equation After doing all edges, the polygon is fully clipped

Phong Reflection Model A simple model supports three models of light – matter interactions – Diffuse – Specular – Ambient and uses four vectors – normal – to source – to viewer – perfect reflector

Graphical User Interface (GUI) Most of the system whether business or engineering are available with Graphical User Interfaces (GUI) thus enabling users to interact with there systems through graphical interfaces

Attributes of GUI Windows – Multiple windows enable variety of information to be prompted on the user’s screen at the same time. Icons – may represent files or processes Menus – Command selection possible from a menu instead of typing Pointing Device – Mouse may be used for selecting choices from a menu Graphics – Text and Graphical element can be mixed

Design Process Design requirements and view from the user (user centered design) Analyses and understanding of user activities Design prototype (paper based) – Evaluated by end user (modify if required) Design prototype – Evaluated by end user (modify if required) Produce dynamic design prototype – Evaluated by end user (modify if required) Executable prototype – Evaluated by end user (modify if required)

Design Principles Experience and capabilities and needs of the system users must be taken into account during design process of UI Designers should be aware of people’s physical and mental limitations and should be convinced that people make mistakes

Design Principles User familiarity – The interface should use terms and concepts drawn from the experience of the users. Consistency Minimal surprise Recoverability – e.g. undo User guidance – help and prompts etc. User diversity – Various people with various background may use

User System Interactions Two issues need to be addressed – How the information from user be provided to the system – How the processed information (from computer) be presented to the user? User System Interactions – Direct manipulation – Menu selection – Form fill-in – Command language – Natural language

Information Presentation Information presentation means how to present processed information to the users It may be presented – Directly (e.g. text) – Transformed like in graphical form Model-View-Controller approach supports multiple presentations of data

Display Factors (Information) User requirement – Precise information – Data relationships Information values change frequency – Should user know immediately about the change? Response on change required or not from user Direct or transformed? Textual or numeric? Multiple information presentation

Use of Colors Extra dimension can be added Can be used for warning Guideline – Too many colors should not be used – Color code should also be provided and the user may be provided flexibility to change color code. – Designing must be done for monochrome and colors should be added afterwards – Color codes should be consistent – Keep lower resolutions in mind

User Facilitation The user guidance system (like on – line help, error messages and manuals) should be integrated with the user interface

Animation Walt Disney created Animated objects – Mickey Mouse – Donald Duck Animate mean bring to life

References Fundamentals of Computer Graphics Third Edition by Peter Shirley and Steve Marschner Interactive Computer Graphics, A Top-down Approach with OpenGL (Sixth Edition) by Edward Angel.