Computer Graphics (ii) OUTPUT elements _20_ Chapter summary (UP)

Source: Internet
Author: User
Tags polyline

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

--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------

  1. Gluortho2d specifying a two-dimensional world coordinate system
  2. glvertex* Select a coordinate position. The function must be placed between glbegin/glend
  3. Glbegin (gl_points); Plots one or more points, each specified in the Glvertex function. The position string ends with a glend statement.
  4. 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.
  5. Glbegin (Gl_line_strip); Displays the polyline specified with the same structure as the Gl_lines
  6. Glbegin (Gl_line_loop); Displays the closed polyline specified with the same structure as the Gl_lines
  7. glrect* displays a fill area on the XY plane
  8. Glbegin (Gl_polygon); Displays a fill polygon whose vertices are given in Glvertex and ended by the Glend statement
  9. Glbegin (Gl_trisngle_strip); Displays a filled triangle with the same description structure as the Gl_polygon
  10. 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
  11. Glbegin (gl_quads); Displays a set of filled quads with the same description structure as the Gl_polygon
  12. Glbegin (Gl_quad_strip); Displays a set of filled quads with the same description structure as the Gl_polygon
  13. Glenableclientstate (Gl_vertex_array); Activate OpenGL's vertex array facility
  14. Glvertexpointer (Size,type,stride,array); Specifying an array of coordinate values
  15. Gldrawelements (Prim,num,type,array); Displays a specified entity type from the array data
  16. Glnewlist (Listid,listmode); Defines a set of commands as a display table, ending with a glendlist statement
  17. Glgenlists generating one or more display table identities
  18. Glislist determine whether a query function that displays the table identity is used
  19. Glcalllist Executing a display table
  20. Gllistbase specifies the displacement of the display table identity array
  21. Glcalllists performing multiple display tables
  22. Gldeletelists Delete a specified list of displayed tables
  23. 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
  24. Glbitmap (W, H, x0, y0, xshift, yshift, pattern); Specifies the bitmap pattern to map to the pixel location corresponding to the current position
  25. Gldrawpixels (W, h, type, format, pattern); Specifies the pixel graph pattern to map to the pixel location corresponding to the current position
  26. Gldrawbuffer Select one or more caches to store the pixel graph
  27. Glreadpixels an array with a pixel holder specified
  28. Glcopypixels copy a pixel from one cache to another
  29. GLLOPICOP Select a logical operation to combine two pixel groups after activating with a constant gl_color_logic_op
  30. Glutbitmapcharacter (font, char); Select a font and a bitmap character to display
  31. Glutstrokecharacter (font, char); Select a font and a contour character to display
  32. GLUTRESHAPEFUNC specifies that the display window size changes when the work

Computer Graphics (ii) OUTPUT elements _20_ Chapter summary (UP)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.