CN113094546A - Simulation animation model loading method and device and simulation equipment - Google Patents

Simulation animation model loading method and device and simulation equipment Download PDF

Info

Publication number
CN113094546A
CN113094546A CN202110454025.9A CN202110454025A CN113094546A CN 113094546 A CN113094546 A CN 113094546A CN 202110454025 A CN202110454025 A CN 202110454025A CN 113094546 A CN113094546 A CN 113094546A
Authority
CN
China
Prior art keywords
file
model
index
bounding box
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110454025.9A
Other languages
Chinese (zh)
Other versions
CN113094546B (en
Inventor
谭亮
吴钊
张大鹏
王舜琰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingwei Hirain Tech Co Ltd
Original Assignee
Beijing Jingwei Hirain Tech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingwei Hirain Tech Co Ltd filed Critical Beijing Jingwei Hirain Tech Co Ltd
Priority to CN202110454025.9A priority Critical patent/CN113094546B/en
Publication of CN113094546A publication Critical patent/CN113094546A/en
Application granted granted Critical
Publication of CN113094546B publication Critical patent/CN113094546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/71Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/787Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Library & Information Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a simulation animation model loading method, a simulation animation model loading device and simulation equipment. Therefore, after the index value of the current bounding box to which the current position belongs is determined according to the index calculation formula and the current position of the observation target, the index value of the surrounding bounding box around the index value of the current bounding box can be determined by utilizing the pre-established index file; and finally, loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file. The loading of the sub-model files in the simulation animation file is realized through the index file in a mode of converting the simulation animation file constructed outside the user into the index file, namely, the external loading of the simulation animation model is realized.

Description

Simulation animation model loading method and device and simulation equipment
Technical Field
The invention relates to the technical field of intelligent simulation, in particular to a method and a device for loading a simulation animation model and simulation equipment.
Background
In the intelligent driving simulation test process, related technicians need to perform repeated simulation tests on the vehicle-mounted sensor, at present, the simulation tests are mainly performed on the vehicle-mounted sensor based on a simulation animation model in a simulation animation file, and the animation loading speed of the simulation animation model is also an evaluation index of the simulation tests.
In order to increase the animation loading speed of the simulation animation model, the currently adopted method is to embed a simulation animation file, that is, to embed the simulation animation model in the simulation software, and all simulation tests are executed according to the embedded simulation animation file, however, the currently embedded simulation animation model cannot meet the test requirements of different sensors or different control algorithms in the sensors, and therefore, the requirement for external loading of the simulation animation model is gradually provided.
Disclosure of Invention
In view of this, the invention provides a method, a device and a device for loading a simulation animation model, which can realize external loading of a simulation animation file.
The invention provides the following technical scheme:
a method of loading a simulated animated model, the method comprising:
determining a current bounding box index value to which the current position belongs according to an index calculation formula and the current position of the observation target;
determining a peripheral bounding box index value of the current bounding box index value by utilizing a pre-established index file; the peripheral bounding box index value is a bounding box index value in a preset range by taking the current bounding box index value as a center in the index file;
loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file; the method comprises the steps of obtaining an index file, wherein the index file comprises a plurality of bounding boxes, the bounding boxes are arranged in the index file, the physical adjacent relation of the index value of each bounding box in the index file is consistent with the physical adjacent relation in the simulation animation file, the simulation animation file comprises simulation animation model files, and each simulation animation model file comprises a sub-model file.
Optionally, the generating process of the index file includes:
acquiring each simulation animation model file in the simulation animation files;
analyzing each simulation animation model file to obtain the position coordinates of each sub-model file in the simulation animation file;
calculating to obtain a bounding box index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file;
and establishing an index relationship between each sub-model file and the corresponding bounding box index value to obtain the index file.
Optionally, analyzing each simulation animation model file to obtain the position coordinates of each sub-model file in the simulation animation file, including:
analyzing each simulation animation model file to obtain model elements under each sub-model file in the simulation animation file;
and determining the position coordinates of each sub-model file according to the model elements under each sub-model file.
Optionally, determining, according to an index calculation formula and the current position of the observation target, an index value of a current bounding box to which the current position belongs, includes:
determining a current bounding box index value to which the current position belongs according to an index calculation formula, the current position of the observation target and the index file; the index file includes a first index relationship between each sub-model index value and each sub-model file, and a second index relationship between each sub-model index value and each bounding box index value.
Optionally, the generating process of the index file includes:
acquiring each simulation animation model file in the simulation animation files;
analyzing each simulation animation file to obtain the position coordinates of each sub-model file in the simulation animation file;
calculating to obtain a sub-model index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file, and establishing a first index relation between each sub-model index value and each sub-model file;
determining a bounding box to which the position coordinates of each sub-model file belong;
and establishing a second index relationship between each sub-model index value and each bounding box index value according to the bounding box to which the position coordinate of each sub-model file belongs and the first index relationship, and generating the index file.
Optionally, loading the sub-model file corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file, including:
comparing the current bounding box index value and the peripheral bounding box index value with historical bounding box index values corresponding to all historically loaded sub-model files, and screening index values different from the historical bounding box index values from the current bounding box index value and the peripheral bounding box index values to serve as target bounding box index values;
and loading the sub-model file corresponding to the index value of the target bounding box.
A simulated animated model loading apparatus, the apparatus comprising:
the current bounding box index value determining unit is used for determining a current bounding box index value to which the current position belongs according to an index calculation formula and the current position of the observation target;
the peripheral bounding box index value determining unit is used for determining the peripheral bounding box index value of the current bounding box index value by utilizing a pre-established index file; the peripheral bounding box index value is a bounding box index value in a preset range by taking the current bounding box index value as a center in the index file;
the loading unit is used for loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file; the method comprises the steps of obtaining an index file, wherein the index file comprises a plurality of bounding boxes, the bounding boxes are arranged in the index file, the physical adjacent relation of the index value of each bounding box in the index file is consistent with the physical adjacent relation in the simulation animation file, the simulation animation file comprises simulation animation model files, and each simulation animation model file comprises a sub-model file.
Optionally, the method further includes: a first index file generation unit;
the first index file generation unit includes:
the model file obtaining unit is used for obtaining each simulation animation model file in the simulation animation files;
the model file analyzing unit is used for analyzing each simulation animation model file to obtain the position coordinates of each sub-model file in the simulation animation files;
the bounding box index value calculation unit is used for calculating the bounding box index value corresponding to each sub-model file by using the index calculation formula and the position coordinate of each sub-model file;
and the index relation establishing unit is used for establishing the index relation between each sub-model file and the corresponding bounding box index value to obtain the index file.
Optionally, the model file parsing unit includes:
the model element analysis unit is used for analyzing each simulation animation model file to obtain model elements under each sub-model file in the simulation animation files;
and the position coordinate determining unit is used for determining the position coordinate of each sub-model file according to the model element under each sub-model file.
An emulation device, the emulation device comprising:
a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is configured to store the program, the program at least to:
the simulated animation model loading method as described above is performed.
According to the technical scheme, compared with the prior art, the simulation animation model loading method, the simulation animation model loading device and the simulation equipment are provided. Therefore, after the index value of the current bounding box to which the current position belongs is determined according to the index calculation formula and the current position of the observation target, the index value of the surrounding bounding box around the index value of the current bounding box can be determined by utilizing the pre-established index file; and finally, loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file. According to the method and the device, the simulation animation file constructed outside the user is converted into the index file, and the sub-model file in the simulation animation file is loaded through the index file, namely, the external loading of the simulation animation model is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a loading method for a simulation animation model according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for generating an index file according to an embodiment of the present invention;
FIG. 3 is a schematic two-dimensional coordinate plane of a bounding box according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating another method for generating an index file according to an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating loading of a simulation animation model according to an embodiment of the present invention;
fig. 6 is a block diagram of a simulation animation model loading apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the intelligent driving simulation test process, related technicians need to perform repeated simulation tests on the vehicle-mounted sensor to finally determine the related operation algorithm or performance of the vehicle-mounted sensor, for example, the vehicle-mounted camera or the vehicle-mounted laser radar is subjected to simulation tests, currently, simulation tests are mainly performed on the vehicle-mounted sensor based on a simulation animation model (such as a three-dimensional simulation animation model) in a simulation animation file, and the loading speed and the animation effect of the simulation animation model in the field of intelligent simulation driving simulation are main evaluation indexes. The animation effect is mainly related to the simulation animation model, and the part can be realized by modeling software; in order to improve the loading speed of the simulation animation model, the currently adopted method is to embed the simulation animation model, that is, the simulation animation model is embedded in the simulation software, all simulation tests are executed according to the embedded simulation animation model, and the flexibility is poor, however, the currently embedded simulation animation model cannot meet the test requirements of different sensors or different control algorithms in the sensors, and cannot meet the personalized customization requirements of users.
In order to solve the problem, the scale of the built-in simulation animation model needs to be continuously and iteratively expanded by the existing simulation software, the cost is that the scale of the software and the scale of a scene are huge, and the software and hardware aspects of the existing simulation software cannot meet the continuous iterative updating of the built-in simulation animation model. Thus, there is an increasing demand for external loading of simulated animated models.
At present, there is an external importing method of a simulation animation model, which is to import the simulation animation models in the simulation animation file into a specific software in a classified manner after a user constructs and completes the simulation animation file, then make the simulation animation models in a special format under the specific software, and finally generate the simulation animation models in the special format. The mode requires a user to create a large number of simulation animation models in conventional three-dimensional modeling software and then carry out secondary model editing and manufacturing in specific software, so that the user operation is complicated, the generation and use efficiency of the simulation animation models is greatly reduced, and the development threshold of the models is improved.
In order to further solve the technical problem, the invention provides a simulation animation model loading method, a simulation animation model loading device and simulation equipment. Therefore, after the index value of the current bounding box to which the current position belongs is determined according to the index calculation formula and the current position of the observation target, the index value of the surrounding bounding box around the index value of the current bounding box can be determined by utilizing the pre-established index file; and finally, loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file. According to the method and the device, the simulation animation file constructed outside the user is converted into the index file, and the sub-model file in the simulation animation file is loaded through the index file, namely, the external loading of the simulation animation model is realized.
In addition, the method disclosed by the invention only needs the step of externally constructing the simulation animation file executed by the user, the simulation software in the invention can receive the simulation animation file constructed by the user, automatically convert the simulation animation file constructed by the user into the form of the index file, and realize the loading of the simulation animation model file in the simulation animation file through the method, namely realize the loading of the simulation animation model externally constructed by the user. The classification storage of the models is not required to be executed by a user, the secondary building process of the simulation animation models with special formats by the user under specific software is not required, the user only needs to build the expected models in the common three-dimensional model modeling software and then derive the models with the preset formats, the user operation is simplified, the generation and use efficiency of the simulation animation models is improved, and the development threshold of the models is reduced. Meanwhile, the customized model of the user can be quickly loaded, and the visual effect is not influenced.
The technical scheme of the invention is described in detail by specific examples below:
fig. 1 is a flowchart of a loading method for a simulation animation model according to an embodiment of the present invention, and referring to fig. 1, the method may include:
step S100, determining a current bounding box index value to which the current position belongs according to an index calculation formula and the current position of the observation target.
It should be noted that the observation target may be an object in the simulation scene, such as an automobile, a pedestrian, or the like, and specifically may also be an automobile carrying a vehicle-mounted camera or a vehicle-mounted lidar. The observation target may also be part of an object in the simulated scene. If the observation target can be a tire on an automobile, an automobile body, various sensors in the automobile, and the like, the embodiment of the invention is not particularly limited.
The current position of the observation target is the current real geographical position of the observation target. In some embodiments, the current bounding box index value refers to a bounding box index value involved in an AABB (Axis-aligned bounding box) method. In practical applications, the sizes of the bounding boxes may be equal or different. To facilitate the bounding box partitioning, each bounding box is typically made equal in size.
Step S110, determining a surrounding box index value of the current surrounding box index value by using a pre-established index file.
It should be noted that the peripheral bounding box index value is a bounding box index value in a preset range in the index file with the current bounding box index value as a center.
Along with the movement of the observation target, the invention needs to load the observation target and also needs to load objects around the observation target, namely, the invention not only loads the simulation animation model file or the sub-model file corresponding to the observation target, but also loads the simulation animation model file and/or the sub-model file in the peripheral position range of the observation target. Therefore, the present invention determines a peripheral bounding box index value of the current bounding box index value, the peripheral bounding box index value indicating position information within a peripheral corresponding range of the observation target. In general, the bounding box index value is the bounding box index value in the index file that is centered around and adjacent to the current bounding box index value. It will be appreciated that in other embodiments, the perimeter bounding box index value may include bounding box index values adjacent to the bounding box index value adjacent to the current bounding box index value, in addition to the bounding box index value in the index file centered on and adjacent to the current bounding box index value.
Alternatively, the bounding box index value may be expressed in the form of an index coordinate.
Step S120, loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file; the method comprises the steps of obtaining an index file, wherein the index file comprises a plurality of bounding boxes, the bounding boxes are arranged in the index file, the physical adjacent relation of the index value of each bounding box in the index file is consistent with the physical adjacent relation in the simulation animation file, the simulation animation file comprises simulation animation model files, and each simulation animation model file comprises a sub-model file.
It should be noted that the simulation animation file simulates a scene, the simulation animation model file simulates objects in the scene, such as automobiles, pedestrians, and the like, the number and the simulation content of the simulation animation model files are determined according to the scene simulated by the simulation animation file, each simulation animation model file includes a sub-model file, the sub-model files are each component part in the simulation animation model file, for example, in the case that the simulation animation model file is an automobile, the sub-model files simulate tires on the automobile, automobile bodies, various sensors in the automobile, and the like, and the embodiment of the present invention is not particularly limited.
It should be noted that, the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value can be found in the index file according to the current bounding box index value and the peripheral bounding box index value, and loaded.
It should be noted that the intelligent driving simulation software mainly performs streaming loading on the sub-model file, and the streaming loading is executed after the intelligent driving simulation animation software is started.
Optionally, the present invention further provides a specific loading process, specifically, the loading the sub-model file corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file includes:
comparing the current bounding box index value and the peripheral bounding box index value with historical bounding box index values corresponding to all historically loaded sub-model files, and screening index values different from the historical bounding box index values from the current bounding box index value and the peripheral bounding box index values to serve as target bounding box index values; and loading the sub-model file corresponding to the index value of the target bounding box.
Screening out the history unloaded sub-model files by the mode; only the sub-model files which are not loaded in the history are loaded, and the sub-model files which are loaded in the history are not loaded any more, so that the loading speed of the model can be further improved.
It should be noted that, in the loading process, if the sub-model file is large, the main thread loads the child model file in a stuck state, and a delayed loading mode or other threads can be adopted for loading, so that the loading speed is increased.
The invention provides a simulation animation model loading method, in the method, because the invention constructs an index file in advance according to a simulation animation file constructed outside a user, the simulation animation file comprises a simulation animation model file, each simulation animation model file comprises a sub-model file, and the adjacent relation of index values of all bounding boxes in the index file is consistent with the physical adjacent relation in the simulation animation file. Therefore, after the index value of the current bounding box to which the current position belongs is determined according to the index calculation formula and the current position of the observation target, the index value of the surrounding bounding box around the index value of the current bounding box can be determined by utilizing the pre-established index file; and finally, loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file. According to the method and the device, the simulation animation file constructed outside the user is converted into the index file, and the sub-model file in the simulation animation file is loaded through the index file, namely, the external loading of the simulation animation model is realized.
The submodel files to be loaded are changed along with the change of the position of the observation target, only the submodel files in the preset range of the current position and the current position of the observation target are loaded each time, and after the position of the observation target is changed, the submodel files in the preset range of the changed position and the changed position of the observation target are loaded, so that the rapid dynamic streaming loading of the simulation animation model is realized, and the loading speed of the simulation animation model is improved.
The method disclosed by the invention only needs the step of externally constructing the simulation animation file executed by the user, the simulation software in the invention can receive the simulation animation file constructed by the user, automatically convert the simulation animation file constructed by the user into the form of the index file, and realize the loading of the simulation animation model file in the simulation animation file by the method, namely realize the loading of the simulation animation model externally constructed by the user. The classification storage of the user execution model is not needed, and the secondary building process of the special format simulation animation model under the specific software is also not needed, so that the user operation is simplified, the generation and use efficiency of the simulation animation model is improved, and the development threshold of the model is reduced.
It should be noted that, in a case that the index file in the present invention includes an index relationship between a sub-model file and each corresponding bounding box index value, a generation process of the index file provided by the present invention is described below, where a generation method of the index file is given below, fig. 2 is a flowchart of a generation method of the index file provided by an embodiment of the present invention, and referring to fig. 2, the method may include:
and S200, acquiring each simulation animation model file in the simulation animation files.
It should be noted that, a user may generally build a simulation animation model through common three-dimensional modeling software, and export the built simulation animation model into a file with a preset format, so as to obtain a simulation animation model file. Files with preset formats such as FBX, OBJ, etc., the present invention is not limited in particular.
Each simulation animation file comprises at least one simulation animation model file.
Step S210, analyzing each simulation animation model file to obtain the position coordinates of each sub-model file in the simulation animation files.
It should be noted that each simulation animation model file contains at least one sub-model file. Since the sub-model files are components in the simulation animation model file, the content included in each sub-model file is related information of the components in the simulation animation model file, such as: the contents of mesh, material, texture, vertex, triangle, normal, and map data, etc. are not specifically limited in the embodiments of the present invention.
Optionally, the present invention mainly adopts an SDK (Software Development Kit) of FBX to parse the simulation animation model file.
The analyzing the simulation animation model files to obtain the position coordinates of each sub-model file in the simulation animation files comprises the following steps:
analyzing each simulation animation model file to obtain model elements under each sub-model file in the simulation animation file; and determining the position coordinates of each sub-model file according to the model elements under each sub-model file.
Optionally, the sub-model file is each component in the simulation animation model file, so that the model elements in the sub-model file are elements of each component in the simulation animation model file, for example, in a case that the simulation animation model file is an automobile, the sub-model file simulates tires on the automobile, automobile bodies, various sensors in the automobile, and the like, and the model elements are each component of the tires, each component of the automobile sensors, and the like, which is not specifically limited in the embodiment of the present invention.
The invention takes the central position coordinates of all model elements under a sub-model file as the position coordinates of the sub-model file.
And S220, calculating to obtain a bounding box index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file.
The invention utilizes an index calculation formula to convert the position coordinates of each sub-model file into bounding box index values. And the bounding box index value corresponding to the sub-model file is the index value of the bounding box in which the sub-model is positioned.
A calculation formula for calculating the bounding box index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file is given as follows:
Figure BDA0003039840120000111
wherein the bounding box index values include: bounding box index abscissa and bounding box index ordinate; (idx, idy) is a bounding box index value, idx is a bounding box index abscissa value corresponding to the sub-model file, and idy is a bounding box index ordinate value corresponding to the sub-model file; x and y are respectively the position coordinates of the sub-model file in the x direction and the y direction, w is the preset width of the virtual bounding box, and ceil () represents the minimum integer operation which is larger than the value in the brackets.
Referring to a schematic diagram of a bounding box two-dimensional coordinate plane shown in fig. 3, a minimum area in the bounding box two-dimensional coordinate plane is a virtual bounding box size, and each polygon shown in the bounding box two-dimensional coordinate plane is a sub-model file.
And step S230, establishing an index relationship between each sub-model file and the corresponding bounding box index value to obtain the index file.
According to the method, the index relation between each sub-model file and the corresponding bounding box index value is established to obtain the index file, so that the simulation animation file constructed outside a user is converted into the index file, the sub-model file in the simulation animation file is loaded through the index file, and the external loading of the simulation animation model is realized.
In addition, in other embodiments, in a case that the index file in the present invention may also include a first index relationship between each sub-model index value and each sub-model file, and a second index relationship between each sub-model index value and each bounding box index value, the process of determining the current bounding box index value to which the current position belongs according to the index calculation formula and the current position of the observation target in the present invention may further include: and determining the index value of the current bounding box to which the current position belongs according to an index calculation formula, the current position of the observation target and the index file. Based on this, the present invention provides another method for generating an index file, fig. 4 is a flowchart of a method for generating an index file according to an embodiment of the present invention, and referring to fig. 4, the method may include:
and step S300, obtaining each simulation animation model file in the simulation animation files.
It should be noted that, a user may generally build a simulation animation model through common three-dimensional modeling software, and export the built simulation animation model into a file with a preset format, so as to obtain a simulation animation model file. Files with preset formats such as FBX, OBJ, etc., the present invention is not limited in particular.
Step S310, analyzing each simulation animation file to obtain the position coordinates of each sub-model file in the simulation animation file;
optionally, the present invention mainly adopts an SDK (Software Development Kit) of FBX to parse the simulation animation model file.
The analyzing the simulation animation model files to obtain the position coordinates of each sub-model file in the simulation animation files comprises the following steps:
analyzing each simulation animation model file to obtain model elements under each sub-model file in the simulation animation file; and determining the position coordinates of each sub-model file according to the model elements under each sub-model file.
Step S320, calculating to obtain a sub-model index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file, and establishing a first index relationship between each sub-model index value and each sub-model file.
The invention can convert the position coordinate of each sub-model file into a sub-model index value by using an index calculation formula.
A calculation formula for calculating the sub-model index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file is given as follows:
Figure BDA0003039840120000121
the sub-model index values include: sub-model index abscissa value and sub-model index ordinate value; (jdx, jdy) is a sub-model index value, jdx is a sub-model index abscissa value corresponding to the sub-model file, and jdy is a sub-model index ordinate value corresponding to the sub-model file; x and y are position coordinates of the sub-model file in the x direction and the y direction, respectively, w is a preset width (the width of the virtual bounding box is an integral multiple of the width), and ceil () represents a minimum integer operation taking a value larger than that in the parentheses.
Referring to a schematic diagram of a two-dimensional coordinate plane of a bounding box shown in fig. 3, the smallest area in the two-dimensional coordinate plane of the bounding box is the size of a virtual bounding box, and each polygon shown in the two-dimensional coordinate plane of the bounding box is a sub-model file.
And step S330, determining the bounding box to which the position coordinates of each sub-model file belong.
Referring to the schematic diagram of the two-dimensional coordinate plane of the bounding box shown in fig. 3, the invention mainly determines the bounding box to which the position coordinate of each sub-model file belongs in the schematic diagram of the two-dimensional coordinate plane of the bounding box. Taking the model at the upper right corner in fig. 3 as an example, a certain simulation animation model file covers two bounding boxes (1, 3) and (2, 3), a triangle sub-model file in the simulation animation model file covers two bounding boxes (1, 3) and (2, 3), and the other 3 sub-model files in the simulation animation model file only cover (2, 3) one bounding box. In addition, referring to fig. 3, there is not necessarily a one-to-one correspondence between the sub-model file and the bounding box index value.
Step S340, establishing a second index relationship between each sub-model index value and each bounding box index value according to the bounding box to which the position coordinate of each sub-model file belongs and the first index relationship, and generating the index file.
The index file includes a first index relationship between each sub-model index value and each sub-model file, and a second index relationship between each sub-model index value and each bounding box index value. Therefore, the corresponding sub-model index value can be determined according to the observation target, and the bounding box index value corresponding to the observation target can be obtained according to the corresponding relation between the sub-model index value and the bounding box index value. And subsequently, obtaining each sub-model index value under the bounding box index value corresponding to the observation target according to the corresponding relation between the sub-model index value and the bounding box index value, and finally obtaining a sub-model file corresponding to each sub-model index value under the bounding box index value corresponding to the observation target to finish external loading of the simulation animation model.
According to the method, the first index relationship between each sub-model index value and each sub-model file and the second index relationship between each sub-model index value and each enclosure box index value are established to obtain the index file, so that the simulation animation file constructed outside a user is converted into the index file, and the loading of the sub-model files in the simulation animation file is realized through the index file, namely, the external loading of the simulation animation model is realized.
It should be noted that the index file in the present invention may exist in the form of an index tree. The creation of the index tree is to perform index traversal search on a later streaming loading range and improve the speed of determining the loading range.
The area range covered by the sub-model file is smaller, so that the index tree obtained by establishing the axis alignment bounding box based on the sub-model file is smaller, the traversal index speed is higher, and the dynamic loading of the simulation animation model is facilitated. And (3) searching the index complexity in the adjacent range by using the sub-model file index to be O (1), and compared with other built trees (such as KD trees and the like), taking the complexity of the adjacent range O (logN) to be smaller (N is the number of model elements).
When the intelligent driving simulation is carried out, the observation target is generally a vehicle, the observation range is generally a rectangular or prototype range, and the loading mode of the model cluster adopting the sub-model file is more in line with the range loading concept.
The following describes in detail a loading method of a simulation animation model according to the present disclosure with a specific example, and the loading method of a simulation animation model is shown with reference to the loading diagram of a simulation animation model given in fig. 5:
1. when the software is initialized, reading a pre-generated index file into a memory, and then calculating a current bounding box index value (idx, idy) to which the current position of an observation target belongs according to the current position (x, y) of the observation target input by a user.
2. According to the current bounding box index value, the number of the surrounding adjacent bounding box indexes is 8, and the distance between the current bounding box index value and the 8 bounding box index values in the preset range is as follows: (idx-1, idy-1), (idx-1, idy), (idx-1, idy +1), (idx, idy-1), (idx, idy +1), (idx +1, idy-1), (idx +1, idy), (idx +1, idy +1) are determined as the peripheral bounding box index values corresponding to the observation target.
3. Taking fig. 5 as an example, if the current bounding box index value of the observation target is calculated to be (1, 1), the index values of the surrounding bounding boxes are: (0, 0), (0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1) and (2, 2), according to the peripheral bounding box index value, determining a sub-model file corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file from the simulation animation file.
4. And loading the sub-model file. After loading, the loaded bounding box index map needs to be recorded, so that subsequent comparison is facilitated, and continuous loading is prevented. The loaded bounding box index map is the loaded current bounding box index value and the perimeter bounding box index value.
In this way, only the scenes around the observation target are loaded, and the advantage is that the initial loading only loads the adjacent region, and the loading speed is high.
5. The position of the observation target can be judged in real time in the operation process, when the observation target enters the next bounding box, as shown in fig. 5, if the observation target enters the bounding box (2, 1) from the bounding box (1, 1), the step 1-4 is repeated, the same method is adopted to carry out index judgment, meanwhile, the adjacent index value is obtained, then repeated region judgment is carried out, only the sub-model files in the new bounding box region are loaded, as shown in fig. 5, only the sub-model files in the bounding boxes (3, 0), (3, 1) and (3, 2) are loaded.
The following introduces the loading device of the simulation animation model provided by the invention, and the loading device of the simulation animation model described below can be referred to in correspondence with the loading method of the simulation animation model.
Fig. 6 is a structural block diagram of a simulation animation model loading device according to an embodiment of the present invention, and referring to fig. 6, the simulation animation model loading device includes:
a current bounding box index value determining unit 600, configured to determine, according to an index calculation formula and a current position of an observation target, a current bounding box index value to which the current position belongs;
a bounding box index value determining unit 610, configured to determine a bounding box index value of the current bounding box index value by using a pre-established index file; the peripheral bounding box index value is a bounding box index value in a preset range by taking the current bounding box index value as a center in the index file;
a loading unit 620, configured to load a sub-model file corresponding to the current bounding box index value and the surrounding bounding box index value in the simulation animation file; the method comprises the steps of obtaining an index file, wherein the index file comprises a plurality of bounding boxes, the bounding boxes are arranged in the index file, the physical adjacent relation of the index value of each bounding box in the index file is consistent with the physical adjacent relation in the simulation animation file, the simulation animation file comprises simulation animation model files, and each simulation animation model file comprises a sub-model file.
Optionally, the method further includes: a first index file generation unit;
the first index file generation unit includes:
the model file obtaining unit is used for obtaining each simulation animation model file in the simulation animation files;
the model file analyzing unit is used for analyzing each simulation animation model file to obtain the position coordinates of each sub-model file in the simulation animation files;
the bounding box index value calculation unit is used for calculating the bounding box index value corresponding to each sub-model file by using the index calculation formula and the position coordinate of each sub-model file;
and the first index relation establishing unit is used for establishing the index relation between each sub-model file and the corresponding bounding box index value to obtain the index file.
Optionally, the model file parsing unit includes:
the model element analysis unit is used for analyzing each simulation animation model file to obtain model elements under each sub-model file in the simulation animation files;
and the position coordinate determining unit is used for determining the position coordinate of each sub-model file according to the model element under each sub-model file.
Optionally, the current bounding box index value determining unit is specifically configured to:
determining a current bounding box index value to which the current position belongs according to an index calculation formula, the current position of the observation target and the index file; the index file includes a first index relationship between each sub-model index value and each sub-model file, and a second index relationship between each sub-model index value and each bounding box index value.
Optionally, the system further comprises a second index file generation unit;
the second index file generation unit includes:
the model file obtaining unit is used for obtaining each simulation animation model file in the simulation animation files;
the model file analyzing unit is used for analyzing each simulation animation file to obtain the position coordinates of each sub-model file in the simulation animation files;
the model index value calculation unit is used for calculating a sub-model index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file;
the second index relation establishing unit is used for establishing a first index relation between each sub-model index value and each sub-model file;
a bounding box determining unit, which is used for determining the bounding box to which the position coordinate of each sub-model file belongs;
and the index file generating subunit is used for establishing a second index relationship between each sub-model index value and each bounding box index value according to the bounding box to which the position coordinate of each sub-model file belongs and the first index relationship, and generating the index file.
Optionally, the loading unit is specifically configured to:
comparing the current bounding box index value and the peripheral bounding box index value with historical bounding box index values corresponding to all historically loaded sub-model files, and screening index values different from the historical bounding box index values from the current bounding box index value and the peripheral bounding box index values to serve as target bounding box index values;
and loading the sub-model file corresponding to the index value of the target bounding box.
Optionally, the present invention further discloses a simulation device, where the simulation device includes:
a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is configured to store the program, the program at least to:
the simulated animation model loading method as described above is performed.
Technical features described in the embodiments in the present specification may be replaced or combined with each other, each embodiment is described with a focus on differences from other embodiments, and the same and similar portions among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for loading a simulation animation model, the method comprising:
determining a current bounding box index value to which the current position belongs according to an index calculation formula and the current position of the observation target;
determining a peripheral bounding box index value of the current bounding box index value by utilizing a pre-established index file; the peripheral bounding box index value is a bounding box index value in a preset range by taking the current bounding box index value as a center in the index file;
loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file; the method comprises the steps of obtaining an index file, wherein the index file comprises a plurality of bounding boxes, the bounding boxes are arranged in the index file, the physical adjacent relation of the index value of each bounding box in the index file is consistent with the physical adjacent relation in the simulation animation file, the simulation animation file comprises simulation animation model files, and each simulation animation model file comprises a sub-model file.
2. The method of claim 1, wherein the generating of the index file comprises:
acquiring each simulation animation model file in the simulation animation files;
analyzing each simulation animation model file to obtain the position coordinates of each sub-model file in the simulation animation file;
calculating to obtain a bounding box index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file;
and establishing an index relationship between each sub-model file and the corresponding bounding box index value to obtain the index file.
3. The method of claim 2, wherein parsing the simulation animation model files to obtain the location coordinates of each sub-model file in the simulation animation files comprises:
analyzing each simulation animation model file to obtain model elements under each sub-model file in the simulation animation file;
and determining the position coordinates of each sub-model file according to the model elements under each sub-model file.
4. The method of claim 1, wherein determining a current bounding box index value to which the current position belongs according to an index calculation formula and the current position of the observation target comprises:
determining a current bounding box index value to which the current position belongs according to an index calculation formula, the current position of the observation target and the index file; the index file includes a first index relationship between each sub-model index value and each sub-model file, and a second index relationship between each sub-model index value and each bounding box index value.
5. The method of claim 4, wherein the generating of the index file comprises:
acquiring each simulation animation model file in the simulation animation files;
analyzing each simulation animation file to obtain the position coordinates of each sub-model file in the simulation animation file;
calculating to obtain a sub-model index value corresponding to each sub-model file by using the index calculation formula and the position coordinates of each sub-model file, and establishing a first index relation between each sub-model index value and each sub-model file;
determining a bounding box to which the position coordinates of each sub-model file belong;
and establishing a second index relationship between each sub-model index value and each bounding box index value according to the bounding box to which the position coordinate of each sub-model file belongs and the first index relationship, and generating the index file.
6. The method of claim 1, wherein loading a sub-model file in the simulated animation file corresponding to the current bounding box index value and the peripheral bounding box index value comprises:
comparing the current bounding box index value and the peripheral bounding box index value with historical bounding box index values corresponding to all historically loaded sub-model files, and screening index values different from the historical bounding box index values from the current bounding box index value and the peripheral bounding box index values to serve as target bounding box index values;
and loading the sub-model file corresponding to the index value of the target bounding box.
7. An apparatus for loading a simulation animation model, the apparatus comprising:
the current bounding box index value determining unit is used for determining a current bounding box index value to which the current position belongs according to an index calculation formula and the current position of the observation target;
the peripheral bounding box index value determining unit is used for determining the peripheral bounding box index value of the current bounding box index value by utilizing a pre-established index file; the peripheral bounding box index value is a bounding box index value in a preset range by taking the current bounding box index value as a center in the index file;
the loading unit is used for loading the sub-model files corresponding to the current bounding box index value and the peripheral bounding box index value in the simulation animation file; the method comprises the steps of obtaining an index file, wherein the index file comprises a plurality of bounding boxes, the bounding boxes are arranged in the index file, the physical adjacent relation of the index value of each bounding box in the index file is consistent with the physical adjacent relation in the simulation animation file, the simulation animation file comprises simulation animation model files, and each simulation animation model file comprises a sub-model file.
8. The apparatus of claim 7, further comprising: a first index file generation unit;
the first index file generation unit includes:
the model file obtaining unit is used for obtaining each simulation animation model file in the simulation animation files;
the model file analyzing unit is used for analyzing each simulation animation model file to obtain the position coordinates of each sub-model file in the simulation animation files;
the bounding box index value calculation unit is used for calculating the bounding box index value corresponding to each sub-model file by using the index calculation formula and the position coordinate of each sub-model file;
and the first index relation establishing unit is used for establishing the index relation between each sub-model file and the corresponding bounding box index value to obtain the index file.
9. The apparatus of claim 8, wherein the model file parsing unit comprises:
the model element analysis unit is used for analyzing each simulation animation model file to obtain model elements under each sub-model file in the simulation animation files;
and the position coordinate determining unit is used for determining the position coordinate of each sub-model file according to the model element under each sub-model file.
10. An emulation device, comprising:
a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is configured to store the program, the program at least to:
executing the method of loading a simulated animated model according to any of claims 1-6 above.
CN202110454025.9A 2021-04-26 2021-04-26 Simulation animation model loading method and device and simulation equipment Active CN113094546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110454025.9A CN113094546B (en) 2021-04-26 2021-04-26 Simulation animation model loading method and device and simulation equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110454025.9A CN113094546B (en) 2021-04-26 2021-04-26 Simulation animation model loading method and device and simulation equipment

Publications (2)

Publication Number Publication Date
CN113094546A true CN113094546A (en) 2021-07-09
CN113094546B CN113094546B (en) 2024-04-09

Family

ID=76679995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110454025.9A Active CN113094546B (en) 2021-04-26 2021-04-26 Simulation animation model loading method and device and simulation equipment

Country Status (1)

Country Link
CN (1) CN113094546B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5852449A (en) * 1992-01-27 1998-12-22 Scientific And Engineering Software Apparatus for and method of displaying running of modeled system designs
WO2012065759A1 (en) * 2010-11-16 2012-05-24 Thomson Licensing Method and apparatus for automatic film restoration
CN111104410A (en) * 2019-12-25 2020-05-05 北京经纬恒润科技有限公司 Local road information extraction method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5852449A (en) * 1992-01-27 1998-12-22 Scientific And Engineering Software Apparatus for and method of displaying running of modeled system designs
WO2012065759A1 (en) * 2010-11-16 2012-05-24 Thomson Licensing Method and apparatus for automatic film restoration
CN111104410A (en) * 2019-12-25 2020-05-05 北京经纬恒润科技有限公司 Local road information extraction method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵阳;谢敏;: "基于ASE文件的3D模型成像仿真", 电子测试, no. 12 *

Also Published As

Publication number Publication date
CN113094546B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN111161349B (en) Object posture estimation method, device and equipment
CN112347546A (en) BIM rendering method, device and computer-readable storage medium based on lightweight device
US11295517B2 (en) Generating realistic point clouds
CN108021131B (en) Robot vision identification method and device and computer readable storage medium
CN110990516B (en) Map data processing method, device and server
CN108984741B (en) Map generation method and device, robot and computer-readable storage medium
CN114708358B (en) Object processing method, device, equipment and computer readable storage medium
CN114066718A (en) Image style migration method and device, storage medium and terminal
WO2019207577A1 (en) System and method for training a machine-learning model to identify real-world elements
CN108986210B (en) Method and device for reconstructing three-dimensional scene
CN113313140B (en) Three-dimensional model classification and retrieval method and device based on deep attention
CN117351133A (en) Data rendering method, device, equipment and computer readable storage medium
CN113094546B (en) Simulation animation model loading method and device and simulation equipment
CN114565092A (en) Neural network structure determining method and device
CN116127802B (en) Method, device and system for displaying CAE simulation result on 3D (three-dimensional) view
CN111967478A (en) Feature map reconstruction method and system based on weight inversion, storage medium and terminal
CN114781014B (en) Object processing method, device, equipment and computer readable storage medium
CN117274526A (en) Neural network model training method and image generating method
CN114283148A (en) Road element extraction method and device, storage medium and electronic equipment
CN114882496A (en) Three-dimensional component similarity calculation method based on depth image
CN114373110A (en) Method and device for detecting target of input image and related products
CN109840945B (en) Finite element preprocessing method and device
CN111340949A (en) Modeling method, computer device and storage medium for 3D virtual environment
CN111784816A (en) High-frequency material rendering method and system based on micro-surface theory
CN116824082B (en) Virtual terrain rendering method, device, equipment, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant