Traffic flow generation method and device in dynamic three-dimensional scene and terminal equipment

By generating a path network and dividing the grid map in a dynamic three-dimensional scene, and updating the vehicle model position according to the camera distance, the problems of high computational load and poor realism in the existing technology are solved, and the efficient generation of realistic traffic flow is achieved.

CN120689522APending Publication Date: 2025-09-23GUANGZHOU FRONTOP DIGITAL ORIGINALITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510849455.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

When generating dynamic three-dimensional traffic flows, existing technologies have difficulty in reducing the computational load of three-dimensional creation tools while ensuring realistic effects, resulting in performance degradation or poor realistic effects.

Method used

By generating a path network and dividing the grid map, the vehicle model position is updated hierarchically according to the camera distance, the update frequency and interpolation frequency of different grids are set, and the vehicle model position is optimized in combination with collision detection to ensure realistic effects and computational efficiency.

Benefits of technology

It is achieved that while ensuring the realism of traffic flow, the computational load of 3D creation tools is reduced, traffic flow discontinuities are avoided, and computational efficiency and realism are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689522A_ABST
    Figure CN120689522A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow generation method and device in a dynamic three-dimensional scene and terminal equipment, and belongs to the field of dynamic three-dimensional modeling, and the method comprises the steps: generating a path network through a three-dimensional creation tool, and randomly generating a vehicle model along the path network; dividing the ground to which the path network belongs, and obtaining a grid map; the distance between the position of the camera of the three-dimensional creation tool and the grid in the grid map is smaller than or equal to a first preset distance to serve as a first grid; judging whether the traffic flow on the path network needs not to have a fault phenomenon or not; if so, only updating the position of the vehicle model passing through the first path of the first grid in the path network at a fixed frequency; and if not, updating the position of the vehicle model in the first grid at a first frequency, and updating the positions of the vehicle models in grids outside the first grid at a frequency lower than the first frequency. According to the invention, the problem that the calculation load of a three-dimensional creation tool is too high when the traffic flow is generated can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of dynamic three-dimensional modeling, and in particular to a method, apparatus and terminal device for generating traffic flow in a dynamic three-dimensional scene. Background Art

[0002] At present, in the field of digital twins, especially when building urban scenes, it is necessary to build dynamically moving traffic on urban roads.

[0003] When existing technologies use 3D creation tools to construct dynamic 3D scenes, lanes are usually generated directly through the 3D creation tools, and the initially generated lanes are further edited through the 3D creation tools, such as setting the number of lanes and the density and speed of vehicles on the lanes, thereby completing the generation of traffic flow. When faced with a large number of vehicles moving at the same time, the positions of a large number of vehicle models need to be updated in real time. The above method fails to consider how to set the update frequency of each vehicle model position. If the positions of all vehicle models are updated at the same frequency, and high-frequency updates are used to ensure the realism of the traffic flow, the computing load will be greatly increased, causing the performance of the 3D creation tool to degrade and freeze. If low-frequency updates are used to ensure the performance of the 3D creation tool, the realism of the traffic flow will be affected.

[0004] Therefore, how to optimize traffic flow generation to ensure realistic traffic flow effects while reducing the computational load of three-dimensional creation tools is a technical problem that needs to be solved at present. Summary of the Invention

[0005] The present application provides a method, apparatus and terminal device for generating traffic flow in a dynamic three-dimensional scene, which can solve the problem in the prior art of how to optimize traffic flow generation to ensure realistic traffic flow effects while reducing the computational load of three-dimensional creation tools.

[0006] In one embodiment of the present application, a method for generating traffic flow in a dynamic three-dimensional scene is provided, comprising:

[0007] generating a path network using a three-dimensional authoring tool, and randomly generating vehicle models along the path network;

[0008] Divide the ground of the path network according to a preset grid size to obtain a grid map;

[0009] The grid in the grid map whose distance from the camera position of the three-dimensional creation tool is less than or equal to a first preset distance is used as the first grid;

