30 views

Uploaded by sania_sania3467

save

- IP - Practical 4
- Computer and Graphics Lab File With Manual
- XL H1A vs XH A1S
- iPhone Design Tools Trial
- Mobile Phones Selection
- Mca Assignment 2012 13 -V Sem
- Aim
- CG Viva
- Digital camera
- Rhino3d Shoe Tutorial.
- 3D Animation
- 37188108 Computer Graphics Lab Manual
- archmodels_vol_90.pdf
- anoop rp
- Computer Graphics Lab Programs
- Close-range photogrammetry applications.pdf
- Telemedicine-07
- Leica Captivate DS
- Terrain Tools Info
- Cgarena Dec-jan11 Magazine
- SQL Queries PArt 1
- comp_6
- CNC Glossary of Terms
- imageenhancementtechniques-130712012622-phpapp02
- Leica Scan Station 2 Datasheet En
- Simple Processing
- Hd Infrared
- Counterfeit Currency Detection
- week_one
- 05 Queues
- riyaa-thehiddenshirkbngla.pdf
- ddo_java.pdf
- BQAPDI (resumen)
- ma-01-02-08.pdf
- Trabajo Gestion Del Cambio
- Actividad 1 SEGURIDAD
- weiche wotan weiche erde wagner
- ty
- Elsa Pello
- 2 Calamba Medical vs NLRC - G.R. No. 176484.pdf
- Articles-29001 Recurso Doc
- Tipos de Jeringas
- MANICHUDAR_10_09_2018
- Reader
- Vibration of CT
- Prueba de Historia 27de septiembre.pdf
- 5.1.4 (2) Kak Pembinaan Dan Bukti Pembinaan
- DAFTAR PUSTAKA
- Contoh-surat-lamaran-kerja-fresh-graduate.docx
- Kartu Menuju Sehat Lansia
- 4 Propuestas LENGUA 1ro
- a3-catalogo-es-197.pdf
- 1. Manual Plc
- dpjp
- Metode Alternatif Penyusunan Anggaran Kelompok 13
- extraterrestres_Rafapal.pdf
- dependencia
- 11624726-Modulo-0-ERGONOMIA-2.pdf
- Organi Borrador
- PROSES DAUN SIRSAK

You are on page 1of 3

**Line Drawing Algorithms
**

Progress so far…

OpenGL is an open source Graphics library that is widely used in creation of Graphic Applications. We have so far covered basic implementation of a graphic applications, two and three dimensional object and object transformations.

Today’s Lab:

The objective of today’s lab is to implement basic line drawing algorithms like DDA and Bresenham’s Line Drawing Algorithm.

Submission Requirements:

Submit your codes, only .cpp files, through LMS. Deadline: 5th March, 2012. Copy cases will be marked zero without any further clarification or discussion. Comments in your code can get you extra credit. Do add proper comments and always be prepared for viva.

**Digital Differential Analyzer:
**

A line is an infinite number of dots between two different points. The basic problem is how you can find those points. Therefore, you use the basic equation of line.

Here you can find the coordinates of y for given x provided that slope of line is m and y intercept is b. On the computer screen, you can only plot points in the form of pixels. Pixels are present on screen in the form of rectangular grid. Actual line on screen should be displayed like this,

and obtain the starting value for the decision parameter as p0 = 2Δy – Δx 4. Perform step 4 Δx-1 times. If p k<0. Input two line end points and store the first end point in (x0. At each xk along the line. You cannot see the line on screen like this. 10) to p2 (150. 15) having slope 0. (Refer to Class Discussion for complete algorithm) Question 1: Draw a line from the point p1 (10. starting it k=0.100). but pixel by pixel illumination of points makes a line visible on screen. the next point to plot is (xk+1.2Δx. Question 2: Draw a line on screen starting from point p3 (10. Also calculate the time to draw that line.2Δx 5. . plot the first point. Δy. Calculate the constants Δx. y0). yk+1) and pk+1 = pk + 2Δy . Set the color for frame buffer position (x0.Computer Graphics Using OpenGL But as you can see all the pixels are not illuminated on screen. Although that line will not be straight but it will be visible in the form of straight line on screen. perform the following test. There are certain line drawing algorithms that calculate the pixels that should be illuminated on screen to draw a straight line. y0) that is. 2. 3.yk) and pk+1 = pk +2Δy Otherwise.75. 2Δy . the next point to plot is (xk+1. Bresenham’s Line Drawing Algorithm: 1. You can draw it till x=150. For that you can calculate the y coordinate for each increment in the value of x or vice versa.

Question 5: Draw a rectangle of height 100 and width 150 using both line drawing algorithms. Question 4: Draw a line on screen starting from point p3 (10. 10) to p2 (150.100).Computer Graphics Using OpenGL Question 3: Draw a line from the point p1 (10. You can draw it till x=150. Also calculate the time to draw that line.75. Also calculate the time elapsed to draw both rectangles. Evaluate both algorithms on the basis of your results. 15) having slope 0. . NOTE: Submit your codes with a report of your comments about both algorithms.

- IP - Practical 4Uploaded byDimple Maheshwari
- Computer and Graphics Lab File With ManualUploaded byBalvinder Singh
- XL H1A vs XH A1SUploaded bygilmor111
- iPhone Design Tools TrialUploaded bycahya303
- Mobile Phones SelectionUploaded byMicah Smith
- Mca Assignment 2012 13 -V SemUploaded bypkj_kr
- AimUploaded byWilson Nadar
- CG VivaUploaded bySantOsh JamaDar
- Digital cameraUploaded byabhijeetsahu21119907617
- Rhino3d Shoe Tutorial.Uploaded byquiquichina17450
- 3D AnimationUploaded bybreunisoos3321
- 37188108 Computer Graphics Lab ManualUploaded bypaviucet
- archmodels_vol_90.pdfUploaded bySergio Ferrís Girbés
- anoop rpUploaded byRaUlKishan
- Computer Graphics Lab ProgramsUploaded byRahul Hellsanxel
- Close-range photogrammetry applications.pdfUploaded byDoc2005
- Telemedicine-07Uploaded byAmandeep Kaur
- Leica Captivate DSUploaded byAsovicVaso
- Terrain Tools InfoUploaded bySasa
- Cgarena Dec-jan11 MagazineUploaded bycellmerah
- SQL Queries PArt 1Uploaded bySai Veeramreddy
- comp_6Uploaded byManav
- CNC Glossary of TermsUploaded bybest4rever
- imageenhancementtechniques-130712012622-phpapp02Uploaded byKapil Dev
- Leica Scan Station 2 Datasheet EnUploaded byNiall J Kane
- Simple ProcessingUploaded bybasab_ecens
- Hd InfraredUploaded byMag Fhearadhaigh
- Counterfeit Currency DetectionUploaded byEditor IJTSRD
- week_oneUploaded byjonkyjonkerson
- 05 QueuesUploaded byAzrul Ikhwan Zulkifli