Model collision animation generation method and device, storage medium, and electronic device

By decomposing, classifying and merging complex models, an accurate convex hull collision body is generated, and through surface reduction and model bonding processing, the problems of inaccurate collision detection and low collision animation accuracy in the existing technology are solved, and efficient and accurate model collision animation generation is achieved.

CN119784903APending Publication Date: 2025-04-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411837136.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, simple geometric collision bodies cannot accurately represent the shape of complex models, resulting in inaccurate collision detection and low accuracy of generated collision animations.

Method used

By performing convex hull decomposition, classification and merging of the original virtual model, more accurate convex hull colliders are generated, and the accuracy and consistency of the colliders are improved through surface reduction and model bonding.

Benefits of technology

Accurate collision animation generation of complex models is achieved, the accuracy and efficiency of collision detection is improved, and the high consistency between the model and the collider is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784903A_ABST
    Figure CN119784903A_ABST
Patent Text Reader

Abstract

The present disclosure is about a method and device for generating a model collision animation, a storage medium, and an electronic device, and relates to the field of graphics rendering technology. The method includes: classifying a first original convex hull block to obtain a first target convex hull block and a first remaining convex hull block; performing convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classifying the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block; merging the convex hull block to be merged and the second remaining convex hull block to obtain a convex hull merging result, and performing face reduction processing on the convex hull merging result to obtain a convex hull block after face reduction processing; generating a convex hull collision body corresponding to the original virtual model according to the convex hull block after face reduction processing, and merging the original virtual model and the convex hull collision body to obtain a model collision animation. The present disclosure improves the accuracy of the model collision animation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of graphics rendering technology, and in particular, to a method for generating a model collision animation, a device for generating a model collision animation, a computer-readable storage medium, and an electronic device. Background Art

[0002] In the related collision animation generation scheme, it can be realized based on the collision between simple geometric bodies and virtual models. However, this scheme has the following defects: simple geometric collision bodies cannot accurately represent the shape of complex models, which will lead to inaccurate collision detection; at the same time, it will also make the generated collision animation less accurate.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0004] The purpose of the present disclosure is to provide a method for generating a model collision animation, a device for generating a model collision animation, a computer-readable storage medium, and an electronic device. , thereby at least to some extent overcoming the problems of inaccurate collision detection and low accuracy of collision animation caused by the limitations and defects of related technologies.

[0005] According to one aspect of the present disclosure, a method for generating a model collision animation is provided, comprising:

[0006] Performing convex hull decomposition on the original virtual model to obtain first original convex hull blocks, and classifying the first original convex hull blocks to obtain first target convex hull blocks and first remaining convex hull blocks;

[0007] Performing convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classifying the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block;

[0008] Merging the convex hull blocks to be merged and the second remaining convex hull blocks to obtain a convex hull merging result, and performing surface reduction processing on the convex hull merging result to obtain convex hull blocks after surface reduction processing;

[0009] A convex hull collision body corresponding to the original virtual model is generated according to the convex hull blocks after the surface reduction process, and the original virtual model and the convex hull collision body are merged to obtain a model collision animation.

[0010] According to one aspect of the present disclosure, there is provided a device for generating a model collision animation, comprising:

[0011] A first convex hull classification module is used to perform convex hull decomposition on the original virtual model to obtain first original convex hull blocks, and classify the first original convex hull blocks to obtain first target convex hull blocks and first remaining convex hull blocks;

[0012] A second convex hull classification module is used to perform convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classify the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block;

[0013] A convex hull merging module is used to merge the convex hull blocks to be merged and the second remaining convex hull blocks to obtain a convex hull merging result, and perform surface reduction processing on the convex hull merging result to obtain a convex hull block after surface reduction processing;

[0014] The collision animation generation module is used to generate a convex hull collision body corresponding to the original virtual model according to the convex hull blocks after the surface reduction process, and merge the original virtual model and the convex hull collision body to obtain a model collision animation.

[0015] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating a model collision animation described in any one of the above is implemented.

[0016] According to one aspect of the present disclosure, there is provided an electronic device, including:

[0017] Processor; and

[0018] A memory, configured to store executable instructions of the processor;

[0019] Wherein, the processor is configured to execute any one of the above-mentioned methods for generating model collision animation by executing the executable instructions.

[0020] The present disclosure provides a method for generating a model collision animation. On the one hand, the method performs convex hull decomposition on the original virtual model to obtain a first original convex hull block, and classifies the first original convex hull block to obtain a first target convex hull block and a first remaining convex hull block; then, the first target convex hull block is decomposed into a convex hull to obtain a second original convex hull block, and the first remaining convex hull block and the second original convex hull block are classified to obtain a convex hull block to be merged and a second remaining convex hull block; then, the convex hull block to be merged and the second remaining convex hull block are merged to obtain a convex hull merged result, and the convex hull block is merged into a convex hull merged result. The result of the merging is subjected to surface reduction processing to obtain convex hull blocks after surface reduction; finally, a convex hull collision body corresponding to the original virtual model is generated according to the convex hull blocks after surface reduction, and the original virtual model and the convex hull collision body are merged to obtain a model collision animation, thereby realizing the generation of collision animation for complex models, solving the problem in related technologies that a simple geometric collision body cannot accurately represent the shape of a complex model, thus causing inaccurate collision detection; on the other hand, it also solves the problem in related technologies that the accuracy of the generated collision animation is low, thereby improving the accuracy of the model collision animation.

[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0023] Figure 1 A flowchart of a method for generating a model collision animation according to an exemplary embodiment of the present disclosure is schematically shown.

[0024] Figure 2 A scene example diagram of an original virtual model used according to an example embodiment of the present disclosure is schematically shown.

[0025] Figure 3 A scene example diagram schematically illustrates an obtained first original convex hull partition according to an example embodiment of the present disclosure.

[0026] Figure 4 A scene example diagram schematically illustrates an obtained first vertex concave information according to an example embodiment of the present disclosure.

[0027] Figure 5A scene example diagram schematically shows an obtained first convex hull concave feature according to an example embodiment of the present disclosure.

[0028] Figure 6 An example scene diagram schematically illustrates an area with normals pointing upward in a first original convex hull partition obtained according to an example embodiment of the present disclosure.

