Computer graphics semester review

This article is only a compilation of review materials for the end of the "Computer Graphics".
1. The composition of the graphics system.
     
     Computer: computing function
     mouse, other graphics input equipment: input function
     plotter, other hard copy equipment: output function
     tape drive, hard disk, other storage devices: storage function
     Graphic display terminal: dialogue function
 
     2. Computer graphics The relationship with image processing.
    Computer graphics starts from the data model and constructs graphics. It is a concept from scratch; while image processing is to transform, analyze, and reconstruct existing images. image. Graphics and images can not be confused, there are the following differences: 1> storage difference, graphics are stored functions of drawing, images are stored pixel position information, color information and grayscale information. 2>The difference between zooming, graphics zooming will not be distorted, and image zooming may be distorted.
    
 
     3. Color lookup table The
     color lookup table is a color lookup table added between the frame buffer memory and the DAC. The purpose is to control the increase of the frame buffer and improve the gray level through the color lookup table. In the display system of the color lookup table, set the number of frame buffer bit planes as N and the bit width of the lookup table as W. When W>N, the number of entries in the lookup table is 2N, and the display can have 2W gray levels but only There can be 2N different gray levels available.
 
      4. How to judge that a point is inside a polygon
     Method 1: Ray penetration method:
Basic idea: Make a ray parallel to the X axis to the left through point P, and count the intersection points between this ray and the polygon. If the number of intersection points is odd, point Inside the polygon, if it is an even number, the point is outside the polygon. However, special treatment is required for the following situations: 1) It just passes through a fixed point of the polygon. 2) The ray coincides with an edge of the polygon. 3) The point is on an edge of the polygon.
Assuming that the currently processed edge is P1P2, and the point to be judged is point P
1) If the point P is on the edge of P1P2, it is directly determined that the point is inside the polygon.
2) If the ray of point P passes through P1 or P2, the intersection point will be counted twice in the algorithm. The processing method is: determine whether the y coordinate of point P
is the same as the smaller y coordinate value of P1 and P2, if the same Then this point is ignored.
3) If the ray from point P is parallel to P1P2, ignore this edge.
 
      5. Accelerated graphics picking measures
      There are three commonly used accelerated graphics picking measures. (1) The filter method is to mark pickable and unpickable graphics separately, and judge the pickable graphics for picking, and skip directly for unpickable graphics. (2) The area rough judgment method is to judge the circumscribed rectangle of the figure to be picked. If the picked point falls within the rectangle, then judge the pixel. (3) Solidify the picking algorithm of basic pixels, that is, use hardware to realize the picking algorithm of points and line segments.
 
     6. Input control
(1) Request mode (program initialization device): In request mode, the initialization of the input device is set in the application. That is, by inputting the setting command (or sentence), after the required input mode is set for the corresponding device, the device can do the corresponding input processing.

(2) Sampling mode (program and equipment work at the same time): When one or more input devices are defined as sample mode, these devices will continuously input information without waiting for the input sentence of the application, that is, information The input has nothing to do with the input commands in the application. When the application program encounters a sampling command, it uses the value of the corresponding physical device as the sampling value.
Advantages: This mode does not require the user to have an obvious action like the request mode. It is more convenient for continuous information flow input, and it can also process input information from multiple input devices at the same time.
Disadvantages: When processing a certain input takes a long time, some input information may be lost.

(3) Event mode (device initialization program): When the device is set to event mode, the input device and the program work in parallel. All input data (or events) set to event mode are stored in an event queue, which is arranged in the order in which the events occurred. When the user completes an input action (such as pressing a button) on the input device, an event is generated, and the input information and the device number are stored in the event queue. Different applications can go to the queue to query and extract related events.

Guess you like

Origin blog.csdn.net/qq_37412975/article/details/109513874