[0010] Determine whether it is necessary to prevent traffic flow interruptions on the path network; if so, determine a first path passing through a first grid from the path network, and update only the position of the vehicle model in the first path at a fixed frequency; if not, update the position of the vehicle model in the first grid at a first frequency, and update the position of the vehicle model in grids other than the first grid at a frequency lower than the first frequency.

[0011] Compared to existing technologies, the above embodiment has the following advantages: First, the ground surface of the path network is divided into a grid to obtain a grid map. This avoids the need to calculate the distance between the camera and each vehicle model, and uses the grid as the basis for subsequent management of vehicle model position updates, thereby improving computational efficiency. Second, based on the distance between the camera and the grid, the user's viewpoint area of ​​interest, namely the first grid, is determined. At this time, the user's attention is focused on the three-dimensional model of the first grid. Therefore, using the first grid as the basis for subsequent vehicle model position updates can effectively ensure the realistic effect of the traffic flow generated from the user's perspective when the vehicle position is updated. Finally, different vehicle model position update methods are set according to actual needs. By updating only the position of the vehicle model on the first path passing through the first grid at a fixed frequency, the position of the vehicle model on other paths remains unchanged, thereby reducing the computing load while ensuring that there is no interruption in the traffic flow on the path; or according to the distance between the grid and the camera, the update frequency of the vehicle model position in different grids is set, that is, the position of the vehicle model in the first grid is updated at a higher update frequency, and the position of the vehicle model in other grids farther away from the camera is updated at a lower frequency, thereby effectively avoiding the waste of computing resources in areas that the user does not notice, and reducing the computing load of the 3D creation tool.

[0012] Furthermore, updating the position of the vehicle model in a grid other than the first grid at a frequency lower than the first frequency includes:

[0013] The grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than or equal to a second preset distance is used as the second grid;

[0014] updating the position of the vehicle model in the second grid at a second frequency; wherein the first preset distance is less than the second preset distance; and the first frequency is greater than the second frequency;

[0015] Using a grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than a first preset distance and less than a second preset distance as a buffer zone;

[0016] In a frequency range smaller than the first frequency and larger than the second frequency, the interpolation selects a frequency to update the position of the vehicle model.

[0017] Compared to existing technologies, the above embodiment has the following beneficial effects: Because the user's viewpoint area of ​​interest, namely the total area of ​​the first grid, is smaller than the total area of ​​the other grids, when there is no need to ensure that the generated traffic flow is completely uninterrupted, computing resources can be focused on updating the positions of vehicle models in the first grid, while the positions of vehicle models in other grids are updated more frequently, thereby effectively reducing the computational load when generating traffic flow. At the same time, a buffer area is set between the second grid, which is updated at a lower frequency, and the first grid. The update frequency of the vehicle model position is interpolated within this buffer area, alleviating the discontinuity caused by the difference in position update frequency.

[0018] Furthermore, updating the position of the vehicle model by interpolating and selecting a frequency within a frequency range that is less than the first frequency and greater than the second frequency includes:

[0019] Calculating a first distance between the vehicle model and the nearest first grid;

[0020] According to the first distance, a corresponding third frequency is selected from the frequency range to update the position of the vehicle model; wherein, the smaller the first distance is, the closer the third frequency is to the first frequency.

[0021] Compared with the existing technology, the above embodiment has the following beneficial effects: through the distance attenuation mechanism and the smooth transition operation of the interpolation frequency, it ensures high-frequency updates of the area close to the user's viewpoint, and alleviates the problem of traffic discontinuity caused by the two areas being updated at different fixed low frequencies. At the same time, it avoids the waste of computing resources and achieves a dynamic balance between computing efficiency and realism.

[0022] Furthermore, the randomly generating vehicle models along the path network includes:

[0023] The vehicle models are sequentially generated along the path network, and the interval distance between two adjacent vehicle models is set according to the length of the vehicle model and a random number randomly generated within a preset range.

[0024] Compared with the existing technology, the above embodiment has the following beneficial effects: in order to prevent the overlap between vehicle models caused by excessive vehicle density, the random spacing caused by differences in driver behavior in real traffic is simulated, and the interval distance between two adjacent vehicle models is set in combination with the length of the vehicle model, thereby improving the realism of the traffic flow.