[0029] Figure 7 A scene example diagram schematically illustrates an obtained first convex hull orientation feature according to an example embodiment of the present disclosure.

[0030] Figure 8 A scene example diagram schematically illustrates an obtained first target convex hull segmentation according to an example embodiment of the present disclosure.

[0031] Fig. 9 A scene example diagram schematically illustrates an obtained second original convex hull partition according to an example embodiment of the present disclosure.

[0032] Fig.10 An example diagram of a scene of a convex hull block to be merged and a second remaining convex hull block obtained according to an example embodiment of the present disclosure is schematically shown.

[0033] Fig.11 A scene example diagram schematically illustrates an obtained convex hull merging result according to an example embodiment of the present disclosure.

[0034] Fig.12 A scene example diagram schematically illustrates a convex hull merging result before face reduction according to an example embodiment of the present disclosure.

[0035] Fig.13 A scene example diagram schematically shows a convex hull merging result after face reduction according to an example embodiment of the present disclosure.

[0036] Fig.14 A specific scenario example diagram of performing ray detection on a convex hull collision body according to an example embodiment of the present disclosure is schematically shown.

[0037] Fig.15 A scene example diagram of a collision animation before fitting according to an example embodiment of the present disclosure is schematically shown.

[0038] Fig.16 A scene example diagram of a collision animation after fitting processing according to an example embodiment of the present disclosure is schematically shown.

[0039] Fig.17 A block diagram schematically illustrates a device for generating a model collision animation according to an exemplary embodiment of the present disclosure.

[0040] Fig.18An electronic device for implementing a method for generating a model collision animation according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0041] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features or structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, and the like may be adopted. In some other cases, the known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.

[0042] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0043] In relevant game development solutions, collision detection technology is a key component to ensure the physical realism of the game and the player's interactive experience. Under this premise, in order to further improve the physical realism of the game and the player's interactive experience, the relevant game collision technology mainly relies on several standard collision body models; for example, rectangles, circles, capsules and convex hulls, etc. These models perform well when dealing with simple geometric shapes, but when faced with complex and irregular models, their accuracy and performance are often difficult to meet the requirements.

[0044] In actual application, collision technology can be divided into simple geometric collision bodies and complex mesh collision bodies. For simple geometric collision bodies, standard geometric shapes such as rectangles, circles, capsules and convex hulls can be used as collision bodies. Furthermore, for complex mesh collision bodies, the model mesh can be used directly as the collision body, or the collision body can be created by simplifying the mesh. However, in the above-mentioned scheme, although it performs well when processing simple geometric shapes, its accuracy and performance are often difficult to meet actual needs when facing complex and irregular models, which can be specifically manifested in the following aspects: On the one hand, the accuracy problem: that is, in the actual application process, simple geometric collision bodies cannot accurately represent the shape of complex models, resulting in inaccurate collision detection; on the other hand, the performance problem: that is, in the actual application process, although the mesh collision body and the complex convex hull body have higher accuracy, the calculation complexity is large, which has a greater impact on the performance of the computer and cannot be used for dynamic objects; on the other hand, inconsistency: that is, in the actual application process, simplifying the mesh collision body may lead to inconsistency between the model and the collision body, especially in the concave and convex parts of the model; further, optimization limitations: that is, in the actual application process, the existing optimization methods often focus on improving the overall performance and ignore the accuracy requirements of specific areas.

[0045] Based on this, the example embodiments of the present disclosure propose a more accurate and efficient collision detection optimization method based on the above-mentioned game collision technology, aiming to solve the collision consistency problem of complex models in the game, thereby providing game developers with a new tool to improve gaming experience and performance.

[0046] In an exemplary embodiment, a method for generating a model collision animation is first provided in this exemplary embodiment. The method can be run on a terminal device, server, server cluster or cloud server where a game development engine is located; of course, those skilled in the art can also run the method disclosed in this disclosure on other platforms as required, and this exemplary embodiment does not specifically limit this. Specifically, refer to Figure 1 As shown, the method for generating the model collision animation may include the following steps:

[0047] Step S110. Decomposing the original virtual model by convex hull to obtain first original convex hull blocks, and classifying the first original convex hull blocks to obtain first target convex hull blocks and first remaining convex hull blocks;

[0048] Step S120: performing convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classifying the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block;

[0049] Step S130: Merge the convex hull blocks to be merged and the second remaining convex hull blocks to obtain a convex hull merging result, and perform surface reduction processing on the convex hull merging result to obtain convex hull blocks after surface reduction processing;

[0050] Step S140: Generate a convex hull collision body corresponding to the original virtual model according to the convex hull blocks after the surface reduction process, and merge the original virtual model and the convex hull collision body to obtain a model collision animation.

[0051] In the above-described method for generating a model collision animation, on the one hand, by performing convex hull decomposition on the original virtual model to obtain a first original convex hull block, and classifying the first original convex hull block to obtain a first target convex hull block and a first remaining convex hull block; then performing convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classifying the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block; then merging the convex hull block to be merged and the second remaining convex hull block to obtain a convex hull merged result, and classifying the convex hull merged result. The result is subjected to surface reduction processing to obtain convex hull blocks after surface reduction processing; finally, a convex hull collision body corresponding to the original virtual model is generated according to the convex hull blocks after surface reduction processing, and the original virtual model and the convex hull collision body are merged to obtain a model collision animation, thereby realizing the generation of collision animation for complex models, solving the problem in related technologies that a simple geometric collision body cannot accurately represent the shape of a complex model, thus causing inaccurate collision detection; on the other hand, it also solves the problem in related technologies that the accuracy of the generated collision animation is low, thereby improving the accuracy of the model collision animation.

[0052] Hereinafter, the method for generating the model collision animation described in the exemplary embodiment of the present disclosure will be explained and illustrated in detail with reference to the accompanying drawings.

[0053] First, the terms involved in the exemplary embodiments of the present disclosure are explained and illustrated.

[0054] Convex hull: Convex hull is a basic concept in computational geometry. It refers to a convex polygon with the minimum area or volume in a geometric figure. This polygon can contain all the points in the figure. At the same time, in practical applications, because convex polygons have some good mathematical properties, such as the line segment between any two points is inside the polygon, collision detection of convex polygons is much simpler than that of non-convex polygons.

