Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Sung-Ju Kang Department of Physics Kangwon National University Basic Concept of The Computer Graphic. For the investigation of the physical problem by.

Similar presentations


Presentation on theme: "1 Sung-Ju Kang Department of Physics Kangwon National University Basic Concept of The Computer Graphic. For the investigation of the physical problem by."— Presentation transcript:

1 1 Sung-Ju Kang Department of Physics Kangwon National University Basic Concept of The Computer Graphic. For the investigation of the physical problem by using the computer, the visualization of the solution are very advantageous for the researcher. The computer graphic is different to the real graphic, below text is the basic concept of the computer graphic. Contents 1. Graphic Card and Graphic Mode. 2. The Real Coordinate to The Computer Coordinate. 3. The Real Floating Point to The Pixel Integer Point. 4. Basic Graphic Functions.

2 2 1. Graphic Card and Graphic Mode. graphic cardGraphic driver HGAherc.bgi EGAega.bgi VGAegavga.bgi C language support the BGI (Borland Graphics Interface). Graphic driver of graphic card must exist in folder.

3 3 2. The Real Coordinate to The Computer Coordinate. The computer recognize the left upper edge as the origin, output images must be represented through the rectangular coordinate Real Coordinate: Windows Coordinate:......

4 4 3. The Real Floating Point to The Pixel Integer Point. Unit in the real world: Floating point number Unit in the computer graphic: Integer number transform int round(double U) { return(( U>0 ) ? (int) floor(U + 0.5) : (int) ceil(U - 0.5)); } floor find the largest integer not > U ceil find the smallest integer not < U ex) U = 123.54 floor(U) = 123.00 ceil(U) = 124.00

5 5 4. Basic Graphic Functions. Plot a point in the screen * putpixel(x,y,color) putpixel plots a pixel at a specified point. Plot to print a character String in the screen * outtextxy(x,y,s) outtextxy displays a string at the specified location. (graphics mode) Plot a line in the screen * line(x1,y1,x2,y2) line draws a line between two specified points.

6 6 Summary 1. C language support the BGI (Borland Graphics Interface). 2. We study the computer coordinate and the unit in the computer graphic. 3. We study the handling a point and a line in the screen.


Download ppt "1 Sung-Ju Kang Department of Physics Kangwon National University Basic Concept of The Computer Graphic. For the investigation of the physical problem by."

Similar presentations


Ads by Google