CS2405 - COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,

Slides:



Advertisements
Similar presentations
Computer Graphics- SCC 342
Advertisements

Three Dimensional Viewing
1 Computer Graphics Chapter 8 3D Transformations.
Course Website: Computer Graphics 4: Viewing In 2D.
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,
2D Viewing and Projection
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
1 Computer Graphics Chapter 6 2D Transformations.
CS 325 Introduction to Computer Graphics 02 / 24 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 26 / 2007 Instructor: Michael Eckmann.
7-2 Similarity and transformations
OpenGL (II). How to Draw a 3-D object on Screen?
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
UNIT - 5 3D transformation and viewing. 3D Point  We will consider points as column vectors. Thus, a typical point with coordinates (x, y, z) is represented.
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
1 CMT Fundamentals of Computer Graphics Revision Dr. Xiaohong Gao BG---Room 2C23 Week 11.
Transformation of Graphics
CSE 381 – Advanced Game Programming Basic 3D Graphics
2D Transformation of Graphics
Two Dimensional Viewing
Geometric Transformations
Computer Graphics Bing-Yu Chen National Taiwan University.
Acute angle An angle with a measure less than 90 degrees.
INT 840E Computer graphics Introduction & Graphic’s Architecture.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
CS 376 Introduction to Computer Graphics 02 / 23 / 2007 Instructor: Michael Eckmann.
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 1 1.
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)
Two-Dimensional Geometric Transformations A two dimensional transformation is any operation on a point in space (x, y) that maps that point's coordinates.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
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.
Three-Dimensional Viewing Hearn & Baker Chapter 7
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Handle By, S.JENILA AP/IT
CISC 110 Day 3 Introduction to Computer Graphics.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Lecture 13: Raster Graphics and Scan Conversion
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, N Y S S, India DTEL DTEL (Department for Technology.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
Dilations A dilation is a transformation that produces an image that is the same shape as the original, but is a different size. A dilation stretches or.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Introduction to Computer Graphics
Rendering Pipeline Fall, 2015.
Geometric Transformations
University of North Carolina at Greensboro
Transformations By: Christina Chaidez Math 1351.
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics CC416 Week 13 Clipping.
Transformations contd.
CSCE 441 Computer Graphics 3-D Viewing
Line and Character Attributes 2-D Transformation
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
WINDOWING AND CLIPPING
WINDOWING AND CLIPPING
Lecture 13 Clipping & Scan Conversion
Geometric Objects and Transformations (II)
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
Presentation transcript:

CS COMPUTER GRAPHICS LABORATORY

LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line, Circle and Ellipse Attributes 3.Two Dimensional transformations - Translation, Rotation, Scaling, Reflection, Shear. 4.Composite 2D Transformations 5.Cohen Sutherland 2D line clipping and Windowing 6.Sutherland – Hodgeman Polygon clipping Algorithm 7.Three dimensional transformations - Translation, Rotation, Scaling 8.Composite 3D transformations 9.Drawing three dimensional objects and Scenes 10.Generating Fractal images

List of Equipments and Components 1.Software : 1) Turbo C 2) Visual C++ with OPENGL 3) Any 3D animation software like 3DSMAX, Maya, Blender 2. Operating system : WINDOWS 2000 / XP

Bresenham’s Algorithm – Line, Circle & Ellipse The Bresenham's line-drawing algorithm is based on drawing an approximation of the true line. The true line is indicated in bright color, and its approximation is indicated in black pixels. In this example the starting point of the line is (0, 0) and the ending point of the line at (9, 6).

Line, Circle and Ellipse Attributes Any parameter that affects the way a primitive is to be displayed is referred to as an attribute parameter. Line attributesCircle attributesEllipse attributes

2D Transformations Transformaions are a fundamental part of computer graphics. Transformations are used to position objects, to shape objects, to change viewing positions, and even to change how something is viewed (e.g. the type of perspective that is used). Translation Assume you are given a point at (x,y)=(2,1). Where will the point be if you move it 3 units to the right and 1 unit up? Ans: (x',y') = (5,2). How was this obtained? - (x',y') = (x+3,y+1). That is, to move a point by some amount dx to the right and dy up, you must add dx to the x- coordinate and add dy to the y-coordinate. What was the required transformation to move the green triangle to the red triangle? Here the green triangle is represented by 3 points triangle = { p1=(1,0), p2=(2,0), p3=(1.5,2) }

Scaling Suppose we want to double the size of a 2-D object. That is, we must specify how much to change the size along each dimension. Below we see a triangle and a house that have been doubled in both width and height (note, the area is more than doubled). Rotation Below, we see objects that have been rotate by 25 degrees.

A sequence of transformations calculate composite transformation matrix rather than applying individual transformations Composite two-dimensional translations Apply two successive translations, T 1 and T 2 Composite transformation matrix in coordinate form Composite transformation

2D Clipping & windowing Clipping Techniques in 2D Clipping in Two dimensions Look at some possible cases. 1.Unclipped image 2.Clipped image

Window to Viewport Mapping Start with 3D scene, but eventually project to 2D scene 2D scene is infinite plane. Device has a finite visible rectangle. Answer: map rectangular region of 2D device scene to device. Window:rectangular region of interest in scene. Viewport:rectangular region on device. Usually, both rectangles are aligned with the coordinate axes.

The Sutherland - Hodgman algorithm performs a clipping of a polygon against each window edge in turn. It accepts an ordered sequence of verices v1, v2, v3,..., vn and puts out a set of vertices defining the clipped polygon. This figure represents a polygon (the large, solid, upward pointing arrow) before clipping has occurred. The following figures show how this algorithm works at each edge, clipping the polygon. Clipping against the left side of the clip window. Clipping against the top side of the clip window. Clipping against the right side of the clip window. Clipping against the bottom side of the clip window. Sutherland - Hodgman Polygon Clipping

3-D Transformations Transformations allow the developer to reposition, resize, and reorient models without changing the base values that define them. Translation It moves all the points in the Model3D in the direction of the offset vector with the OffsetX, OffsetY, and OffsetZ properties. For example, one vertex (2,2,2), an offset vector of (0,1.6,1) would move that vertex (2,2,2) to (2,3.6,3). The cube's vertex is still (2,2,2) in model space, but now that model space has changed its relationship to world space so that (2,2,2) in model space is (2,3.6,3) in world space.

Scaling It changes the model's scale by a specified scale vector with reference to a center point. Specify a uniform scale, which scales the model by the same value in the X, Y, and Z axes, to change the model's size proportionally. For example, setting the transform's ScaleX, ScaleY, and ScaleZ properties to 0.5 halves the size of the model; setting the same properties to 2 doubles its scale in all three axes.ScaleXScaleYScaleZ

Rotation Axis-angle rotations assume rotation about the origin if a value is not specified for the CenterX, CenterY, and CenterZ properties on RotateTransform3D.CenterXCenterYCenterZ As with scaling, it's helpful to remember that the rotation transforms the model's entire coordinate space. If the model was not created about the origin, or has been translated previously, the rotation might "pivot" about the origin instead of rotating in place.

Drawing three dimensional objects and Scenes

Animation is the rapid display of a sequence of images to create an illusion illusion of movement. The most common method of presenting animation is as a motion picture or video program. The bouncing ball animation consists of these six frames(Flash). This animation moves at 10 frames per second.

Generating Fractal images Self similarity between parts and overall features of the object is called fractal.