[0055] Complex collision: usually refers to mesh collision bodies, which can accurately describe complex shapes, but the computational overhead is large and can easily lead to performance degradation, especially in real-time scenes. Therefore, in real-time game scenes, complex collisions cannot be used on dynamic objects.

[0056] Secondly, the technical implementation principle of the exemplary embodiment of the present disclosure is explained and illustrated. Specifically, in some related technical solutions, due to the high computational complexity of complex collisions, it is impossible to act on dynamic objects. Therefore, the solution recorded in the exemplary embodiment of the present disclosure needs to generate a convex hull type collision body. At the same time, the exemplary embodiment of the present disclosure analyzes the problems existing in other related technologies recorded above, and it is found that the problems are: when the number of convex hulls and the number of vertices are limited, conventional convex hull collision bodies cannot accurately represent the collision of complex models, nor can they be customized based on the special effects and usage of the model; and, when the accuracy of convex hull collisions is limited, there will still be collisions that do not fit the complex concave and convex parts of the surface of the object. To this end, the main purpose of the exemplary embodiment of the present disclosure is to optimize these problems, and the goals to be achieved can include the following aspects: on the one hand, a more accurate convex hull collision body that is more in line with the model characteristics and application scenarios is generated under a limited number of convex hulls; on the other hand, the generated convex hull body cannot be too complex; on the other hand, the collision consistency is improved when the accuracy of the collision body is limited.

[0057] On the premise of the above-mentioned contents, in order to realize the above-mentioned technical points, the exemplary embodiment of the present disclosure proposes an optimization method for performing secondary convex hull decomposition based on the curvature and direction of the model and combining the geometric features of the original model, aiming at the collision consistency problem of irregular models. The specific implementation ideas are: on the one hand, secondary convex hull decomposition based on model characteristics: that is, in the process of actual application, the concave area can be identified by analyzing the curvature and direction of the model, and secondary convex hull decomposition can be performed, thereby significantly improving the accuracy of the collision body; and this method can generate a collision body that fits the actual shape better, reducing the error during collision detection; on the other hand, face reduction and convex hull processing: that is, in the process of actual application, after completing the convex hull decomposition, each decomposed model can be subjected to face reduction processing, and then convex hull processing can be performed on the basis of reducing the computational complexity, so that the final collision body is both efficient and accurate; on the other hand, model fitting processing: that is, in the process of actual application, the vertex position of the original model can be adjusted by measuring the curvature and direction of the model, so that the fit between the model and the collision body is higher, further reducing the area of ​​inconsistent collision.

[0058] The following will Figure 1 The generation method of the model collision animation shown in is further explained and illustrated. Specifically:

[0059] In step S110, the original virtual model is subjected to convex hull decomposition to obtain first original convex hull blocks, and the first original convex hull blocks are classified to obtain first target convex hull blocks and first remaining convex hull blocks.

[0060] In this exemplary embodiment, first, the original virtual model is decomposed to obtain the first original convex hull block; wherein the original virtual model recorded here can refer to Figure 2 As shown; the original virtual model can be a three-dimensional model with a complex model structure, such as a three-dimensional irregular mountain model, a three-dimensional irregular building model, etc., or it can be other models, and this example does not impose special restrictions on this; further, in the model decomposition process, it can be implemented in the following way: traverse the original virtual model, extract the first polyhedron included in the original virtual model, and calculate the first internal angle sum of the first polyhedron; determine the first model concave area of ​​the original virtual model based on the first internal angle sum, and calculate the first concave distance of the first model concave area; sort the first concave distance according to the size of the first concave distance to obtain the first concave distance sorting result, and configure the first area weight value for the first model concave area according to the first concave distance sorting result; perform convex hull decomposition on the original virtual model based on the first area weight value and the first model concave area to obtain the first original convex hull block.

[0061] In an exemplary embodiment, in the process of performing the first convex hull segmentation on a complex irregular model, it can be achieved in the following manner: first, determine whether the original virtual model can be used as a model entity; if the original virtual model can be used as a model entity, determine whether the original virtual model is a closed model; if not, fill the holes of the original virtual model, and then perform convex hull decomposition; if yes, perform convex hull decomposition directly; at the same time, if the original virtual model cannot be used as a model entity, perform convex hull decomposition directly. Among them, in the process of performing the closedness detection of the model, it can be implemented based on the watertightness detection; in the process of performing the entity detection of the model, it can be implemented based on the corresponding entity detection model.

[0062] In an exemplary embodiment, in the process of dividing the original virtual model into the first original convex hull blocks, it can be implemented as follows: first, the original virtual model is imported into Houdini; then, after the original virtual model is successfully imported, the Convex Decomposition in Houdini is called to quickly decompose the model according to the specified maximum concave distance, and generate uniform (weighted uniform) optimal convex hull blocks according to the concave-convex structure of the model. Among them, the weighted uniform optimal convex hull block recorded here means that the difference between the average concave distances in each block can be maintained within a specific range, that is, the absolute value of the difference between the average concave distances in each block needs to be less than or equal to a specific value. At the same time, in the process of block division based on Convex Decomposition, the specific algorithm steps are: first, identify the concave area of ​​the original virtual model: that is, in the actual application process, the polyhedron included in the original virtual model can be first determined, and then all the corners of the polyhedron are traversed to check whether the sum of the internal angles of each corner is greater than 180 degrees. If so, the part is a concave area. Secondly, the model is divided into blocks according to the concave area: that is, in the actual application process, a cutting operation can be performed around the identified concave area of ​​the model, and then the corresponding convex hull blocks are obtained. The first original convex hull block can be referred to Figure 3 shown.

[0063] Secondly, the first original convex hull block is classified to obtain a first target convex hull block and a first remaining convex hull block; specifically, this can be achieved by the following method: determining the first convex hull concave feature and the first convex hull orientation feature of the first original convex hull block, and classifying the first original convex hull block according to the first convex hull concave feature and the first convex hull orientation feature to obtain a first target convex hull block and a first remaining convex hull block.

