BY Kamran Yousaf Line Attributes (X1, Y1, X2, Y2, Color) The Line Based on Slope Decision on the dx and dy Loop on Greater (Counter of 1) Increment of.

Slides:



Advertisements
Similar presentations
3.7 Implicit Differentiation
Advertisements

Section 7.1 – Area of a Region Between Two Curves
 putpixel function plots a pixel at location (x, y) of specified color.  Declaration :- void putpixel(int x, int y, int color);
1 2D Graphics CIS 487/587 Bruce R. Maxim UM-Dearborn.
Basic Raster Graphics Algorithms for Drawing 2D Primitives
CS 376 Introduction to Computer Graphics 02 / 02 / 2007 Instructor: Michael Eckmann.
Computer Graphics 4: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling By:Kanwarjeet Singh.
Line Drawing Algorithms
+ CPCS 391 Computer Graphics 1 Instructor: Dr. Sahar Shabanah Lecture 3.
CSE 123 Plots in MATLAB. Easiest way to plot Syntax: ezplot(fun) ezplot(fun,[min,max]) ezplot(fun2) ezplot(fun2,[xmin,xmax,ymin,ymax]) ezplot(fun) plots.
Line Drawing Algorithms. Rasterization-Process of determining which pixels give the best approximation to a desired line on the screen. Scan Conversion-Digitizing.
Larry F. Hodges (modified by Amos Johnson) 1 Design of Line, Circle & Ellipse Algorithms.
Borland Style Graphics for Dev C++)
RAPTOR Syntax and Semantics By Lt Col Schorsch
The lines of this object appear continuous However, they are made of pixels 2April 13, 2015.
Computer Graphics Tz-Huan Huang National Taiwan University (Slides are based on Prof. Chen’s)
Lecture 16 Fun with graphics
Lecture # 11 JavaScript Graphics. Scalable Vector Graphics (SVG) Scalable Vector Graphics (SVG), as the name implies, are - scalable (without pixelation):
Parametric Equations t x y
Copyright © Cengage Learning. All rights reserved.
Section 2.9 Linear Approximations and Differentials Math 1231: Single-Variable Calculus.
Tic-Tac-Toe Using the Graphing Calculator for Derivatives.
Trigonometric Robot Workbook Version 0.1 Prepared by Phil Bourke Tipperary Institute.
HTML 5 Previous version: HTML4.01, 1999 Still work in progress, most browsers support some of it.
Copyright © Cengage Learning. All rights reserved.
BY Kamran Yousaf Application of Computer Graphics and Animation Using C++ Language.
© 2001 By Default! A Free sample background from Slide 1 Attributes of Output Primitives Definition Parameter that affects.
2D Output Primitives Graphics packages provide basic operations (called primitive operations) to describe a scene in terms of geometric structures. The.
Raster conversion algorithms for line and circle
Parametric Shapes & Lighting Jared Jackson Stanford - CS 348b June 6, 2003.
OOP&M - laboratory lectures1 OOP&M – LAB3 LABtres: drawing.
Aim: How can we measure area on ImageJ?
Circle Drawing algo..
1/24/20061 Fill-Area Algorithms and Functions. 1/24/20062 Learning Objectives OpenGL state variables Color and gray scale Color functions Point attributes.
CGMB214: Introduction to Computer Graphics
1 CS 430/536 Computer Graphics I Circle Drawing and Clipping Week 3, Lecture 6 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent.
BY Kamran Yousaf Computer Graphics & Animation. BY Kamran Yousaf Contents Introduction Usage, Application & Advantages Video Display Devices Output Devices.
Lecture 3 Drawing Basic Shapes Professor: Dr. Miguel Alonso Jr.
Lesson 3-11 Linear Approximations and Differentials.
1 Introduction Line attribute Color and gray scale Area filled attribute Anti-aliasing.
1 Circle Drawing Algorithms Pictures snagged from
CGMB214: Introduction to Computer Graphics
Chapter 9: Quadratic Relations and Systems Section 9-3: Ellipses.
ELLIPSE GENERATING ALGORITHMS 1. DEFINITION Ellipse is an elongated circle. Elliptical curves can be generated by modifying circle-drawing procedures.
CHAPTER Continuity Implicit Differentiation.
MIDPOINT CIRCLE & ELLIPSE GENERARTING ALGORITHMS
November 18, We could solve for y in terms of x ( x 0, y 0 ) are the origin points A Simple Circle Drawing Algorithm The equation for a circle.
Circumference Review. Review What is the relationship between a radius and a diameter? What does a circumference measure? What formulas do we use to calculate.
10/15/02 (c) 2002 University of Wisconsin, CS559 Who Am I? Prof Stephen Chenney These notes will be online after the lecture – in fact they’re online already.
Simulations Report E. García, UIC. Run 1 Geometry Radiator (water) 1cm x 2cm x 2cm with optical properties Sensitive Volume (hit collector) acrylic (with.
For any function f (x), the tangent is a close approximation of the function for some small distance from the tangent point. We call the equation of the.
Midpoint Circle Algorithm
Polar Equations M 140 Precalculus V. J. Motto. Graphing Polar Equations It is expected that you will be using a calculator to sketch a polar graph. Before.
Lecture 15: Raster Graphics and Scan Conversion
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
Sin x = Solve for 0° ≤ x ≤ 720°
Hyperbolas Ellipses Inside Out (9.4). POD Sketch the ellipse. What is the center? What are the lengths of the three radii?
Lecture 2: 19/4/1435 Graphical algorithms Lecturer/ Kawther Abas CS- 375 Graphics and Human Computer Interaction.
ATTRIBUTE OF OUTPUT PRIMITIVES. Attribute of Output Primitives 30/9/2008 A.Aruna/Assistant professor/IT/SNSCE 2 Definition Line Attribute Curve Attribute.
Computer Graphics Lecture 07 Ellipse and Other Curves Taqdees A. Siddiqi
Computer Graphics : output primitives.. 2 of 32 T1 – pp. 103–123, 137–145, 147–150, 164–171 Points and LinesPoints Line Drawing AlgorithmsLine Mid–Point.
Lecture 05: Mid-point Ellipse algorithm Dr. Manal Helal – Fall 2014
Chapter Three Part I Output Primitives CS 380.
Scan Conversion of Circles
Electrical Wiring Single Pole Switches.
SLOPE = = = The SLOPE of a line is There are four types of slopes
Area of a Composite Calculate the area of this shape Total Area =
Rectangle, x = 100, y = 200 Ellipse, x = 200, y = 300 #1.
Line Drawing Algorithms
OUTPUT PRIMITIVES / DISPLAY TECHNIQUES
Presentation transcript:

BY Kamran Yousaf Line Attributes (X1, Y1, X2, Y2, Color) The Line Based on Slope Decision on the dx and dy Loop on Greater (Counter of 1) Increment of other (Slope) Plot Pixels in the loop

BY Kamran Yousaf Line ‘dx’, ‘dy’ to calculate the diffrence along x and y axis ‘steps’ to calculate Loop counting ‘xInc’, ‘yInc’ to calculate the Difference covered in each step ‘x’, ‘y’ to store current pixel position ‘i’ as a loop variable

BY Kamran Yousaf Line Calculate ‘dx’ as x2-x1,‘dy’ as y2-y1 ‘steps’ will have the greater absolute value from ‘dx’ or ‘dy’ ‘xInc’ is ‘dx’/’steps’,‘yInc’ is ‘dy’/’steps’ ‘x’ is ‘x1’ ‘y’ is ‘y1’ Plot 1 st pixel at ‘x’,’y’ using ‘color’ Loop ‘k’ 1 to steps and ‘x’+=‘xInc’, ‘y’+=‘yInc’

BY Kamran Yousaf Rectangle Attributes (X1,Y1,X2,Y2,Color) Set of four Lines Line 1(X1,Y1,X2,Y1) Line 2(X1,Y2,X2,Y2) Line 3(X1,Y1,X1,Y2) Line 4(X2,Y1,X2,Y2)

BY Kamran Yousaf Button Set of 8 Lines Line 1(X1,Y1,X2,Y1, Silver) Line 2(X1,Y2,X2,Y2, Black) Line 3(X1,Y1,X1,Y2,Silver) Line 4(X2,Y1,X2,Y2, Black) Line 5(X1+1,Y1+1,X2-1,Y1+1, White) Line 6(X1+1,Y2-1,X2-1,Y2-1,Gray) Line 7(X1+1,Y1+1,X1+1,Y2-1,White) Line 8(X2-1,Y1+1,X2-1,Y2-1, Gray)

BY Kamran Yousaf PolyGon n no of Attributes Set of n/2 no of lines Filled or Open Shape Parameters Array, and count of points

BY Kamran Yousaf Circle Attributes ( xc, yc, radius, color) ‘x’, ‘y’ as current points ‘i’ to run loop 0 to 360 ‘x’ is calculated as xc+radius*cos(rad) ‘y’ is calculated as yc+radius*sin(rad) Where rad is PI*deg/180

BY Kamran Yousaf Arc Attributes ( xc, yc, radius,startAngle, endAngle, color) ‘x’, ‘y’ as current points ‘i’ to run loop start to end ‘x’ is calculated as xc+radius*cos(rad) ‘y’ is calculated as yc+radius*sin(rad) Where rad is PI*deg/180

BY Kamran Yousaf Ellipse Attributes ( xc, yc, Xradius,Yradius, color) ‘x’, ‘y’ as current points ‘i’ to run loop 0 to 360 ‘x’ is calculated as xc+Xradius*cos(rad) ‘y’ is calculated as yc+Yradius*sin(rad) Where rad is PI*deg/180

BY Kamran Yousaf Elliptical Arc Attributes ( xc, yc, Xradius,Yradius,start, end, color) ‘x’, ‘y’ as current points ‘i’ to run loop start to end ‘x’ is calculated as xc+Xradius*cos(rad) ‘y’ is calculated as yc+Yradius*sin(rad) Where rad is PI*deg/180