Introduction to the coordinate system under IOS, COCOS2DX, Unity3d

Source: Internet
Author: User

Most of the common controls in 1.iOS are in the Uikit package, the Uikit coordinate system is the origin of the upper-left corner, the downward y is larger, the right x is larger, and the control's frame.origin is in the upper-left corner. While the quartz is drawn with the lower left corner, the upper right becomes larger. So there is often a coordinate system conversion operation.

The coordinate origin of the 2.cocos2dx+lua frame is the screen or the lower left corner of the sprite, to the right x to large, to the upper y to large , the outer Z becomes larger. The anchor point default appears to be (0,0), which is the lower-left pixel of the picture with the coordinate point ( t1,t2) ( T1 , T2), keep the lower left corner position unchanged while rotating, and the other pixels revolve around.

3.unity3d has four coordinate systems, as described in: http://blog.csdn.net/zuoyamin/article/details/8813424 introduction, in simple terms:

    1. World Space: We add objects (such as Cube) to the scene, and they are all displayed in world coordinates in the scene. The location coordinates can be obtained by the transform.position.
    2. Screen Space: defined in pixels, in the lower-left corner of the screen (0,0), the upper-right corner (Screen.width,screen.height), and the position of z is measured in the camera's world unit. Note: The mouse position coordinates belong to the screen coordinates, Input.mouseposition can obtain the position coordinates, the finger touch screen is also the screen coordinates, Input.gettouch (0). Position can get a single finger to touch the screen coordinates.

    3. ViewPort Space (viewport coordinates): viewport coordinates are standard and relative to the camera. The lower-left corner of the camera is (0,0), the upper-right corner is (the) point, and the position of z is measured in the camera's world unit.

    4. Draw the coordinate system of the GUI interface: This coordinate system is similar to the screen coordinate system, which is different from the upper-left corner of the screen (0,0) and the lower-right corner (screen.width,screen.height).

Introduction to the coordinate system under IOS, COCOS2DX, Unity3d

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.