[0064] In an exemplary embodiment, determining the first convex hull concave feature and the first convex hull orientation feature of the first original convex hull block can be achieved in the following manner: determining the first vertex concave value of the first convex hull vertex included in the first original convex hull block, and determining the first convex hull concave feature based on the first vertex concave value; determining the first normal orientation of the first original convex hull block, and determining the first convex hull orientation feature based on the first normal orientation. Among them, the specific determination process of the first convex hull concave feature can be achieved in the following manner: extracting the first vertex position of the first convex hull vertex included in the first original convex hull block, and determining the first vertex concave value of the first convex hull vertex based on the first vertex position; averaging the first vertex concave values ​​to obtain a first average concave distance, and obtaining the first convex hull concave feature based on the first average concave distance and the first plane concave value of the first original convex hull block. Furthermore, the specific determination process of the first convex hull orientation feature can be achieved in the following manner: determining, according to the first normal orientation, the area in the first original convex hull block where the normal is facing upward and other areas except the area where the normal is facing upward; determining, according to the area where the normal is facing upward and other areas, the probability that the first original convex hull block is facing upward; and obtaining the first convex hull orientation feature according to the probability that the first original convex hull block is facing upward.

[0065] Furthermore, after obtaining the first convex hull concave feature and the first convex hull orientation feature, the first original convex hull block can be classified; wherein the specific classification process can be implemented in the following manner: traversing the first original convex hull block, if the first convex hull concave feature of any of the original convex hull blocks is that the first average concave distance is greater than a preset concave distance threshold, and the first convex hull orientation feature is that the probability that the first original convex hull block is upward is greater than a preset probability threshold, then the first original convex hull block is used as the first target convex hull block, and the other blocks in the first original convex hull block except the first target convex hull block are used as the first remaining convex hull blocks.

[0066] The classification process of the first original convex hull block will be further explained and illustrated below. Specifically, in the actual application process, due to the property restrictions of the convex hull, the situation where the collision body in the convex hull does not fit the model usually occurs in the concave part of the model. Therefore, the surface concave part of the first original convex hull block can be measured through the measurement node Measure in Houdini to obtain the first plane concave value; then, the first vertex concave values ​​of all the first convex hull vertices on the first original convex hull block are averaged to obtain the first average concave distance of the first original convex hull block, and the first convex hull concave feature can be obtained based on the first average concave distance and the first plane concave value; the information of the first vertex concave value recorded here can be referred to. Figure 4As shown, the first convex hull concave feature recorded here can refer to Figure 5 As shown. In addition, for most games, the top of the original virtual model can be used as the main area for the game character to walk, so the top of the original virtual model is also an area where the collision body does not fit easily; under this premise, in order to further achieve the purpose of collision body fitting, it is necessary to calculate the first normal direction of the first original convex hull block to obtain the area with the normal facing upward in the first original convex hull block; similarly, the area with the normal facing other directions in the first original convex hull block can also be calculated according to the first normal direction; then, the ratio of the area with the normal facing upward in the first original convex hull block to the area with the normal facing other directions in the first original convex hull block is calculated to obtain the probability of the first original convex hull block facing upward; wherein, the area with the normal facing upward in the first original convex hull block recorded here can refer to Figure 6 As shown; the probability of the first original convex hull block facing upward (that is, the first convex hull orientation feature) recorded here can be referred to Figure 7 Finally, after obtaining the first convex hull concave feature and the first convex hull orientation feature of the first original convex hull block, the first original convex hull block that meets the requirements can be extracted to obtain the first target convex hull block, and then the first target convex hull block is subjected to secondary convex hull decomposition processing; wherein the obtained first target convex hull block can refer to Figure 8 shown.

[0067] In step S120, the first target convex hull block is convex hull decomposed to obtain a second original convex hull block, and the first remaining convex hull block and the second original convex hull block are classified to obtain a convex hull block to be merged and a second remaining convex hull block.

[0068] In this example embodiment, first, the first target convex hull block is decomposed into a convex hull to obtain a second original convex hull block; specifically, it can be implemented in the following manner: traverse the first target convex hull block, extract the second polyhedron included in the first target convex hull block, and calculate the second internal angle sum of the second polyhedron; determine the second model concave area of ​​the first target convex hull block based on the second internal angle sum, and decompose the first target convex hull block into a convex hull based on the second model concave area to obtain a second original convex hull block; wherein the obtained second original convex hull block can refer to Fig. 9As shown; secondly, classifying the first remaining convex hull block and the second original convex hull block to obtain the convex hull block to be merged and the second remaining convex hull block; specifically, it can be implemented in the following way: calculating the first convex hull volume of the first remaining convex hull block and the second convex hull volume of the second original convex hull block, and sorting the first remaining convex hull block and the second original convex hull block based on the first convex hull volume and the second convex hull volume to obtain a volume sorting result; determining the convex hull block to be merged from the first remaining convex hull block and the second original convex hull block according to the volume sorting result, and taking the other blocks of the first remaining convex hull block and the second original convex hull block except the convex hull block to be merged as the second remaining convex hull block; wherein the convex hull block to be merged and the second remaining convex hull block obtained can refer to Fig.10 As shown. Furthermore, in the actual application process, since the convex hull blocks obtained in the process of performing two convex hull block divisions may have some thin slices or small blocks; therefore, in order to reduce the difference between collision and model (the convex hull generated by thin slices is usually inaccurate and will overlap with other convex hulls, which will affect the accuracy of the convex hull) and reduce the number of convex hulls, it is necessary to select blocks with too small volumes from the first remaining convex hull blocks and the second original convex hull blocks as blocks to be merged, so as to reduce the problem of too many convex hulls.

[0069] In step S130, the convex hull blocks to be merged and the second remaining convex hull blocks are merged to obtain a convex hull merging result, and the convex hull merging result is subjected to surface reduction processing to obtain convex hull blocks after surface reduction processing.