[0025] Furthermore, the method for generating traffic flow in a dynamic three-dimensional scene further includes:

[0026] For the vehicle models on the same path, setting the same vehicle travel speed;

[0027] For the vehicle models on different paths, random disturbance settings are performed based on preset vehicle travel speeds.

[0028] Compared with the existing technology, the above embodiment has the following beneficial effects: by randomly perturbing the driving speed of vehicle models in different paths, the traffic flow in the three-dimensional dynamic scene is avoided from being too monotonous, thereby improving the realism of the traffic flow; further, the driving speed of the vehicle models in the same path is set to the same speed, thereby reducing the computational complexity when updating the vehicle position.

[0029] Furthermore, when the position of the vehicle model is updated, the method further includes:

[0030] The space within a preset range in the vertical direction of the three-dimensional space where the vehicle model is located is used as a collision detection space;

[0031] If the collision detection space corresponding to the updated position of the vehicle model collides with the preset static model, the position of the vehicle model is corrected to the collision coordinate point.

[0032] Compared with the existing technology, the above embodiment has the following beneficial effects: since static models such as the ground will be uneven during modeling, the present application sets a certain range of collision detection space in the vertical direction of the position of the vehicle model, and resets the position of the vehicle model according to the collision coordinate point, which can prevent the vehicle model from being suspended in the air or colliding with the ground model, thereby improving the realism of the traffic flow.

[0033] Another embodiment of the present application further provides a vehicle flow generation device in a dynamic three-dimensional scene, comprising: a vehicle model setting module, a grid division module, a first grid screening module, and a position updating module;

[0034] The vehicle model setting module is used to generate a path network using a three-dimensional creation tool and randomly generate vehicle models along the path network;

[0035] The grid division module is used to divide the ground of the path network according to a preset grid size to obtain a grid map;

[0036] The first grid screening module is configured to select a grid in the grid map whose distance from the camera position of the three-dimensional authoring tool is less than or equal to a first preset distance as a first grid;

[0037] The position update module is used to determine whether it is necessary to prevent traffic interruptions on the path network; if so, determine a first path passing through a first grid from the path network, and update only the position of the vehicle model in the first path at a fixed frequency; if not, update the position of the vehicle model in the first grid at a first frequency, and update the position of the vehicle model in grids other than the first grid at a frequency lower than the first frequency.

[0038] Furthermore, updating the position of the vehicle model in a grid other than the first grid at a frequency lower than the first frequency includes:

[0039] The grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than or equal to a second preset distance is used as the second grid;

[0040] updating the position of the vehicle model in the second grid at a second frequency; wherein the first preset distance is less than the second preset distance; and the first frequency is greater than the second frequency;

[0041] Using a grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than a first preset distance and less than a second preset distance as a buffer zone;

[0042] In a frequency range smaller than the first frequency and larger than the second frequency, the interpolation selects a frequency to update the position of the vehicle model.

[0043] Furthermore, when the position of the vehicle model is updated, the method further includes:

[0044] The space within a preset range in the vertical direction of the three-dimensional space where the vehicle model is located is used as a collision detection space;

[0045] If the collision detection space corresponding to the updated position of the vehicle model collides with the preset static model, the position of the vehicle model is corrected to the collision coordinate point.

[0046] Another embodiment of the present application also provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the steps of the vehicle flow generation method in a dynamic three-dimensional scene of the present application are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0048] Figure 1 A schematic flow chart of a method for generating traffic flow in a dynamic three-dimensional scene provided in some embodiments of the present application;

[0049] Figure 2 This is a structural diagram of a vehicle flow generation device in a dynamic three-dimensional scene provided in some embodiments of the present application. DETAILED DESCRIPTION

[0050] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.

[0052] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.

[0053] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0054] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0055] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0056] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.

