Vehicle driving animation method, device and equipment based on three-dimensional engine and medium

By importing three-dimensional models and texture maps into the three-dimensional engine, setting the vehicle's starting point and end coordinates, simulating the running route, and generating an animation keyframe data table, the flexibility and performance problems of traditional animation production are solved, and adaptive vehicle driving animation is realized Update, save manpower and material resources and improve computing performance.

CN119027554APending Publication Date: 2024-11-26山东捷瑞信息技术产业研究院有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411154167.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In traditional three-dimensional modeling software, vehicle driving animation production requires a lot of manpower and material resources, and re-animation is required when road changes, which lacks flexibility, resulting in increased computing performance consumption and difficulty in adapting to environmental changes.

Method used

Through a three-dimensional engine-based method, preset three-dimensional models and texture maps are imported, the starting point and end coordinates of the vehicle model are set, the running route is simulated, and the animation keyframe data table is generated to realize adaptive updates of vehicle driving animations, save manpower and material resources and improve flexibility.

Benefits of technology

It realizes the generation of three-dimensional vehicle driving animations that adapt to environmental changes in the three-dimensional engine, reducing the need for repetitive production, improving the flexibility and computing performance of the animation, and saving manpower and material resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027554A_ABST
    Figure CN119027554A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle driving animation method and device based on a three-dimensional engine, equipment and a medium, and relates to the technical field of three-dimensional visualization, and the method comprises the steps: importing a target three-dimensional scene model and a vehicle model corresponding to a target vehicle into a preset three-dimensional engine; determining a path starting point three-dimensional coordinate and a path end point three-dimensional coordinate of the vehicle model in the target three-dimensional scene model as initial animation key frames, and determining a vehicle advancing angle of the vehicle model; setting an animation frame frequency of a preset three-dimensional engine to obtain an animation unit frame frequency, determining a vehicle driving position corresponding to each frame of the vehicle model in the vehicle driving process, and then determining a vehicle driving animation key frame based on each vehicle driving position; and generating an animation key frame data table based on the initial animation key frame and the vehicle driving animation key frame, and generating a vehicle driving animation of the target vehicle based on the animation key frame data table. In this way, the three-dimensional scene vehicle can automatically play animations and can adapt to terrains.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional visualization technology, and in particular to a vehicle driving animation method, device, equipment and medium based on a three-dimensional engine. Background Art

[0002] At present, the application field of digital twin technology is expanding day by day. In some cities and factory scenes, vehicle driving animation is often used to increase the realism and visual effects. The traditional implementation method is to make animation in 3D modeling software, and then import the model animation into the scene. When the 3D scene road is adjusted and changed, the animation needs to be remade in the software. This method not only consumes a lot of manpower and material resources for preliminary calculations and animation production, but also causes the scene to increase the performance consumption of the computer and lack flexibility. Therefore, how to generate a 3D animation of vehicle driving that can adapt to environmental changes needs to be solved. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a vehicle driving animation method, device, equipment and medium based on a three-dimensional engine, which can generate a vehicle driving three-dimensional animation that can adapt to environmental changes. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a method for generating a vehicle driving animation based on a three-dimensional engine, comprising:

[0005] Importing a preset three-dimensional model and a preset texture map into a pre-created three-dimensional scene to obtain a target three-dimensional scene model, and importing the target three-dimensional scene model and a vehicle model corresponding to a target vehicle into a preset three-dimensional engine;

[0006] Determine the path starting point 3D coordinates and the path ending point 3D coordinates of the vehicle model in the target 3D scene model as initial animation key frames, and determine the vehicle forward angle of the vehicle model in the target 3D scene model based on the starting point 3D coordinates and the ending point 3D coordinates;

[0007] The animation frame rate of the preset three-dimensional engine is set to obtain an animation unit frame rate, and the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point, and the three-dimensional coordinates of the path end point, and then the vehicle driving animation key frame is determined based on each of the vehicle driving positions;

[0008] An animation key frame data table is generated based on the initial animation key frame and the vehicle driving animation key frame, and a vehicle driving animation of the target vehicle is generated based on the animation key frame data table.

[0009] Optionally, the determining a vehicle advancing angle of the vehicle model in the target three-dimensional scene model based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the end point includes:

[0010] Determine coordinate axis differences corresponding to three coordinate axes of the target vehicle based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the end point;

[0011] The coordinate axis difference is substituted into a preset vehicle driving angle calculation formula to determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model.

[0012] Optionally, determining the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path end point includes:

[0013] Obtaining the moving distance per second of the vehicle, and substituting the moving distance per second, the animation unit frame rate and the coordinate axis difference into a preset moving distance calculation formula to obtain the corresponding moving distance of the vehicle model on the three coordinate axes;

[0014] The vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the moving distance, the vehicle forward angle and the three-dimensional coordinates of the path starting point.

[0015] Optionally, the setting the animation frame rate of the preset three-dimensional engine to obtain the animation unit frame rate includes:

[0016] Acquire device information and software operating environment corresponding to the preset 3D engine, and determine the execution time of each picture frame of the preset 3D engine based on the device information and the software operating environment;

[0017] After comparing the execution time with a preset human eye recognition speed, the number of frames transmitted per second is determined based on the comparison result to obtain the animation unit frame rate; the preset human eye recognition speed is the speed at which the human eye recognizes a continuous image.

[0018] Optionally, the method further includes:

[0019] Adding a mesh collision body corresponding to the vehicle model and the scene ground in the target three-dimensional scene model in the preset three-dimensional engine, and simulating an initial running route of the vehicle model in the target three-dimensional scene model based on the animation key frame data table;

[0020] Simulating the vehicle model to travel in the target three-dimensional scene model based on the initial running route, and using a preset physical engine and the mesh collision body to monitor the collision between the target vehicle and the running ground in real time, so as to obtain the actual geographical location corresponding to each frame of the vehicle model;

[0021] Determining whether the actual geographical location of each frame of the vehicle model is the same as the corresponding vehicle driving location;

[0022] If the actual geographic location is inconsistent with the corresponding vehicle driving location, the vehicle driving location is replaced by the actual geographic location to obtain a new vehicle driving location, and the animation key frame data table is updated based on the new vehicle driving location.

[0023] Optionally, the method further includes:

[0024] Determining whether the driving terrain in the target three-dimensional scene model changes;

[0025] If the driving terrain changes, the new path starting point three-dimensional coordinates and the new path ending point three-dimensional coordinates of the vehicle model are determined according to the driving terrain, and the process jumps to the step of determining the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as initial animation key frames.

[0026] Optionally, generating the vehicle driving animation of the target vehicle based on the animation key frame data table includes:

[0027] In the preset three-dimensional engine, after the target three-dimensional scene model is rendered in real time based on the animation key frame data table, each animation key frame in the animation key frame data table is played frame by frame to generate the vehicle driving animation of the target vehicle.

[0028] In a second aspect, the present application discloses a vehicle driving animation generating device based on a three-dimensional engine, comprising:

[0029] An animation scene determination module, used for importing a preset 3D model and a preset texture map into a pre-created 3D scene to obtain a target 3D scene model, and importing the target 3D scene model and a vehicle model corresponding to a target vehicle into a preset 3D engine;

[0030] A coordinate determination module, used to determine the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as initial animation key frames, and determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model based on the starting point three-dimensional coordinates and the ending point three-dimensional coordinates;

[0031] A key frame determination module, used to set the animation frame rate of the preset three-dimensional engine to obtain an animation unit frame rate, and determine the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path end point, and then determine the vehicle driving animation key frame based on each of the vehicle driving positions;

[0032] The animation generation module is used to generate an animation key frame data table based on the initial animation key frame and the vehicle driving animation key frame, and generate the vehicle driving animation of the target vehicle based on the animation key frame data table.

[0033] In a third aspect, the present application discloses an electronic device, comprising:

[0034] Memory, used to store computer programs;

[0035] A processor is used to execute the computer program to implement the aforementioned vehicle driving animation generation method.

[0036] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, which implements the aforementioned vehicle driving animation generation method when executed by a processor.

[0037] It can be seen that in the present application, the preset three-dimensional model and the preset texture map are imported into the pre-created three-dimensional scene to obtain the target three-dimensional scene model, and the vehicle model corresponding to the target three-dimensional scene model and the target vehicle is imported into the preset three-dimensional engine; the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path ending point of the vehicle model in the target three-dimensional scene model are determined as the initial animation key frame, and the vehicle forward angle of the vehicle model in the target three-dimensional scene model is determined based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the ending point; the animation frame rate of the preset three-dimensional engine is set to obtain the animation unit frame rate, and the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path ending point, and then the vehicle driving animation key frame is determined based on each of the vehicle driving positions; an animation key frame data table is generated based on the initial animation key frame and the vehicle driving animation key frame, and the vehicle driving animation of the target vehicle is generated based on the animation key frame data table. That is, in the three-dimensional engine, by setting the starting and ending coordinates of the vehicle and simulating the route, the key frame information in the middle is obtained to form a prefabricated path. For subsequent adjustments and modifications, it is only necessary to re-simulate the route to update it to the latest path, saving a lot of manpower and material resources and having strong flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0039] Figure 1 A flow chart of a vehicle driving animation method based on a three-dimensional engine disclosed in this application;

