Cocos2d-x OpenGL ES World coordinate system

Source: Internet
Author: User
Many tutorials say that the cocos2d-x OpenGL ES World coordinate system origin is in the lower left corner, but as to why in the lower left corner no one has ever mentioned it, which leads most people to think that this is OpenGL ES's rule, in fact it is wrong, OpenGL The coordinate origin of ES in the lower left or center of the screen is related to the projection matrix, if we set the Cocos2d-x projection matrix to the unit matrix then the coordinate origin will be in the center of the screen. and cocos2d-x his projection matrix is (here only the value of the translation x, Y is shown: × =-size.width/2, y =-SIZE.HEIGHT/2), so its projection matrix is to move it from the center of the screen to the lower left corner. The reality of OpenGL's default coordinate origin is in the center of the screen.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Cocos2d-x OpenGL ES World coordinate system

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.