Computer Graphics Lecture 28 REVIEW III Taqdees A. Siddiqi

Slides:



Advertisements
Similar presentations
15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
Advertisements

8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
Lecture 8 Transparency, Mirroring
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
Computer Science 631 Lecture 7: Colorspace, local operations
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
September 17, 2013Computer Vision Lecture 5: Image Filtering 1ColorRGB HSI.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Game Programming 06 The Rendering Engine
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Realtime NPR Toon and Pencil Shading Joel Jorgensen May 4, 2010.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Local Illumination and Shading
Computer Graphics Matrices
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Unit 10 Transformations. Lesson 10.1 Dilations Lesson 10.1 Objectives Define transformation (G3.1.1) Differentiate between types of transformations (G3.1.2)
Properties of Transformations. Translate Figures and Use Vectors Translation: moves every point of a figure the same distance in the same direction Image:
Computer Graphics Lecture 19 PROJECTIONS I Taqdees A. Siddiqi
Computer Graphics Lecture 07 Ellipse and Other Curves Taqdees A. Siddiqi
Computer Graphics Lecture 26 Mathematics of Lighting and Shading Part II Taqdees A. Siddiqi
Reflections in Plane Mirrors
Computer Graphics: An Introduction
Three Dimensional Viewing
Computer Graphics Overview
Rendering Pipeline Fall, 2015.
- Introduction - Graphics Pipeline
Computer Graphics Lecture 21 Triangles and Planes Taqdees A
Oblique Triangles and Vectors
Week 7 - Monday CS361.
Bitmap Image Vectorization using Potrace Algorithm
Week 2 - Friday CS361.
PERSPECTIVE PROJECTION…...
Intro to 3D Graphics.
CSCE 441 Computer Graphics 3-D Viewing
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
3D Graphics Rendering PPT By Ricardo Veguilla.
CS451Real-time Rendering Pipeline
Common Classification Tasks
Computer Vision Lecture 4: Color
Fitting Curve Models to Edges
MODULE - 8 ANALYTICAL GEOMETRY.
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
Three Dimensional Viewing
Computer Graphics Lecture 20
Planar Geometric Projection Classes
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Chapter V Vertex Processing
Lecture 13 Clipping & Scan Conversion
Kinematics Vectors and Motion
Transformations Dilations Translations Reflections Rotations.
Computer Graphics Material Colours and Lighting
Computer Graphics (Fall 2003)
Presentation transcript:

Computer Graphics Lecture 28 REVIEW III Taqdees A. Siddiqi cs602@vu Computer Graphics Lecture 28 REVIEW III Taqdees A. Siddiqi cs602@vu.edu.pk

REVIEW III Taqdees A. Siddiqi cs602@vu.edu.pk

Oblique Projection

Xp = x + z ( L1 cos (Ф) ) Yp = y + z ( L1 sin (Ф) )

Perspective Projection

Presumptions For Simplification The point of View (POV) must lie on the Z axis, The screen plane must be parallel to the X-Y plane, with the left and right edges of the screen parallel to the Y-axis, and the top and bottom edges of the screen parallel to the X-axis

Because the POV represents the viewer’s eye, and we presume that the viewer will be behind the center of the screen. Two common approaches are used with this: The first is where the POV is at some point (0, 0, -z) and the screen lies on the X-Y plane, graphically, this looks like figure:

The second is where the POV lies at the origin, and the screen lies on a plane at some +Z coordinate, as shown in figure given below:

Calculating the screen pixel that correlates to a 3D point is now a matter of simple geometry. From a viewpoint above the screen and POV (looking at the X-Z plane), the geometry appears like the one shown in figure below:

In geometric terms, we say that the triangle from A to B to S is similar to the triangle from A to C to P because the three angles that make up the triangles are the same; the angle from AB to AS is the same as the angle from AC to AP.

The two right angles i.e. 90o, and therefore the remaining two angles are the same (the sum of the angles in a triangle is always 180 degrees).

What also holds true from similar triangles is that the ratio of two sides also holds between the similar triangles; this means that the ratio of BS to AB is the same as the ratio of CP to AC.

But we know what AB is - it is Screen.z! and we know what AC is - it is point.z! and we know what CP is - it is point.x! therefore:

|BS| / |AB| = |CP| / |AC| |BS| = |AB| * |CP| / |AC| |BS| = Screen.z * point.x / point.z

Note that: Screen.z is the distance d from the point of view at origin or the scaling factor.

Triangles

Triangles "flesh out" a 3D object, connecting them together to form a skin or mesh that defines the boundary surface of an object

The ordering of the vertices goes clockwise around the triangle

Three points in space, and the triangle connecting them

Triangle Strips and Fans

Triangle List The first is an explicit list or array of triangles, where every three elements represent a new triangle.

Triangle Fan Triangle fans, conceptually, look like the folding fans you see in souvenir shops. They are a list of triangles that all share a common point.

A list of points composing a triangle fan

Triangle Strip Triangles in a triangle strip, instead of sharing a common element with all other triangles like a fan, only share elements with the triangle immediately preceding them.

The first three elements define the first triangle The first three elements define the first triangle. Then each subsequent element is combined with the two elements before it, in clockwise order, to create a new triangle