[0040] Figure 2 A schematic diagram of a specific vehicle driving animation based on a three-dimensional engine disclosed in this application;

[0041] Figure 3 A flowchart of a specific vehicle driving animation method based on a three-dimensional engine disclosed in this application;

[0042] Figure 4 A flowchart of a specific vehicle driving animation method based on a three-dimensional engine disclosed in this application;

[0043] Figure 5 This is a schematic diagram of the structure of a vehicle driving animation device based on a three-dimensional engine disclosed in this application;

[0044] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] In some urban and factory scenes, vehicles driving on roads are often used to increase realism and visual effects. The traditional implementation method is to make animations in 3D modeling software such as Maya and 3Dmax (3D Studio Max), and then import the model animations into the scene. When the 3D scene road is adjusted or changed, the animation needs to be remade in the software. This embodiment will specifically introduce a method for generating a vehicle driving animation that can adjust the animation according to the 3D road.

[0047] See also Figure 1 As shown, the embodiment of the present application discloses a method for generating a vehicle driving animation based on a three-dimensional engine, comprising:

[0048] Step S11: importing a preset 3D model and a preset texture map into a pre-created 3D scene to obtain a target 3D scene model, and importing the target 3D scene model and a vehicle model corresponding to a target vehicle into a preset 3D engine.

[0049] In this embodiment, the preset 3D model and the preset texture map are imported into the pre-created 3D scene to obtain the target 3D scene model, and the target 3D scene model and the vehicle model corresponding to the target vehicle are imported into the preset 3D engine. That is, a 3D scene is established, the 3D model and the texture map are imported, the scene model and the related vehicle model are imported into the 3D engine; and then the 3D scene and the vehicle model are imported into the 3D engine.

[0050] Step S12: Determine the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as initial animation key frames, and determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model based on the starting point three-dimensional coordinates and the ending point three-dimensional coordinates.

[0051] In this embodiment, the determination of the vehicle forward angle of the vehicle model in the target three-dimensional scene model based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the end point includes: determining the coordinate axis difference corresponding to the three coordinate axes of the target vehicle based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the end point; substituting the coordinate axis difference into a preset vehicle driving angle calculation formula to determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model. Specifically, the three-dimensional coordinates of the starting point and the end point of the vehicle in the three-dimensional scene are set as animation key frame information, and the difference between the x, y, and z axes of the starting point and the end point is calculated, and then the difference between the x-axis and the y-axis is substituted into the following formula to obtain the straight-line distance of the vertical plane between the starting point and the end point:

[0052] ;

[0053] Among them, a is the linear distance between the starting point and the end point in the horizontal plane, △x is the difference between the starting point and the end point on the x-axis, and △y is the difference between the starting point and the end point on the y-axis. Then, substitute the difference between the x-axis and the z-axis into the following formula to obtain the linear distance between the starting point and the end point in the horizontal plane:

[0054] ;

[0055] Among them, b is the straight-line distance of the vertical plane between the starting point and the end point, △x is the x-axis difference between the starting point and the end point, and △z is the z-axis difference between the starting point and the end point. Then, the calculated straight-line distance of the vertical plane between the starting point and the end point and the y-axis difference △y are substituted into the following formula to obtain the z-axis angle ∠z between the starting point and the end point:

[0056] ;

[0057] Among them, ∠z is the z-axis angle between the starting point and the end point, △y is the y-axis difference between the starting point and the end point, and a is the straight-line distance between the starting point and the end point on the vertical plane. Then, the calculated horizontal plane straight-line distance b between the starting point and the end point and the z-axis difference △z are substituted into the following formula to obtain the y-axis angle ∠y between the starting point and the end point:

[0058] ;

[0059] Among them, ∠y is the y-axis angle between the starting point and the end point, △z is the z-axis difference between the starting point and the end point, and b is the horizontal straight-line distance between the starting point and the end point. Finally, the z-axis angle value ∠z and the y-axis angle value ∠y are mapped to the scene model and bound to the starting point coordinates.

[0060] Step S13: The animation frame rate of the preset three-dimensional engine is set to obtain the animation unit frame rate, and the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path end point, and then the vehicle driving animation key frames are determined based on each of the vehicle driving positions.

[0061] In this embodiment, the setting of the animation frame rate of the preset 3D engine to obtain the animation unit frame rate includes: obtaining the device information and software operating environment corresponding to the preset 3D engine, and determining the execution time of each picture frame of the preset 3D engine based on the device information and the software operating environment; after comparing the execution time with the preset human eye recognition speed, determining the number of transmission frames per second based on the comparison result to obtain the animation unit frame rate; the preset human eye recognition speed is the speed of human eye recognition of continuous images. Specifically, regarding setting the animation frame rate in the event called by the 3D engine transmission frame per second (FPS, i.e., Frame Per Second), considering that the transmission frame per second of the 3D engine is affected by the computer hardware and software operating environment, the transmission frame per second is not a fixed value, so it is necessary to compare the execution time of each frame with the real time, and the speed of human eye recognition of continuous images is 24 frames / second, so when the time difference is greater than or equal to 40ms, the animation starts to be executed, and the animation is executed 25 times per second, that is, the animation frame rate is 25 frames / second, which can make the entire animation play smoothly.

[0062] In this embodiment, the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path end point, including: obtaining the vehicle's moving distance per second, and substituting the moving distance per second, the animation unit frame rate and the coordinate axis difference into the preset moving distance calculation formula to obtain the moving distance corresponding to the vehicle model on the three coordinate axes; based on the moving distance, the vehicle forward angle and the three-dimensional coordinates of the path starting point, the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process. Specifically, the difference △x between the vehicle's moving distance per second in reality and the x-axis between the vehicle's starting point and the end point is substituted into the following formula to obtain the x-axis moving distance d for each execution. x :

[0063] ;

[0064] Where, d x is the distance the vehicle moves on the x-axis each time it is executed, △x is the difference between the x-axis of the starting point and the end point, s is the distance the vehicle moves per second in reality, and f is the animation frame rate. The current distance the vehicle moves on the y-axis is calculated based on the speed of the vehicle along the x-axis. Substitute the distance the vehicle moves per second in reality and the difference between the x-axis and y-axis of the starting point and the end point of the vehicle into the following formula to obtain the distance d on the y-axis each time it is executed y :

[0065] ;

[0066] Where, d y is the distance the vehicle moves on the x-axis each time it is executed, △x is the difference between the x-axis of the starting point and the end point, △y is the difference between the y-axis of the starting point and the end point, s is the distance the vehicle moves per second in reality, and f is the animation frame rate. Similarly, the distance the current vehicle moves on the z-axis is obtained by calculating the speed of the vehicle along the x-axis. Substituting the difference between the x-axis and z-axis of the starting point and the end point of the vehicle into the following formula, the distance the vehicle moves on the z-axis each time it is executed is obtained. z :

[0067] ;

[0068] Where, d z is the distance the vehicle moves on the x-axis at each execution, △x is the x-axis difference between the starting point and the end point, △z is the z-axis difference between the starting point and the end point, s is the distance the vehicle moves per second in reality, and f is the animation frame rate. In this way, the basic path animation of the vehicle is realized by adding the moving distance at each execution to the current coordinates of the model, and recorded as key frame information to generate an animation key frame data table.

[0069] Step S14: generating an animation key frame data table based on the initial animation key frame and the vehicle driving animation key frame, and generating a vehicle driving animation of the target vehicle based on the animation key frame data table.

[0070] In this embodiment, the vehicle driving animation of the target vehicle is generated based on the animation key frame data table, including: in the preset three-dimensional engine, after the target three-dimensional scene model is rendered in real time based on the animation key frame data table, each animation key frame in the animation key frame data table is played frame by frame to generate the vehicle driving animation of the target vehicle. That is, after the simulation operation is completed, the key frame information of the entire process is saved, updated to the animation key frame data table, and then the physical engine is turned off to save performance, and then the scene is rendered in real time, and the vehicle will be animated according to the key frames obtained in the above steps. During playback, the entire animation can be fully played by reading the animation key frame data table for each frame.

