[Engine tools] flowchart Editor-implementation solution Summary

Source: Internet
Author: User
I. Introduction

The flow chart editing method is the development trend of interaction between the level designer and the game engine editor. It can provide obvious efficiency and facilitate collaborative work, and is very convenient for error checking and modification. In the past, text or simple Windows interface editing methods, such as the Warcraft trigger Editor, no one can understand the complex point map except the author, but if it is a flowchart, other users can quickly understand the author's ideas.

Let's take a look at the following three items to give an intuitive impression, and then explain how to implement the unreal3 and crysis sandbox visual flowchart editor.

 

 

II. Specific implementation:

1. Glossary:

View: refers to the flowchart editing window.

Expression (exp): Each edit element in the view. The expression can have multiple input and output values.

Handle: the input and output of each expression, which can also be expressed as pink, with inputpink and outputpink

2. Coordinate Transformation Process


 

 

Convention: Right Hand coordinate system, Y axis facing up. The focus is on Coordinate Transformation in three phases: Model Viewpoint Change, projection, and screen ing.

2.1 model and viewpoint changes:

Each expression represents a surface. It consists of two triangles. The input output and intermediate rendering results are pre-rendered to rendertexture. Expressions, links, and arrows are all a ry. The zcoordinates of these geometries are always 0. When you move an expression, only the XY coordinates are changed.

Skillful in camera and expression position. When zoom = 1, the expression changes to the video plane through model coordinate-> Perspective Projection-> screen coordinate-> window coordinate, the size of the expression that is finally rendered to the window is the same as that set for 2D (or orthogonal projection) rendering.

The camera is placed at (0, 0, 1) and points to the-Z axis. All expressions are placed on the XY plane (the zcoordinate is 0). Drag the expression to change only its XY coordinate, and the zcoordinate of the expression is always 0. You can scale and drag the screen area by modifying the camera XYZ.

2.2 projection:

The view supports camera zoom in/out. Therefore, orthogonal projection is not allowed and must be perspective projection.

Cone: Left =-1, Right = 1, Top = 1, Bottom =-1, near = 0.01, far = 10. Both the horizontal and vertical directions are 90 degrees.

The selection of the video plane determines the difficulty of subsequent processing. The distance between the visual plane and the viewpoint is also known as the line of sight (d ). The D value has a significant impact on the projection Change and Its Relationship with the screen coordinate. Here, our D value is 1.

2.3 screen ing:

When the horizontal and vertical field of view is 90 degrees and the line of sight is 1, the conversion formula from the plane coordinate to the screen coordinate is as follows:

Xper:-1 to 1-> xscreen: 0-> screen_width-1

Yper:-1 to 1-> yscreen: 0-> screen_height-1

Xscreen = (Xper + 1) * (0.5 * screen_width-0.5)

Yscreen = (screen_height-1)-(yper + 1) * (0.5 * screen_height-0.5) (Note: the Y axis of the screen coordinate should be reversed with the visual plane coordinate .)

Let's test the formula:

P1 (-1, 1)-> S1 (0, 0), in the upper left corner of the screen.

P2 (-1,-1)-> S1 (0, screen_height-1), in the lower left corner of the screen.

P1 (1, 1)-> S1 (SCREEN_WIDTH-1, 0), top right corner of the screen.

P1 (1,-1)-> S1 (SCREEN_WIDTH-1, screen_height-1), bottom right corner of the screen.

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.