A list of points composing a triangle strip

Plane Planes are defined as infinitely large, infinitely thin slices of space, like big pieces of paper.

Each of the triangles that make up our model, exists in its own plane

Equation of plane in 3D Ax + By + Cz + d = 0

Ax + By + Cz + d = 0 The triplet (a, b ,c) represents what is called the normal of the plane

Ax + By + Cz + d = 0 The d component in the equation represents the distance from the plane to the origin. The distance is computed by tracing a line towards the plane until you hit it.

Ax + By + Cz + d = 0 Finally the triplet (x ,y, z) is any point that satisfies the equation The set of all points (x ,y, z) that solve the equation is exactly all the points that lie in the plane

‘d’ is -ve when the normal faces away from origin

‘d’ is +ve when the normal faces towards origin

It's important to notice that technically the normal (x, y, z) does not have to be unit-length for it to have a valid plane equation. But since things end up nicer if the normal is unit-length.

Back-face Culling

Back-face Culling To perform the back-face cull, just subtract one of the triangle's points from the camera location and perform a dot product of the resultant vector and the normal. If the result of the dot product is greater than zero, then the view point was in front of the triangle

Figure: A visual example of back-face culling

Triangle Rasterization Flat Filling Triangles

For each scan line (horizontal line on the screen), find the points of intersection with the edges of the triangle. Then, draw a horizontal line between intersections and do this for all scan lines.

Gouraud Shading Triangles

Flat triangle interpolated only one value (x in connection with y), 256 colors gouraud needs three (x related to y, color related to y, and color related to x),

hi-color gouraud needs seven parameters (i. e hi-color gouraud needs seven parameters (i.e. x related to y, red, green and blue components of color related to y, and color related to x (also three components))

Textured Triangles

We can also apply any bitmap on triangle for filling it.

Again we're using the idea of interpolation; And again the idea is perfectly the same, only two more values to interpolate, that is five values in all

In texture mapping, we interpolate x, u, and v related to y, and u and v related to x (u and v are coordinates in the 2D bitmap space)

The left triangle is the triangle which is drawn onto the screen The left triangle is the triangle which is drawn onto the screen. There's a single scanline (one call to the horizontal line routine) pointed out as an example.

The triangle on the right is the same triangle in the bitmap space, and there's the same scanline drawn from another point of view into it, too..

COLOR A color is usually represented in the graphics pipeline by a three-element vector representing the intensities of the red, green, and blue components

Or for a more complex object, by a four-element vector containing an add-itional value called the alpha component that represents the opacity of the color

Colors can also be represented as floating point values in the range [0,1]

A 16-bit display is named since each pixel in a 16-bit image is taken up by 16 bits (2 bytes): 5 bits of red information, 6 bits of green information, and 5 bits of blue information

A 24-bit display, of course, uses 24 bits, or 3 bytes per pixel, for color information. This gives 1 byte, or 256 distinct values each, for red, green, and blue

Finally, there is 32-bit color, something seen on most new graphics cards. Many 3D accelerators keep 8 extra bits per pixel around to store transpa-rency information, which is generally referred to as the alpha channel

GAMUT The 1931 CIE diagram shows the gamut of the eye and the lesser gamut of output devices.

Multiplication of Colors Colors are multiplied to describe the interaction between a surface and a light source The colors of each are multiplied together to estimate the reflected light color–this is the color of the light that this particular light reflects off this surface

This intensity of our light is represented by, say, a nice lime green color Let's say we shine this light on a nice magenta surface given by cs.

Multiplying (modulating) color values results in a color equal to or less than (darker) the original two.

Dealing with Saturated Colors

Adding colors can result in colors that are outside the displayable range.

The results of three strategies for dealing with the same oversaturated color.

Any value that's greater than one is clamped to one, and any value less than zero are clamped to zero. Clamping Color Values

Scaling Color Values Instead of clamping, we might want to scale the color by dividing by the largest color value, thus scaling the rgb values into the [0,1] range.

Clipping Color Values One problem with clamping or scaling colors is that they get darker (lose saturation). An alternative to scaling is to maintain saturation by shifting color values. This technique is called clipping,

Color Space Tool The ColorSpace tool is a handy tool that we can use to interactively add two colors together to see the effects of the various strategies for handling oversaturated colors.

Negative Colors and Darklights Darklights are nothing more than lights in which one or more of the color values are negative.

Uses of Darklights Eliminate bright areas of a scene Filter out a specific RGB color Night Vision – to eliminate Red and Blue components

Alpha Blending An alpha value of 0xFF (255) means the color is completely opaque, and an alpha value of 0x00 (0) means the color is completely transparent.

The name "alpha blending" comes from the fact that generally the blending factors used are either the alpha or the inverse of the alpha.

Final Color = SOURCE. SOURCE BLEND FACTOR + DESTINATION Final Color = SOURCE * SOURCE BLEND FACTOR + DESTINATION * DESTINATION BLEND FACTOR

FINAL COLOR = SOURCE * 1.0 + DESTINATION * 0.0

First Image

Second Image

Image after blending

Computer Graphics Lecture 28