[0057] When constructing dynamic three-dimensional scenes using three-dimensional creation tools, existing technologies typically directly generate lanes through the three-dimensional creation tools, and then further edit the initially generated lanes through the three-dimensional creation tools, such as setting the number of lanes and the density and speed of vehicles on the lanes, thereby completing the generation of traffic flow. When faced with a large number of vehicles moving simultaneously, the positions of a large number of vehicle models need to be updated in real time. The above method fails to consider how to set the update frequency of each vehicle model position. If the positions of all vehicle models are updated at the same frequency, and a high frequency update is used to ensure the realism of the traffic flow, the computing load will be greatly increased, resulting in a decrease in the performance of the three-dimensional creation tool and the occurrence of lag. If a low frequency update is used to ensure the performance of the three-dimensional creation tool, the realism of the traffic flow will be affected.

[0058] Please refer to Figure 1 To solve the problem of optimizing traffic flow generation in the prior art to ensure realistic traffic flow effects while reducing the computational load of 3D creation tools, the present invention provides a method for generating traffic flow in a dynamic 3D scene, including S101 to S104, specifically:

[0059] S101: Generate a path network using a three-dimensional creation tool, and randomly generate a vehicle model along the path network.

[0060] Furthermore, in some embodiments of the present application, the three-dimensional creation tools include but are not limited to engines such as Unity, Unreal Engine, CryEngine, Twinmotion, etc., and the present application does not limit the tools used.

[0061] Preferably, in some embodiments of the present application, the generation of a path network through a three-dimensional creation tool includes: taking the Unreal Engine (UE) engine as an example, first using the spline tool in the UE engine, detecting the position of the mouse in the world scene, and clicking the mouse in sequence to add any number of curve points, so that the UE engine generates a spline path according to the above curve points, and all paths constitute a path network.

[0062] Furthermore, in some embodiments of the present application, the randomly generating a vehicle model along the path network includes:

[0063] The vehicle models are sequentially generated along the path network, and the interval distance between two adjacent vehicle models is set according to the length of the vehicle model and a random number randomly generated within a preset range.

[0064] Preferably, in some embodiments of the present application, the random generation of vehicle models along the path network further includes: before setting the interval distance between vehicle models, specifying one or more vehicle models in the model library as an alternative vehicle model library; and then, when generating vehicle models in sequence along the path network, binding the vehicle models from the alternative vehicle model library at the determined position, and the position is determined according to the interval distance of each random generation.

[0065] Preferably, in some embodiments of the present application, the spacing distance between two adjacent vehicle models is set based on the length of the vehicle model and a randomly generated random number within a preset range, including: the spacing distance is the distance between the centers of the two vehicles. First, a base value at least greater than 0 is set for the spacing distance. Then, to increase the sense of realism, half the length of the vehicle model and a randomly generated random number (the preset range for random number generation may be a multiple of the model length value) are added to the base value to determine the location of the next vehicle model to be set.

[0066] It can be seen from the above embodiments that in order to prevent the overlap between vehicle models caused by excessive vehicle density, the present application simulates the random spacing caused by differences in driver behavior in real traffic, and combines the length of the vehicle model to set the interval distance between two adjacent vehicle models, thereby improving the realism of the traffic flow.

[0067] Furthermore, in some embodiments of the present application, after generating a vehicle model on a path network, it is necessary to further set the driving speed of the vehicle model, including:

[0068] For the vehicle models on the same path, setting the same vehicle travel speed;

[0069] For the vehicle models on different paths, random disturbance settings are performed based on preset vehicle travel speeds.

[0070] Preferably, in some embodiments of the present application, the method for setting the driving speed of each vehicle model includes: setting a uniform speed for all vehicle models on the same path within the range of 0-120 km / h, so that all vehicle models move along the path at the same speed; in addition, in order to make the traffic flow on different paths slightly different and to prevent the moving traffic flow from being monotonous, the driving speed of the vehicle models on different paths is randomly perturbed on the original basic driving speed (the random perturbation interval is generally the minimum interval of 0.5 to 1.5 times the vehicle model driving speed and the vehicle model driving speed fluctuating by 10 km / h).

[0071] By randomly perturbing the speed of vehicle models in different paths, the monotonous changes in traffic flow in three-dimensional dynamic scenes are avoided, thereby improving the realism of traffic flow; further, the speed of vehicle models in the same path is set to the same speed, thereby reducing the computational complexity when updating vehicle positions.

[0072] S102: Divide the ground of the path network according to a preset grid size to obtain a grid map.

[0073] Preferably, in some embodiments of the present application, dividing the ground surface of the path network according to a preset grid size to obtain a grid map includes: the grid map being composed of rectangular grids, each grid having the same size and shape. Setting the grid to a rectangular shape facilitates subsequent distance calculations, such as the distance between the camera position and the grid or the distance between grids.

[0074] S103: A grid in the grid map whose distance from the camera position of the three-dimensional creation tool is less than or equal to a first preset distance is used as a first grid.

[0075] Preferably, in some embodiments of the present application, the distance between the camera position and the grid is specifically obtained by determining the intersection of the camera line of sight and the grid map, and then calculating the distance between the intersection and the center point of the grid.

[0076] Preferably, in some embodiments of the present application, the first preset distance can be set to a multiple of the grid width or length. The specific setting can be determined according to the viewing angle range of the camera. The present application does not limit the parameter setting.

[0077] Preferably, in some embodiments of the present application, the method for determining the first grid further includes: determining the intersection of the camera line of sight and the grid map, taking the grid at the intersection as the first grid obtained, and then taking the eight grids around the first grid as the first grid, thereby avoiding a large amount of distance data calculation and improving calculation efficiency.

[0078] S104: Determine whether it is necessary to prevent traffic flow on the path network from being interrupted; if so, determine a first path passing through a first grid from the path network, and update only the position of the vehicle model in the first path at a fixed frequency; if not, update the position of the vehicle model in the first grid at a first frequency, and update the position of the vehicle model in grids other than the first grid at a frequency lower than the first frequency.

[0079] Preferably, in some embodiments of the present application, all vehicle models can also be updated through a fixed and unified update frequency. This method has too high a computational load and may cause the three-dimensional creation tool to freeze, but it can achieve the best simulation effect.

[0080] Preferably, in some embodiments of the present application, after determining the first path passing through the first grid from the path network, the position of the vehicle model on the first path can be updated at a higher frequency, and the position of the vehicle model on other paths can be updated at a lower frequency, thereby saving some computing resources. At the same time, the traffic on all paths is in a dynamic state, and the traffic flow is avoided from being interrupted, thereby improving the realism.

[0081] Furthermore, in some embodiments of the present application, updating the position of the vehicle model in a grid other than the first grid at a frequency lower than the first frequency includes:

[0082] The grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than or equal to a second preset distance is used as the second grid;

[0083] updating the position of the vehicle model in the second grid at a second frequency; wherein the first preset distance is less than the second preset distance; and the first frequency is greater than the second frequency;

[0084] Using a grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than a first preset distance and less than a second preset distance as a buffer zone;

[0085] In a frequency range smaller than the first frequency and larger than the second frequency, the interpolation selects a frequency to update the position of the vehicle model.

[0086] Preferably, in some embodiments of the present application, the method for determining the buffer zone and the second grid further includes: using a grid adjacent to the first grid but not the first grid as a buffer zone; and using a grid that is not the first grid and the buffer zone as a second grid, thereby avoiding excessive numerical calculations of distances and improving computational efficiency.

[0087] Preferably, in some embodiments of the present application, the first frequency can be set to update the position of the vehicle model once every 0.03 seconds; the second frequency can be set to update the position of the vehicle model once every 1 second.

[0088] The above embodiment shows that because the user's viewpoint area of ​​interest, i.e., the total area of ​​the first grid, is smaller than the total area of ​​the other grids, when there is no need to ensure that the generated traffic flow is completely uninterrupted, computing resources can be focused on updating the vehicle model positions in the first grid, and the positions of the vehicle models in other grids can be updated more frequently, thereby effectively reducing the computational load when generating traffic flow. At the same time, a buffer area is set between the second grid, which is updated at a lower frequency, and the first grid. The update frequency of the vehicle model position is interpolated within this buffer area to alleviate the discontinuity caused by the difference in position update frequency.

[0089] Furthermore, in some embodiments of the present application, updating the position of the vehicle model by interpolating a selected frequency within a frequency range less than the first frequency and greater than the second frequency includes:

[0090] Calculating a first distance between the vehicle model and the nearest first grid;

