output Elements Chapter summary
For a long time the 2nd chapter finally ended, the output elements discussed in this chapter provide the basic tools for using lines, curves, fill areas, cell pattern styles, and text to construct graphics. We specify the elements by giving a geometric description in the Cartesian world coordinate system .
The three methods used to draw pixels along the route are DDA algorithm, Bresenham algorithm and midpoint algorithm ,Bresenham calculation The method and the midpoint algorithm are equivalent and are the most effective. The color bit storage of pixels along the path of a segment is effectively done in a way that calculates the memory address incrementally. any segment generation algorithm can achieve parallel implementations by splitting segments and distributing segmented segments to the available processors .
Circle and Ellipse adopt the midpoint algorithm and make efficient and accurate scanning transformation according to its symmetry . Other two curves (parabolic andhyperbola) can also be drawn using a similar method. The spline curve of piecewise continuous polynomial is widely used in animation and computationmachine-aided design. The parallel implementation of the curve generation can be achieved by a method similar to the parallel segment processing method.
to consider the fact that the lines and curves have a finite width, we must adjust the object's pixel size so that it is associated with the specifiedThe geometrical dimensions are consistent. You can use the pixel position as the address method in the lower-left corner, or by adjusting the length of the line toimplementation.
a
fill area is a flat area that is displayed as a monochrome or color pattern. But in general, we can use any boundary to refer to The fill area is fixed. Many graphics packages allow only convex polygons to fill the area. At this point, the concave polygon fill area can be divided into a set of convexpolygon to display. Triangles are the most easily populated polygons, because each scan line intersects only the two edges of the triangle (assuming that the sweepthe stroke does not intersect the triangle vertex).
Parity rules can be used to determine the interior points of a planar area. Other methods can also be used to define the interior of an object, especially irregular self-intersecting objects. A representative example is a non-0 surround number rule. The rule is that the rules are processed with multiple boundaries definedobject is more flexible. We can also use Boolean operations to combine planar areas based on the deformation of the surround number rule.
Each polygon has a
forward face and a
back face that determines the direction of the polygon's plane space . The spatial direction is available with the polygon plane positive the intersection of the normal vector to determine, and from the back face to the forward face. can be arranged counterclockwise from the polygon plane equation or the use plane andThe three angles are less than 180 degrees of the three points of the vector cross product to calculate the component of the normal vector. All coordinate values of a scene, Space squareinto vertices, edges, and polygon sheets, respectively, to and from other geometry data.
some other available entities in the graphics package have pattern patterns and strings. Pattern patterns can be used to describe a variety of two-dimensional shapes,includes a character set expressed in a two-value or color-value collection that uses a rectangular structure. Strings are used to provide markup for graphics.
Use the primitive functions in the OpenGL base library to generate patterns for points, line segments, convex polygon fills, and bitmap or pixel graphs
Array. A subroutine that displays a string in glut. Other entities such as circle, ellipse, and convex polygon fill areas can use these functions to constructcan also be generated using glu and glut subroutines. All coordinate values are seated in the right-hand Cartesian coordinate system with absoluteThe standard representation. The coordinate position describing the scene can be given in a two-dimensional or three-dimensional reference system. You can use integers or floating-point numbers to give a coordinate value.A pointer to an array of coordinate values can also be used to represent the position. The scene describes two of the viewing function transformed into an output device such as a video monitor.dimension display. In addition to the Glrect function, each position of a vertex, segment, or polygon is specified in the Glvertex function. Define each diagrama set of Glvertex functions for a tuple is included with a pair of statement glbegin/glend, where the element type is based on the Glbegin function.the symbolic constants of the variables to identify them. When describing a polygon filled surface that contains many polygons, you can use the OpenGL vertex array to specifyand other data to generate the display results efficiently.
below, you'll list the basic functions for generating output primitives in OpenGL. Some of the related subroutines are also in the process.
Function description
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------
- Gluortho2d specifying a two-dimensional world coordinate system
- glvertex* Select a coordinate position. The function must be placed between glbegin/glend
- Glbegin (gl_points); Plots one or more points, each specified in the Glvertex function. The position string ends with a glend statement.
- Glbegin (Gl_lines); Displays a set of straight line segments whose endpoint coordinates are specified in the Glvertex function. The end string is finally ended by the Glend statement.
- Glbegin (Gl_line_strip); Displays the polyline specified with the same structure as the Gl_lines
- Glbegin (Gl_line_loop); Displays the closed polyline specified with the same structure as the Gl_lines
- glrect* displays a fill area on the XY plane
- Glbegin (Gl_polygon); Displays a fill polygon whose vertices are given in Glvertex and ended by the Glend statement
- Glbegin (Gl_trisngle_strip); Displays a filled triangle with the same description structure as the Gl_polygon
- Glbegin (Gl_triangle_fan); Displays a sector-shaped fill triangle with all triangles connected to the first vertex with the same description structure as the Gl_polygon
- Glbegin (gl_quads); Displays a set of filled quads with the same description structure as the Gl_polygon
- Glbegin (Gl_quad_strip); Displays a set of filled quads with the same description structure as the Gl_polygon
- Glenableclientstate (Gl_vertex_array); Activate OpenGL's vertex array facility
- Glvertexpointer (Size,type,stride,array); Specifying an array of coordinate values
- Gldrawelements (Prim,num,type,array); Displays a specified entity type from the array data
- Glnewlist (Listid,listmode); Defines a set of commands as a display table, ending with a glendlist statement
- Glgenlists generating one or more display table identities
- Glislist determine whether a query function that displays the table identity is used
- Glcalllist Executing a display table
- Gllistbase specifies the displacement of the display table identity array
- Glcalllists performing multiple display tables
- Gldeletelists Delete a specified list of displayed tables
- glrasterpos* specifies a two-dimensional or three-dimensional current position for the frame cache. This position is used as a reference for bitmap and pixel graph patterns
- Glbitmap (W, H, x0, y0, xshift, yshift, pattern); Specifies the bitmap pattern to map to the pixel location corresponding to the current position
- Gldrawpixels (W, h, type, format, pattern); Specifies the pixel graph pattern to map to the pixel location corresponding to the current position
- Gldrawbuffer Select one or more caches to store the pixel graph
- Glreadpixels an array with a pixel holder specified
- Glcopypixels copy a pixel from one cache to another
- GLLOPICOP Select a logical operation to combine two pixel groups after activating with a constant gl_color_logic_op
- Glutbitmapcharacter (font, char); Select a font and a bitmap character to display
- Glutstrokecharacter (font, char); Select a font and a contour character to display
- GLUTRESHAPEFUNC specifies that the display window size changes when the work
Computer Graphics (ii) OUTPUT elements _20_ Chapter summary (UP)