[0071] In addition, this embodiment also includes: judging whether the driving terrain in the target three-dimensional scene model has changed; if the driving terrain has changed, determining the new path starting point three-dimensional coordinates and the new path ending point three-dimensional coordinates of the vehicle model according to the driving terrain, and jumping to the step of determining the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as the initial animation key frame. In other words, when the scene road changes, the start and end coordinate positions can be adjusted according to the new terrain, and then the animation frame data table can be updated to the new key frame information through simulation operation again.

[0072] It can be seen that in this embodiment, Figure 2As shown, a preset three-dimensional model and a preset texture map are imported into a pre-created three-dimensional scene to obtain a target three-dimensional scene model, and the target three-dimensional scene model and the vehicle model corresponding to the target vehicle are imported into a preset three-dimensional engine; the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path ending point of the vehicle model in the target three-dimensional scene model are determined as initial animation key frames, and the vehicle forward angle of the vehicle model in the target three-dimensional scene model is determined based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the ending point; the animation frame rate of the preset three-dimensional engine is set to obtain an animation unit frame rate, and the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path ending point, and then the vehicle driving animation key frames are determined based on each of the vehicle driving positions; an animation key frame data table is generated based on the initial animation key frame and the vehicle driving animation key frame, and the vehicle driving animation of the target vehicle is generated based on the animation key frame data table. That is, in the three-dimensional engine, by setting the starting and ending coordinates of the vehicle and simulating the route, the key frame information in the middle is obtained to form a prefabricated path. For subsequent adjustments and modifications, it is only necessary to re-simulate the route to update it to the latest path, saving a lot of manpower and material resources and having strong flexibility.

[0073] The above embodiment specifically introduces the vehicle driving animation generation process of the entire three-dimensional engine. However, in the actual driving process, the vehicle will be affected by the terrain (uphill / downhill) and the driving angle will change greatly. This embodiment will specifically introduce this situation.

[0074] See also Figure 3 As shown, the embodiment of the present application discloses a specific vehicle collision monitoring method, including:

[0075] Step S21: adding a mesh collision body corresponding to the vehicle model and the scene ground in the target three-dimensional scene model in the preset three-dimensional engine, and simulating the initial running route of the vehicle model in the target three-dimensional scene model based on the animation key frame data table.

[0076] In this embodiment, a mesh collision body corresponding to the vehicle model and the scene ground in the target three-dimensional scene model is added in the preset three-dimensional engine, and the initial running route of the vehicle model in the target three-dimensional scene model is simulated based on the animation key frame data table. That is, a mesh collision body is added for the vehicle and the ground in the three-dimensional engine, and then the initial running route formed by the animation key frame data table is simulated.

[0077] Step S22: simulating the vehicle model to travel in the target three-dimensional scene model based on the initial running route, and using a preset physics engine and the mesh collision body to monitor the collision between the target vehicle and the running ground in real time to obtain the actual geographical location corresponding to each frame of the vehicle model.

[0078] Step S23: determining whether the actual geographical location of each frame of the vehicle model is the same as the corresponding vehicle driving location.

[0079] Step S24: If the actual geographical location is inconsistent with the corresponding vehicle driving position, the vehicle driving position is replaced by the actual geographical location to obtain a new vehicle driving position, and the animation key frame data table is updated based on the new vehicle driving position.

[0080] In this embodiment, the collision between the vehicle and the ground is monitored in real time through the physical engine during playback. When it is detected that the information value of the vehicle in the current key frame is different from the predetermined path position information value calculated by interpolation, the x, y, z position and rotation information ∠x, ∠y, ∠z of the current frame vehicle model are updated to replace the previous key frame information.

[0081] It can be seen that in this embodiment, the intermediate key frame information is obtained by simulating the running route to form a prefabricated path. For subsequent adjustments and modifications, it is only necessary to re-simulate the running route to update it to the latest path, which saves a lot of manpower and material resources and has strong flexibility.