[0091] According to the first distance, a corresponding third frequency is selected from the frequency range to update the position of the vehicle model; wherein, the smaller the first distance is, the closer the third frequency is to the first frequency.

[0092] Preferably, in some embodiments of the present application, the distance between the vehicle model and the grid is the distance between the center point of the vehicle model and the center point of the grid.

[0093] Preferably, in some embodiments of the present application, the corresponding third frequency is selected from the frequency range according to the first distance, including: the closer the vehicle model is to the second grid, the closer the third frequency is to the second frequency; the closer the vehicle model is to the first grid, the closer the third frequency is to the first frequency; that is, the magnitude of the third frequency decreases with the increase of the first distance, and the relationship between the two can be obtained through linear modeling.

[0094] It can be seen from the above embodiments that the present application ensures high-frequency updates of areas close to the user's viewpoint through a distance attenuation mechanism and interpolation frequency transition smoothing operations, alleviates the problem of traffic discontinuity caused by the two areas updating at different fixed low frequencies, and avoids waste of computing resources, achieving a dynamic balance between computing efficiency and realism.

[0095] Furthermore, in some embodiments of the present application, when the position of the vehicle model is updated, the method further includes:

[0096] The space within a preset range in the vertical direction of the three-dimensional space where the vehicle model is located is used as a collision detection space;

[0097] If the collision detection space corresponding to the updated position of the vehicle model collides with the preset static model, the position of the vehicle model is corrected to the collision coordinate point.

[0098] Preferably, in some embodiments of the present application, the space within a preset range in the vertical direction of the three-dimensional space where the vehicle model is located is used as the collision detection space, including: taking the position a certain distance vertically upward (generally 10m) of the current vehicle model's position as the starting point, and the position a certain distance vertically downward (generally 10m) as the end point, and taking the range between the starting point and the end point as the collision detection space.

[0099] It can be seen from the above embodiments that since static models such as the ground will be uneven during modeling, the present application sets a certain range of collision detection space in the vertical direction of the position of the vehicle model, and resets the position of the vehicle model according to the collision coordinate point, which can prevent the vehicle model from being suspended in the air or colliding with the ground model, thereby improving the realism of the traffic flow.

[0100] Preferably, in some embodiments of the present application, after the vehicle model starts to move, it is necessary to continuously add new vehicle models at the starting point of each path, that is, when the vehicle model closest to the starting point of each path leaves the starting point for a certain distance, a new vehicle model is generated at the starting point to avoid traffic interruption.

[0101] In summary, compared to the prior art, the method for generating traffic flow in a dynamic three-dimensional scene provided by the embodiment of the present application has the following beneficial effects: first, the ground of the path network is divided into a grid to obtain a grid map, and then the distance between the camera and each vehicle model is avoided. The grid is used as the basis for subsequent management of vehicle model position updates, thereby improving computational efficiency. Secondly, based on the distance between the camera and the grid, the user's viewpoint focus area, i.e., the first grid, is determined. At this time, the user's attention is focused on the three-dimensional model of the first grid. Therefore, using the first grid as the basis for subsequent vehicle model position updates can effectively ensure the realistic effect of the traffic flow generated from the user's perspective when the vehicle position is updated. Finally, different vehicle model position update methods are set according to actual needs. By updating only the position of the vehicle model on the first path passing through the first grid at a fixed frequency, the position of the vehicle model on other paths remains unchanged, thereby reducing the computing load while ensuring that there is no interruption in the traffic flow on the path; or according to the distance between the grid and the camera, the update frequency of the vehicle model position in different grids is set, that is, the position of the vehicle model in the first grid is updated at a higher update frequency, and the position of the vehicle model in other grids farther away from the camera is updated at a lower frequency, thereby effectively avoiding the waste of computing resources in areas that the user does not notice, and reducing the computing load of the 3D creation tool.

[0102] like Figure 2 As shown, based on the above-mentioned method embodiment, an embodiment of the present application provides a traffic flow generation device in a dynamic three-dimensional scene, including: a vehicle model setting module 201, a grid division module 202, a first grid screening module 203 and a position update module 204.

