Virtual-real registration method and system for independent design model
By converting the data types of independently designed models and using custom registration components, the problem of spatial position offset of models in Unreal Engine was solved, and efficient model loading and development process optimization were achieved.
Patent Information
- Application Number
- CN202510631013.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-09-19
AI Technical Summary
When independently designed models are imported into the Unreal Engine, differences in coordinate systems can cause spatial position offsets, leading to low development efficiency and increased costs.
By converting the data types of independent design models, creating custom registration components, and using the PROJ library to calculate model weights and optimize offsets, automatic conversion and precise registration of coordinate systems can be achieved.
Significantly improve development efficiency, reduce costs, ensure model consistency from design to engine loading, and promote the rapid implementation and iteration of the digital twin platform.
Smart Images

Figure CN120673003A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of virtual-real registration, and in particular to a virtual-real registration method and system for an independent design model. Background Art
[0002] In the current digital scene development process, BIM technology is typically used to complete the detailed design and construction of the model, leveraging its parametric modeling capabilities to achieve precise control of complex structures and details. To achieve realistic scene display and interactive features, the model is then loaded into Unreal Engine, leveraging its powerful 3D rendering and physics simulation capabilities to carry out scene development and create an immersive digital twin environment.
[0003] However, independent design models often use an independent coordinate system to facilitate effect adjustment and optimization during the design process. This coordinate system is fundamentally different from the default spatial reference system of the Unreal Engine, resulting in serious spatial position offset problems when the model is imported into the Unreal Engine.
[0004] The currently commonly used manual pose adjustment method requires developers to repeatedly perform coordinate conversion, model positioning and other operations. The process is lengthy and cumbersome, which not only greatly reduces development efficiency, but also significantly increases the time and manpower cost investment of the project, becoming a key bottleneck restricting the rapid implementation and optimization iteration of the digital twin platform. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a virtual-reality registration method and system for independently designed models, which can avoid the tedious operation of manual adjustment, greatly improve development efficiency and reduce costs, and can also accurately solve the problem of model spatial position offset, thereby ensuring the continuity of the model from design to engine loading.
[0006] To solve the above technical problems, an embodiment of the present invention provides a virtual-real registration method for an independently designed model, comprising:
[0007] Convert the data type of the independent design model to obtain an engine-adapted independent design model;
[0008] Importing the engine-adapted independent design model into the Unreal Engine, and creating an entity object and a static mesh component thereof in the Unreal Engine scene;
[0009] Creating a custom registration component; the custom registration component is used to compile and call the PROJ library in the Unreal Engine, calculate the model weight of the engine adaptation independent design model, and then obtain the optimized offset of the engine adaptation independent design model based on the model weight;
[0010] Applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain registration model coordinates;
[0011] The engine-adapted independent design model is loaded into the Unreal Engine according to the registration model coordinates.
[0012] As an improvement to the above solution, converting the data type of the independent design model to obtain the engine-adapted independent design model includes:
[0013] Read metadata from the independent design model and construct an XML file; the metadata includes spatial reference, block structure and texture information;
[0014] Converting a first data type of the independently designed model into a second data type that can be directly loaded by the Unreal Engine;
[0015] An engine adaptation independent design model is obtained according to the XML file and the second data type.
[0016] As an improvement to the above solution, the engine-adapted independent design model is imported into the Unreal Engine, and an entity object and its static mesh component are created in the Unreal Engine scene, including:
[0017] Import engine-adapted independent design models into Unreal Engine;
[0018] Create Static Mesh components in Unreal Engine, with one Static Mesh component corresponding to each engine-adapted independent design model;
[0019] Create an Entity Object and add the Static Mesh Component to the Entity Object.
[0020] As an improvement to the above solution, when the number of independent design models adapted by the engine is greater than one, creating an entity object and adding the static mesh component to the entity object includes:
[0021] Creating an entity object, creating a static mesh component set based on the static mesh components corresponding to the independent design models adapted by each engine, and adding the static mesh component set to the entity object;
[0022] or,
[0023] Create the same number of entity objects as the independent design model adapted by the engine, and add the static mesh component to one of the entity objects without duplication, so that each entity object corresponds to a static mesh component.
[0024] As an improvement to the above solution, the step of creating a custom registration component includes:
[0025] Create a custom registration component, compile the PROJ library in Unreal Engine through the custom registration component, and call the target coordinate system information of the PROJ library;
[0026] Converting the independent coordinate system of the engine-adapted independent design model into the target coordinate system according to the target coordinate system information to obtain the initial model coordinates;
[0027] Calculate the minimum bounding box volume of each Static Mesh component that the engine can adapt to the independent design model;
[0028] Obtaining a model weight according to the minimum bounding box volume;
[0029] According to the model weights, the weighted distances from the initial model coordinates of the independent design model adapted to each engine and the coordinates of the minimum reference point are calculated to obtain the optimized offset.
[0030] As an improvement to the above solution, obtaining the model weight according to the minimum bounding box volume includes:
[0031] pass The calculation engine adapts the model weight of the independent design model i; where V i is the minimum bounding box volume of the engine-adapted independent design model i; n is the number of engine-adapted independent design models.
[0032] As an improvement to the above solution, the weighted distances from the initial model coordinates of the independent design model adapted to each engine and the coordinates of the minimum reference point are calculated based on the model weights to obtain the optimized offset, including:
[0033] pass Get the initial coordinates c of the reference point (0) ;
[0034] pass Establish the objective function;
[0035] According to the objective function, Performing a k+1th weighted iterative solution on the initial model coordinates to calculate the coordinate c of the reference point and obtain an optimized offset;
[0036] Among them, w i The model weight of the independent design model i for engine adaptation; p i =(x i ,y i ), p i is the initial model coordinate of the engine adaptation independent design model i; n is the number of engine adaptation independent design models.
[0037] As an improvement to the above solution, applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain the registration model coordinates includes:
[0038] Applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain an optimized offset corresponding to the static mesh component;
[0039] The initial model coordinates are offset according to the optimized offset to obtain the registration model coordinates.
[0040] As an improvement to the above solution, loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates includes:
[0041] Loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates;
[0042] An image base map layer is loaded into the Unreal Engine to verify the virtual-real registration result of the independent design model.
[0043] An embodiment of the present invention further provides a virtual-real registration system for an independent design model, comprising:
[0044] A data conversion module is used to convert the data type of the independent design model to obtain an engine-adapted independent design model;
[0045] A model import module, for importing the engine-adapted independent design model into the Unreal Engine, and creating an entity object and its static mesh component in the Unreal Engine scene;
[0046] A component creation module, configured to create a custom registration component; the custom registration component is configured to compile and call a PROJ library in the Unreal Engine, calculate a model weight for the engine to adapt to the independently designed model, and then obtain an optimized offset for the engine to adapt to the independently designed model based on the model weight;
[0047] A component calling module, configured to apply the custom registration component to the static mesh component and call the custom registration component through the entity object to obtain registration model coordinates;
[0048] A registration model loading module is used to load the engine adaptation independent design model into the Unreal Engine according to the registration model coordinates.
[0049] Compared with the prior art, the present invention discloses a virtual-real registration method and system for an independent design model. The method converts the data type of the independent design model to obtain an engine-adapted independent design model; imports the engine-adapted independent design model into the Unreal Engine, creates a physical object and its static mesh component in the Unreal Engine scene; creates a custom registration component; the custom registration component is used to compile and call the PROJ library in the Unreal Engine, calculate the model weight of the engine-adapted independent design model, and then obtain the optimized offset of the engine-adapted independent design model based on the model weight; applies the custom registration component to the static mesh component, and calls the custom registration component through the physical object to obtain the registration model coordinates; and loads the engine-adapted independent design model into the Unreal Engine based on the registration model coordinates. The embodiment of the present invention can avoid the tedious operation of manual adjustment, greatly improve development efficiency, reduce costs, and accurately solve the problem of model spatial position offset, ensuring the consistency of the model from design to engine loading. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a schematic flow chart of the steps of a virtual-real registration method for an independently designed model provided by an embodiment of the present invention;
[0051] Figure 2 This is a schematic diagram of a component calling relationship of an entity object provided by an embodiment of the present invention;
[0052] Figure 3 It is a structural diagram of a virtual-reality registration system for an independent design model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0054] In the description of the specification and claims, it should be understood that the terms "first," "second," etc., are used solely for descriptive purposes to distinguish between identical technical features and are not to be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to, nor do they necessarily describe a sequential or chronological order. The terms are interchangeable where appropriate. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one of those features.
[0055] As my country's emphasis on the display, utilization, preservation, and dynamic supervision of historical and cultural blocks continues to grow, digital technologies such as GIS, digital twins, and BIM have become crucial support for the intelligent display and renovation management of historical and cultural blocks. Independent design models, such as historical and cultural block models, are often constructed using independent coordinate systems during the design phase. However, this results in discrepancies between their coordinate information and Unreal Engine's default coordinate system, causing the models to be significantly offset when loaded into Unreal Engine.
[0056] Based on the above considerations, an embodiment of the present invention provides a virtual-real registration method for an independent design model. Figure 1 In this embodiment, the virtual-real registration method for an independent design model is specifically performed through steps S1 to S5:
[0057] S1. Convert the data type of the independent design model to obtain an engine-adapted independent design model.
[0058] It should be noted that independent design models come in a wide variety of data types. For example, historical and cultural block models include 3dmax, osgb, obj, FBX, and DataSmith. However, the native Unreal Engine only supports direct loading of FBX and DataSmith. Pre-processing of data types ensures that independent design models from various sources can be smoothly imported into the Unreal Engine, improving the system's compatibility and versatility.
[0059] S2. Importing the engine-adapted independent design model into the Unreal Engine, and creating an entity object and a static mesh component thereof in a scene of the Unreal Engine.
[0060] In Unreal Engine, Entity Objects (Actors) and Static Mesh (StaticMesh) components are the core elements for building 3D scenes. In the specific application of the embodiment of the present invention, Entity Object instances are created as the carrier of the model, and Static Mesh components are the main rendering components.
[0061] S3. Create a custom registration component; the custom registration component is used to compile and call the PROJ library in the Unreal Engine, calculate the model weight of the engine adaptation independent design model, and then obtain the optimized offset of the engine adaptation independent design model based on the model weight.
[0062] In an embodiment of the present invention, a custom registration component is creatively created. By compiling and calling the PROJ library within Unreal Engine, the powerful projection and coordinate transformation capabilities of the library can be leveraged to transform the model's independent coordinate system into the target coordinate system. Furthermore, by calculating and optimizing offsets, the model's position can be fine-tuned based on its characteristics and requirements, improving registration accuracy and ensuring that the model's position within Unreal Engine more closely matches actual requirements. Furthermore, the custom registration component can be packaged, enabling quick reuse across multiple projects.
[0063] S4. Apply the custom registration component to the static mesh component, and call the custom registration component through the entity object to obtain registration model coordinates.
[0064] By associating a custom registration component with a Static Mesh component, the custom registration component can modify or add properties and functionality to the Static Mesh component, achieving a binding effect with the Static Mesh component. This provides greater flexibility by eliminating the need to modify the underlying code of the Static Mesh component built into Unreal Engine.
[0065] S5. Loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates.
[0066] The above solution realizes automatic conversion of coordinate systems, avoiding tedious manual adjustments, greatly improving development efficiency and reducing costs. By combining metadata with custom registration components, it can accurately solve the problem of spatial position offset of the model, ensure the consistency of the model from design to engine loading, and promote the implementation and iteration of the digital twin platform.
[0067] As a preferred embodiment, step S1, converting the data type of the independent design model to obtain the engine-adapted independent design model, includes:
[0068] Read metadata from the independent design model and construct an XML file; the metadata includes spatial reference, block structure and texture information;
[0069] Converting a first data type of the independently designed model into a second data type that can be directly loaded by the Unreal Engine;
[0070] An engine adaptation independent design model is obtained according to the XML file and the second data type.
[0071] In an embodiment of the present invention, in order to avoid data loss during subsequent operations, the metadata is first read and an XML file is created, which can provide the necessary basic data for correctly creating and processing the model in the Unreal Engine, ensuring that the creation and display of the model in the Unreal Engine can accurately reflect the spatial characteristics, structure and appearance of its original design, and help to achieve accurate virtual-reality alignment.
[0072] Considering that the data types of the independent design model may differ from those supported by the Unreal Engine, the embodiment of the present invention converts the data types of the independent design model before importing it into the Unreal Engine, and combines it with the XML file to obtain an engine-adapted independent design model. For example, 3dsmax is used for data conversion.
[0073] As a preferred embodiment, step S2, importing the engine-adapted independent design model into the Unreal Engine, and creating an entity object and its static mesh component in the Unreal Engine scene, includes:
[0074] Import engine-adapted independent design models into Unreal Engine;
[0075] Create Static Mesh components in Unreal Engine, with one Static Mesh component corresponding to each engine-adapted independent design model;
[0076] Create an Entity Object and add the Static Mesh Component to the Entity Object.
[0077] It's important to note that assigning a separate Static Mesh component to each model ensures the independence of this data, preventing data from different models from being mixed up or interfering with each other. This allows for clear location of specific model data during model editing, modification, and maintenance, improving data management efficiency and accuracy. It also makes updating model data more convenient.
[0078] Furthermore, preferably, when the number of independent design models adapted by the engine is greater than one, creating an entity object and adding the static mesh component to the entity object includes:
[0079] Creating an entity object, creating a static mesh component set based on the static mesh components corresponding to the independent design models adapted by each engine, and adding the static mesh component set to the entity object;
[0080] or,
[0081] Create the same number of entity objects as the independent design model adapted by the engine, and add the static mesh component to one of the entity objects without duplication, so that each entity object corresponds to a static mesh component.
[0082] It's understood that in this embodiment, the engine adapts a one-to-one correspondence between independent design models and Static Mesh components. However, multiple Static Mesh components can belong to the same entity object or have a one-to-one correspondence with entity objects. The specific number of entity objects is determined by the interaction requirements and the relevance of the model.
[0083] For example, when multiple engines adapt independent design models that are closely related logically, such as when they together form a complete building scene and require unified movement, rotation, scaling, and other operations, it is more convenient to use a single entity object to manage the collection of Static Mesh components for all models. On the other hand, when each engine adapts an independent design model that needs to interact independently with other elements in the scene, and the interaction logic is different, creating a separate entity object for each model can better achieve this fine-grained control.
[0084] In other preferred embodiments, multiple entity objects may be constructed, each entity object including at least one static mesh component. If a static mesh component is included in an entity object, it is added in the form of a static mesh component collection.
[0085] As a preferred embodiment, step S3, creating a custom registration component, is performed through steps S31-S35:
[0086] S31. Create a custom registration component, compile the PROJ library in the Unreal Engine through the custom registration component, and call the target coordinate system information of the PROJ library;
[0087] S32, converting the independent coordinate system of the engine-adapted independent design model into the target coordinate system according to the target coordinate system information to obtain initial model coordinates;
[0088] S33. Calculate the minimum bounding box volume of the engine-adapted independent design model corresponding to each static mesh component;
[0089] S34, obtaining a model weight according to the minimum bounding box volume;
[0090] S35. Calculate the weighted distances between the initial model coordinates of the independent design model adapted to each engine and the coordinates of the minimum reference point based on the model weights to obtain an optimized offset.
[0091] It should be noted that the Unreal Engine itself lacks coordinate conversion functionality and the ability to process independent coordinate systems. This embodiment integrates coordinate conversion and processing capabilities into the Unreal Engine by encapsulating the compilation and invocation of the PROJ library within a custom registration component. However, the initial model coordinates derived from the PROJ library's target coordinate system information are still inaccurate and require further correction.
[0092] It should also be noted that the initial model coordinates correspond to the center point of the engine adaptation independent design model.
[0093] In some preferred embodiments, the target coordinate system is an ESPG coordinate system, and the target coordinate system information includes WebMercator projection parameters. For example, the ESPG coordinate system is specifically ESPG:3857.
[0094] Preferably, when converting the independent coordinate system of the engine-adapted independent design model to the target coordinate system, the metadata XML file is parsed and read to set the spatial reference in Unreal Engine. The spatial reference includes the projection type, central meridian, origin latitude, ellipsoid, and coordinate units. In some preferred embodiments, the calculated optimized offset is also written to the XML file.
[0095] The minimum bounding box volume reflects the geometric characteristics of the model. Models of different volumes have different model weights during the registration process. This quantitative method allows for more precise model analysis and processing. Further calculation of the weighted distance from each initial model coordinate and the minimum reference point coordinates is used to obtain the optimized offset. This comprehensively considers the position and weight information of all models and finds the optimal reference point that minimizes the sum of the weighted distances of each model at that reference point. This optimized offset can be used to adjust the position of the model for more precise registration, reducing deviation and overlap between models, improving the accuracy and quality of registration, and making the combination of models in Unreal Engine more reasonable and natural.
[0096] Furthermore, preferably, step S34, obtaining a model weight according to the minimum bounding box volume, includes:
[0097] pass The calculation engine adapts the model weight of the independent design model i; where V i is the minimum bounding box volume of the engine-adapted independent design model i; n is the number of engine-adapted independent design models.
[0098] In the above scheme, model weights reflect the relative importance of the engine's independently designed models within the overall model set. Larger models have a higher weight and a higher proportion of the overall model set, receiving more attention in subsequent registration calculations. This reflects the relative relationship between models, helps to more rationally allocate computing resources and focus, and improves registration results.
[0099] Preferably, step S35, calculating the weighted distances between the initial model coordinates of the independent design model adapted to each engine and the coordinates of the minimum reference point according to the model weights to obtain the optimized offset, includes:
[0100] pass Get the initial coordinates c of the reference point (0) ;
[0101] pass Establish the objective function;
[0102] According to the objective function, Performing a k+1th weighted iterative solution on the initial model coordinates to calculate the coordinate c of the reference point and obtain an optimized offset;
[0103] Among them, w i The model weight of the independent design model i for engine adaptation; p i =(x i ,y i ), p i is the initial model coordinate of the engine adaptation independent design model i; n is the number of engine adaptation independent design models.
[0104] In the embodiment of the present invention, the weighted arithmetic mean center is selected as the initial coordinate value of the reference point, and the coordinates of the reference point are iteratively solved based on the constraints of the objective function. The coordinates of the reference point finally obtained can reflect the offset degree of the engine adaptation independent design model in the Unreal Engine, and the optimized offset value (c x ,c y ).
[0105] Furthermore, after calling the custom registration component, the Unreal Engine can calculate the registration model coordinates according to the initial model coordinates and the optimized offset.
[0106] In some preferred embodiments, by x i ′ =x i -c x 、y i ′ =y i -c y Calculate the registration model coordinates p i ′ =(x i ′ ,y i ′ ).
[0107] As a preferred embodiment, step S4, applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain registration model coordinates, includes:
[0108] Applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain an optimized offset corresponding to the static mesh component;
[0109] The initial model coordinates are offset according to the optimized offset to obtain the registration model coordinates.
[0110] See Figure 2 The entity object includes its inherent static mesh component and a custom registration component created using an embodiment of the present invention. By applying the custom registration component to the static mesh component, the coordinate variables defined in the static mesh component can be updated when the custom registration component is called.
[0111] As a preferred embodiment, step S5, loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates, includes:
[0112] Loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates;
[0113] An image base map layer is loaded into the Unreal Engine to verify the virtual-real registration result of the independent design model.
[0114] As can be understood, the coordinate information of the layer also has a geographic reference. Therefore, in the embodiment of the present invention, in addition to loading the 3D engine-adapted independent design model, it is also possible to load the vector layer in the Unreal Engine through a network service to more intuitively verify the virtual-real registration results. More preferably, the parameters of the Unreal Engine are adjusted based on the virtual-real registration results.
[0115] The virtual-reality registration method for independently designed models provided by an embodiment of the present invention can realize automatic conversion of coordinate systems, avoid tedious manual adjustment operations, greatly improve development efficiency and reduce costs; and by combining metadata with custom registration components, it can accurately solve the problem of model spatial position offset, ensure the consistency of the model from design to engine loading, and promote the implementation and iteration of the digital twin platform.
[0116] The embodiment of the present invention provides a virtual-real registration system for independently designed models. Figure 3 The virtual-real registration system for an independent design model includes a data conversion module 11, a model import module 12, a component creation module 13, a component calling module 14 and a registration model loading module 15, wherein:
[0117] The data conversion module 11 is used to convert the data type of the independent design model to obtain an engine-adapted independent design model;
[0118] A model import module 12 is used to import the engine-adapted independent design model into the Unreal Engine, and create a physical object and its static mesh component in the Unreal Engine scene;
[0119] A component creation module 13 is used to create a custom registration component; the custom registration component is used to compile and call the PROJ library in the Unreal Engine, calculate the model weight of the engine adaptation independent design model, and then obtain the optimized offset of the engine adaptation independent design model based on the model weight;
[0120] A component calling module 14 is configured to apply the custom registration component to the static mesh component and call the custom registration component through the entity object to obtain registration model coordinates;
[0121] The registration model loading module 15 is used to load the engine adaptation independent design model into the Unreal Engine according to the registration model coordinates.
[0122] As a preferred embodiment, the data conversion module 11 is specifically configured to:
[0123] Read metadata from the independent design model and construct an XML file; the metadata includes spatial reference, block structure and texture information;
[0124] Converting a first data type of the independently designed model into a second data type that can be directly loaded by the Unreal Engine;
[0125] An engine adaptation independent design model is obtained according to the XML file and the second data type.
[0126] As a preferred embodiment, the model importing module 12 includes:
[0127] Model import unit, used to import engine-adapted independent design models into Unreal Engine;
[0128] Static Mesh Component Creation Unit, used to create Static Mesh Components in Unreal Engine. Each engine-adapted independent design model corresponds to a Static Mesh Component.
[0129] An entity object creation unit is used to create an entity object and add the static mesh component to the entity object.
[0130] Furthermore, preferably, the entity object creation unit is specifically configured to:
[0131] Creating an entity object, creating a static mesh component set based on the static mesh components corresponding to the independent design models adapted by each engine, and adding the static mesh component set to the entity object;
[0132] or,
[0133] Create the same number of entity objects as the independent design model adapted by the engine, and add the static mesh component to one of the entity objects without duplication, so that each entity object corresponds to a static mesh component.
[0134] As a preferred embodiment, the component creation module 13 includes:
[0135] The library integration unit is used to create a custom registration component, compile the PROJ library in the Unreal Engine through the custom registration component, and call the target coordinate system information of the PROJ library;
[0136] A coordinate conversion unit, configured to convert the independent coordinate system of the engine-adapted independent design model into the target coordinate system according to the target coordinate system information to obtain initial model coordinates;
[0137] Volume calculation unit, used to calculate the minimum bounding box volume of each static mesh component corresponding to the engine-adapted independent design model;
[0138] A model weight calculation unit, configured to obtain a model weight according to the minimum bounding box volume;
[0139] The optimized offset calculation unit is used to calculate the weighted distance between the initial model coordinates of the independent design model adapted to each engine and the coordinates of the minimum reference point according to the model weight to obtain the optimized offset.
[0140] Furthermore, preferably, the model weight calculation unit is specifically used to:
[0141] pass The calculation engine adapts the model weight of the independent design model i; where V i is the minimum bounding box volume of the engine-adapted independent design model i; n is the number of engine-adapted independent design models.
[0142] Preferably, the optimization offset calculation unit is specifically used to:
[0143] pass Get the initial coordinates c of the reference point (0) ;
[0144] pass Establish the objective function;
[0145] According to the objective function, Performing a k+1th weighted iterative solution on the initial model coordinates to calculate the coordinate c of the reference point and obtain an optimized offset;
[0146] Among them, w iThe model weight of the independent design model i for engine adaptation; p i =(x i ,y i ), p i is the initial model coordinate of the engine adaptation independent design model i; n is the number of engine adaptation independent design models.
[0147] As a preferred implementation, the component calling module 14 is specifically configured to:
[0148] Applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain an optimized offset corresponding to the static mesh component;
[0149] The initial model coordinates are offset according to the optimized offset to obtain the registration model coordinates.
[0150] As a preferred embodiment, the registration model loading module 15 is specifically used to:
[0151] Loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates;
[0152] An image base map layer is loaded into the Unreal Engine to verify the virtual-real registration result of the independent design model.
[0153] The virtual-reality registration system for independently designed models provided by the embodiment of the present invention can realize automatic conversion of coordinate systems, avoid tedious manual adjustment operations, greatly improve development efficiency and reduce costs; and by combining metadata with custom registration components, it can accurately solve the problem of model spatial position offset, ensure the consistency of the model from design to engine loading, and promote the implementation and iteration of the digital twin platform.
[0154] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0155] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A virtual-real registration method for an independently designed model, characterized in that: include: Convert the data type of the independent design model to obtain an engine-adapted independent design model; Importing the engine-adapted independent design model into the Unreal Engine, and creating an entity object and a static mesh component thereof in the Unreal Engine scene; Creating a custom registration component; the custom registration component is used to compile and call the PROJ library in the Unreal Engine, calculate the model weight of the engine adaptation independent design model, and then obtain the optimized offset of the engine adaptation independent design model based on the model weight; Applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain registration model coordinates; The engine-adapted independent design model is loaded into the Unreal Engine according to the registration model coordinates.
2. A virtual-real registration method for an independent design model according to claim 1, characterized in that: The data type of the independent design model is converted to obtain the engine-adapted independent design model, including: Read metadata from the independent design model and construct an XML file; the metadata includes spatial reference, block structure and texture information; Converting a first data type of the independently designed model into a second data type that can be directly loaded by the Unreal Engine; An engine adaptation independent design model is obtained according to the XML file and the second data type.
3. The virtual-real registration method for an independent design model according to claim 1, wherein: Importing the engine-adapted independent design model into the Unreal Engine, and creating an entity object and its static mesh component in the Unreal Engine scene, includes: Import engine-adapted independent design models into Unreal Engine; Create Static Mesh components in Unreal Engine, with one Static Mesh component corresponding to each engine-adapted independent design model; Create an Entity Object and add the Static Mesh Component to the Entity Object.
4. A virtual-real registration method for an independent design model according to claim 3, characterized in that: When the number of independent design models adapted by the engine is greater than one, creating an entity object and adding the static mesh component to the entity object includes: Creating an entity object, creating a static mesh component set based on the static mesh components corresponding to the independent design models adapted by each engine, and adding the static mesh component set to the entity object; or, Create the same number of entity objects as the independent design model adapted by the engine, and add the static mesh component to one of the entity objects without duplication, so that each entity object corresponds to a static mesh component.
5. The virtual-real registration method for an independent design model according to claim 1, wherein: The step of creating a custom registration component includes: Create a custom registration component, compile the PROJ library in Unreal Engine through the custom registration component, and call the target coordinate system information of the PROJ library; Converting the independent coordinate system of the engine-adapted independent design model into the target coordinate system according to the target coordinate system information to obtain the initial model coordinates; Calculate the minimum bounding box volume of each Static Mesh component that the engine can adapt to the independent design model; Obtaining a model weight according to the minimum bounding box volume; According to the model weights, the weighted distances from the initial model coordinates of the independent design model adapted to each engine and the coordinates of the minimum reference point are calculated to obtain the optimized offset.
6. A virtual-real registration method for an independent design model according to claim 5, characterized in that: Obtaining a model weight according to the minimum bounding box volume includes: pass The calculation engine adapts the model weight of the independent design model i; where V i is the minimum bounding box volume of the engine-adapted independent design model i; n is the number of engine-adapted independent design models.
7. The virtual-real registration method for an independent design model according to claim 5, characterized in that: The step of calculating the weighted distance between the initial model coordinates of the independent design model adapted to each engine and the coordinates of the minimum reference point according to the model weights to obtain the optimized offset includes: pass Get the initial coordinates c of the reference point (0) ; pass Establish the objective function; According to the objective function, Performing a k+1th weighted iterative solution on the initial model coordinates to calculate the coordinate c of the reference point and obtain an optimized offset; Among them, w i The model weight of the independent design model i for engine adaptation; p i =(x i ,y i ), p i is the initial model coordinate of the engine adaptation independent design model i; n is the number of engine adaptation independent design models.
8. The virtual-real registration method for an independent design model according to claim 5, wherein: The step of applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain registration model coordinates includes: Applying the custom registration component to the static mesh component and calling the custom registration component through the entity object to obtain an optimized offset corresponding to the static mesh component; The initial model coordinates are offset according to the optimized offset to obtain the registration model coordinates.
9. The virtual-real registration method for an independent design model according to claim 1, wherein: The step of loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates includes: Loading the engine-adapted independent design model into the Unreal Engine according to the registration model coordinates; An image base map layer is loaded into the Unreal Engine to verify the virtual-real registration result of the independent design model.
10. A virtual-real registration system for an independent design model, characterized in that: include: A data conversion module is used to convert the data type of the independent design model to obtain an engine-adapted independent design model; A model import module, for importing the engine-adapted independent design model into the Unreal Engine, and creating an entity object and its static mesh component in the Unreal Engine scene; Component creation module, used to create custom registration components; The custom registration component is used to compile and call the PROJ library in the Unreal Engine, calculate the model weight of the engine adaptation independent design model, and then obtain the optimized offset of the engine adaptation independent design model according to the model weight; A component calling module, configured to apply the custom registration component to the static mesh component and call the custom registration component through the entity object to obtain registration model coordinates; A registration model loading module is used to load the engine adaptation independent design model into the Unreal Engine according to the registration model coordinates.