[0070] In this example embodiment, first, the convex hull block to be merged and the second remaining convex hull block are merged to obtain a convex hull merging result; specifically, this can be achieved in the following manner: determine the first original convex hull position of the convex hull block to be merged in the original virtual model, and determine the second original convex hull position of the second remaining convex hull block in the original virtual model; determine the second target convex hull block corresponding to the convex hull block to be merged from the second remaining convex hull blocks according to the first original convex hull position and the second original convex hull position; merge the convex hull block to be merged and the second target convex hull block corresponding to the convex hull block to be merged to obtain a convex hull merging result. That is, in actual application, the convex hull block to be merged can be merged into the surrounding blocks adjacent to the convex hull block to be merged in a manner of proximity principle, thereby obtaining a convex hull merging result; wherein the obtained convex hull merging result can be referred to Fig.11It should be noted that the reason why the convex hull blocks of thin slices or small blocks need to be merged is, on the one hand, to avoid the problem of heavy computational burden caused by too many convex hull blocks; on the other hand, to avoid the problem that the convex hull generated by thin slices is usually inaccurate and will overlap with other convex hulls, which will affect the accuracy of the convex hull.

[0071] Secondly, the convex hull merging result is subjected to surface reduction processing to obtain convex hull blocks after surface reduction processing; specifically, this can be achieved in the following manner: first, the convex hull merging result is subjected to UV expansion to obtain a texture map including the second convex hull vertices of the convex hull merging result and the original convex hull face patches; secondly, the importance values ​​of the original convex hull face patches in the texture map to the convex hull merging result are calculated, and the original convex hull face patches are sorted according to the importance values ​​to obtain a face sorting result; then, the original convex hull face patches are subjected to surface reduction processing according to the face sorting result to obtain a target convex hull face patch, and the convex hull blocks after surface reduction processing are generated according to the target convex hull face patch and the second convex hull vertices. The specific calculation process of the importance value can be implemented as follows: determine the normal direction of the original convex hull patch according to the second normal direction of the convex hull merging result, and determine the normal vector smoothness value of the original convex hull patch according to the normal direction; determine the patch area of ​​the original convex hull patch, and determine the importance value of the original convex hull patch to the convex hull merging result according to the patch area and the normal vector smoothness value; wherein the convex hull merging result before face reduction can refer to Fig.12 As shown, the convex hull block after surface reduction can be referenced Fig.13 As shown; at the same time, Fig.12 as well as Fig.13 From the example diagram shown in , it can be seen that the number of collision vertices before the face reduction is significantly smaller than the number of collision vertices after the face reduction. Based on this, the convex hull segmentation after the face reduction can be made efficient and accurate while reducing the computational complexity.

[0072] In step S140, a convex hull collision body corresponding to the original virtual model is generated according to the convex hull blocks after the surface reduction process, and the original virtual model and the convex hull collision body are merged to obtain a model collision animation.

[0073] In this example embodiment, first, a convex hull collision body is generated; specifically, it can be achieved in the following manner: based on a preset convex hull calculation tool, a proxy convex hull of the convex hull block after surface reduction processing is calculated, and the proxy convex hulls are merged to obtain a convex hull collision body corresponding to the original virtual model; wherein the convex hull calculation tool recorded herein may be Houdini PDG; secondly, the original virtual model and the convex hull collision body are merged to obtain a model collision animation; specifically, it can be achieved in the following manner: according to the convex hull collision body, the first convex hull vertex of the first remaining convex hull block in the original virtual model is adjusted to obtain a target virtual model; the target virtual model and the convex hull collision body are merged to obtain a model collision animation.

[0074] In an exemplary embodiment, the first convex hull vertex of the first remaining convex hull block in the original virtual model is adjusted according to the convex hull collision body to obtain the target virtual model, which can be achieved in the following way: perform ray detection on the convex hull collision body along the first convex hull vertex of the first remaining convex hull block in the original virtual model to obtain a ray detection result; determine the convex hull block that needs to be adjusted from the first remaining convex hull block according to the ray detection result, and determine the vertex adjustment range according to the ray detection result; adjust the first convex hull vertex of the convex hull block that needs to be adjusted based on the vertex adjustment range until the first convex hull vertex of the convex hull block that needs to be adjusted fits with the convex hull collision body to obtain the target virtual model. The specific scene example diagram of ray detection recorded here can be referred to. Fig.14 As shown; at the same time, the collision animation before fitting can refer to Fig.15 As shown, the collision animation after fitting can be referred to Fig.16 As shown. It should be supplemented here that the reason why the model fitting process is needed is that some depressions between the first convex hull vertex of the first remaining convex hull block in the original virtual model and the convex hull collision body still have certain floating problems. Therefore, it is necessary to fit the first convex hull vertex of the first remaining convex hull block; further, in the specific fitting process, the convex hull collision body can be ray-checked along the normal direction of the vertices of the first remaining convex hull block, and the vertices below the collision can be moved to improve the consistency between the model and the collision body.

[0075] So far, the method for generating the model collision animation described in the exemplary embodiments of the present disclosure has been fully implemented. Based on the above-mentioned contents, it can be known that the method for generating model collision animation recorded in the exemplary embodiment of the present disclosure can optimize the convex hull collision body by performing secondary convex hull decomposition based on the curvature and direction of the model, and optimize the collision consistency of the irregular model. Compared with other technical solutions, it has the following advantages: on the one hand, the accuracy of the obtained collision animation is improved: that is, in the process of actual application, the area of ​​inconsistent collision is effectively reduced by secondary convex hull decomposition and vertex adjustment, and the accuracy of collision detection is improved; on the other hand, the performance is optimized: that is, in the process of actual application, the number of vertices of the collision body is reduced by face reduction and convex hull processing, the efficiency of collision detection is improved, and high performance is ensured in real-time scenes, avoiding the performance bottleneck caused by the mesh collision body; on the other hand, the consistency is improved: that is, in the process of actual application, the exemplary embodiment of the present disclosure can handle more complex and irregular models, provide better collision detection results, ensure the consistency between the model and the collision body, and is particularly suitable for the increasingly complex three-dimensional environment in modern games; further, flexibility and customization: that is, in the process of actual application, the exemplary embodiment of the present disclosure also provides a hierarchical collision body structure and user customization options, so that the optimization process is more flexible and meets the needs of different scenarios.

[0076] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0077] The exemplary embodiment of the present disclosure also provides a device for generating a model collision animation. Specifically, refer to Fig.17 As shown, the device for generating the model collision animation may include a first convex hull classification module 1710 , a second convex hull classification module 1720 , a convex hull merging module 1730 and a collision animation generation module 1740 .

[0078] in:

