TAILIEUCHUNG - 3D - Computer Graphics P2

OpenGL keeps track of whether polygons are facing toward or away from the viewer, that is, OpenGL assigns eachpol ygon a front face and a back face. In some situations, it is desirable for only the front faces of polygons to be viewable, whereas at other times you may want both the front and back faces to be visible. | Coordinates Points Lines and Polygons 13 Figure . Three triangles. The triangles are turned obliquely to the viewer so that the top portion of each triangle is in front of the base portion of another. It is also important to clear the depth Uuffer eccli timy you render an image. Tliis is typicylly done with a command í uc tr as glClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT which both clears the color . initializes the entire image to the default color and clears the depth values. The SimpleDraw program illustrates the use of depth buffering for hidden surfaces. It shows three triangles each of which partially hides another as in Figure . This example shows why ordering polygons from back to front is not a reliable means of performing hidden surface computation. Polygon Face Orientations OpenGL keeps track of whether polygons are facing toward or away from the viewer that is OpenGL assigns each polygon a front face md a back fiice. In some sitiiaiions it is desirable for only the front faces of polygons to be viewable whereas at other times you may want both the front and back faces to be visible. If we set the back faces to be invisible then any polygon whose back face would ordinarily be seen is not drawn at all and in effect becomes transparent. By default both fines are ri brhs. OpenGL determines which face of a polygon is the front face by the default convention that vertices on a polygon are specified in counterclockwise order with some exceptions for triangle strips and quadrilateral strips . The polygons in Figures and are all shown withtheir front faces visible. You can change the convention for which face is the front face by using the glFrontFace command. This command has the format glFrontFace GL_CW GL_CCW where CW and CCW stand for clockwise and counterclockwise gl_ccw is the default. Using gl_cw causes the conventions for front and back faces to be reversed on subsequent polygons. To make front or back faces invisible or .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.