Method, device and medium suitable for unreal engine three-dimensional visualized vector data

By directly loading and rendering vector data in Unreal Engine, the problem of loading and updating vector data in Unreal Engine is solved, simplifying the process and shape restoration, and supporting dynamic display of multiple formats.

CN116310170BActive Publication Date: 2026-05-15SICHUAN CHUANGSHU SMART TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SICHUAN CHUANGSHU SMART TECH CO LTD
Filing Date
2023-03-03
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies cannot directly load and dynamically update vector data in Unreal Engine, nor can they fully restore the shape and attributes of vector data. The operation is complicated and depends on other engines.

Method used

Vector data files can be directly loaded into Unreal Engine. Through reading, cleaning, and offset processing, the points, lines, and polygons of the vector data are rendered into a 3D scene. It supports shp, kml, dxf, gdb, and mdb formats and enables dynamic updates.

Benefits of technology

It simplifies the loading and rendering process of vector data, supports multiple formats, can completely restore the shape and elements of vector data, and supports dynamic update display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310170B_ABST
    Figure CN116310170B_ABST
Patent Text Reader

Abstract

The application discloses a kind of method, equipment and medium suitable for unreal engine three-dimensional visual vector data, wherein method includes the following steps: vector data reading: obtain vector data file path, judge whether the data corresponding to path is vector data format, if yes, then data reading is carried out;Obtain coordinate system information, judge whether point coordinate is projected, if not, then geographic coordinate is converted into plane coordinate;Vector data cleaning: judge whether the vector data obtained is line or polygon with quantity greater than 3, if yes, then redundant point with equal slope is eliminated;Vector data offset: the vector data obtained by cleaning is offset based on the coordinate system of three-dimensional scene of unreal engine, to obtain the coordinate under unreal engine;Vector data three-dimensional presentation: the point line surface represented by the vector data obtained by offset is rendered into three-dimensional scene, and the corresponding effect is superimposed.The application greatly simplifies production process, and can realize vector data loading, presentation automation processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic digital data processing technology, and in particular to a method, apparatus and medium suitable for 3D visualization vector data in Unreal Engine. Background Technology

[0002] Unreal Engine is a 3D rendering engine widely used in the field of digital twins, such as smart cities and smart parks. Vector data, on the other hand, represents the real location, shape, and attributes of geographic entities by recording coordinates, and is a widely used geographic information data format.

[0003] In the 3D scenes of digital twin projects built using Unreal Engine, it is essential to accurately represent geographical information such as landmarks, routes, and boundaries. Unreal Engine does not provide tools specifically for this purpose. A common solution is: 1. Import vector data using engines like Houdini; 2. Create models representing routes or boundaries based on the generated points, lines, and polygons; 3. Import these models into Unreal Engine and apply the corresponding effects. This approach relies on another engine, is cumbersome, does not support dynamic updates, cannot access the attributes of the vector data, and cannot fully recreate the shapes represented by the vector data. Summary of the Invention

[0004] To address the aforementioned issues, this invention proposes a method, device, and medium for 3D visualization of vector data in Unreal Engine. This method allows for the direct loading of vector data files into Unreal Engine, dynamic rendering of corresponding models, and presentation of points, lines, and polygons from the vector data into a 3D scene.

[0005] The technical solution adopted in this invention is as follows:

[0006] A method for visualizing vector data in 3D using Unreal Engine includes the following steps:

[0007] S1. Vector data reading: Obtain the vector data file path, determine whether the data corresponding to the path is in vector data format, if so, read the data, the reading content includes the point coordinates and attribute fields of the vector data; obtain coordinate system information, determine whether the point coordinates have been projected, if not, set the target projection coordinate system, convert the geographic coordinates into planar coordinates, and obtain the converted vector data;

[0008] S2. Vector data cleaning: Determine whether the vector data obtained in step S1 is a line or polygon with more than 3 elements. If so, traverse the points and calculate the slope between each point and its adjacent points, and remove redundant points with equal slopes.

[0009] S3. Vector data offset: The vector data obtained in step S2 is offset based on the coordinate system of the Unreal Engine's 3D scene to obtain the coordinates under Unreal Engine;

