OpenGL Example 1 GLRECTF anatomy

Source: Internet
Author: User

4.3 GLRECTF ( -0.5f, -0.5f, 0.5f, 0.5f)Anatomy

GLRECTF ( -0.5f, -0.5f, 0.5f, 0.5f);// GLRECTF , draw a rectangle with four parameters representing the horizontal and vertical coordinates of two points on the diagonal

Maybe a lot of beginners do not understand, in fact, I do not understand, but took two more steps.

1) The F that follows the number is a floating-point, not a double type, minus no effect

leads to the following question, said online, this is the upper left corner of the rectangle, and the lower right corner of the coordinates, the coordinates are not integers? How to have 0.5, do not understand, crazy!!!!! Unveiled as follows:

your window's default coordinate system is -1~1 , which will be clipped if it is larger than this value .

you fill in the 100*50, in fact it is painted, but more than 1 of the parts have been cut off, presented in your window is the entire screen is the color of the rectangle

B(+)

&&&&&&&&&&&&&&&&&&

& &

& &

& &

& &

& &

& &

&&&&&&&&&&&&&&&&&&

A(-1,-1)

from this figure, it should be understood:GLRECTF (100f,100f, 50f,50f);

It's painted! But it was brushed off!!


OpenGL Example 1 GLRECTF anatomy

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.