[0103] Furthermore, in some embodiments of the present application, the vehicle model setting module 201 is used to generate a path network through a three-dimensional creation tool and randomly generate vehicle models along the path network; the grid division module 202 is used to divide the ground belonging to the path network according to a preset grid size to obtain a grid map; the first grid screening module 203 is used to use the grid in the grid map whose distance from the camera position of the three-dimensional creation tool is less than or equal to a first preset distance as the first grid; the position update module 204 is used to determine whether it is necessary to prevent the traffic flow on the path network from being interrupted; if necessary, determine the first path passing through the first grid from the path network, and update only the position of the vehicle model in the first path at a fixed frequency; if not, update the position of the vehicle model in the first grid at a first frequency, and update the position of the vehicle model in grids other than the first grid at a frequency lower than the first frequency.

[0104] Furthermore, in some embodiments of the present application, updating the position of the vehicle model in a grid outside the first grid at a frequency lower than the first frequency includes: using a grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than or equal to a second preset distance as a second grid; updating the position of the vehicle model in the second grid at a second frequency; wherein the first preset distance is less than the second preset distance; the first frequency is greater than the second frequency; using a grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than the first preset distance and less than the second preset distance as a buffer zone; and updating the position of the vehicle model by interpolation selection frequency within a frequency range less than the first frequency and greater than the second frequency.

[0105] Furthermore, in some embodiments of the present application, the interpolation selection frequency within the frequency range less than the first frequency and greater than the second frequency to update the position of the vehicle model includes: calculating a first distance between the vehicle model and the nearest first grid; based on the first distance, selecting a corresponding third frequency from the frequency range to update the position of the vehicle model; wherein, the smaller the first distance, the closer the third frequency is to the first frequency.

[0106] Furthermore, in some embodiments of the present application, the randomly generating vehicle models along the path network includes: generating the vehicle models in sequence along the path network, and setting the interval distance between two adjacent vehicle models based on the length of the vehicle model and a random number randomly generated within a preset range.

[0107] Furthermore, in some embodiments of the present application, it also includes: for the vehicle models on the same path, setting the same vehicle driving speed; for the vehicle models on different paths, performing random disturbance setting based on the preset vehicle driving speed.

[0108] Furthermore, in some embodiments of the present application, when updating the position of the vehicle model, it also includes: using the space within a preset range of the vehicle model's position in the vertical direction of the three-dimensional space as a collision detection space; if the collision detection space corresponding to the updated position of the vehicle model collides with a preset static model, the position of the vehicle model is corrected to a collision coordinate point.

[0109] It can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present application, which can implement any of the above-mentioned method embodiments of the present application to provide a method for generating traffic flow in a dynamic three-dimensional scene.

[0110] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided herein, the connection relationship between the modules indicates that there is a communication connection between them, which may be implemented as one or more communication buses or signal lines. Those skilled in the art may understand and implement the present invention without inventive effort.

[0111] Based on the above-mentioned embodiment of the method for generating traffic flow in a dynamic three-dimensional scene, another embodiment of the present application provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the method for generating traffic flow in a dynamic three-dimensional scene of any embodiment of the present application is implemented.

[0112] For example, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more module elements may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0113] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0114] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.

[0115] Based on the above-mentioned method embodiments, another embodiment of the present application provides a computer-readable storage medium, including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the traffic flow generation method in a dynamic three-dimensional scene described in any one of the above-mentioned method embodiments of the present application.

[0116] Wherein, the module / unit integrated in the device / terminal equipment, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium, etc.

Claims

1. A method for generating traffic flow in a dynamic three-dimensional scene, characterized in that: include: generating a path network using a three-dimensional authoring tool, and randomly generating vehicle models along the path network; Divide the ground of the path network according to a preset grid size to obtain a grid map; The grid in the grid map whose distance from the camera position of the three-dimensional creation tool is less than or equal to a first preset distance is used as the first grid; Determine whether it is necessary to prevent traffic flow interruptions on the path network; if so, determine a first path passing through a first grid from the path network, and update only the position of the vehicle model in the first path at a fixed frequency; if not, update the position of the vehicle model in the first grid at a first frequency, and update the position of the vehicle model in grids other than the first grid at a frequency lower than the first frequency.