[0010] S4. 3D rendering of vector data: The points, lines, and polygons represented by the vector data obtained from the offset in step S3 are rendered into a 3D scene, and corresponding effects are superimposed to achieve 3D visualization of vector data.

[0011] Further, step S1 includes the following sub-steps:

[0012] S101. Vector data file selection: Obtain the vector data file path, and determine whether the data corresponding to the path is in vector data format. If so, read the data.

[0013] S102. Vector coordinate reading: Traverse each feature under each layer, obtain the geometric structure type under each feature, and store the position coordinates into the corresponding data structure according to the classification method of points, lines and polygons;

[0014] S103. Vector Attribute Reading: Obtain the attribute table structure of the layer, traverse each feature under each layer, obtain the attribute fields under each feature, and store them into the corresponding data structure according to the attribute field type;

[0015] S104. Vector coordinate transformation: Obtain coordinate system information, determine whether the coordinates of the point have been projected, if not, set the target projection coordinate system, convert the geographic coordinates into planar coordinates, and obtain the transformed coordinate data.

[0016] Furthermore, in step S101, the vector data format includes shp, kml, dxf, gdb, and mdb formats.

[0017] Further, in step S104, the method for converting geographic coordinates into planar coordinates includes conversion using a projection function algorithm, wherein the projection function algorithm includes transverse Mercator projection.

[0018] Furthermore, in step S4, the methods for rendering vector data include point rendering, line rendering, surface rendering, and 3D model rendering.

[0019] Furthermore, the point rendering includes: in Unreal Engine, performing vertical ray detection based on the point coordinates, finding the corresponding point in the 3D scene and generating a point object, and creating point labels.

[0020] Furthermore, the line rendering includes: in Unreal Engine, traversing the point coordinates, performing vertical ray detection to obtain a list of points mapped in the 3D scene, calculating vertex coordinates, vertex indices, and UV coordinates, generating a static mesh model of the line, assigning appropriate materials, and creating boundary range markers as required.

[0021] Furthermore, the surface rendering includes: in Unreal Engine, using the ear-cutting method to cut the polygonal face represented by the point array of the face into several triangles, obtaining the vertex coordinates and vertex indices, then constructing a static mesh surface, assigning corresponding materials, and creating area markers as required.

[0022] Furthermore, the 3D model rendering includes: in Unreal Engine, firstly, using surface rendering to obtain the coordinates and indexes of the top vertex, then obtaining the coordinates and indexes of the bottom vertex based on the height offset, calculating the coordinates and indexes of the side vertex, generating a 3D static mesh model, assigning appropriate materials, and creating markings as required.

[0023] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above for 3D visualization vector data in Unreal Engine.

[0024] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above for 3D visualization vector data in Unreal Engine.

[0025] The beneficial effects of this invention are as follows:

[0026] This invention can directly load vector data files in Unreal Engine and dynamically render the corresponding models, presenting the points, lines, and polygons of the vector data in a 3D scene. This invention greatly simplifies the production process, automates vector data loading and rendering, supports common formats such as shp, kml, dxf, gdb, and mdb, completely reproduces the shapes and elements represented by the vector data, and supports dynamic updates and display of the vector data. Attached Figure Description

[0027] Figure 1 This is a flowchart of a method for visualizing vector data in Unreal Engine according to Embodiment 1 of the present invention.

[0028] Figure 2 This is a schematic diagram of vector data cleaning in Embodiment 1 of the present invention.

[0029] Figure 3 This is a line rendering schematic diagram of Embodiment 1 of the present invention.

[0030] Figure 4 This is a schematic diagram of the ear-cutting method used in Embodiment 1 of the present invention to cut polygons into triangular meshes.

[0031] Figure 5 This is a schematic diagram of surface rendering of Embodiment 1 of the present invention.

[0032] Figure 6 This is a schematic diagram of the 3D model rendering of Embodiment 1 of the present invention. Detailed Implementation

[0033] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments are now described. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention; that is, the described embodiments are only a part of the embodiments of the invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0034] Example 1