[0079] The first convex hull classification module 1710 may be used to perform convex hull decomposition on the original virtual model to obtain first original convex hull blocks, and classify the first original convex hull blocks to obtain first target convex hull blocks and first remaining convex hull blocks;

[0080] The second convex hull classification module 1720 may be used to perform convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classify the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block;

[0081] The convex hull merging module 1730 may be used to merge the convex hull blocks to be merged and the second remaining convex hull blocks to obtain a convex hull merging result, and perform surface reduction processing on the convex hull merging result to obtain a convex hull block after surface reduction processing;

[0082] The collision animation generation module 1740 can be used to generate a convex hull collision body corresponding to the original virtual model according to the convex hull blocks after the surface reduction process, and merge the original virtual model and the convex hull collision body to obtain a model collision animation.

[0083] In an exemplary embodiment of the present disclosure, the first original convex hull block is classified to obtain a first target convex hull block and a first remaining convex hull block, including: determining a first convex hull concave feature and a first convex hull orientation feature of the first original convex hull block, and classifying the first original convex hull block according to the first convex hull concave feature and the first convex hull orientation feature to obtain a first target convex hull block and a first remaining convex hull block.

[0084] In an exemplary embodiment of the present disclosure, determining a first convex hull concave feature and a first convex hull orientation feature of a first original convex hull block includes: determining a first vertex concave value of a first convex hull vertex included in the first original convex hull block, and determining the first convex hull concave feature based on the first vertex concave value; determining a first normal orientation of the first original convex hull block, and determining a first convex hull orientation feature based on the first normal orientation.

[0085] In an exemplary embodiment of the present disclosure, the first vertex concavity value of the first convex hull vertex included in the first original convex hull block is determined, and the first convex hull concavity feature is determined based on the first vertex concavity value, including: extracting the first vertex position of the first convex hull vertex included in the first original convex hull block, and determining the first vertex concavity value of the first convex hull vertex based on the first vertex position; averaging the first vertex concavity values ​​to obtain a first average concavity distance, and obtaining the first convex hull concavity feature based on the first average concavity distance and the first plane concavity value of the first original convex hull block.

[0086] In an exemplary embodiment of the present disclosure, determining a first convex hull orientation feature according to the first normal orientation includes: determining, according to the first normal orientation, areas in the first original convex hull block with normals facing upward and other areas except the areas with normals facing upward; determining a probability that the first original convex hull block is facing upward according to the areas with normals facing upward and other areas; and obtaining the first convex hull orientation feature according to the probability that the first original convex hull block is facing upward.

[0087] In an exemplary embodiment of the present disclosure, the first original convex hull block is classified according to the first convex hull concave feature and the first convex hull orientation feature to obtain a first target convex hull block and a first remaining convex hull block, including: traversing the first original convex hull block, if the first convex hull concave feature of any of the original convex hull blocks is that the first average concave distance is greater than a preset concave distance threshold, and the first convex hull orientation feature is that the probability that the first original convex hull block is upward is greater than a preset probability threshold, then the first original convex hull block is used as the first target convex hull block, and the other blocks in the first original convex hull block except the first target convex hull block are used as the first remaining convex hull block.

[0088] In an exemplary embodiment of the present disclosure, the first remaining convex hull blocks and the second original convex hull blocks are classified to obtain convex hull blocks to be merged and the second remaining convex hull blocks, including: calculating the first convex hull volume of the first remaining convex hull blocks and the second convex hull volume of the second original convex hull blocks, and sorting the first remaining convex hull blocks and the second original convex hull blocks based on the first convex hull volume and the second convex hull volume to obtain a volume sorting result; determining the convex hull blocks to be merged from the first remaining convex hull blocks and the second original convex hull blocks according to the volume sorting result, and taking the other blocks of the first remaining convex hull blocks and the second original convex hull blocks except the convex hull blocks to be merged as the second remaining convex hull blocks.

[0089] In an exemplary embodiment of the present disclosure, the convex hull block to be merged and the second remaining convex hull block are merged to obtain a convex hull merging result, including: determining the first original convex hull position of the convex hull block to be merged in the original virtual model, and determining the second original convex hull position of the second remaining convex hull block in the original virtual model; determining the second target convex hull block corresponding to the convex hull block to be merged from the second remaining convex hull blocks according to the first original convex hull position and the second original convex hull position; merging the convex hull block to be merged and the second target convex hull block corresponding to the convex hull block to be merged to obtain a convex hull merging result.

[0090] In an exemplary embodiment of the present disclosure, the convex hull merging result is subjected to surface reduction processing to obtain convex hull blocks after surface reduction processing, including: UV unfolding the convex hull merging result to obtain a texture map including the second convex hull vertices of the convex hull merging result and the original convex hull facets; calculating the importance value of the original convex hull facets in the texture map to the convex hull merging result, and sorting the original convex hull facets according to the importance value to obtain a facet sorting result; performing surface reduction processing on the original convex hull facets according to the facet sorting result to obtain a target convex hull facet, and generating convex hull blocks after surface reduction processing according to the target convex hull facets and the second convex hull vertices.

[0091] In an exemplary embodiment of the present disclosure, the importance value of the original convex hull patch in the texture map to the convex hull merging result is calculated, including: determining the patch normal orientation of the original convex hull patch according to the second normal orientation of the convex hull merging result, and determining the normal vector smoothness value of the original convex hull patch according to the patch normal orientation; determining the patch area of ​​the original convex hull patch, and determining the importance value of the original convex hull patch to the convex hull merging result according to the patch area and the normal vector smoothness value.

[0092] In an exemplary embodiment of the present disclosure, a convex hull collision body corresponding to the original virtual model is generated according to the convex hull blocks after surface reduction processing, including: based on a preset convex hull calculation tool, calculating the proxy convex hull of the convex hull blocks after surface reduction processing, and merging the proxy convex hulls to obtain a convex hull collision body corresponding to the original virtual model.

[0093] In an exemplary embodiment of the present disclosure, the original virtual model and the convex hull collision body are merged to obtain a model collision animation, including: adjusting the first convex hull vertex of the first remaining convex hull block in the original virtual model according to the convex hull collision body to obtain a target virtual model; merging the target virtual model and the convex hull collision body to obtain a model collision animation.