2. The method for generating traffic flow in a dynamic three-dimensional scene according to claim 1, wherein: The updating of the position of the vehicle model located in a grid other than the first grid at a frequency lower than the first frequency comprises: The grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than or equal to a second preset distance is used as the second grid; updating the position of the vehicle model in the second grid at a second frequency; wherein the first preset distance is less than the second preset distance; and the first frequency is greater than the second frequency; Using a grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than a first preset distance and less than a second preset distance as a buffer zone; In a frequency range smaller than the first frequency and larger than the second frequency, the interpolation selects a frequency to update the position of the vehicle model.

3. The method for generating traffic flow in a dynamic three-dimensional scene according to claim 2, wherein: The updating of the position of the vehicle model by interpolating and selecting a frequency within a frequency range less than the first frequency and greater than the second frequency comprises: Calculating a first distance between the vehicle model and the nearest first grid; According to the first distance, a corresponding third frequency is selected from the frequency range to update the position of the vehicle model; wherein, the smaller the first distance is, the closer the third frequency is to the first frequency.

4. The method for generating traffic flow in a dynamic three-dimensional scene according to claim 1, wherein: The randomly generating vehicle models along the path network comprises: The vehicle models are sequentially generated along the path network, and the interval distance between two adjacent vehicle models is set according to the length of the vehicle model and a random number randomly generated within a preset range.

5. The method for generating traffic flow in a dynamic three-dimensional scene according to claim 1, wherein: Also includes: For the vehicle models on the same path, setting the same vehicle travel speed; For the vehicle models on different paths, random disturbance settings are performed based on preset vehicle travel speeds.

6. The method for generating traffic flow in a dynamic three-dimensional scene according to any one of claims 1 to 5, characterized in that: When the position of the vehicle model is updated, the method further includes: The space within a preset range in the vertical direction of the three-dimensional space where the vehicle model is located is used as a collision detection space; If the collision detection space corresponding to the updated position of the vehicle model collides with the preset static model, the position of the vehicle model is corrected to the collision coordinate point.

7. A vehicle flow generation device in a dynamic three-dimensional scene, characterized in that: include: Vehicle model setting module, grid division module, first grid screening module and position update module; The vehicle model setting module is used to generate a path network using a three-dimensional creation tool and randomly generate vehicle models along the path network; The grid division module is used to divide the ground of the path network according to a preset grid size to obtain a grid map; The first grid screening module is configured to select a grid in the grid map whose distance from the camera position of the three-dimensional authoring tool is less than or equal to a first preset distance as a first grid; The position update module is used to determine whether it is necessary to prevent traffic interruptions on the path network; if so, determine a first path passing through a first grid from the path network, and update only the position of the vehicle model in the first path at a fixed frequency; if not, update the position of the vehicle model in the first grid at a first frequency, and update the position of the vehicle model in grids other than the first grid at a frequency lower than the first frequency.

8. The vehicle flow generation device in a dynamic three-dimensional scene according to claim 7, characterized in that: The updating of the position of the vehicle model located in a grid other than the first grid at a frequency lower than the first frequency comprises: The grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than or equal to a second preset distance is used as the second grid; updating the position of the vehicle model in the second grid at a second frequency; wherein the first preset distance is less than the second preset distance; and the first frequency is greater than the second frequency; Using a grid in the grid map whose distance from the camera position of the three-dimensional creation tool is greater than a first preset distance and less than a second preset distance as a buffer zone; In a frequency range smaller than the first frequency and larger than the second frequency, the interpolation selects a frequency to update the position of the vehicle model.

9. The vehicle flow generation device in a dynamic three-dimensional scene according to claim 7 or 8, characterized in that: When the position of the vehicle model is updated, the method further includes: The space within a preset range in the vertical direction of the three-dimensional space where the vehicle model is located is used as a collision detection space; If the collision detection space corresponding to the updated position of the vehicle model collides with the preset static model, the position of the vehicle model is corrected to the collision coordinate point.

10. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for generating traffic flow in a dynamic three-dimensional scene according to any one of claims 1 to 6 is implemented.