[0035] like Figure 1 As shown, this embodiment provides a method for visualizing vector data in 3D using Unreal Engine, including the following steps:

[0036] S1. Vector Data Reading: Obtain the vector data file path, determine whether the data corresponding to the path is in vector data format, and if so, read the data, including the point coordinates and attribute fields of the vector data; obtain coordinate system information, determine whether the point coordinates have been projected, and if not, set the target projection coordinate system, convert the geographic coordinates into planar coordinates, and obtain the converted vector data.

[0037] S2. Vector Data Cleaning: Determine if the vector data obtained in step S1 consists of lines or polygons with more than 3 elements. If so, traverse the points and calculate the slope between each point and its adjacent points. Remove redundant points with equal slopes, such as... Figure 2 As shown;

[0038] S3. Vector data offset: The vector data obtained in step S2 is offset based on the coordinate system of the Unreal Engine's 3D scene to obtain the coordinates under Unreal Engine;

[0039] S4. 3D rendering of vector data: The points, lines, and polygons represented by the vector data obtained from the offset in step S3 are rendered into a 3D scene, and corresponding effects are superimposed to achieve 3D visualization of vector data.

[0040] Commonly used vector data formats include shp, kml, dxf, gdb, and mdb. This embodiment reads different types of vector data without differentiation through a single entry point. Preferably, step S1 includes the following sub-steps:

[0041] S101. Vector data file selection: Obtain the path to the vector data file, and determine whether the data corresponding to the path is in vector data format. If so, read the data.

[0042] S102. Vector Coordinate Reading: Traverse each feature under each layer, obtain the geometric structure type under each feature, and store the position coordinates into the corresponding data structure according to the classification method of points, lines, and polygons.

[0043] S103. Vector Attribute Reading: Obtain the attribute table structure OGRFeatureDefn of the layer, traverse each feature under each layer, obtain the attribute fields under each feature, and store them into the corresponding data structure according to the attribute field type.

[0044] Vector data has two types of coordinates: geographic coordinates (represented by latitude and longitude) and planar coordinates. The geographic coordinate system may be CS_WGS_1984, GCS_CN_2000, etc. The geographic coordinates need to be converted to planar coordinates in the target projected coordinate system. The conversion method is as follows:

[0045] S104. Vector Coordinate Transformation: Obtain coordinate system information, determine whether the point coordinates have been projected, and if not, set the target projection coordinate system, convert the geographic coordinates into planar coordinates, and obtain the transformed coordinate data. Preferably, the method for converting geographic coordinates into planar coordinates includes conversion using a projection function algorithm, such as the transverse Mercator projection.

[0046] Preferably, in step S4, the methods for rendering vector data include point rendering, line rendering, surface rendering, and 3D model rendering.

[0047] More preferably, point rendering includes: in Unreal Engine, performing vertical ray detection based on point coordinates, finding the corresponding point in the 3D scene and generating point objects, and creating point labels.

[0048] More preferably, such as Figure 3 As shown, line rendering includes: in Unreal Engine, traversing the coordinates of points, performing vertical ray detection, obtaining a list of points mapped in the 3D scene, calculating vertex coordinates, vertex indices, and UV coordinates, generating a static mesh model of the line, assigning appropriate materials, and creating boundary range markers as required.

[0049] More preferably, such as Figure 4 and Figure 5 As shown, surface rendering includes: in Unreal Engine, using the ear-cutting method to cut the polygonal face represented by the point array of the face into several triangles, obtaining the vertex coordinates and vertex indices, then constructing a static mesh surface, assigning the corresponding materials, and creating area markers as required.

[0050] More preferably, such as Figure 6As shown, 3D rendering includes: in Unreal Engine, firstly, the vertex coordinates and indices of the top face are obtained using the face rendering method, then the vertex coordinates and indices of the bottom face are obtained based on the height offset, the vertex coordinates and indices of the side faces are calculated, a 3D static mesh model is generated, appropriate materials are applied, and logos are created according to requirements.

[0051] Example 2

[0052] This embodiment is based on embodiment 1:

