"Unity" 5.1 3D Coordinate system basics

Source: Internet
Author: User

Categories: Unity, C #, VS2015

Date Created: 2016-04-20 I. INTRODUCTION

In the virtual game world, the mathematical knowledge associated with 3D determines how the game engine calculates and simulates every frame the developer and the player sees. Learning or thinking about the basics of 3D math can help developers get a deeper understanding of the game engine. Second, coordinate system

In game development, a different coordinate system is often used to describe the position in the space, and the commonly used coordinate systems are:

1. World coordinate system

A datum used to describe the position and orientation of all objects in a game scene, also known as the global coordinate system.

2. Local coordinate system (locally)

Each object has its own object coordinate system, and the same movement or rotation with the object, also known as the model coordinate system or object coordinate system.

The grid model (mesh) holds the coordinates of the vertex coordinates in the local coordinate system.

3. Camera coordinate system (cameras)

A coordinate system based on the observed position and direction. The coordinate system makes it easy to judge whether an object is in front of the camera and the order of occlusion between objects.

4. Screen coordinate system (screens)

This is a two-dimensional coordinate system built on the screen to describe the position of the pixel on the screen. That

The upper left corner of the screen is (0,0);

The x-axis is in the right direction (from left to right);

The y-axis is in the positive direction (top to bottom). Iii. conversions between different coordinate systems in unity

In Unity: The following methods of the transform component can be converted to a coordinate system:

Transform.transformpoint method: Converts a coordinate point from a local coordinate system to a world coordinate system.

Transform.inversetransformpont method: Converts a coordinate point from a local coordinate system to a world coordinate system.

Transform.transformdirection and transform.inversetransformdirection: used to convert vectors between the object coordinate system and the world coordinate system.

"Unity" 5.1 3D Coordinate system basics

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.