[0094] In an exemplary embodiment of the present disclosure, the first convex hull vertex of the first remaining convex hull block in the original virtual model is adjusted according to the convex hull collision body to obtain a target virtual model, including: performing ray detection on the convex hull collision body along the first convex hull vertex of the first remaining convex hull block in the original virtual model to obtain a ray detection result; determining the convex hull block that needs to be adjusted from the first remaining convex hull block according to the ray detection result, and determining the vertex adjustment range according to the ray detection result; adjusting the first convex hull vertex of the convex hull block that needs to be adjusted based on the vertex adjustment range until the first convex hull vertex of the convex hull block that needs to be adjusted fits with the convex hull collision body to obtain the target virtual model.

[0095] In an exemplary embodiment of the present disclosure, a convex hull decomposition is performed on an original virtual model to obtain a first original convex hull block, including: traversing the original virtual model, extracting a first polyhedron included in the original virtual model, and calculating a first internal angle sum of the first polyhedron; determining a first model concave area of ​​the original virtual model based on the first internal angle sum, and calculating a first concave distance of the first model concave area; sorting the first concave distances according to the size of the first concave distances to obtain a first concave distance sorting result, and configuring a first area weight value for the first model concave area according to the first concave distance sorting result; and performing a convex hull decomposition on the original virtual model based on the first area weight value and the first model concave area to obtain a first original convex hull block.

[0096] The specific details of each module in the above-mentioned model collision animation generation device have been described in detail in the corresponding model collision animation generation method, so they will not be repeated here.

[0097] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0098] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0099] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. A person skilled in the art will appreciate that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a circuit, module, or system.

[0100] Refer to the following Fig.18 1800 according to this embodiment of the present disclosure is described. Fig.18The electronic device 1800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0101] like Fig.18 As shown, the electronic device 1800 is in the form of a general computing device. The components of the electronic device 1800 may include, but are not limited to: the at least one processing unit 1810, the at least one storage unit 1820, a bus 1830 connecting different system components (including the storage unit 1820 and the processing unit 1810), and a display unit 1840.

[0102] The storage unit stores a program code, which can be executed by the processing unit 1810, so that the processing unit 1810 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1810 can perform the following steps: Figure 1 Step S110 shown in: performing convex hull decomposition on the original virtual model to obtain a first original convex hull block, and classifying the first original convex hull block to obtain a first target convex hull block and a first remaining convex hull block; step S120: performing convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classifying the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block; step S130: merging the convex hull block to be merged and the second remaining convex hull block to obtain a convex hull merging result, and performing surface reduction processing on the convex hull merging result to obtain a convex hull block after surface reduction processing; step S140: generating a convex hull collision body corresponding to the original virtual model according to the convex hull block after surface reduction processing, and merging the original virtual model and the convex hull collision body to obtain a model collision animation.

[0103] The storage unit 1820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 18201 and / or a cache storage unit 18202 , and may further include a read-only storage unit (ROM) 18203 .

[0104] The storage unit 1820 may also include a program / utility 18204 having a set (at least one) of program modules 18205, such program modules 18205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0105] Bus 1830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0106] The electronic device 1800 may also communicate with one or more external devices 1900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1800, and / or communicate with any device that enables the electronic device 1800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1850. In addition, the electronic device 1800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1860. As shown, the network adapter 1860 communicates with other modules of the electronic device 1800 via a bus 1830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0107] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0108] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0109] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0110] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0111] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0112] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0113] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0114] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0115] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the inventions invented herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not invented by the present disclosure. The specification and examples are to be considered merely exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A method for generating a model collision animation, characterized in that: include: Performing convex hull decomposition on the original virtual model to obtain first original convex hull blocks, and classifying the first original convex hull blocks to obtain first target convex hull blocks and first remaining convex hull blocks; Performing convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classifying the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block; Merging the convex hull blocks to be merged and the second remaining convex hull blocks to obtain a convex hull merging result, and performing surface reduction processing on the convex hull merging result to obtain convex hull blocks after surface reduction processing; A convex hull collision body corresponding to the original virtual model is generated according to the convex hull blocks after the surface reduction process, and the original virtual model and the convex hull collision body are merged to obtain a model collision animation.

2. The method for generating a model collision animation according to claim 1, characterized in that: Classifying the first original convex hull block to obtain a first target convex hull block and a first remaining convex hull block, including: A first convex hull concave feature and a first convex hull orientation feature of the first original convex hull block are determined, and the first original convex hull block is classified according to the first convex hull concave feature and the first convex hull orientation feature to obtain a first target convex hull block and a first remaining convex hull block.

3. The method for generating a model collision animation according to claim 2, characterized in that: Determining a first convex hull concave feature and a first convex hull orientation feature of the first original convex hull block includes: Determine a first vertex concave value of a first convex hull vertex included in the first original convex hull block, and determine the first convex hull concave feature according to the first vertex concave value; A first normal orientation of the first original convex hull block is determined, and a first convex hull orientation feature is determined according to the first normal orientation.

4. The method for generating a model collision animation according to claim 3, characterized in that: Determining a first vertex concavity value of a first convex hull vertex included in the first original convex hull block, and determining the first convex hull concavity feature according to the first vertex concavity value, comprises: Extracting a first vertex position of a first convex hull vertex included in the first original convex hull block, and determining a first vertex concavity value of the first convex hull vertex according to the first vertex position; The first vertex concavity values ​​are averaged to obtain a first average concavity distance, and the first convex hull concavity feature is obtained according to the first average concavity distance and the first plane concavity value of the first original convex hull block.

5. The method for generating a model collision animation according to claim 3, characterized in that: Determining a first convex hull orientation feature according to the first normal orientation includes: Determine, according to the first normal direction, an area in the first original convex hull block where the normal is facing upward and other areas except the area where the normal is facing upward; Determine the probability that the first original convex hull block faces upward according to the area where the normal faces upward and other areas; The first convex hull orientation feature is obtained according to the probability that the first original convex hull block is facing upward.

