Assignment 3 .Bresenham’s circle drawing algorithm
Bresenham’s circle drawing algorithm Read Radius r x=0, y=r Set decision parameter d to d = 3 – (2 * r). do while x < = y Call 8way drawCircle(int x, int y). Increment value of x. If d < 0, set d = d + (4*x) + 6 Else, set d = d + 4 * (x – y) + 10 and decrement y by 1. while End; 8 Way Symmetry Assignment 03 Implement Bresenham circle drawing algorithm to draw any object. The object should be displayed in all the quadrants with respect to center and radius Code # include <GL/glut.h> # include <iostream> using namespace std ; int r; void E_way ( int x, int y) { glBegin(GL_POINTS); glVertex2i(x+ 320 ,y+ 240 ); glVertex2i(y+ 320 ,x+ 240 ); glVertex2i(y+ 320 , -x+ 240 ); glVertex2i(x+ 320 , -y+ 240 ); glVertex2i(-x+ 320 ,-y+ 240 ); glVertex2i(-y+ 320 ,-x+ 240 ); glVertex2i(-y+ 320 ,x+ 240 ); glVertex2i(-x+ 320 ,y+ 240 ); glEnd(); ...