Prove Redbook's error with a local method

Source: Internet
Author: User
According to Redbook's explanation, in automatic texture coordinate generation, the gl_object_linear mode does not need to use the model view matrix. The gl_eye_linear mode uses the Model View matrix. Then we can make a series of tests to verify the above conclusions:

1. Use gl_eye_linear mode to generate texture coordinates. Set the Model View matrix and projection matrix to enable OGL to perform coordinate transformation with a fixed rendering pipeline.

Test results: The program results are normal. The texture coordinates are related to the eye coordinates and change with the eye coordinates.

2. Use gl_eye_linear mode to generate texture coordinates. Set the Model View matrix to a matrix of units, and perform Model View transformation by yourself. Only the OGL can perform projection transformation in a fixed pipeline.

Test results: The program results are normal.

3. Use gl_object_linear mode to generate texture coordinates. Set the Model View matrix and projection matrix to enable OGL to perform coordinate transformation with a fixed rendering pipeline.

Test results: The program results are normal, and the texture coordinates are related to the object coordinate, which does not change with the eye coordinate.

4. Use gl_object_linear mode to generate texture coordinates. Set the Model View matrix to a matrix of units, and perform Model View transformation by yourself. Only the OGL can perform projection transformation in a fixed pipeline.

Test result: the program result is abnormal and the effect is the same as that in gl_eye_linear mode.

Conclusion: The model view matrix is not required for the gl_eye_linear mode, and the model view matrix is required for the gl_object_linear mode.

In addition, if we assume that Redbook is indeed reversed, the formula for generating automatic texture coordinates in gl_object_linear mode is:

T = (p * M-1) * Vt;

In experiment 4, we set the Model View matrix as the unit matrix, and there are:

T = (p * M-1) * Vt = p * Vt;

The result is in the same gl_eye_linear mode. This is the same as what we have observed.

Maybe Redbook is really wrong.

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.