[0082] See also Figure 4As shown, this application will introduce a specific vehicle collision monitoring method through actual data. First, a three-dimensional scene is established, a three-dimensional model and texture map are imported, and the scene model and related vehicle model are imported into the three-dimensional engine. The three-dimensional coordinates of the starting point and the end point of the vehicle in the three-dimensional scene are set as the animation key frame information, and the difference between the x, y, and z axes of the starting point and the end point is calculated. Here, it is assumed that the x, y, and z axis coordinate values ​​of the starting point of the vehicle are (0, 0, 0), and the x, y, and z axis coordinate values ​​of the end point are (100, 5, 20). The difference △x of the x-axis is 100, and the difference △y of the y-axis is 5. Substitute the difference between the x-axis and the y-axis into the following formula, and the straight-line distance between the vertical plane of the starting point and the end point is 100.12. The difference △z of the z-axis is 20. Substitute the difference between the x-axis and the z-axis into the following formula, and the straight-line distance between the horizontal plane of the starting point and the end point is 101.98. Substitute the calculated straight-line distance between the starting point and the end point and the y-axis difference △y into the following formula, and the z-axis angle ∠z between the starting point and the end point is 2.86. Substitute the calculated straight-line distance b between the starting point and the end point and the z-axis difference △z into the following formula, and the y-axis angle ∠y between the starting point and the end point is 11.31. Therefore, substitute the actual vehicle moving distance per second and the x-axis difference △x between the vehicle starting point and the end point into the following formula, assuming that the vehicle moves 16 meters per second, and the x-axis moving distance d is obtained for each execution. x The current vehicle y-axis moving distance is calculated based on the vehicle's speed along the x-axis. Substitute the actual vehicle moving distance per second and the difference between the x-axis and y-axis values ​​of the vehicle's starting and ending points into the following formula to obtain the y-axis moving distance d for each execution. y Similarly, the current z-axis moving distance of the vehicle is calculated according to the speed of the vehicle along the x-axis. The difference between the x-axis and z-axis of the vehicle's starting and ending points △x and △z is substituted into the following formula to obtain the z-axis moving distance d for each execution. z The basic path animation of the vehicle is realized by adding the moving distance of each execution to the current coordinates of the model, and recorded as key frame information to generate an animation key frame data table. The data table format is as follows:

[0083] .

[0084] Furthermore, a mesh collision body is added to the vehicle and the ground in the three-dimensional engine, and the basic path animation implemented in step 2 is simulated. During the playback process, the collision between the vehicle and the ground is monitored in real time through the physical engine. When the information value of the vehicle in the current key frame is detected to be different from the predetermined path position information value calculated by interpolation, the x, y, z position and rotation information ∠x, ∠y, ∠z of the vehicle model in the current frame are updated to replace the previous key frame information, and the entire process animation is played in this way. After the simulation is completed, the key frame information of the entire process is saved and updated to the animation key frame data table, and then the physical engine is closed to save performance. During playback, the entire animation can be played completely by reading the animation key frame data table for each frame. When the scene road changes, the start and end coordinate positions can be adjusted according to the new terrain, and then the animation frame data table is updated to the new key frame information through simulation again. The scene is rendered in real time, and the vehicle will play the animation according to the key frames obtained in the above steps.

[0085] In this way, compared with the traditional method of making animations in 3D modeling software such as Maya and 3Dmax, and then importing the finished model animation into the scene, which consumes a lot of manpower and physics, and increases the computing and rendering burden of the computer, it lacks flexibility. This application sets the starting and ending coordinates of the vehicle, simulates the running route, obtains the key frame information in the middle, and forms a prefabricated path. For subsequent adjustments and modifications, you only need to re-simulate the running route to update it to the latest path, saving a lot of manpower and material resources and having strong flexibility.

[0086] refer to Figure 5 The embodiment of the present application also discloses a vehicle driving animation generating device based on a three-dimensional engine, including:

[0087] Animation scene determination module 11, used for importing a preset 3D model and a preset texture map into a pre-created 3D scene to obtain a target 3D scene model, and importing the target 3D scene model and a vehicle model corresponding to a target vehicle into a preset 3D engine;

[0088] A coordinate determination module 12 is used to determine the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as initial animation key frames, and determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model based on the starting point three-dimensional coordinates and the ending point three-dimensional coordinates;

[0089] A key frame determination module 13 is used to set the animation frame rate of the preset three-dimensional engine to obtain an animation unit frame rate, and determine the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path end point, and then determine the vehicle driving animation key frame based on each of the vehicle driving positions;

[0090] The animation generating module 14 is used to generate an animation key frame data table based on the initial animation key frame and the vehicle driving animation key frame, and to generate the vehicle driving animation of the target vehicle based on the animation key frame data table.

[0091] It can be seen that in this embodiment, in the three-dimensional engine, by setting the starting and ending coordinates of the vehicle and simulating the running route, the key frame information in the middle is obtained to form a prefabricated path. For subsequent adjustments and modifications, it is only necessary to re-simulate the running route to update it to the latest path, which saves a lot of manpower and material resources and has strong flexibility.

