Содержание
- 2. Output primitives and reference frames Output primitives are functions that we use to describe the various
- 3. Screen coordinates Screen coordinates (integers): Locations on a video monitor Coordinates correspond to pixel positions in
- 4. Specifying a 2D WC reference frame Figure 4-2 World-coordinate limits for a display window, as specified
- 5. OpenGL point functions glBegin (GL_POINTS); glVertex2i (50, 100); glVertex2i (75, 150); glVertex2i (100, 200); glEnd (
- 6. OpenGL point functions: alternative code int point1 [ ] = {50, 100}; int point2 [ ]
- 7. More on point functions Specifying positions in 3D using floating-point coordinates Using class or struct to
- 8. OpenGL line functions Figure 4-4 Line segments that can be displayed in OpenGL using a list
- 9. Polygon Fill Areas Figure 4-8 A convex polygon (a), and a concave polygon (b). Concave polygons
- 10. Identifying concave polygons Figure 4-9 Identifying a concave polygon by calculating cross-products of successive pairs of
- 11. Splitting concave polygons: vector method Form the edge vectors Ek=Vk+1 - Vk Calculate the cross-products of
- 12. Splitting example Figure 4-10 Splitting a concave polygon using the vector method.
- 13. Splitting polygons
- 14. Splitting a convex polygon into a set of triangles Triangles make several important processing routines simple
- 15. Inside-outside tests Odd-even rule Draw a line from any position P to a distant point outside
- 16. Nonzero winding-number rule Object edges and the line must be vectors Count the number of times
- 17. Inside-outside test examples Figure 4-12 Identifying interior and exterior regions of a closed polyline that contains
- 18. Variations of nonzero winding-number rule Figure 4-13 A fill area defined as a region that has
- 19. Variations of nonzero winding-number rule Figure 4-14 A fill area defined as a region with a
- 20. Variations of nonzero winding-number rule Figure 4-15 A fill area defined as a region with a
- 21. Polygon tables Figure 4-16 Geometric data-table representation for two adjacent polygon surface facets, formed with six
- 22. Plane equations Often, information about spatial orientation of surface components is needed This info is obtained
- 23. Solutions to plane equations We obtain A, B, C, and D by solving a set of
- 24. Solutions Then
- 25. Front and back polygon faces Faces can be determined by the sign of Ax+By+Cz+D Figure 4-19
- 26. OpenGL polygon fill-area functions Figure 4-22 Displaying polygon fill areas using a list of six vertex
- 27. Fill-area examples
- 28. Quadrilateral fill-areas Figure 4-23 Displaying quadrilateral fill areas using a list of eight vertex positions. (a)
- 29. A complex scene might require hundreds or thousands of OpenGL calls! Figure 4-24 A cube with
- 30. Using a vertex array Figure 4-25 Subscript values for array pt corresponding to the vertex coordinates
- 31. Display lists const double TWO_PI = 6.2831853; GLuint regHex; GLdouble theta; GLint x, y, k; /*
- 33. Скачать презентацию