Unreal engine graphics creation method and apparatus, and computer-readable storage medium
Through the underlying functions and low-code development model of Unreal Engine, combined with data model driving, the graph behavior and reuse problems in digital twin data visualization are solved, and efficient three-dimensional graphic display and development efficiency are achieved.
Patent Information
- Application Number
- PCT/CN2022/140823
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2024-11-28
AI Technical Summary
The existing digital twin data visualization technology has shortcomings in chart behavior, animation and lens coordination. In particular, the Echarts component relies on a web browser to meet the needs of complex chart displays, and art developers manually handle chart materials and meshes time-consuming. It is labor-intensive and cannot be reused.
Calling the underlying functions in the blueprint layer through Unreal Engine's underlying functions (C++ development language), combining the low-code development model, using a data model to drive graph construction, realize the coordination of animation, special effects and lenses, meet the needs of three-dimensional graphics display, and use the data model to achieve the data model Implement iteration and multiplexing.
It improves the efficiency of data visualization development, reduces the three-dimensional graphics development cycle, realizes high-performance three-dimensional graphics display, is compatible with the use of program developers and art developers, and solves the problems of chart behavior and reuse.
Smart Images

Figure CN2022140823_28112024_PF_FP_ABST
Abstract
Description
Unreal engine graphics construction method and device, and computer-readable storage medium Technical Field
[0001] The embodiments of the present disclosure relate to, but are not limited to, the field of Unreal Engine technology, and in particular to a method and device for constructing Unreal Engine graphics, and a computer-readable storage medium. Background Art
[0002] Digital twins fully utilize data such as physical models, sensor updates, and operational history to integrate multi-disciplinary, multi-physical, multi-scale, and multi-probability simulation processes, completing mapping in virtual space to reflect the entire life cycle of the corresponding physical equipment. Currently, at the digital twin data visualization level, there are two types of chart-based technology implementation solutions:
[0003] 1) Using the Echarts component to visualize chart data is advantageous in that it is open source and can meet most panel-level data visualization requirements. However, in the digital twin field, in addition to panel-level data visualization, many chart behaviors require animation, special effects, and camera shots. However, due to the Echarts component's dependence on web browsers, this approach cannot meet these requirements.
[0004] 2) Art developers process corresponding chart materials and meshes to meet the display requirements of a series of chart contents. Although this method can meet certain data chart display capabilities, it is time-consuming and labor-intensive, and the developed products, such as meshes, cannot be reused and iterated in different scenarios, projects, or businesses.
[0005] Summary of the Invention
[0006] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0007] The present disclosure provides an Unreal Engine graphics construction method, comprising:
[0008] Receive data to be displayed;
[0009] Determining the number N of basic graphics included in the graphics to be constructed according to the data to be displayed, where N>1;
[0010] The underlying function is called in the blue layer to draw N basic graphics in sequence, and the underlying function is used to create the basic graphics.
[0011] An embodiment of the present disclosure also provides an Unreal Engine graphics construction device, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the Unreal Engine graphics construction method described in any embodiment of the present disclosure based on the instructions stored in the memory.
[0012] The embodiments of the present disclosure further provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the Unreal Engine graphics construction method described in any embodiment of the present disclosure.
[0013] Other aspects will become apparent upon reading and understanding the drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are intended to provide a further understanding of the technical solutions of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solutions of the present disclosure and do not constitute a limitation of the technical solutions of the present disclosure. The shapes and sizes of the components in the drawings do not reflect the actual scale and are intended only to illustrate the contents of the present disclosure.
[0015] FIG1 is a flow chart of an Unreal Engine graphics construction method provided by an exemplary embodiment of the present disclosure;
[0016] FIG2 is a schematic diagram of a columnar heat map provided by an exemplary embodiment of the present disclosure;
[0017] FIG3A is a schematic diagram of a correlation coefficient matrix and a coloring disk provided by an exemplary embodiment of the present disclosure;
[0018] FIG3B is a schematic diagram of another columnar heat map provided by an exemplary embodiment of the present disclosure;
[0019] FIG4 is a schematic diagram of a rectangular body provided by an exemplary embodiment of the present disclosure;
[0020] FIG5 is a flow chart of a method for constructing a columnar heat map according to an exemplary embodiment of the present disclosure;
[0021] 6A and 6B are schematic diagrams of two other columnar heat maps provided by exemplary embodiments of the present disclosure;
[0022] FIG7 is a schematic diagram of a Nightingale rose diagram provided by an exemplary embodiment of the present disclosure;
[0023] FIG8A is a schematic diagram of a method for setting the color of a Nightingale rose diagram provided by an exemplary embodiment of the present disclosure;
[0024] FIG8B is a schematic diagram of another Nightingale rose diagram provided by an exemplary embodiment of the present disclosure;
[0025] FIG8C is a flow chart of a method for constructing a Nightingale rose diagram according to an exemplary embodiment of the present disclosure;
[0026] FIG9 is a schematic diagram of a parallel coordinate graph provided by an exemplary embodiment of the present disclosure;
[0027] FIG10A is a schematic diagram of a smooth curve provided by an exemplary embodiment of the present disclosure;
[0028] FIG10B is a schematic diagram of a method for generating a smooth curve according to an exemplary embodiment of the present disclosure;
[0029] FIG11 is a schematic diagram of a flow chart of a method for constructing a parallel coordinate graph according to an exemplary embodiment of the present disclosure;
[0030] FIG12 is a schematic structural diagram of an Unreal Engine graphics construction device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] To make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other in any manner.
[0032] Unless otherwise defined, the technical or scientific terms used in the embodiments of the present disclosure should have the ordinary meaning understood by people with ordinary skills in the field to which the present disclosure belongs. The words "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. The words "include" or "comprising" and similar words mean that the elements or objects preceding the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0033] Low-code is a visual application development approach that delivers applications faster with less code, automating the code programmers don't want to develop. Low-code is a set of digital technology tools that leverages more efficient methods like graphical drag-and-drop and parameterized configuration to enable rapid builds, data orchestration, ecosystem connectivity, and mid-tier services. It enables innovative scenarios and applications in digital transformation with minimal or no code.
[0034] As shown in FIG1 , an embodiment of the present disclosure provides an Unreal Engine graphics construction method, including:
[0035] Step 101: receiving data to be displayed;
[0036] Step 102: Determine the number N of basic graphics included in the graphics to be constructed according to the data to be displayed, where N>1;
[0037] Step 103: Call the underlying function in the blue layer to draw N basic graphics in sequence. The underlying function is used to create basic graphics.
[0038] The Unreal Engine graphics construction method of the disclosed embodiment uses the underlying functions of the Unreal Engine (C++ development language) as the underlying driving method, calls the underlying functions at the Blueprint layer (using C++ as the underlying layer also has extremely strong cross-platform compatibility), and uses low-code to expose the corresponding data model interface. While meeting the data visualization requirements, it can also cooperate with the Unreal Engine itself to complete the corresponding animation, special effects and / or lens coordination, and complete the three-dimensional graphics display capability with higher performance and better compatibility, thereby solving the problem of the Echarts system's dependence on Web browsers and the inability to use camera movement, animation, and special effects to display three-dimensional graphics.
[0039] In addition, the Unreal Engine graphics construction method of the disclosed embodiment uses a data model to complete the entire low-code development process, only requires a data model drive, is fully iterative and reusable, and is compatible with the use of both program developers and art developers. It meets the ability to improve development efficiency and realize data visualization, greatly reduces the development cycle of three-dimensional graphics in the Unreal Engine, and can significantly reduce the development time of developers.
[0040] In some exemplary embodiments, as shown in FIG2 , the graph to be constructed may be a heat map.
[0041] A heat map is a statistical chart that displays data by coloring blocks of color. When drawing, you need to specify the color mapping rules (the colors of the charts in the figures of the embodiments of this disclosure are not shown). For example, larger values are represented by darker colors, smaller values by lighter colors; larger values are represented by warmer colors, smaller values by cooler colors, and so on. Based on the data structure, heat maps are generally divided into two types:
[0042] First, a tabular heat map, also known as a color block map, requires two categorical fields and one numerical field. The categorical fields determine the X and Y axes, dividing the chart into regular rectangular blocks. The numerical field determines the color of the rectangular blocks.
[0043] Second, non-tabular heat maps (or smooth heat maps) require three numerical fields and can be drawn in a parallel coordinate system (two numerical fields determine the X-axis and Y-axis respectively, and one numerical field determines the coloring).
[0044] The present embodiment aims to create a first-class tabular heat map. Heat maps are suitable for viewing overall conditions, identifying outliers, displaying differences between multiple variables, and detecting any correlations between them. It is worth noting that when drawing a heat map, it is recommended to choose an appropriate color palette that is both visually distinguishable and consistent with the intended purpose.
[0045] Heat map scenario description:
[0046] (1) The advantage of heat maps is their high spatial efficiency, which allows them to accommodate relatively large amounts of data. Heat maps not only help to discover relationships between data and identify extreme values, but are also often used to depict the overall appearance of data, making it easier to compare data sets. For example, each athlete's historical performance can be condensed into a heat map for comparison.
[0047] (2) If a row or column is set as a time variable, a heat map can also be used to show how data changes over time. For example, a heat map can be used to show the temperature changes in a city over the course of a year, making the trend of the climate warm or cold clear at a glance.
[0048] (3) Although heat maps can accommodate a large amount of data, it is difficult to convert the color blocks into precise numbers. Therefore, when the numerical value needs to be clearly known, additional annotations may be required. In addition, there are also polar coordinate deformations of heat maps, namely annular heat maps. It should be noted that this chart has similar appearances to charts such as the sunburst chart, but its functions are completely different. Be careful when using it.
[0049] In some exemplary embodiments, the graph to be constructed may be a columnar heat map, and its basic graph may be a rectangular body (i.e., a hexahedron whose faces are all rectangular). However, the embodiments of the present disclosure are not limited to this, and the shape of its basic graph may also be other cylindrical shapes.
[0050] In some exemplary embodiments, the data to be displayed includes N target values, and N basic graphics are drawn in sequence, including:
[0051] Determine the number of two-dimensional bases M included in the columnar heat map to be constructed according to the dimension N1 of the first data and the dimension N2 of the second data in the data to be displayed, where M=N1*N2;
[0052] Determine the maximum target value and the minimum target value in the data to be displayed, and determine a coloring disk based on the determined maximum target value and minimum target value, the coloring disk including multiple colors and a target data range corresponding to each color;
[0053] N rectangular bodies are generated on a two-dimensional base corresponding to N target values. The height of each rectangular body is determined according to the corresponding target value, and the color of each rectangular body is determined according to the color corresponding to the corresponding target value in the coloring disk.
[0054] In the embodiment of the present disclosure, the data range of the coloring disk can be normalized or non-normalized, and the embodiment of the present disclosure does not limit this.
[0055] When displaying colors, there are three color channels: red (R), green (G), and blue (B). Each color channel has 256 levels of brightness, resulting in a total of 256*256*256=16777216 color schemes. These multiple color schemes are practically indistinguishable. Considering that heat maps are semantic charts, the graph construction method of the disclosed embodiment uses a color palette to determine the color corresponding to each target value.
[0056] For example, assuming that the maximum target value MAX and the minimum target value MIN in the data to be displayed are between -100 and 100 respectively (the maximum target value MAX and the minimum target value MIN can also be any other numerical values, for example, the maximum target value MAX can be 300, and the minimum target value MIN can be -100, and the embodiments of the present disclosure are not limited to this), the target data range is normalized, as shown in Figure 3A, the data range corresponding to the coloring disk is between -1 and 1, the ratio of each target value to MAX is calculated, and the color of the corresponding rectangle is determined according to the color corresponding to each ratio in the coloring disk.
[0057] In some exemplary embodiments, the color parameters of the columnar heat map include: maximum data value max, minimum data value min, center value center and color mapping table colormap, wherein the maximum data value max, minimum data value min and center value center can be determined according to the data to be displayed. For example, in the coloring disk shown in FIG3A, max = 1.0, min = -1.0, center = 0, and the color mapping table colormap represents the corresponding mapping relationship from the numerical value to the color space. For example, (-1.0, -0.8) corresponds to The first color, (-0.8, -0.6) corresponds to the second color, (-0.6, -0.4) corresponds to the third color, (-0.4, -0.2) corresponds to the fourth color, (-0.2, 0) corresponds to the fifth color, (0, 0.2) corresponds to the sixth color, (0.2, 0.4) corresponds to the seventh color, (0.4, 0.6) corresponds to the eighth color, (0.6, 0.8) corresponds to the ninth color, and (0.8, 1.0) corresponds to the tenth color. The first color to the tenth color can change gradually; or, the color corresponding to each value between (-1.0, 1.0) changes gradually.
[0058] In the embodiment of the present disclosure, the center value center represents the color center alignment value of the heat map. The overall depth of the generated graphic color can be adjusted by adjusting the color corresponding to the center value; when setting the center value center, if there is data overflow, the manually set max and min will automatically change. For example, the color parameters of the heat map in Figure 2: after the center value center changes, the new heat map effect is shown in Figure 3B (the colors of the heat maps in Figures 2 and 3B are not displayed. In the actual display process, the overall color of Figure 2 is blue, and the overall color of Figure 3B is red).
[0059] For example, assuming the MAX value is 200 and a target value is 156, the threshold percentage is 0.78. The corresponding color can be determined by searching the color number corresponding to 0.78 in the coloring disk, and then the corresponding rectangular height is set according to the target value or threshold percentage to complete the construction of the basic graphic corresponding to the target value.
[0060] In some exemplary embodiments, the data to be displayed includes statistical features of N1-dimensional first data and statistical features of N2-dimensional second data, and N basic graphics are drawn in sequence, including:
[0061] Determine the number of two-dimensional bases M included in the heat map to be constructed according to the dimension N1 of the first data and the dimension N2 of the second data in the data to be displayed, where M=N1*N2;
[0062] Calculate the correlation coefficient between the first data of each dimension and the second data of each dimension based on the statistical characteristics of the first data of N1 dimension and the statistical characteristics of the second data of N2 dimension to obtain a correlation coefficient matrix, wherein the correlation coefficient matrix includes N non-zero values; determine a coloring disk, wherein the data range corresponding to the coloring disk is between -1 and 1;
[0063] N rectangular bodies are generated on the two-dimensional base corresponding to N non-zero values. The height of each rectangular body is determined according to the corresponding correlation coefficient value, and the color of each rectangular body is determined according to the color corresponding to the corresponding correlation coefficient value in the coloring disk.
[0064] For example, the correlation coefficient may be a Pearson correlation coefficient.
[0065] In statistics, the Pearson correlation coefficient is used to measure the correlation (linear correlation) between two variables X and Y. Its value is between -1 and 1. When the Pearson correlation coefficient is 0, it means that there is no linear relationship between the two variables. In the field of natural science, this coefficient is widely used to measure the degree of correlation between two variables. The Pearson correlation coefficient between two variables is defined as the quotient of the covariance and standard deviation between the two variables. The embodiment of the present disclosure can calculate the corresponding color threshold by the Pearson correlation coefficient to distinguish colors.
[0066] In some exemplary embodiments, as shown in FIG4 , each rectangular body includes eight points, and the eight points include a zeroth point, a first point, a second point, a third point, a fourth point, a fifth point, a sixth point, and a seventh point;
[0067] The Z-axis coordinates of the zeroth point, the first point, the second point, and the third point are the same; the X-axis coordinates of the zeroth point, the third point, the fourth point, and the seventh point are the same; and the Y-axis coordinates of the second point, the third point, the sixth point, and the seventh point are the same.
[0068] In the embodiment of the present disclosure, the coordinates of the eight points of each rectangular body can be determined based on the starting position coordinates (i.e., the coordinates of the third point), the bottom length L, the bottom width W, and the height H of each rectangular body.
[0069] The starting position coordinates of the rectangular body in the example in Figure 4 are the coordinate origin of the XYZ three-axis coordinate system. Therefore, the Z-axis coordinates of the four points 0, 1, 2, and 3 are 0; the X-axis coordinates of the four points 0, 3, 4, and 7 are 0; and the Y-axis coordinates of the four points 2, 3, 6, and 7 are 0.
[0070] Because the coordinates of the fifth point include the base length L, base width W, and height H of the rectangle, the coordinates of all remaining points can be inferred based on the coordinates of the fifth point. For example, the coordinates of the fifth point can be used as a threshold control valve to control the color of the rectangle.
[0071] In some exemplary embodiments, the bottom surface of each rectangular body may be a square. Assuming that the XY axis area corresponding to the target is S, the bottom surface width of each rectangular body is W, and the length is L, then However, the embodiment of the present disclosure is not limited to this, and the bottom surface of each rectangular body may also be a rectangle.
[0072] In some exemplary embodiments, generating a rectangular volume includes:
[0073] Calculate the coordinates of the eight points of the rectangular body;
[0074] Generate six faces of the rectangular body in sequence, each face of the rectangular body is composed of two triangles, and each triangle is composed of three of the eight points.
[0075] In the embodiment of the present disclosure, the remaining N-1 rectangular bodies can just copy the rules of the first rectangular body, and control the color of each rectangular body according to the height H of each rectangular body to complete the columnar stacking matrix deployment.
[0076] In some exemplary embodiments, as shown in FIG5 , an exemplary graphics construction method includes the following steps: accessing parameters (i.e., receiving data to be displayed), performing grid splitting according to the first data dimension N1 and the second data dimension N2 of the access parameters (wherein the first data dimension N1 and the second data dimension N2 may be the same or different), determining the number of two-dimensional bases M contained in the graphics to be constructed, where M=N1*N2, and calculating the values of the bottom width W and length L of each rectangular body; at the same time, determining color parameters: maximum data value max, minimum data value min, center value center, determining a coloring disk (i.e., a color mapping table colormap) according to the determined color parameters, calculating the ratio of the target value in each data to be displayed to the maximum target value MAX, and selecting the corresponding color in the coloring disk according to the calculated ratio to generate a corresponding color body material; generating a basic rectangular body shape according to the bottom width W and length L of each rectangular body and the generated corresponding color body material (wherein the height H of the rectangular body may be determined according to the ratio or the target value), and recursively splicing to complete the overall heat map construction.
[0077] In some exemplary embodiments, the material of the rectangular body is exposed to the blueprint layer, and the material of the rectangular body can be a transparent material or an opaque material.
[0078] In this embodiment, the material of the rectangle is exposed to the blueprint layer in the editor. These contents can be controlled in the underlying C++ code, thus accepting various secondary development capabilities. An exemplary underlying code is shown below:
[0079]
[0080] The function declaration UFUNCTION defines a method that can be called from a Blueprint. The property specifier UPROPERTY exposes the material properties of the bar graph to the Blueprint layer.
[0081] This is a parameterized example. If you need to bind animation, you can expose the corresponding animation interface. If you need to expose transparency and light reflection, you can expose the corresponding Alpha channel in the Blue Layer. The Alpha channel is used to record the transparency information in the image.
[0082] In the disclosed embodiment, after the color parameters are determined, the overall graphics construction can be completed by completing the color replication of the vertex shader and setting the transparency in the corresponding parameters through the material instantiation scheme of the Unreal Engine itself.
[0083] As shown in FIG6A and FIG6B , the heat map constructed in the embodiment of the present disclosure can better fit the display of different scene sizes, and the constructed heat map can match any rotation, enlargement and reduction like any other model body.
[0084] In some exemplary embodiments, as shown in FIG7 , the graph to be constructed may be a Nightingale rose graph, and its basic graph may be a sector.
[0085] As one of the most intuitive and excellent ways to express polar coordinate statistical analysis in data visualization, the Nightingale rose diagram has gradually become an irreplaceable part of the data visualization process. The graphics construction method of the embodiment of the present disclosure can achieve the native expression of the corresponding Nightingale rose diagram using mathematical calculations in the Unreal Engine.
[0086] In some exemplary embodiments, the data to be displayed includes N-dimensional data, and N basic graphics are drawn in sequence, including:
[0087] Determine the coordinates of the center of the circle;
[0088] Determine the angle of each sector in,
[0089] Draw N sectors in sequence, and the starting angle of the i-th sector is The ending angle of the i-th sector is The outer diameter length of the i-th sector is determined according to the size of the target data value in the i-th dimension data, 1≤i≤N.
[0090] In the disclosed embodiment, the construction idea of the Nightingale rose diagram is to fit two circles of concentric polar coordinates. The inner diameter circle can be transparent (the inner diameter length can be 0, that is, there is no inner diameter circle), and the outer diameter is determined by binding data to the corresponding sector radius length. The angle of each sector is bisected according to the statistical dimension. If the statistical dimension includes merging and processing, then a minimum radius (Radius) needs to be set for differential superposition. Although the Nightingale rose diagram ultimately appears as a circle, because the differential angle is extremely small, it can be understood as a triangle with the same vertex angle being circumscribed and spliced.
[0091] In some exemplary embodiments, as shown in FIG7 , each sector includes three points: a center point, a starting point, and an ending point;
[0092] In each sector, the angle between the line connecting the center of the circle to the starting point and the line connecting the center of the circle to the ending point is equal to the angle The length of the line connecting the center of the circle and the starting point is equal to the length of the line connecting the center of the circle and the ending point.
[0093] In some exemplary embodiments, the material and color of the fan shape are exposed to the blueprint layer, and the material of the fan shape can be a transparent material or an opaque material.
[0094] In the embodiment of the present disclosure, after the underlying function is compiled, the interface can be exposed to the Unreal Engine Blueprint layer according to the corresponding parameters. An exemplary underlying code is shown below:
[0095]
[0096] The function declaration UFUNCTION defines a method callable by the Blueprint. SetValue represents the data set range for generating the Nightingale Rose diagram. The property specifier UPROPERTY defines the center position (CenterPosition), the inner radius (IR), and the color (Colors) corresponding to each sector.
[0097] The center position CenterPosition represents the starting point of the concentric coordinate system. In the above code, let CenterPosition = FVector2D(300.f,300.f). This is just an example. You can also use Fvector3D coordinates to bind the World mapping coordinate relationship in the Unreal Engine to complete the mapping of the corresponding space world + screen world.
[0098] In the above code, let the inner diameter length IR = 50, where 50 is just a minimum unit mark and has no practical meaning.
[0099] The color array Colors contains the display color corresponding to each sector. As shown in Figure 8A, users can set the color array Colors in the blueprint layer to set the color corresponding to each sector.
[0100] The above is just a parameterized example. If you need to bind animation, you can expose the corresponding animation interface; if you need to expose transparency and light reflection, you can expose the corresponding Alpha channel in the Blueprint layer, as shown in Figure 8B (the colors of the sectors in Figure 8A are different, and the colors of the sectors in Figure 8B are the same but the transparency is different). For example, the transparency in Figure 8B gradually changes clockwise from 0.1 to 0.9.
[0101] The graphics construction method of the disclosed embodiment can be copied using the native drawing (NativePaint) method of the Unreal Engine. Since the circumscribed triangle is essentially used for fan-shaped splicing, it is only necessary to control two points as the central axis, the point CurrentEVPosition is the current starting point A, and the minimum vector angle of rotation becomes NexEVPosition, and the point CurrentIVPosition is the current end point B. The same angle rotation is performed and then multiplied by the vector from the center of the circle along the radius direction to obtain the translation end point NextIVPosition.
[0102] As shown in FIG8C , an exemplary method for constructing a graphic includes the following steps: determining a layer and determining the coordinates of the center of a circle; receiving inner and outer diameters input by a user (which can also be automatically calculated by the program) and drawing concentric circles (i.e., n inner diameter circles); receiving an external data set (i.e., data to be displayed) and an external color set; determining the number N of sectors to be included in the Nightingale rose diagram to be constructed based on the dimension of the data to be displayed, and determining the angle of each sector. in, Draw N sectors in sequence, and the starting angle of the i-th sector is The ending angle of the i-th sector is The outer diameter length of the i-th sector is determined according to the target data value in the i-th dimension data. Each sector is colored according to the external color set, bound to the simulation world, and displayed in the coordinate system mapping.
[0103] The graphics constructed in the embodiments of the present disclosure can be layer expressions, for example, placed at a certain position on the screen; or they can be non-layer expressions, that is, the constructed graphics are independent, for example, when the user clicks a certain button, the constructed graphics pop up. Both layer expressions and non-layer expressions are acceptable, and which method to use depends on business needs.
[0104] In some exemplary embodiments, as shown in FIG9 , the graph to be constructed may be a parallel coordinate system multi-dimensional concurrent curve graph (referred to as a parallel coordinate graph in this disclosure), and its basic graph may be a Bezier curve.
[0105] As one of the most intuitive and excellent ways to express statistical analysis in data visualization, parallel coordinate graphs have gradually become an irreplaceable part of data visualization. The graph construction method of the embodiment of the present disclosure focuses on achieving the native expression of the corresponding parallel coordinate graph using mathematical calculations in the Unreal Engine.
[0106] This disclosed embodiment decomposes a parallel coordinate graph into smooth sub-Bézier curves between two very close points. Multiple consecutive sub-Bézier curves are connected to form a smooth curve. As shown in Figure 10A , the graph has six discrete connection points: (1, 1), (3, 6), (6, 3), (8, 0), (11, 6), and (12, 12). This disclosed embodiment investigates how to generate a smooth curve (the solid line in the figure) through interpolation, rather than a rigid multi-line segment (the dashed line in the figure).
[0107] In some exemplary embodiments, the data to be displayed may include N-dimensional data, each dimension of data including a plurality of discrete connection points, and drawing the i-th basic graph includes:
[0108] Get all discrete connection points in the i-th dimension data;
[0109] Generate two control points between every two adjacent discrete connection points. The two control points ensure that a sub-Bezier curve is generated between the two adjacent discrete connection points, and the connection point between the two adjacent sub-Bezier curves and the control points on both sides of the connection point are collinear.
[0110] According to the generated control points, a Bezier curve connecting all discrete connection points in the i-th dimension data is generated, and the line connecting the connection point and the two control points adjacent to the connection point is tangent to the Bezier curve, 1≤i≤N.
[0111] As shown in Figure 10B, Bezier curves are generated using control points, not all of which lie on the final curve. The first and last control points are the endpoints of the final curve (i.e., the first and last control points will lie on the final curve), and the lines connecting each of the adjacent control points are tangent to the final curve. For two sub-Bezier curves to connect smoothly, the connecting point must be collinear with the control points on its left and right. The control points must be set to ensure smooth connection between the sub-Bezier curves.
[0112] That is, a sub-Bézier curve is generated between two discrete connection points, and these two points serve as the two endpoints of the sub-Bézier curve. Two additional control points are then determined, and these control points are set so that the connection point of the two adjacent sub-Bézier curves and the control points on the left and right of the connection point are collinear. Figure 10B shows a smooth curve composed of two sub-Bézier curves, and each sub-Bézier curve only requires two control points.
[0113] In some exemplary embodiments, the material and color of the Bezier curve are exposed to the blueprint layer, and the material of the Bezier curve is a transparent material or an opaque material.
[0114] In the disclosed embodiment, after the underlying function is compiled, the interface can be exposed to the Unreal Engine Blueprint layer according to the corresponding parameters. The method of exposing the blueprint interface depends on the control method of the underlying code and the corresponding business logic. For example, the exposed parameters may include:
[0115] InValue, represents the range of the data set for which the parallel coordinate graph needs to be generated;
[0116] RectValue: Spacing length, used to determine the distinguishing dimension of the starting coordinate axis of the Bezier curve.
[0117] Colors: Corresponding to the display colors of the parallel coordinate graph.
[0118] Of course, the above is just a parameterized example. If you need to bind animation, you can expose the corresponding animation interface. If you need to expose transparency and light reflection, you can expose the corresponding Alpha channel in the Blue Layer.
[0119] The graphics construction method of the embodiment of the present disclosure can be replicated using the native painting (NativePaint) method of the Unreal Engine, and each curve is smoothly connected by Bezier curves to multiple discrete connection points.
[0120] As shown in Figure 11, an exemplary graphics construction method includes the following steps: determining the layer; determining the Rect to distinguish the area; inputting the interval and the starting point; receiving the external data set (i.e., the data to be displayed) and starting to draw the Bezier curve; determining the number N of Bezier curves contained in the parallel coordinate graph to be constructed according to the dimension of the data to be displayed, and for the i-th dimension data, generating two control points between every two adjacent discrete connection points, the two control points enable a sub-Bezier curve to be generated between the two adjacent discrete connection points, and the connection point between the two adjacent sub-Bezier curves and the control points on both sides of the connection point are collinear; based on the generated control points, generating a Bezier curve connecting all discrete connection points in the i-th dimension data, the line connecting the connection point and the two control points adjacent to the connection point is tangent to the Bezier curve, 1≤i≤N; receiving the external color set, coloring each Bezier curve according to the external color set, binding the simulation world, and displaying the coordinate system mapping.
[0121] The graphics constructed in the embodiments of the present disclosure can be layered, for example, placed at a certain location on the screen, or non-layered, meaning the constructed graphics are independent, for example, when a user clicks a button, the constructed graphics pop up. Both layered and non-layered representations are possible, and the method used depends on business needs.
[0122] In the embodiment of the present disclosure, the graphics to be constructed may also be any other graphics. The embodiment of the present disclosure will not give examples one by one, and the graphics can be constructed with reference to the above graphics construction method.
[0123] The Unreal Engine graphics construction method of the disclosed embodiment adopts a low-code approach to implement the commonly used columnar heat maps, parallel coordinate system multi-dimensional concurrent curve charts, Nightingale rose charts, etc. in data visualization in the Unreal Engine, so as to solve the problem that the current data charts cannot move with the scene and the camera switch, and solve the problem that the currently used Echarts technology system is limited to the architecture of the Web container. The disclosed embodiment uses low code to expose the corresponding data model interface to meet the needs of improving development efficiency and realizing data visualization, and significantly reduces the display development cycle of the Unreal Engine 3D graphics; by using the low-code mode, it can be compatible with the use of both program developers and art developers; at the same time, using C++ as the underlying layer also has extremely strong cross-platform compatibility.
[0124] The graphics construction method of the disclosed embodiment can be applied to application scenarios in all industries, including smart parks, smart cities, digital villages, rail transit, judicial supervision, emergency command, schools, hospitals, and electricity.
[0125] As shown in Figure 11, in the smart park technology solution, the entire system consists of the following two ends:
[0126] 1. Service / Central Control Terminal
[0127] The service / control end includes the following three layers:
[0128] 1) Data dashboard layer
[0129] With Web container / visualization chart as the main core display capability, data display is completed through traditional TCP / IP communication protocol. When the data dashboard layer is manipulated, processed or data changes, corresponding instructions are sent to the model twin layer.
[0130] 2) Model twin layer
[0131] With the rendering engine as the core development capability, supplemented by program and art rendering, programs are built based on real-world scenarios. The model twin layer includes the ability to parse and receive instructions / data commands, achieve spatial movement using roaming technology, enable scripted processing, and call multi-dimensional scenes, with the ability to feedback the effects of these changes to the display device.
[0132] 3) Service and communication layer
[0133] The service and communication layer mainly includes the following contents: data transmission in traditional communication logic, transmission of operation control instructions, transmission of rendering flow feedback from the model layer, etc.
[0134] 2. Access client / distributed client
[0135] Access clients / distributed clients include various mobile devices, which are bound through the streaming media address sent out by the model end, and at the same time formulate corresponding access methods and interaction logic based on their own business needs.
[0136] In addition, in terms of product direction, the overall digital twin + virtual simulation system is usually jointly formed through the production layer, processing layer and product layer.
[0137] 1. Production layer
[0138] Step 1: Use a GIS engine (such as Cesium) to pull data from open source official data platforms such as OpenStreetMap and TianDiTu, including but not limited to latitude and longitude, floor height, terrain Dem (Digital Elevation Model), and POI (Point of Interest) location information.
[0139] Step 2: The data is processed in three dimensions by three-dimensional pulling of a box, such as a CE platform, a Blender platform, a TwinMotion platform, etc., to form a common first-level (L1) white film.
[0140] Step 3: Artists join in at this point to complete the integration of art effects, such as staircase materials, lighting effects, model bodies, and post-production materials, to form a basic Level 2 (L2) model. Simultaneously, developers join in to complete data repairs, such as replacing old data or deleting redundant data.
[0141] Step 4: The final product of the first stage is formed: FBX / obj / 3ds and other model files.
[0142] 2. Processing layer
[0143] Step 1: The processing layer accesses the model file output by the production layer for secondary development. The main purpose at this time is to merge the data that requires inversion of control (IOC) and concrete expression, and the state + processing layer products into the overall required scenario. The merging method uses the virtual engine to complete the 3D scene creation.
[0144] Step 2: After completing the initial setup, you need to bind corresponding traditional capabilities, such as non-business logic capabilities such as lighting, day and night cycle, and weather system, as well as the scene effects in the night state, such as luminous textures and global illumination.
[0145] Step 3: Bind the actual business logic, such as POI information, corresponding POI distribution, and auxiliary but necessary functions such as roaming + lens offset.
[0146] Step 4: Fit the data dashboard with the scenario model as a whole and output it to the product layer.
[0147] Three: Product layer
[0148] Step 1: Bind the camera's built-in push capability plug-in to the scene and bind it to the remote streaming server.
[0149] Step 2: Bind the command receiving module to the scene and dynamically monitor the data from the IOC+ data dashboard.
[0150] Step 3: Package the entire package according to the corresponding platform and publish it to the corresponding address.
[0151] Step 4: Once completed, set the program startup method and corresponding power on / off status indicators and other general software parameters on the target platform. This is usually done using a BAT file for batch processing / registry processing.
[0152] The virtual engine graphics construction method of the embodiment of the present disclosure can bind data (for example, receive sensor data) through the processing layer and present it to the end user at the product layer.
[0153] An embodiment of the present disclosure also provides an Unreal Engine graphics construction device, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the Unreal Engine graphics construction method as described in any embodiment of the present disclosure based on the instructions stored in the memory.
[0154] As shown in Figure 12, in one example, an Unreal Engine graphics construction device may include: a processor 1210, a memory 1220, a bus system 1230, and a transceiver 1240. The processor 1210, memory 1220, and transceiver 1240 are connected via the bus system 1230. The memory 1220 is used to store instructions, and the processor 1210 is used to execute the instructions stored in the memory 1220 to control the transceiver 1240 to transmit and receive signals. Specifically, under the control of the processor 1210, the transceiver 1240 may receive data to be displayed. Based on the data to be displayed, the processor 1210 determines the number N of basic graphics to be constructed, where N>1. The processor 1210 then calls a low-level function in the blueprint layer to sequentially draw N of the basic graphics, and the low-level function is used to create the basic graphics.
[0155] It should be understood that the processor 1210 may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0156] The memory 1220 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1210. A portion of the memory 1220 may also include a non-volatile random access memory. For example, the memory 1220 may also store information about the device type.
[0157] In addition to the data bus, the bus system 1230 may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as the bus system 1230 in FIG.
[0158] During implementation, the processing performed by the processing device can be completed by the hardware integrated logic circuit in the processor 1210 or by instructions in the form of software. That is, the method steps of the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1220, and the processor 1210 reads the information in the memory 1220 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0159] The present disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the Unreal Engine graphics construction method described in any of the embodiments of the present disclosure. The method for driving Unreal Engine graphics construction by executing executable instructions is substantially the same as the Unreal Engine graphics construction method described in the aforementioned embodiments of the present disclosure and is not further described here.
[0160] In some possible implementations, various aspects of the Unreal Engine graphics construction method provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the Unreal Engine graphics construction method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the Unreal Engine graphics construction method recorded in the embodiments of the present application.
[0161] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0162] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0163] Although the embodiments disclosed in this disclosure are as described above, the contents described are merely embodiments adopted to facilitate understanding of the disclosure and are not intended to limit the present invention. Any person skilled in the art may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope of the disclosure. However, the scope of patent protection of the present invention shall still be based on the scope defined by the appended claims.
Claims
1. A method for constructing graphics in an Unreal Engine, comprising: Receive data to be displayed; Determine the number N of basic graphics included in the graphics to be constructed according to the data to be displayed, where N>1; The underlying function is called in the blue layer to draw N basic graphics in sequence, and the underlying function is used to create the basic graphics.
2. The method according to claim 1, wherein: The data to be displayed includes N non-zero target values, the graph is a columnar heat map, the basic graph is a rectangular body, and the sequential drawing of the N basic graphs includes: Determine the number of two-dimensional bases M included in the graph to be constructed according to the dimension N1 of the first data and the dimension N2 of the second data in the data to be displayed, where M=N1*N2; Determine the maximum target value and the minimum target value in the data to be displayed, and determine a coloring disk according to the determined maximum target value and the minimum target value, wherein the coloring disk includes a plurality of colors and a target data range corresponding to each color; N rectangular bodies are generated on a two-dimensional base corresponding to the N non-zero target values, the height of each rectangular body is determined according to the corresponding target value, and the color of each rectangular body is determined according to the color corresponding to the corresponding target value in the coloring disk.
3. The method according to claim 1, wherein: The data to be displayed includes statistical features of first data of N1 dimension and statistical features of second data of N2 dimension, the graph is a columnar heat map, the basic graph is a rectangular body, and sequentially drawing N basic graphs includes: Determine the number of two-dimensional bases M included in the graph to be constructed according to the dimension N1 of the first data and the dimension N2 of the second data in the data to be displayed, where M=N1*N2; According to the statistical characteristics of the first data of the N1 dimension and the statistical characteristics of the second data of the N2 dimension, the correlation coefficient between the first data of each dimension and the second data of each dimension is calculated to obtain a correlation coefficient matrix, wherein the correlation coefficient matrix includes N non-zero values; and a coloring disk is determined, wherein the data range corresponding to the coloring disk is between -1 and 1; N rectangular bodies are generated on the two-dimensional base corresponding to the N non-zero values, the height of each rectangular body is determined according to the corresponding correlation coefficient value, and the color of each rectangular body is determined according to the color corresponding to the corresponding correlation coefficient value in the coloring disk.
4. The method according to claim 2 or 3, wherein: Each of the rectangular bodies includes eight points, and the eight points include the zeroth point, the first point, the second point, the third point, the fourth point, the fifth point, the sixth point, and the seventh point; The zeroth point, the first point, the second point and the third point have the same Z-axis coordinates, the zeroth point, the third point, the fourth point and the seventh point have the same X-axis coordinates, and the second point, the third point, the sixth point and the seventh point have the same Y-axis coordinates; Generate a rectangular body, including: Calculate the coordinates of eight points of the rectangular body; The six faces of the rectangular body are generated in sequence, each face of the rectangular body is composed of two triangles, and each of the triangles is composed of three points among the eight points.
5. The method according to claim 4, wherein: The material of the rectangular body is exposed to the blueprint layer, and the material of the rectangular body is a transparent material or an opaque material.
6. The method according to claim 1, wherein: The data to be displayed includes N-dimensional data, the graph is a Nightingale rose graph, the basic graph is a sector, and sequentially drawing N basic graphs includes: Determine the coordinates of the center of the circle; Determine the angle of each sector in, Draw N sectors in sequence, and the starting angle of the i-th sector is The ending angle of the i-th sector is The outer diameter length of the i-th sector is determined according to the size of the target data value in the i-th dimension data, 1≤i≤N.
7. The method according to claim 6, wherein: Each of the sectors includes three points: the center, the starting point and the ending point; In each of the sectors, the angle between the line connecting the center of the circle and the starting point and the line connecting the center of the circle and the ending point is equal to the angle The length of the line connecting the center of the circle and the starting point is equal to the length of the line connecting the center of the circle and the ending point.
8. The method according to claim 6, wherein: The material and color of the fan are exposed to the blue layer, and the material of the fan is either a transparent material or an opaque material.
9. The method according to claim 1, wherein: The data to be displayed includes N-dimensional data, each dimensional data includes a plurality of discrete connection points, the graph is a multi-dimensional concurrent curve graph of a parallel coordinate system, the basic graph is a Bezier curve, and drawing the i-th basic graph includes: Get all discrete connection points in the i-th dimension data; Between every two adjacent discrete connection points, two control points are generated, wherein the two control points enable a sub-Bezier curve to be generated between the two adjacent discrete connection points, and the connection point between the two adjacent sub-Bezier curves and the control points on both sides of the connection point are collinear; A Bezier curve connecting all discrete connection points in the i-th dimensional data is generated according to the generated control points, and the connecting line between the connection point and the adjacent control point is tangent to the Bezier curve, 1≤i≤N.
10. The method according to claim 9, wherein: The material and color of the Bezier curve are exposed to the blue layer, and the material of the Bezier curve is a transparent material or an opaque material.
11. An Unreal Engine graphics construction device, comprising a memory; and a processor connected to the memory, the memory being used to store instructions, the processor being configured to execute the steps of the Unreal Engine graphics construction method as described in any one of claims 1 to 10 based on the instructions stored in the memory.
12. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the Unreal Engine graphics construction method according to any one of claims 1 to 10 is implemented.
