beginning opengl game programming 2004 phần 7

Tham khảo tài liệu 'beginning opengl game programming 2004 phần 7', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Texture Coordinate Generation 203 for you. This works in situations where the texture coordinates can be determined using well-defined mathematical steps. Examples include reflections contouring and projective texturing. We ll be discussing a couple of specific examples here. Texture coordinate generation is controlled independently for each coordinate. To use it you must first enable it by passing GL_TEXTURE_GEN_S GL_TEXTURE_GEN_T GL_TEXTURE_GEN_R or GL_TEXTURE_GEN_Q each corresponding to the indicated coordinate to glEnable . To specify how texture coordinates are generated you use one of the following void glTexGen ifd GLenum coord GLenum pname TYPE param void glTexGen ifd v GLenum coord GLenum pname const TYPE params coord indicates which texture coordinate to apply the parameter to. Valid values are GL_S GL_T GL_R and GL_Q corresponding to the s t r and q texture coordinates. The accepted values of pname and the param or params associated with them are listed in Table . Table Texture Generation Parameters Parameter Meaning GL_TEXTURE_GEN_MODE param specifies the texture generation mode which must be GL_OBJECT_LINEAR GL_EYE_LINEAR GL_SPHERE_MAP GL_REFLECTION_MAP or GL_NORMAL_MAP . GL_OBJECT_PLANE params is a pointer to a four-element array of values that are used as parameters for the texture coordinate generation function. Used in conjunction With GL_OBJECT_LINEAR. GL_EYE_PLANE Same as above but used with GL_EYE_LINEAR. Available only via the ARB_ _texture_cube_map extension under Windows. If the texture generation mode is GL_OBJECT_LINEAR then the texture coordinates are generated using the following equation texcoord pi Xo p2 yo p3 Zo p4 Wo xo yo zo and wo are the object-space coordinates of the vertex the texture coordinate is being generated for. p1 p2 p3 and p4 are the four parameters provided via GL_OBJECT_PLANE. These are used to pass the A B C and D coefficients of a plane so this equation is in effect calculating the distance from the plane and

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
27    288    2    17-05-2024
Đã 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.