6. The method for generating a model collision animation according to claim 2, characterized in that: The first original convex hull block is classified according to the first convex hull concave feature and the first convex hull orientation feature to obtain a first target convex hull block and a first remaining convex hull block, including: The first original convex hull blocks are traversed. If the first convex hull concave feature of any of the original convex hull blocks is that the first average concave distance is greater than a preset concave distance threshold, and the first convex hull orientation feature is that the probability that the first original convex hull block is upward is greater than a preset probability threshold, the first original convex hull block is used as the first target convex hull block, and the other blocks in the first original convex hull block except the first target convex hull block are used as the first remaining convex hull blocks.

7. The method for generating a model collision animation according to claim 1, characterized in that: Classifying the first remaining convex hull block and the second original convex hull block to obtain the convex hull block to be merged and the second remaining convex hull block, including: Calculating a first convex hull volume of the first remaining convex hull block and a second convex hull volume of the second original convex hull block, and sorting the first remaining convex hull block and the second original convex hull block based on the first convex hull volume and the second convex hull volume to obtain a volume sorting result; The convex hull blocks to be merged are determined from the first remaining convex hull blocks and the second original convex hull blocks according to the volume sorting result, and the other blocks of the first remaining convex hull blocks and the second original convex hull blocks except the convex hull blocks to be merged are used as the second remaining convex hull blocks.

8. The method for generating a model collision animation according to claim 1, characterized in that: The convex hull block to be merged and the second remaining convex hull block are merged to obtain a convex hull merging result, including: Determine a first original convex hull position of the convex hull block to be merged in the original virtual model, and determine a second original convex hull position of the second remaining convex hull block in the original virtual model; Determine, from the second remaining convex hull blocks, a second target convex hull block corresponding to the convex hull block to be merged according to the first original convex hull position and the second original convex hull position; The convex hull block to be merged and the second target convex hull block corresponding to the convex hull block to be merged are merged to obtain a convex hull merging result.

9. The method for generating a model collision animation according to claim 1, characterized in that: Performing surface reduction processing on the convex hull merging result to obtain convex hull blocks after surface reduction processing, including: Performing UV unfolding on the convex hull merging result to obtain a texture map including the second convex hull vertices of the convex hull merging result and the original convex hull facets; Calculating the importance value of the original convex hull face patches in the texture map to the convex hull merging result, and sorting the original convex hull face patches according to the importance value to obtain a face patch sorting result; The original convex hull patch is subjected to surface reduction processing according to the patch sorting result to obtain a target convex hull patch, and convex hull blocks after surface reduction processing are generated according to the target convex hull patch and the second convex hull vertices.

10. The method for generating model collision animation according to claim 9, characterized in that: Calculating the importance value of the original convex hull patch in the texture map to the convex hull merging result, including: Determine the patch normal orientation of the original convex hull patch according to the second normal orientation of the convex hull merging result, and determine the normal vector smoothness value of the original convex hull patch according to the patch normal orientation; The patch area of ​​the original convex hull patch is determined, and the importance value of the original convex hull patch to the convex hull merging result is determined according to the patch area and the normal vector smoothness value.

11. The method for generating a model collision animation according to claim 1, characterized in that: The convex hull collision body corresponding to the original virtual model is generated according to the convex hull block after the surface reduction process, including: Based on a preset convex hull calculation tool, the proxy convex hull of the convex hull blocks after the surface reduction process is calculated, and the proxy convex hulls are merged to obtain a convex hull collision body corresponding to the original virtual model.

12. The method for generating a model collision animation according to claim 1, characterized in that: The original virtual model and the convex hull collision body are merged to obtain a model collision animation, including: Adjusting the first convex hull vertex of the first remaining convex hull block in the original virtual model according to the convex hull collision body to obtain a target virtual model; The target virtual model and the convex hull collision body are merged to obtain a model collision animation.

13. The method for generating a model collision animation according to claim 12, characterized in that: The first convex hull vertex of the first remaining convex hull block in the original virtual model is adjusted according to the convex hull collision body to obtain a target virtual model, including: Performing ray detection on the convex hull collision body along the first convex hull vertex of the first remaining convex hull block in the original virtual model to obtain a ray detection result; Determine the convex hull blocks that need to be adjusted for vertices from the first remaining convex hull blocks according to the ray detection result, and determine the vertex adjustment range according to the ray detection result; The first convex hull vertex of the convex hull block that needs vertex adjustment is adjusted based on the vertex adjustment range until the first convex hull vertex of the convex hull block that needs vertex adjustment fits with the convex hull collision body to obtain the target virtual model.

14. The method for generating a model collision animation according to claim 1, characterized in that: The original virtual model is decomposed into a convex hull to obtain a first original convex hull block, including: traversing the original virtual model, extracting a first polyhedron included in the original virtual model, and calculating a first internal angle sum of the first polyhedron; Determine a first model concave area of ​​the original virtual model based on the first inner angle and calculate a first concave distance of the first model concave area; Sorting the first concave distances according to the sizes of the first concave distances to obtain a first concave distance sorting result, and configuring a first area weight value for the first model concave area according to the first concave distance sorting result; The original virtual model is subjected to convex hull decomposition based on the first region weight value and the first model concave region to obtain first original convex hull blocks.

15. A device for generating a model collision animation, characterized in that: include: A first convex hull classification module is used to perform convex hull decomposition on the original virtual model to obtain first original convex hull blocks, and classify the first original convex hull blocks to obtain first target convex hull blocks and first remaining convex hull blocks; A second convex hull classification module is used to perform convex hull decomposition on the first target convex hull block to obtain a second original convex hull block, and classify the first remaining convex hull block and the second original convex hull block to obtain a convex hull block to be merged and a second remaining convex hull block; A convex hull merging module is used to merge the convex hull blocks to be merged and the second remaining convex hull blocks to obtain a convex hull merging result, and perform surface reduction processing on the convex hull merging result to obtain a convex hull block after surface reduction processing; The collision animation generation module is used to generate a convex hull collision body corresponding to the original virtual model according to the convex hull blocks after the surface reduction process, and merge the original virtual model and the convex hull collision body to obtain a model collision animation.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a model collision animation according to any one of claims 1 to 14 is implemented.

17. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the method for generating a model collision animation according to any one of claims 1 to 8 by executing the executable instructions.

Citation Information

Cited By

  • Convex hull decomposition method and device, equipment and storage medium

    CN121353492A