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