02_GraphicsPrimitives

02_GraphicsPrimitives - Graphics (Output) Primitives...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Graphics (Output) Primitives Chapters 3 & 4 Graphic Output and Input Graphic Output and Input Pipeline Pipeline n Scan conversion n converts primitives such as lines, circles, etc. into pixel values n geometric description Þ a finite scene area n Clipping n the process of determining the portion of a primitive lying within a region called clip region Graphic Output Pipeline Graphic Output Pipeline application model : descriptions of objects application program : generates a sequence of functions to display a model graphics package : clipping, scan conversion, shading, etc. display H/W Graphic Input Pipeline Graphic Input Pipeline user interaction (e.g., mouse click) graphic package (by sampling or event-driven input functions) application program modify the model or the image on the screen Output Pipeline in Software Output Pipeline in Software When scan conversion and clipping happen? n Clipping before scan conversion n for lines, rectangles, and polygons clipping before scan converting each primitive (scissoring) n Clipping after scan converting the entire collection of primitives into a temporary canvas n for text Scan Converting Lines Scan Converting Lines A line from (x 1 ,y 1 ) to (x 2 ,y 2 ) Þ a series of pixels [Criteria] n Straight lines should appear straight n Line end-points should be constrained n Uniform density and intensity n Line algorithms should be fast Why Study Why Study Scan Conversion Algorithms? Scan Conversion Algorithms? § Every high-end graphics card support this. § You will never have to write these routines yourself, unless you become a graphics hardware designer. § So why learn this stuff? § Maybe you will become a graphics hardware designer. § But seriously, the same basic tricks underlie lots of algorithms: § 3-D shaded polygons § Texture mapping § etc. Simple Scan Converting Lines Simple Scan Converting Lines Based on slope-intercept algorithm from algebra: y = mx + b Simple approach: increment x , solve for y Floating point arithmetic required Digital Differential Analyzer(DDA) Digital Differential Analyzer(DDA) n Idea 1. Go to starting end point 2. Increment x and y values by constants proportional to x and y such that one of them is 1.- If 0 <m £ 1 , y k+1 = y k + m- If m >1 , x k+1 = x k + 1/ m 3. Round to the closest raster position ) , ( i i y x )) ( , 1 ( m y Round x i i + + )) ( , ( i i y Round x ) , 1 ( m y x i i + + Digital Differential Analyzer(DDA) Digital Differential Analyzer(DDA) n Drawbacks n rounding to an integer takes time n floating-point operations n Is there a simpler way? n Can we use only integer arithmetic? Easier to implement in hardware Midpoint Line Algorithm Midpoint Line Algorithm (Bresenham's Bresenham's Line Algorithm) Line Algorithm) n Assume a line from ( x 1 , y 1 ) to ( x 2 , y 2 ) that 0< m < 1 and x 1 < x 2 ....
View Full Document

This note was uploaded on 04/29/2010 for the course CSE 4190.411 taught by Professor Shinyeonggil during the Fall '08 term at Seoul National.

Page1 / 61

02_GraphicsPrimitives - Graphics (Output) Primitives...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online