[0092] In some specific embodiments, the coordinate determination module 12 may specifically include:

[0093] A coordinate calculation unit, used to determine coordinate axis differences corresponding to three coordinate axes of the target vehicle based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the end point;

[0094] The angle determination unit is used to substitute the coordinate axis difference into a preset vehicle driving angle calculation formula to determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model.

[0095] In some specific embodiments, the key frame determination module 13 may specifically include:

[0096] A moving distance determination unit, used for obtaining the moving distance per second of the vehicle, and substituting the moving distance per second, the animation unit frame rate and the coordinate axis difference into a preset moving distance calculation formula to obtain the corresponding moving distance of the vehicle model on the three coordinate axes;

[0097] A driving position determination unit is used to determine the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process based on the moving distance, the vehicle forward angle and the three-dimensional coordinates of the path starting point.

[0098] In some specific embodiments, the key frame determination module 13 may specifically include:

[0099] An execution time determination unit, used to obtain device information and a software operating environment corresponding to the preset 3D engine, and determine the execution time of each picture frame of the preset 3D engine based on the device information and the software operating environment;

[0100] The speed comparison unit is used to compare the execution time with a preset human eye recognition speed, and determine the number of frames transmitted per second based on the comparison result to obtain the animation unit frame rate; the preset human eye recognition speed is the speed at which the human eye recognizes a continuous image.

[0101] In some specific embodiments, the vehicle driving animation generating device may further include:

[0102] An initial route generation module, used for adding a mesh collision body corresponding to the vehicle model and the scene ground in the target three-dimensional scene model in the preset three-dimensional engine, and simulating an initial running route of the vehicle model in the target three-dimensional scene model based on the animation key frame data table;

[0103] An actual geographic location monitoring module, used to simulate the vehicle model driving in the target three-dimensional scene model based on the initial running route, and to monitor the collision between the target vehicle and the running ground in real time using a preset physical engine and the mesh collision body, so as to obtain the actual geographic location corresponding to each frame of the vehicle model;

[0104] A position determination module, used to determine whether the actual geographical location of each frame of the vehicle model is the same as the corresponding vehicle driving position;

[0105] The data table updating module is used to replace the vehicle driving position with the actual geographical location to obtain a new vehicle driving position if the actual geographical location is inconsistent with the corresponding vehicle driving position, and update the animation key frame data table based on the new vehicle driving position.

[0106] In some specific embodiments, the vehicle driving animation generating device may further include:

[0107] A terrain judgment module, used to judge whether the driving terrain in the target three-dimensional scene model has changed;

[0108] A step jump module is used to determine the new path starting point three-dimensional coordinates and the new path ending point three-dimensional coordinates of the vehicle model according to the driving terrain if the driving terrain changes, and jump to the step of determining the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as initial animation key frames.

[0109] In some specific embodiments, the animation generation module 14 may specifically include:

[0110] The animation playback unit is used to, in the preset three-dimensional engine, after real-time rendering of the target three-dimensional scene model based on the animation key frame data table, play each animation key frame in the animation key frame data table frame by frame to generate a vehicle driving animation of the target vehicle.

[0111] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of the present application.

[0112] Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the vehicle driving animation generation method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0113] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0114] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0115] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the vehicle driving animation generation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0116] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the vehicle driving animation generation method disclosed above is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.

[0117] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0119] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0120] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0121] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A vehicle driving animation generation method based on a three-dimensional engine, characterized in that: include: Importing a preset three-dimensional model and a preset texture map into a pre-created three-dimensional scene to obtain a target three-dimensional scene model, and importing the target three-dimensional scene model and a vehicle model corresponding to a target vehicle into a preset three-dimensional engine; Determine the path starting point 3D coordinates and the path ending point 3D coordinates of the vehicle model in the target 3D scene model as initial animation key frames, and determine the vehicle forward angle of the vehicle model in the target 3D scene model based on the starting point 3D coordinates and the ending point 3D coordinates; The animation frame rate of the preset three-dimensional engine is set to obtain an animation unit frame rate, and the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point, and the three-dimensional coordinates of the path end point, and then the vehicle driving animation key frame is determined based on each of the vehicle driving positions; An animation key frame data table is generated based on the initial animation key frame and the vehicle driving animation key frame, and a vehicle driving animation of the target vehicle is generated based on the animation key frame data table.

