OpenGL view transformations, model transformations, projection transformations, viewport transformations

Source: Internet
Author: User

The process of producing a target scene is similar to taking a picture with a camera:

(1) Secure the camera to the tripod and let him view the scene from a different location in the scene ( views transform )

Glulookat

(2) Arranging the scene so that the position of each object in the photo is what we want to move, rotate or enlarge the object in the scene ( model transformation )

gltranslate*, glrotate*, glscale*

(3) Select the camera lens and adjust the magnification (focus) Display object, you can choose how the object is projected onto the screen ( projection transformation )

glfrustum, gluperspective, Glortho

(4) Determine the size of the photo, enlarge the photo or reduce the photo to draw down the picture, is to occupy the entire screen or part of the screen ( viewport transformation )

Glviewport

Note: The view transform must appear before the model transformation, but you can perform a projection transform and a viewport transform at any time before the drawing.

If OpenGL does not set the model, projection, viewport, the coordinates of the plotted geometry can only be 1 to 1 (the x-axis to the right, the y-axis upward, and the z-axis vertical screen).

The default is the view model change glmatrixmode(gl_modelview);

Default projection transform to Glortho

OpenGL view transformations, model transformations, projection transformations, viewport transformations

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.