[0053] This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method for 3D visualization vector data applicable to Unreal Engine 1 as described in Embodiment 1. The computer program can be in the form of source code, object code, executable file, or some intermediate form.

[0054] Example 3

[0055] This embodiment is based on embodiment 1:

[0056] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method for 3D visualization vector data in Unreal Engine 1. The computer program can be in the form of source code, object code, executable file, or some intermediate form. The storage medium includes any entity or device capable of carrying computer program code, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. It should be noted that the content of the storage medium can be appropriately added to or subtracted according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the storage medium does not include electrical carrier signals and telecommunication signals.

[0057] It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

Claims

1. A method for visualizing vector data in 3D using Unreal Engine, characterized in that, Includes the following steps: S1. Vector data reading: Obtain the vector data file path, determine whether the data corresponding to the path is in vector data format, and if so, read the data, including the point coordinates and attribute fields of the vector data; Obtain coordinate system information, determine whether the point coordinates have been projected, if not, set the target projection coordinate system, convert the geographic coordinates into planar coordinates, and obtain the converted vector data; S2. Vector data cleaning: Determine whether the vector data obtained in step S1 is a line or polygon with more than 3 elements. If so, traverse the points and calculate the slope between each point and its adjacent points, and remove redundant points with equal slopes. S3. Vector Data Offset: Offset the vector data obtained in step S2 based on the coordinate system of the Unreal Engine's 3D scene to obtain the coordinates under Unreal Engine; S4. 3D rendering of vector data: The points, lines, and polygons represented by the vector data obtained from the offset in step S3 are rendered into a 3D scene, and corresponding effects are superimposed to achieve 3D visualization of vector data; Step S1 includes the following sub-steps: S101. Vector data file selection: Obtain the path of the vector data file, and determine whether the data corresponding to the path is in vector data format. If so, read the data. S102. Vector coordinate reading: Traverse each feature under each layer, obtain the geometric structure type under each feature, and store the position coordinates into the corresponding data structure according to the classification method of points, lines, and polygons; S103. Vector Attribute Reading: Obtain the attribute table structure of the layer, traverse each feature under each layer, obtain the attribute fields under each feature, and store them into the corresponding data structure according to the attribute field type; S104. Vector coordinate transformation: Obtain coordinate system information, determine whether the coordinates of the point have been projected, if not, set the target projection coordinate system, convert the geographic coordinates into planar coordinates, and obtain the transformed coordinate data; In step S4, the methods for rendering vector data include point rendering, line rendering, surface rendering, and 3D model rendering. The point rendering includes: in Unreal Engine, performing vertical ray detection based on point coordinates to obtain points mapped in the 3D scene and generating point objects, and creating point labels; The line rendering includes: in Unreal Engine, traversing point coordinates, performing vertical ray detection, obtaining a list of points mapped in the 3D scene, calculating vertex coordinates, vertex indexes, and UV coordinates, generating a static mesh model of the line, assigning appropriate materials, and creating boundary range markers as required. The surface rendering includes: in Unreal Engine, using the ear-cutting method to cut the polygonal face represented by the point array into several triangles, obtaining vertex coordinates and vertex indices, then constructing a static mesh surface, assigning corresponding materials, and creating region markers as needed; the 3D model rendering includes: in Unreal Engine, using the surface rendering method to obtain the vertex coordinates and indices of the top face, obtaining the vertex coordinates and indices of the bottom face based on the height offset, calculating the vertex coordinates and indices of the side faces, generating a 3D static mesh model, assigning corresponding materials, and creating markers as needed.

2. The method for visualizing vector data in Unreal Engine according to claim 1, characterized in that, In step S101, the vector data format includes shp, kml, dxf, gdb, and mdb formats.

3. The method for visualizing vector data in Unreal Engine according to claim 1, characterized in that, In step S104, the method for converting geographic coordinates into planar coordinates includes conversion using a projection function algorithm, wherein the projection function algorithm includes transverse Mercator projection.

4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for three-dimensional visualization vector data of Unreal Engine as described in any one of claims 1-3.

5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for three-dimensional visualization vector data of Unreal Engine as described in any one of claims 1-3.