2. The vehicle driving animation generation method according to claim 1, characterized in that: The determining of the vehicle forward angle of the vehicle model in the target three-dimensional scene model based on the starting point three-dimensional coordinates and the end point three-dimensional coordinates includes: Determine coordinate axis differences corresponding to three coordinate axes of the target vehicle based on the three-dimensional coordinates of the starting point and the three-dimensional coordinates of the end point; The coordinate axis difference is substituted into a preset vehicle driving angle calculation formula to determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model.

3. The vehicle driving animation generation method according to claim 2, characterized in that: The determining of the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path end point includes: Obtaining the moving distance per second of the vehicle, and substituting the moving distance per second, the animation unit frame rate and the coordinate axis difference into a preset moving distance calculation formula to obtain the corresponding moving distance of the vehicle model on the three coordinate axes; The vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process is determined based on the moving distance, the vehicle forward angle and the three-dimensional coordinates of the path starting point.

4. The vehicle driving animation generation method according to claim 1, characterized in that: The step of setting the animation frame rate of the preset three-dimensional engine to obtain the animation unit frame rate includes: Acquire device information and software operating environment corresponding to the preset 3D engine, and determine the execution time of each picture frame of the preset 3D engine based on the device information and the software operating environment; After comparing the execution time with a preset human eye recognition speed, the number of frames transmitted per second is determined based on the comparison result to obtain the animation unit frame rate; the preset human eye recognition speed is the speed at which the human eye recognizes a continuous image.

5. The vehicle driving animation generation method according to claim 1, characterized in that: Also includes: Adding a mesh collision body corresponding to the vehicle model and the scene ground in the target three-dimensional scene model in the preset three-dimensional engine, and simulating an initial running route of the vehicle model in the target three-dimensional scene model based on the animation key frame data table; Simulating the vehicle model to travel in the target three-dimensional scene model based on the initial running route, and using a preset physical engine and the mesh collision body to monitor the collision between the target vehicle and the running ground in real time, so as to obtain the actual geographical location corresponding to each frame of the vehicle model; Determining whether the actual geographical location of each frame of the vehicle model is the same as the corresponding vehicle driving location; If the actual geographic location is inconsistent with the corresponding vehicle driving location, the vehicle driving location is replaced by the actual geographic location to obtain a new vehicle driving location, and the animation key frame data table is updated based on the new vehicle driving location.

6. The vehicle driving animation generation method according to claim 1, characterized in that: Also includes: Determining whether the driving terrain in the target three-dimensional scene model changes; If the driving terrain changes, the new path starting point three-dimensional coordinates and the new path ending point three-dimensional coordinates of the vehicle model are determined according to the driving terrain, and the process jumps to the step of determining the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as initial animation key frames.

7. The vehicle driving animation generation method according to any one of claims 1 to 6, characterized in that: The generating the vehicle driving animation of the target vehicle based on the animation key frame data table comprises: In the preset three-dimensional engine, after the target three-dimensional scene model is rendered in real time based on the animation key frame data table, each animation key frame in the animation key frame data table is played frame by frame to generate the vehicle driving animation of the target vehicle.

8. A vehicle driving animation generation device based on a three-dimensional engine, characterized in that: include: An animation scene determination module, used for importing a preset 3D model and a preset texture map into a pre-created 3D scene to obtain a target 3D scene model, and importing the target 3D scene model and a vehicle model corresponding to a target vehicle into a preset 3D engine; A coordinate determination module, used to determine the path starting point three-dimensional coordinates and the path ending point three-dimensional coordinates of the vehicle model in the target three-dimensional scene model as initial animation key frames, and determine the vehicle forward angle of the vehicle model in the target three-dimensional scene model based on the starting point three-dimensional coordinates and the ending point three-dimensional coordinates; A key frame determination module, used to set the animation frame rate of the preset three-dimensional engine to obtain an animation unit frame rate, and determine the vehicle driving position corresponding to each frame of the vehicle model during the vehicle driving process based on the vehicle forward angle, the animation unit frame rate, the three-dimensional coordinates of the path starting point and the three-dimensional coordinates of the path end point, and then determine the vehicle driving animation key frame based on each of the vehicle driving positions; The animation generation module is used to generate an animation key frame data table based on the initial animation key frame and the vehicle driving animation key frame, and generate the vehicle driving animation of the target vehicle based on the animation key frame data table.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the vehicle driving animation generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the vehicle driving animation generation method as described in any one of claims 1 to 7.