Tag: Notes of BIM
Math || Solution-2017
Solution-2019
Continue ReadingComputer Graphics | Preboard Solution 2019
Group B Morgan Short Question Write a Program to draw a circle with radius 200 and center (500,700) using midpoint circle algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import java.applet.Applet; import java.awt.Color; import java.awt.Graphics; public class CircleDemo extends Applet{ public void paint(Graphics g){ int r =200; int d = 1-r; int xc = 500, yc = 700; int x = 0; int y = r; do{ g.setColor(Color.red); //drawing an initial point g.drawOval(x+500, y+700, 2, 2); g.drawOval(y+500, x+700, 2, 2); g.drawOval(x+500, -y+700, 2, 2); g.drawOval(y+500, -x+700, 2, 2); g.drawOval(-y+500,-x+700, 2, 2); g.drawOval(-x+500, -y+700, 2, 2); g.drawOval(-x+500, y+700, 2, 2); g.drawOval(-y+500, x+700, 2, 2); if(d<0){ x=x+1; d = d + 2*x+3; } else{ x=x+1; y = y-1; d = d+2*(x-y)+5; }while(x<Y); } } |
Comprehensive Questions Define intensity attenuation and ambient light. Explain the procedure of Phong shading method for polygon rendering with its algorithm. Intensity attenuation means that a surface close to the light […]
Continue Reading