Convex hull generation method and device, electronic equipment, storage medium and program product

The convex hull is generated through iterative segmentation and surface reduction technology, which solves the problem of ignoring details in the existing technology, improves the authenticity and performance of the game's physical effects, and achieves more efficient convex hull generation.

CN118593985APending Publication Date: 2024-09-06NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410741176.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing technology often ignores details such as slits and holes when generating convex hulls, resulting in unrealistic game physical effects, and it is difficult for existing tools to effectively retain model details, affecting real-time performance.

Method used

By determining the concavity value of the convex hull of the original mesh, if it is greater than the preset threshold, iterative segmentation is performed until the concavity value is less than or equal to the threshold, and the sub-convex hull is reduced based on the preset surface reduction parameters to generate Target convex hull collection to preserve more details.

Benefits of technology

It effectively retains the details of the model, improves the authenticity and real-time performance of the game's physical effects, reduces the repetitive workload of artists, and improves the accuracy and efficiency of convex hull generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118593985A
    Figure CN118593985A
Patent Text Reader

Abstract

The invention provides a convex hull generation method and device, electronic equipment, a storage medium and a program product, and the method comprises the steps: determining an original grid body, and generating an original convex hull corresponding to the original grid body; determining a concavity value of the original convex hull; if the concavity value of the original convex hull is greater than a preset concavity threshold value, carrying out iterative segmentation on the original convex hull until the concavity value of a sub convex hull obtained by segmentation is less than or equal to the preset concavity threshold value, and obtaining a plurality of standby sub convex hulls; determining a preset surface reduction parameter, wherein the surface reduction parameter comprises the number of target vertexes or a reduction proportion of the number of the target vertexes; and performing surface reduction on the standby sub-convex hulls based on the preset surface reduction parameters to obtain a sub-convex hull set after surface reduction, and determining the sub-convex hull set after surface reduction as a target convex hull set corresponding to the original grid body. Through the convex hulls in the target convex hull set corresponding to the generated original grid body, more details can be reserved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer graphics technology, and in particular to a convex hull generation method, device, electronic device, storage medium and program product. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] In electronic games based on computer graphics technology, convex hulls are often used to implement physical effects such as collision and breakage of game objects. Using convex hulls instead of the original complex meshes for physical calculations can improve real-time performance.

[0004] However, in the related art, when generating a convex hull from an original complex mesh, some details are usually ignored, such as slits and holes, which are required in the process of interaction with the user. Summary of the invention

[0005] In view of this, the purpose of the present disclosure is to provide a convex hull generation method, device, electronic device, storage medium and program product, which at least to a certain extent solve one of the technical problems in the related art.

[0006] Based on the above purpose, the first aspect of the exemplary embodiment of the present disclosure provides a convex hull generation method, including:

[0007] Determine an original mesh body, and generate an original convex hull corresponding to the original mesh body;

[0008] Determining the concavity value of the original convex hull;

[0009] If the concavity value of the original convex hull is greater than a preset concavity threshold, the original convex hull is iteratively segmented until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls;

[0010] Determining a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a target vertex number reduction ratio;

[0011] Based on the preset surface reduction parameters, the spare sub-convex hull is subjected to surface reduction to obtain a sub-convex hull set after surface reduction, and the sub-convex hull set after surface reduction is determined as a target convex hull set corresponding to the original mesh body.

[0012] Based on the same inventive concept, the second aspect of the exemplary embodiment of the present disclosure provides a convex hull generating device, comprising:

[0013] An original convex hull generation module is configured to determine an original mesh volume and generate an original convex hull corresponding to the original mesh volume;

[0014] a concavity value determining module, configured to determine a concavity value of the original convex hull;

[0015] A convex hull segmentation module is configured to iteratively segment the original convex hull if the concavity value of the original convex hull is greater than a preset concavity threshold, until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls;

[0016] A face reduction parameter determination module is configured to determine a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a reduction ratio of a target vertex number;

[0017] The convex hull face reduction module is configured to reduce the face of the spare sub-convex hull based on the preset face reduction parameters to obtain a sub-convex hull set after face reduction, and determine the sub-convex hull set after face reduction as the target convex hull set corresponding to the original mesh body.

[0018] Based on the same inventive concept, a third aspect of the exemplary embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.

[0019] Based on the same inventive concept, a fourth aspect of the exemplary embodiments of the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.

[0020] Based on the same inventive concept, a fifth aspect of the exemplary embodiments of the present disclosure provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the method described in the first aspect.

[0021] From the above, it can be seen that the convex hull generation method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure include: determining an original mesh body, and generating an original convex hull corresponding to the original mesh body; determining the concavity value of the original convex hull; if the concavity value of the original convex hull is greater than a preset concavity threshold, iteratively segmenting the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a number of spare sub-convex hulls; determining a preset face reduction parameter, wherein the face reduction parameter includes the number of target vertices or the reduction ratio of the number of target vertices; based on the preset face reduction parameter, the spare sub-convex hull is reduced in face to obtain a sub-convex hull set after face reduction, and the sub-convex hull set after face reduction is determined as the target convex hull set corresponding to the original mesh body. The convex hull in the target convex hull set corresponding to the original mesh body generated by the present disclosure can retain more details. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 A schematic diagram of a convex hull generation solution in the related art;

[0024] Figure 2 A schematic diagram of an application scenario of the convex hull generation method provided by an exemplary embodiment of the present disclosure;

[0025] Figure 3 A schematic diagram of another application scenario of the convex hull generation method provided by an exemplary embodiment of the present disclosure;

[0026] Figure 4 A schematic diagram of a flow chart of a convex hull generation method provided for an exemplary embodiment of the present disclosure;

[0027] Figure 5a A schematic diagram of a segmentation method provided for an exemplary embodiment of the present disclosure;

[0028] Figure 5b A schematic diagram of a segmentation method provided for an exemplary embodiment of the present disclosure;

[0029] Figure 6 A schematic diagram of a surface reduction effect provided by an exemplary embodiment of the present disclosure;

[0030] Figure 7a A schematic diagram of surface reduction control provided for an exemplary embodiment of the present disclosure;

[0031] Figure 7b Another schematic diagram of surface reduction control provided for an exemplary embodiment of the present disclosure;

[0032] Figure 8a A schematic diagram of a structure of a convex hull provided for an exemplary embodiment of the present disclosure;

[0033] Figure 8b A schematic diagram of a structure after a convex hull is introduced provided by an exemplary embodiment of the present disclosure;

[0034] Figure 8c It is a structural schematic diagram after the convex hull in the related technology is introduced;

[0035] Fig. 9 A schematic diagram of data flow provided for an exemplary embodiment of the present disclosure;

[0036] Fig.10 Another schematic flow chart of a convex hull generation method provided for an exemplary embodiment of the present disclosure;

[0037] Fig.11 A schematic diagram of a product side of a convex hull generation method provided by an exemplary embodiment of the present disclosure;

[0038] Fig.12 A schematic structural diagram of a convex hull generating device provided by an exemplary embodiment of the present disclosure;

[0039] Fig.13 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0040] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, usage scenarios, etc. of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0041] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present application according to the prompt message.

[0042] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0043] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation method of the present application. Other methods that meet the relevant laws and regulations may also be applied to the implementation method of the present application.

[0044] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0045] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, the principles and spirit of the present disclosure will be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0046] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0047] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connecting" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly. The article "one" or "a" before an element does not exclude the existence of multiple such elements.

[0048] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.

[0049] As described in the background technology, in electronic games based on computer graphics technology, convex hulls are usually used to implement physical effects such as collision and breakage of game objects. Using convex hulls instead of original complex meshes for physical calculations can improve real-time performance.

[0050] However, in the related art, when generating a convex hull from an original complex mesh, some details are usually ignored, such as slits and holes, which are required in the process of interaction with the user.

[0051] Specifically, as the software and hardware levels of the game industry continue to improve, players' demands for realism such as collisions and fragmentation in games are also increasingly developing towards a higher level. In three-dimensional games, convex hulls are often used to achieve physical effects such as collisions and fragmentation of game objects. Convex hulls are simpler meshes, which are used to replace the original complex meshes for physical operations, thereby improving real-time performance. During the development process, developers will generate the three-dimensional convex hull of the art model offline in advance. For models with more details, such as some gameplay props for player interaction, some methods are needed to split them into several sub-convex hulls. In this way, the granularity of collision detection, collision processing, or fragmentation generation will be finer, ultimately making the game physics more realistic.

[0052] There are various methods for generating and cutting convex hulls. The basic approach is for specialized artists to manually rebuild a convex hull model based on a three-dimensional grid on professional software, or to perform convex hull modeling on each detail of the grid separately, and finally import it into the game engine. This process consumes a lot of manpower and the effect is affected by the professionalism of the art and the complexity of the model. A more common approach in related technologies is to use the built-in tools of the game engine to directly generate a segmented convex hull for the model. For example, the Unreal Engine will automatically generate a convex hull when importing a model. However, for models with high requirements for details, this method often ignores some details, such as slits and holes, which are necessary for certain gameplays. In addition, the sub-convex hull cutting effect is also poor, and the area that was originally a convex hull may be divided again, or the sub-convex hull may be in a strip shape, which does not meet the expected shape. Due to these defects, it is still necessary to spend manpower to re-make the convex hull.

[0053] Next, we will introduce the convex hull generation scheme in related technologies and analyze the problems therein:

[0054] refer to Figure 1 A convex hull generation scheme in the related art uses the engine's built-in convex hull generation function. Taking Unreal Engine as an example, this scheme generally requires the user to directly import the mesh body to be generated with the convex hull into the engine, and then use the engine's built-in convex hull function to generate the convex hull. Generally speaking, the generated convex hull should be composed of several sub-convex hulls, and each sub-convex hull should wrap a part of the original mesh body shape with convex details. After the generation is completed, the user needs to observe the convex hull to judge whether it meets expectations.

[0055] Commonly used evaluation criteria: whether the sub-convex hulls are segmented reasonably, that is, the detail areas that should be segmented are segmented, and the areas that are already convex are not segmented excessively; whether the number of convex hulls meets expectations, if too many will affect real-time performance; whether the number of faces or vertices of each sub-convex hull meets expectations, which is also an important indicator affecting performance; whether the convex hull can meet the gameplay requirements, such as some gameplays with physics, such as a container for liquid, which requires the liquid to be poured out of the container. However, if the generated convex hull ignores the container hole, it cannot meet the gameplay requirements.

[0056] In this solution, the convex hull tool used by the game engine is a black box for users. It is inconvenient to re-edit the convex hull that does not meet expectations. If the result does not meet expectations, the user needs to readjust the parameters to generate it. However, if the original mesh is complex and the built-in method cannot meet the requirements, the engine cannot directly modify the convex hull through face editing. Therefore, the user still needs to re-make the convex hull from the art software, mark it as required by the engine, and then re-import it into the engine for testing. In addition, the engine generally cannot generate convex hulls for a large number of original meshes in batches according to certain parameters, and manual repeated loading and operation are required.

[0057] In this solution, the Unreal Engine uses the V-HACD method. For some meshes with holes, the generated convex hull often ignores them, and these holes are often necessary elements for a certain gameplay or simulation. The reason for this phenomenon is that V-HACD matches the convex hull and the original mesh through the voxel volume ratio. V-HACD will first voxelize the mesh to be processed, and use the traditional "divide and conquer method" to generate the convex hull. Then, when the mesh is divided and the corresponding sub-convex hull is obtained, the current sub-convex hull will be judged based on the voxel volume of the divided mesh and the volume of the sub-convex hull to determine whether it is sufficient to match the original mesh. The closer the ratio is to 1, the more it matches, and the smaller it is, the less it matches. If the ratio does not meet the preset threshold, it will continue to divide until convergence. Since volume comparison is not sensitive to some small holes (because the holes themselves are very small), details are ignored; in addition, since the V-HACD method adopts a method of randomly selecting segmentation planes along the global coordinate axis when segmenting the grid body, the resulting segmented sub-convex hull is often strip-shaped, and segmentation is performed in areas that are already convex hulls and should not be segmented, that is, the segmentation granularity is inaccurate.

[0058] In order to solve the above problems, the present disclosure provides a convex hull generation scheme, which specifically includes: determining an original mesh body and generating an original convex hull corresponding to the original mesh body; determining the concavity value of the original convex hull; if the concavity value of the original convex hull is greater than a preset concavity threshold, iteratively segmenting the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a number of spare sub-convex hulls; determining a preset face reduction parameter, wherein the face reduction parameter includes the number of target vertices or the reduction ratio of the number of target vertices; based on the preset face reduction parameter, the spare sub-convex hull is reduced in face to obtain a sub-convex hull set after face reduction, and the sub-convex hull set after face reduction is determined as the target convex hull set corresponding to the original mesh body. The convex hull in the target convex hull set corresponding to the original mesh body generated by the present disclosure can retain more details.

[0059] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0060] refer to Figure 2 and Figure 3 , which are schematic diagrams of two application scenarios of the convex hull generation method provided by the exemplary embodiments of the present disclosure.

[0061] This application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, the server 102, and the data storage system 103 may be connected via a wired or wireless communication network to achieve data interaction.

[0062] The terminal device 101 may be an electronic device with data transmission and multimedia input / output functions close to the user side, including but not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of realizing the above functions. The electronic device may include a processor and a display screen with a touch input function, the display screen is used to present a graphical user interface, the graphical user interface can display an application interface, and the processor is used to process application data, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0063] Server 102 and data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0064] In some exemplary embodiments, the convex hull generation method may be executed on the server 102 or the terminal device 101 .

[0065] When the convex hull generation method is run on the server 102, the server 102 is used to provide a convex hull generation service to the user of the terminal device 101. The terminal device 101 is installed with a client that communicates with the server 102, and the user can input the original mesh body to be generated for the convex hull through the client. Among them, the data format of the original mesh body can include at least two types of FBX and OBJ. The user can also specify all or part of the original mesh body used to generate the convex hull, and configure related parameters, specifically: select the batch directory or click the mesh body to be processed, use the default parameters or set the convex hull and face reduction parameters, and click "Batch generate selected files" or "Generate convex hull of selected objects".

[0066] The client sends the original mesh to the server 102, and the server 102 determines the original mesh and generates an original convex hull corresponding to the original mesh; determines the concavity value of the original convex hull; if the concavity value of the original convex hull is greater than a preset concavity threshold, iteratively divides the original convex hull until the concavity value of the sub-convex hull obtained by dividing is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls; determines a preset face reduction parameter, wherein the face reduction parameter includes a target number of vertices or a reduction ratio of a target number of vertices; based on the preset face reduction parameter, reduces the face of the spare sub-convex hull to obtain a sub-convex hull set after face reduction, and determines the sub-convex hull set after face reduction as a target convex hull set corresponding to the original mesh.

[0067] The server 102 may send the target convex hull set corresponding to the original mesh to the client, and the client displays the target convex hull set to the user. The user may consult or even adjust the target convex hull set, and then import the sub-convex hull set into a designated game engine for use. Specifically, if it meets expectations, it is directly imported into the designated game engine for use; if it does not meet expectations, it can be modified in the designated software (e.g., 3DsMax) or automatically generated after modifying the parameters.

[0068] The server 102 may also import the target convex hull set corresponding to the original mesh into a designated game engine for use.

[0069] When the convex hull generation method is run on the server 102 , the method can be implemented and executed based on the cloud interaction system.

[0070] Among them, the cloud interaction system includes client devices and cloud application servers.

[0071] In some exemplary embodiments, various cloud applications can be run under the cloud interaction system. Cloud applications refer to applications based on cloud computing. In the operation mode of cloud applications, the operating body of the application and the application screen presentation body are separated. The storage and operation of the state control method in the application are completed on the cloud application server. The role of the client device is to receive and send data and present the application screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud application server in the cloud is responsible for information processing. When interacting, the player operates the client device to send an operation instruction to the cloud application server. The cloud application server runs the application according to the operation instruction, encodes and compresses the application screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the application screen.

[0072] In the above embodiment, the convex hull generation method is described by taking the case where the convex hull generation method is run on the server 102 as an example. However, the present disclosure is not limited thereto. In some exemplary embodiments, the convex hull generation method may also be run on the terminal device 101 .

[0073] When the convex hull generation method is run on the terminal device 101, the terminal device 101 may include a display screen and a processor. A client is installed in the terminal device 101, and the user can input the original mesh body for which the convex hull is to be generated through the client. Among them, the data format of the original mesh body may include at least two types: FBX and OBJ. The user can also specify all or part of the original mesh body used to generate the convex hull, and configure relevant parameters, specifically: select the batch directory or click the mesh body to be processed, use the default parameters or set the convex hull and face reduction parameters, and click "Batch generate selected files" or "Generate convex hull of selected objects".

[0074] The client sends the original mesh to the processor, and the processor determines the original mesh and generates an original convex hull corresponding to the original mesh; determines the concavity value of the original convex hull; if the concavity value of the original convex hull is greater than a preset concavity threshold, iteratively divides the original convex hull until the concavity value of the sub-convex hull obtained by dividing is less than or equal to the preset concavity threshold, and obtains a plurality of spare sub-convex hulls; determines a preset face reduction parameter, and the face reduction parameter includes a target number of vertices or a reduction ratio of the target number of vertices; based on the preset face reduction parameter, reduces the face of the spare sub-convex hull to obtain a sub-convex hull set after face reduction, and determines the sub-convex hull set after face reduction as a target convex hull set corresponding to the original mesh.

[0075] The processor can send the target convex hull set corresponding to the original mesh to the client, and the client displays the target convex hull set to the user. The user can check or even adjust the target convex hull set, and then import the target convex hull set into the specified game engine for use. Specifically: if it meets expectations, it is directly imported into the specified game engine for use; if it does not meet expectations, it can be modified in the specified software (such as 3DsMax) or automatically generated after modifying the parameters.

[0076] The processor may also import the target convex hull set corresponding to the original mesh into a specified game engine for use.

[0077] When the convex hull generation method is run on the terminal device 101, taking the application as an example, the terminal device stores the application and is used to present the application screen. The terminal device is used to interact with the player through a graphical user interface, that is, the application is downloaded and installed and run by the conventional electronic device. The terminal device can provide the graphical user interface to the player in a variety of ways, for example, it can be rendered and displayed on the display screen of the terminal, or provided to the player through a holographic projection. For example, the terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes an application screen, and the processor is used to run the application, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0078] The data storage system 103 is used to store relevant data.

[0079] Combine the following Figure 2 and Figure 3 The convex hull generation method according to the exemplary embodiment of the present disclosure is described by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0080] refer to Figure 4 , which is a flow chart of a convex hull generation method provided by an exemplary embodiment of the present disclosure.

[0081] The exemplary embodiment of the present disclosure provides a convex hull generation method, comprising the following steps:

[0082] Step S410: determine an original mesh volume, and generate an original convex hull corresponding to the original mesh volume.

[0083] In this exemplary embodiment, the data formats of the original mesh include: FBX format and OBJ format.

[0084] In specific implementation, when the data format of the original mesh is in FBX format, it is first converted into OBJ format, and then the original convex hull corresponding to the original mesh is generated;

[0085] When the data format of the original mesh is OBJ format, the original convex hull corresponding to the original mesh is directly generated.

[0086] In specific implementation, the present disclosure does not limit the specific method for generating the original convex hull corresponding to the original mesh body, and methods in related technologies that can achieve the above functions (such as the divide-and-conquer method) are all included therein.

[0087] Step S420: Determine the concavity value of the original convex hull.

[0088] In this exemplary embodiment, the method for determining the concavity value of the original convex hull includes:

[0089] Calculating Hausdorff distance values ​​between vertices of the original mesh and the surface of the original convex hull;

[0090] Calculating the volume value of the space between the original mesh body and the original convex hull;

[0091] The maximum value between the Hausdorff distance value and the volume value of the space is used as the concavity value of the original convex hull.

[0092] In specific implementation, the concavity value (Concavity) of the original convex hull is calculated according to the following formula:

[0093] Concavity(S)=max(H b (S),R v (S));

[0094] Where Concavity(S) represents the concavity value of the original convex hull S.

[0095] H b (S) represents the Hausdorff distance from the original mesh vertex to the original convex hull surface (the Hausdorff distance can be simply understood as the distance between the mesh point set and the original convex hull point set. For each point, the closest point in the other point set is found to form a set of "point pairs". The Hausdorff distance is the largest set of distance values ​​among all "point pairs". Using it as a metric can make the concavity calculation more sensitive to slits and gaps, so that the original convex hull can eventually restore this situation better.

[0096] R v (S) is used to measure the volume of the empty capsule space formed between the original convex hull and the original mesh volume. The volume difference can be approximately regarded as an inscribed sphere, and the radius of the sphere is used to approximate the empty capsule space. Therefore, R v(S) can be calculated by reverse approximation using the sphere volume formula:

[0097]

[0098] Among them, Vol(CH(S)) and Vol(S) represent the volumes of the original convex hull and the original mesh, respectively. Using it as a metric can make the concavity more sensitive to the case with cavities, so that the original convex hull can better restore the shape of the cavity. b (S) or R v (S) increases, indicating the presence of slits and cavities, and the concavity can be more sensitively improved. Further, as long as the concavity is greater than the preset concavity threshold, the original convex hull will be further segmented to generate more sub-convex hulls (step S430 will be described in detail).

[0099] Step S430: If the concavity value of the original convex hull is greater than the preset concavity threshold, the original convex hull is iteratively segmented until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls.

[0100] In the exemplary embodiment of the present disclosure, the idea of ​​Monte Carlo Tree Search is used to select the plane for segmenting the grid. Monte Carlo Tree Search (MCTS for short) is an optimization decision-making method for non-deterministic events, and the method flow is divided into four stages: selection, expansion, simulation, and backtracking. The idea is equivalent to abstracting each decision into a node in a tree structure, making an attempt (i.e., simulation) for each decision, calculating the score of the decision (for example, in chess games, it is the score of the situation after each move, and an experience score can be estimated by the type and position of one's own chess pieces), and then adding the score back to the root node along the decision path to complete a round of iteration. At the beginning of the next round of iteration, the leaf nodes with high scores are selected for splitting (expansion), and more subsequent decisions are tried along the existing best decision path. In this way, the iteration is stopped until the search depth reaches a certain value, and a relatively excellent decision path is finally returned.

[0101] Below, we will explain the decision of splitting the convex hull, specifically:

[0102] In this exemplary embodiment, the iterative segmentation of the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to a preset concavity threshold value, to obtain a plurality of spare sub-convex hulls, includes:

[0103] Using different segmentation methods, the convex hull to be segmented is simulated segmented to obtain different simulated segmentation results;

[0104] Based on the simulated segmentation result corresponding to the segmentation method, calculating the segmentation score corresponding to the segmentation method;

[0105] The convex hull to be segmented is segmented in the segmentation mode corresponding to the highest segmentation score among the plurality of segmentation scores, until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of the spare sub-convex hulls;

[0106] The convex hull to be segmented includes any one of the original convex hull whose concavity value is greater than the preset concavity threshold and the sub-convex hull whose concavity value is greater than the preset concavity threshold.

[0107] In this exemplary embodiment, the calculating the segmentation score corresponding to the segmentation method based on the simulated segmentation result corresponding to the segmentation method includes:

[0108] Based on the concavity value of the convex hull to be segmented, obtaining a quality score of the convex hull to be segmented, wherein the quality score is negatively correlated with the concavity value;

[0109] Determine a first simulated segmentation number of the convex hull to be segmented and a second simulated segmentation number of the parent convex hull corresponding to the convex hull to be segmented;

[0110] The segmentation score is obtained based on the quality score, the first simulated segmentation times, and the second simulated segmentation times.

[0111] In the specific implementation, define the scoring method for each decision (splitting method). In MCTS, this score is called UCB (Upper confidence bound), which can be calculated by the following scoring formula:

[0112]

[0113] Among them, Q(n) represents the quality score, and its value is the opposite of the concavity value of the current n-th convex hull, which means that the quality score Q(n) is inversely proportional to the concavity. For example, the larger the concavity, the smaller the quality score, because at this time the concavity between the convex hull cut out by the decision plane and the current grid body is relatively larger, so the quality of the convex hull is rougher. Optionally, it is more inclined to continue making decisions from a higher quality cutting method, so when the concavity here is smaller, the Q(n) value is larger. In the latter term, c is a fixed coefficient. N(n) represents the number of attempts for the current n-th convex hull (that is, the number of simulations), N(n ’) represents the number of attempts of its parent node in the tree. The meaning of the calculation inside the square root is that if only the preceding term Q(n) is considered, the total score of the unexplored cutting method will always be 0, and it will never be tried. Therefore, for the unexplored node N(n) is 0 at the beginning, so the subsequent term is infinite at the beginning, so this node will definitely be explored during the tree search.

[0114] As a specific example, see Figure 5a , taking an original mesh with grooves as an example to introduce the selection of the splitting plane:

[0115] refer to Figure 5b , which is the situation during the second iteration of the Monte Carlo tree search: Convex0 represents the convex hull generated for the original mesh. Convex1 / 2 and Convex3 / 4 represent different segmentation methods tried in the two iterations (the green dashed line is the sub-convex hull that is attempted to be segmented). It can be seen that for the segmentation method on the left, the concavity after segmentation is larger (because according to the concavity formula, its R v The (S) value is obviously larger than the right-side cutting method), and its quality score Q(n) is smaller, so after applying the UCB scoring formula (3), its value is smaller than the right-side cutting method.

[0116] This result is also consistent with the actual situation: Convex1 obtained by the cutting method on the left still has a groove. If it is executed according to this path, it must continue to be cut, forming redundant and unnecessary blocks. The cutting method on the right obtains two separate convex hulls, Convex3 and Convex4. If the preset concavity threshold is appropriate, they can be regarded as the final sub-convex hull.

[0117] For the present disclosure, the decision path with a larger UCB value will be selected for segmentation until the depth of the tree reaches a certain value, or the calculation exceeds a certain time, then the search is stopped. It can be seen that this method can automatically find a more suitable section, avoid unnecessary segmentation, and obtain a more regular convex hull.

[0118] In the exemplary embodiment of the present disclosure, "concavity" is used as a basis for judging whether to continue cutting the convex hull corresponding to a grid body. If the concavity is less than or equal to the preset concavity threshold, it means that the difference between the currently cut convex hull and the original grid body is not large, and the segmentation of the convex hull can be stopped. Therefore, when the threshold is smaller, the number of convex hulls removed is generally more, so the granularity of the convex hull is larger, so that it can fit the original grid body more closely. When the threshold is closer to 0, it means that the convex hull needs to infinitely tend to the original grid body. Therefore, a reasonable concavity metric aims to be able to sensitively detect the original grid body features that significantly change the collision conditions. Specifically:

[0119] In this exemplary embodiment, the method for determining the concavity value of the convex hull to be segmented includes:

[0120] Calculating the Hausdorff distance between the vertices of the original mesh and the surface of the convex hull to be segmented;

[0121] Calculating the volume value of the space between the original grid body and the convex hull to be segmented;

[0122] The maximum value between the Hausdorff distance value and the volume value of the space is used as the concavity value of the convex hull to be segmented.

[0123] In specific implementation, the concavity value (Concavity) of the convex hull to be segmented is calculated according to the following formula:

[0124] Concavity(I)=max(H b (I),R v (I));

[0125] Concavity(I) represents the concavity value of the convex hull I to be segmented, H b (I) represents the Hausdorff distance from the original mesh vertex to the convex hull surface to be segmented (the Hausdorff distance can be simply understood as the distance between the mesh point set and the convex hull point set to be segmented. For each point, the nearest point in the other point set is found to form a set of "point pairs". The Hausdorff distance is the set of distance values ​​with the largest distance among all "point pairs"). Using it as a metric can make the concavity calculation more sensitive to slits and gaps, so that the convex hull to be segmented can eventually restore this situation better.

[0126] R v (I) is used to measure the volume of the empty space between the convex hull to be segmented and the original mesh volume. The volume difference can be approximately regarded as an inscribed sphere, and the radius of the sphere is used to approximate the empty space. Therefore, R v (I) can be calculated by reverse approximation using the sphere volume formula:

[0127]

[0128] Among them, Vol(CH(I)) and Vol(I) represent the volume of the convex hull to be segmented and the volume of the original mesh, respectively. Using it as a metric can make the concavity more sensitive to the situation with cavities, so that the convex hull to be segmented can better restore the shape of the cavity. In this way, once H appears b (I) or R v (I) increases, indicating the presence of slits and cavities, which can more sensitively increase the concavity. As long as the concavity is greater than the preset concavity threshold, the convex hull to be segmented will be further segmented, thereby generating more sub-convex hulls.

[0129] The definition of the preset concavity threshold (Concavity Threshold) adopted in the present disclosure has a better fit to the difference between the convex hull and the original mesh.

[0130] Step S440: Determine a preset face reduction parameter, where the face reduction parameter includes a target vertex number or a target vertex number reduction ratio.

[0131] During specific implementation, the target number of vertices or the reduction ratio of the target number of vertices may be pre-configured or configured in real time.

[0132] In specific implementation, the target number of vertices or the reduction ratio of the target number of vertices can be calculated based on the pre-configured or real-time configured target vertex density, specifically:

[0133] In an exemplary embodiment of the present disclosure, the determining of a preset face reduction parameter, wherein the face reduction parameter includes a target number of vertices or a reduction ratio of a target number of vertices, includes:

[0134] Determining the surface area of ​​the spare sub-convex hull;

[0135] Determining a target vertex density of the alternate sub-convex hull;

[0136] The target number of vertices or the reduction ratio of the target number of vertices of the spare sub-convex hull is obtained based on the surface area of ​​the spare sub-convex hull and the target vertex density of the spare sub-convex hull.

[0137] In a specific implementation, the surface area of ​​the spare sub-convex hull is divided by the target vertex density of the spare sub-convex hull to obtain the target vertex number of the spare sub-convex hull.

[0138] During specific implementation, based on the target number of vertices of the spare sub-convex hull, a reduction ratio of the target number of vertices of the spare sub-convex hull is obtained.

[0139] Step S450: Based on the preset surface reduction parameters, the spare sub-convex hull is subjected to surface reduction to obtain a sub-convex hull set after surface reduction, and the sub-convex hull set after surface reduction is determined as a target convex hull set corresponding to the original mesh body.

[0140] In the exemplary embodiment of the present disclosure, considering that the generated convex hull itself is also a three-dimensional mesh body, for some original mesh bodies with complex surfaces, the number of faces of the generated convex hull may be large, and directly participating in the physical calculation of the game will lead to performance degradation, so it is necessary to reduce the face of the convex hull, specifically:

[0141] In this exemplary embodiment, the step of reducing the surface of the spare sub-convex hull includes:

[0142] Determine a pair of target vertices of the surface of the alternate subconvex hull;

[0143] The position where the sum of squares of distances to the planes to which the adjacent triangular faces of the triangular face to which the target vertex belongs is minimized is used as the position of the merged vertex obtained after merging the target vertex.

[0144] In this exemplary embodiment, the step of determining a pair of target vertices of the surface of the alternate sub-convex hull includes:

[0145] A pair of adjacent vertices on the surface of the backup sub-convex hull or whose distance is less than or equal to a distance threshold is determined as the target vertices.

[0146] In the specific implementation, the 3DsMax modifier is introduced and implemented using MaxAPI such as MaxScript. The underlying modifier interface is an optimization method based on local edge contraction. Every time an edge is contracted on the manifold triangle mesh surface, one vertex and one to two triangle faces will be reduced. Specifically, the essence of the method is to greedily find legal "point pairs" locally for merging and contraction. The so-called "legal" means that the "point pairs" must be adjacent or the distance is less than or equal to a certain value. The sum of the squares of the distances of the merged "point pairs" to the plane where the adjacent triangles are located before the merger must be the smallest. The added value is the QEM value, which is implemented according to the following formula:

[0147]

[0148] Among them, v1 and v2 represent "point pairs", p represents each plane containing the vertex, and distance is the distance from point v to plane p. The final method will sum the squares of the distance values. When the optimization function (the function value is the error, i.e., the error value) on the right side of the merging symbol ∑ is minimized, the position is used as the merged point to replace the original v1 and v2 vertices.

[0149] refer to Figure 6 After the face reduction operation, the number of faces of the convex hull after face reduction is significantly reduced compared with the convex hull directly generated by the previous process. Especially for the dense triangle faces of the bottle mouth, the face simplification effect is particularly obvious. After optimization, the actual convex hull has little administrative change, and it is of great help to improve the real-time physical calculation performance of the game.

[0150] In this exemplary embodiment, the step of reducing the surface of the spare sub-convex hull includes:

[0151] In response to an adjustment instruction for the number of vertices of the spare sub-convex hull, determining a target ratio between the number of vertices of the sub-convex hull obtained after surface reduction of the spare sub-convex hull and the number of vertices of the spare sub-convex hull before surface reduction;

[0152] The spare sub-convex hull is reduced in number based on the target ratio until a ratio between the number of vertices of the sub-convex hull after the reduction and the number of vertices of the spare sub-convex hull before the reduction is less than or equal to the target ratio.

[0153] In this exemplary embodiment, the step of reducing the surface of the spare sub-convex hull includes:

[0154] In response to an adjustment instruction for the number of vertices of the standby sub-convex hull, determining a target number of vertices of a sub-convex hull obtained by reducing the number of faces of the standby sub-convex hull;

[0155] The spare sub-convex hull is reduced in number based on the target number of vertices until the number of vertices of the sub-convex hull after the reduction is less than or equal to the target number of vertices.

[0156] In the embodiment of the present disclosure, since the user is provided with an automatic pipeline that can be processed in batches, and for an original mesh, the generated convex hulls need to be processed one by one for face reduction, a method that can macro-control the number of overall facets / vertices is needed to allow the user to conveniently set the degree of face reduction. Figure 7a , this embodiment provides a set of face reduction parameters for achieving this purpose:

[0157] Among them, "Simplify by Vert Percent" and "Simplify by Vert Count" are switches, allowing users to control the degree of face reduction by proportion or number of vertices. If "Simplify by Vert Percent" is turned on, you can set the "Max Vert Percent". For example, set it to 50%. At this time, the face reduction method will stop iterating when the number of vertices after the merger is less than or equal to half of the number of vertices before the merger. The number of vertices of each sub-convex hull obtained by the user is half of the original convex hull. If "Simplify by Vert Count" is turned on, you can set the "Max Vert Count". The design is slightly different at this time: for example, if it is set to 50, it means that the total number of vertices of all sub-convex hulls is 50. The number of vertices retained after each convex hull is reduced is determined according to the ratio of the original number of vertices to the total number of vertices. The actual calculation is as follows Figure 7b As shown:

[0158] It can be seen that the sum of the number of vertices of the three sub-convex hulls is 100. For the sub-convex hull Convex1 with an original number of vertices of 50, since the proportion is 50%, the number of vertices after face reduction is reduced to 25, and the number of vertices of the other convex hulls Convex2 and 3 are reduced to 15 and 10 respectively, so the total number of vertices of the sub-convex hull after face reduction is the preset 50. In the actual implementation of the present disclosure, the user is only allowed to use one of the two methods of proportional or vertex number control at the same time. At the same time, when an integer vertex value cannot be obtained by division, the final vertex value will be rounded down.

[0159] refer to Figure 8a , showing the convex hull generated by the present disclosure.

[0160] refer to Figure 8b , showing that after the convex hull generated by the present invention is imported into the Unreal Engine, the engine can correctly recognize the convex hull automatically generated by the plug-in.

[0161] refer to Figure 8c , showing the related technology of Unreal Engine using H-VHACD to generate convex hulls. It can be seen that the recovery of gaps such as building windows is poor, and the generated sub-convex hulls are messy, which will cause large collision judgment errors and performance impact when used in real-time physics in games.

[0162] In specific implementation, the convex hull required in the actual generation must be composed of multiple sub-convex hulls, rather than using a whole large convex hull to surround the original mesh. In other words, the generated convex hulls are not equal to a single large bounding box.

[0163] refer to Fig. 9 , showing the data flow during the convex hull generation process, specifically:

[0164] In response to the data format of the original mesh body being in FBX format, converting the data format of the original mesh body into OBJ format to obtain the original mesh body in OBJ format;

[0165] Generate an original convex hull in OBJ format corresponding to the original mesh in OBJ format;

[0166] Determine the concavity value of the original convex hull in the OBJ format;

[0167] If the concavity value of the original convex hull in the OBJ format is greater than a preset concavity threshold, the original convex hull in the OBJ format is iteratively segmented until the concavity value of the sub-convex hull in the OBJ format obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls in the OBJ format;

[0168] Determining a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a target vertex number reduction ratio;

[0169] Based on the preset face reduction parameters, the spare sub-convex hull in the OBJ format is reduced in face to obtain a sub-convex hull set in the OBJ format after face reduction, and the sub-convex hull set in the OBJ format after face reduction is determined as a target convex hull set in the OBJ format corresponding to the original mesh body in the OBJ format;

[0170] The target convex hull set in the OBJ format is converted into a target convex hull set in the FBX format.

[0171] In specific implementation, this disclosure supports processing of both FBX and OBJ meshes, but the data flow is different when the two are actually processed. For FBX files, they must first be converted to OBJ format data structures and then passed to the CoACD convex hull method for processing, while OBJ format files can be directly passed to the pipeline. For the face reduction operation, MaxAPI is used in the pipeline to perform in-place face reduction on the generated convex hull mesh.

[0172] For the FBX processing flow, after the convex hull generation, segmentation and face reduction are completed, each sub-convex hull generated will be automatically renamed according to the rules of the Unreal Engine. The role of the UCX prefix is: when such FBX is imported into the Unreal Engine, the mesh objects with this prefix in the FBX data structure will be identified, and they will be automatically identified as convex hulls (not valid for OBJ files).

[0173] refer to Fig.10 , showing a method for automatically generating pipelines from convex hulls based on approximate convex decomposition and surface reduction methods:

[0174] Create FBX or OBJ files; select a batch processing directory, or click on the mesh to be processed; use default parameters or set convex hull and face reduction parameters; click "Batch generate selected files" or "Generate convex hull of selected objects"; generate convex hull; import into the game engine.

[0175] Input the original mesh and set the preset concavity threshold; generate the original large convex hull; calculate the concavity; if it exceeds the preset concavity threshold, select a plane to split the current mesh and generate a sub-convex hull; if it is less than or equal to the preset concavity threshold (convergence), obtain the final convex hull set and reduce the sub-convex hull surface.

[0176] Calculation of concavity: The CoACD concavity calculation method was used.

[0177] Select a plane to split the current mesh: Use the Monte Carlo tree search method to select a plane to split the mesh.

[0178] Convex hull face reduction: This is achieved by introducing the 3DsMax modifier and using MaxAPI such as MaxScript.

[0179] In the disclosed embodiment, based on the existing convex hull generation scheme, certain innovative designs are made on both the product side and the method side, and a new convex hull generation method combining approximate convex decomposition and face reduction method is proposed, and an automatic pipeline built into 3DsMax is realized. On the product side, users are supported to automatically process original mesh files in various formats individually or in batches, and the results can be adjusted by setting convex hull and face reduction parameters. Compared with academic third-party methods, it can automatically produce convex hull data structures that can be automatically recognized by Unreal Engine, and the release and deployment are also highly automated. On the method side, the disclosure introduces concavity calculation and Monte Carlo decision tree based on CoACD method, so that the generated convex hull can retain more details, and the granularity of the sub-convex hull is more reasonable and regular, so that the rework rate of the art staff in handling convex hull tasks is significantly reduced. In general, this aspect improves the efficiency of art research and development, and has certain reference value for the research on offline asset generation and improving real-time performance in game production.

[0180] refer to Fig.11 , using the interactive interface implemented by the present disclosure as a starting point to introduce the implementation of the present disclosure on the product side. Fig.11 As shown, the embodiment of the present disclosure uses a 3DsMax built-in plug-in as an interactive method, providing a user operation panel for setting and executing the convex hull program.

[0181] The interactive interface of the embodiment is divided into the following parts:

[0182] Batch file directory selection area: provides the selection of file types that need to be batch processed, and sets the directory (folder) where the files to be processed are located, supporting FBX or OBJ format files;

[0183] CoACD convex hull setting: provides convex hull parameter setting components related to the CoACD method, providing options such as preset concavity threshold (Concavity Threshold), convex hull number (Hull Count), whether to enable preprocessing (Enable Preprocess), whether to turn on random (Is Random), etc.

[0184] Face reduction settings: After the convex hull is generated, the parameters of the face reduction method for each convex hull are automatically set. The user is supported to set the maximum vertex ratio (Max Vert Percent) and the number of vertices (Max Vert Count) after face reduction relative to the front face reduction. Whether to perform face reduction can be controlled by two switches (Simplify by Vert Percent, Simplify by Vert Count).

[0185] Execute button: supports automatic generation of convex hulls for individually selected meshes in the 3DsMax scene, and also supports batch processing of all files to be processed configured in the "Batch File Directory Selection Area";

[0186] Progress display: displays the file processing progress during batch processing.

[0187] Based on the user operation panel provided by the above product side, the following method is implemented:

[0188] In response to a selection operation on a target virtual model in a virtual scene, taking the target virtual model as the original mesh body, and generating an original convex hull corresponding to the original mesh body;

[0189] In response to an input operation for a concavity threshold, determining a concavity value of the original convex hull, and if the concavity value of the original convex hull is greater than the concavity threshold, iteratively segmenting the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the concavity threshold, thereby obtaining a plurality of spare sub-convex hulls;

[0190] In response to an input operation for a face reduction parameter, based on the face reduction parameter, the spare sub-convex hull is subjected to face reduction to obtain a sub-convex hull set after face reduction, and the sub-convex hull set after face reduction is determined as a target convex hull set corresponding to the original mesh body;

[0191] The target convex hull set is imported into the virtual scene.

[0192] During specific implementation, the target convex hull set imported into the virtual scene can be used for collision detection.

[0193] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0194] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0195] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a convex hull generating device.

[0196] refer to Fig.12 The convex hull generating device provided by the exemplary embodiment of the present disclosure includes the following modules:

[0197] The original convex hull generating module 910 is configured to determine an original mesh volume and generate an original convex hull corresponding to the original mesh volume;

[0198] A concavity value determination module 920 is configured to determine a concavity value of the original convex hull;

[0199] The convex hull segmentation module 930 is configured to iteratively segment the original convex hull if the concavity value of the original convex hull is greater than a preset concavity threshold, until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls;

[0200] A face reduction parameter determination module 940 is configured to determine a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a reduction ratio of a target vertex number;

[0201] The convex hull surface reduction module 950 is configured to reduce the surface of the spare sub-convex hull based on the preset surface reduction parameters to obtain a sub-convex hull set after surface reduction, and determine the sub-convex hull set after surface reduction as the target convex hull set corresponding to the original mesh body.

[0202] In some exemplary embodiments, the original convex hull generation module 910 is configured to:

[0203] In response to the data format of the original mesh body being in FBX format, converting the data format of the original mesh body into OBJ format to obtain the original mesh body in OBJ format;

[0204] Generate an original convex hull in OBJ format corresponding to the original mesh in OBJ format.

[0205] In some exemplary embodiments, the concavity value determination module 920 is configured to:

[0206] Calculating Hausdorff distance values ​​between vertices of the original mesh and the surface of the original convex hull;

[0207] Calculating the volume value of the space between the original mesh body and the original convex hull;

[0208] The maximum value between the Hausdorff distance value and the volume value of the space is used as the concavity value of the original convex hull.

[0209] In some exemplary embodiments, the convex hull segmentation module 930 is configured to:

[0210] Using different segmentation methods, the convex hull to be segmented is simulated segmented to obtain different simulated segmentation results;

[0211] Based on the simulated segmentation result corresponding to the segmentation method, calculating the segmentation score corresponding to the segmentation method;

[0212] The convex hull to be segmented is segmented in the segmentation mode corresponding to the highest segmentation score among the plurality of segmentation scores, until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of the spare sub-convex hulls;

[0213] The convex hull to be segmented includes any one of the original convex hull whose concavity value is greater than the preset concavity threshold and the sub-convex hull whose concavity value is greater than the preset concavity threshold.

[0214] In some exemplary embodiments, the convex hull segmentation module 930 is configured to:

[0215] Based on the concavity value of the convex hull to be segmented, obtaining a quality score of the convex hull to be segmented, wherein the quality score is negatively correlated with the concavity value;

[0216] Determine a first simulated segmentation number of the convex hull to be segmented and a second simulated segmentation number of the parent convex hull corresponding to the convex hull to be segmented;

[0217] The segmentation score is obtained based on the quality score, the first simulated segmentation times, and the second simulated segmentation times.

[0218] In some exemplary embodiments, the face reduction parameter determination module 940 is configured to:

[0219] Determining the surface area of ​​the spare sub-convex hull;

[0220] Determining a target vertex density of the alternate sub-convex hull;

[0221] The target number of vertices or the reduction ratio of the target number of vertices of the spare sub-convex hull is obtained based on the surface area of ​​the spare sub-convex hull and the target vertex density of the spare sub-convex hull.

[0222] In some exemplary embodiments, the convex hull reduction module 950′ is configured to:

[0223] Determine a pair of target vertices of the surface of the alternate subconvex hull;

[0224] The position where the sum of squares of distances to the planes to which the adjacent triangular faces of the triangular face to which the target vertex belongs is minimized is used as the position of the merged vertex obtained after merging the target vertex.

[0225] In some exemplary embodiments, the convex hull reduction module 950′ is configured to:

[0226] A pair of adjacent vertices on the surface of the backup sub-convex hull or whose distance is less than or equal to a distance threshold is determined as the target vertices.

[0227] In some exemplary embodiments, the convex hull reduction module 950′ is configured to:

[0228] In response to an adjustment instruction for the number of vertices of the spare sub-convex hull, determining a target ratio between the number of vertices of the sub-convex hull obtained after surface reduction of the spare sub-convex hull and the number of vertices of the spare sub-convex hull before surface reduction;

[0229] The spare sub-convex hull is reduced in number based on the target ratio until a ratio between the number of vertices of the sub-convex hull after the reduction and the number of vertices of the spare sub-convex hull before the reduction is less than or equal to the target ratio.

[0230] In some exemplary embodiments, the convex hull reduction module 950′ is configured to:

[0231] In response to an adjustment instruction for the number of vertices of the standby sub-convex hull, determining a target number of vertices of a sub-convex hull obtained by reducing the number of faces of the standby sub-convex hull;

[0232] The spare sub-convex hull is reduced in number based on the target number of vertices until the number of vertices of the sub-convex hull after the reduction is less than or equal to the target number of vertices.

[0233] In some exemplary embodiments, the convex hull generating device is configured to:

[0234] In response to a selection operation on a target virtual model in a virtual scene, taking the target virtual model as the original mesh body, and generating an original convex hull corresponding to the original mesh body;

[0235] In response to an input operation for a concavity threshold, determining a concavity value of the original convex hull, and if the concavity value of the original convex hull is greater than the concavity threshold, iteratively segmenting the original convex hull until a concavity value of a sub-convex hull obtained by segmentation is less than or equal to the concavity threshold, thereby obtaining a plurality of spare sub-convex hulls;

[0236] In response to an input operation for a face reduction parameter, based on the face reduction parameter, the spare sub-convex hull is subjected to face reduction to obtain a sub-convex hull set after face reduction, and the sub-convex hull set after face reduction is determined as a target convex hull set corresponding to the original mesh body;

[0237] The target convex hull set is imported into the virtual scene.

[0238] In some exemplary embodiments, the convex hull generating device is configured to:

[0239] In response to the data format of the original mesh body being in FBX format, converting the data format of the original mesh body into OBJ format to obtain the original mesh body in OBJ format;

[0240] Generate an original convex hull in OBJ format corresponding to the original mesh in OBJ format;

[0241] Determine the concavity value of the original convex hull in the OBJ format;

[0242] If the concavity value of the original convex hull in the OBJ format is greater than a preset concavity threshold, the original convex hull in the OBJ format is iteratively segmented until the concavity value of the sub-convex hull in the OBJ format obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls in the OBJ format;

[0243] Determining a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a target vertex number reduction ratio;

[0244] Based on the preset face reduction parameters, the spare sub-convex hull in the OBJ format is reduced in face to obtain a sub-convex hull set in the OBJ format after face reduction, and the sub-convex hull set in the OBJ format after face reduction is determined as a target convex hull set in the OBJ format corresponding to the original mesh body in the OBJ format;

[0245] The target convex hull set in the OBJ format is converted into a target convex hull set in the FBX format.

[0246] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0247] The device of the above embodiment is used to implement the corresponding convex hull generation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0248] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the convex hull generation method described in any of the above embodiments is implemented.

[0249] Fig.13A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0250] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0251] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0252] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0253] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0254] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0255] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0256] The electronic device of the above embodiment is used to implement the corresponding convex hull generation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0257] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device is running, the processor 1010 communicates with the memory 1020 via the bus 1030, so that the processor 1010 executes the following instructions when running:

[0258] Determine an original mesh body, and generate an original convex hull corresponding to the original mesh body;

[0259] Determining the concavity value of the original convex hull;

[0260] If the concavity value of the original convex hull is greater than a preset concavity threshold, the original convex hull is iteratively segmented until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls;

[0261] Determining a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a target vertex number reduction ratio;

[0262] Based on the preset surface reduction parameters, the spare sub-convex hull is subjected to surface reduction to obtain a sub-convex hull set after surface reduction, and the sub-convex hull set after surface reduction is determined as a target convex hull set corresponding to the original mesh body.

[0263] In a possible implementation manner, in the instructions executed by the processor 1010, determining the original mesh volume and generating the original convex hull corresponding to the original mesh volume includes:

[0264] In response to the data format of the original mesh body being in FBX format, converting the data format of the original mesh body into OBJ format to obtain the original mesh body in OBJ format;

[0265] Generate an original convex hull in OBJ format corresponding to the original mesh in OBJ format.

[0266] In a possible implementation manner, in the instruction executed by the processor 1010, determining the concavity value of the original convex hull includes:

[0267] Calculating Hausdorff distance values ​​between vertices of the original mesh and the surface of the original convex hull;

[0268] Calculating the volume value of the space between the original mesh body and the original convex hull;

[0269] The maximum value between the Hausdorff distance value and the volume value of the space is used as the concavity value of the original convex hull.

[0270] In a possible implementation, in the instruction executed by the processor 1010, the iterative segmentation of the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, to obtain a plurality of spare sub-convex hulls, includes:

[0271] Using different segmentation methods, the convex hull to be segmented is simulated segmented to obtain different simulated segmentation results;

[0272] Based on the simulated segmentation result corresponding to the segmentation method, calculating the segmentation score corresponding to the segmentation method;

[0273] The convex hull to be segmented is segmented in the segmentation mode corresponding to the highest segmentation score among the plurality of segmentation scores, until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of the spare sub-convex hulls;

[0274] The convex hull to be segmented includes any one of the original convex hull whose concavity value is greater than the preset concavity threshold and the sub-convex hull whose concavity value is greater than the preset concavity threshold.

[0275] In a possible implementation, in the instructions executed by the processor 1010, the calculating, based on the simulated segmentation result corresponding to the segmentation method, a segmentation score corresponding to the segmentation method includes:

[0276] Based on the concavity value of the convex hull to be segmented, obtaining a quality score of the convex hull to be segmented, wherein the quality score is negatively correlated with the concavity value;

[0277] Determine a first simulated segmentation number of the convex hull to be segmented and a second simulated segmentation number of the parent convex hull corresponding to the convex hull to be segmented;

[0278] The segmentation score is obtained based on the quality score, the first simulated segmentation times, and the second simulated segmentation times.

[0279] In a possible implementation, in the instructions executed by the processor 1010, the determining of a preset face reduction parameter, where the face reduction parameter includes a target number of vertices or a reduction ratio of a target number of vertices, includes:

[0280] Determining the surface area of ​​the spare sub-convex hull;

[0281] Determining a target vertex density of the alternate sub-convex hull;

[0282] The target number of vertices or the reduction ratio of the target number of vertices of the spare sub-convex hull is obtained based on the surface area of ​​the spare sub-convex hull and the target vertex density of the spare sub-convex hull.

[0283] In a possible implementation manner, in the instruction executed by the processor 1010, the reducing the surface of the spare sub-convex hull includes:

[0284] Determine a pair of target vertices of the surface of the alternate subconvex hull;

[0285] The position where the sum of squares of distances to the planes to which the adjacent triangular faces of the triangular face to which the target vertex belongs is minimized is used as the position of the merged vertex obtained after merging the target vertex.

[0286] In a possible implementation, in the instruction executed by the processor 1010, the step of determining a pair of target vertices of the surface of the spare sub-convex hull includes:

[0287] A pair of adjacent vertices on the surface of the backup sub-convex hull or whose distance is less than or equal to a distance threshold is determined as the target vertices.

[0288] In a possible implementation manner, in the instruction executed by the processor 1010, the reducing the surface of the spare sub-convex hull includes:

[0289] In response to an adjustment instruction for the number of vertices of the spare sub-convex hull, determining a target ratio between the number of vertices of the sub-convex hull obtained after surface reduction of the spare sub-convex hull and the number of vertices of the spare sub-convex hull before surface reduction;

[0290] The spare sub-convex hull is reduced in number based on the target ratio until a ratio between the number of vertices of the sub-convex hull after the reduction and the number of vertices of the spare sub-convex hull before the reduction is less than or equal to the target ratio.

[0291] In a possible implementation manner, in the instruction executed by the processor 1010, the reducing the surface of the spare sub-convex hull includes:

[0292] In response to an adjustment instruction for the number of vertices of the standby sub-convex hull, determining a target number of vertices of a sub-convex hull obtained by reducing the number of faces of the standby sub-convex hull;

[0293] The spare sub-convex hull is reduced in number based on the target number of vertices until the number of vertices of the sub-convex hull after the reduction is less than or equal to the target number of vertices.

[0294] In a possible implementation manner, in the instruction executed by the processor 1010, the method further includes:

[0295] In response to a selection operation on a target virtual model in a virtual scene, taking the target virtual model as the original mesh body, and generating an original convex hull corresponding to the original mesh body;

[0296] In response to an input operation for a concavity threshold, determining a concavity value of the original convex hull, and if the concavity value of the original convex hull is greater than the concavity threshold, iteratively segmenting the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the concavity threshold, thereby obtaining a plurality of spare sub-convex hulls;

[0297] In response to an input operation for a face reduction parameter, based on the face reduction parameter, the spare sub-convex hull is subjected to face reduction to obtain a sub-convex hull set after face reduction, and the sub-convex hull set after face reduction is determined as a target convex hull set corresponding to the original mesh body;

[0298] The target convex hull set is imported into the virtual scene.

[0299] In a possible implementation manner, in the instruction executed by the processor 1010, the method further includes:

[0300] In response to the data format of the original mesh body being in FBX format, converting the data format of the original mesh body into OBJ format to obtain the original mesh body in OBJ format;

[0301] Generate an original convex hull in OBJ format corresponding to the original mesh in OBJ format;

[0302] Determine the concavity value of the original convex hull in the OBJ format;

[0303] If the concavity value of the original convex hull in the OBJ format is greater than a preset concavity threshold, the original convex hull in the OBJ format is iteratively segmented until the concavity value of the sub-convex hull in the OBJ format obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls in the OBJ format;

[0304] Determining a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a target vertex number reduction ratio;

[0305] Based on the preset face reduction parameters, the spare sub-convex hull in the OBJ format is reduced in face to obtain a sub-convex hull set in the OBJ format after face reduction, and the sub-convex hull set in the OBJ format after face reduction is determined as a target convex hull set in the OBJ format corresponding to the original mesh body in the OBJ format;

[0306] The target convex hull set in the OBJ format is converted into a target convex hull set in the FBX format.

[0307] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the convex hull generation method described in any of the above embodiments.

[0308] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0309] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.

[0310] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the convex hull generation method described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0311] Based on the same inventive concept, corresponding to the convex hull generation method described in any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor execute the convex hull generation method. Corresponding to the execution subject corresponding to each step in each embodiment of the convex hull generation method, the processor that executes the corresponding step may belong to the corresponding execution subject.

[0312] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the convex hull generation method as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0313] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, which contains computer-readable program code.

[0314] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-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 examples) of computer-readable storage media may include, for example: an electrical connection with one or more wires, a portable computer 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. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.

[0315] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. 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. Computer-readable signal media may also be any computer-readable medium other than a computer-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.

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

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

[0318] It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, and these computer program instructions are executed by a computer or other programmable data processing device to produce a device that implements the functions / operations specified in the boxes in the flowchart and / or block diagram.

[0319] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0320] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby enabling the instructions executed on the computer or other programmable device to provide a process for implementing the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0321] In addition, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0322] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0323] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, 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 being embodied by multiple modules or units.

[0324] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0325] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0326] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0327] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

[0328] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims. The scope of the attached claims conforms to the broadest interpretation, thereby including all such modifications and equivalent structures and functions.

Claims

1. A convex hull generation method, characterized in that: include: Determine an original mesh body, and generate an original convex hull corresponding to the original mesh body; Determining the concavity value of the original convex hull; If the concavity value of the original convex hull is greater than a preset concavity threshold, the original convex hull is iteratively segmented until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls; Determining a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a target vertex number reduction ratio; Based on the preset surface reduction parameters, the spare sub-convex hull is subjected to surface reduction to obtain a sub-convex hull set after surface reduction, and the sub-convex hull set after surface reduction is determined as a target convex hull set corresponding to the original mesh body.

2. The method according to claim 1, characterized in that The determining of the original mesh volume and generating the original convex hull corresponding to the original mesh volume includes: In response to the data format of the original mesh body being in FBX format, converting the data format of the original mesh body into OBJ format to obtain the original mesh body in OBJ format; Generate an original convex hull in OBJ format corresponding to the original mesh in OBJ format.

3. The method according to claim 1, characterized in that Determining the concavity value of the original convex hull includes: Calculating Hausdorff distance values ​​between vertices of the original mesh and the surface of the original convex hull; Calculating the volume value of the space between the original mesh body and the original convex hull; The maximum value between the Hausdorff distance value and the volume value of the space is used as the concavity value of the original convex hull.

4. The method according to claim 1, characterized in that: The iterative segmentation of the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold value, to obtain a plurality of spare sub-convex hulls, comprises: Using different segmentation methods, the convex hull to be segmented is simulated segmented to obtain different simulated segmentation results; Based on the simulated segmentation result corresponding to the segmentation method, calculating the segmentation score corresponding to the segmentation method; The convex hull to be segmented is segmented in the segmentation mode corresponding to the highest segmentation score among the plurality of segmentation scores, until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of the spare sub-convex hulls; The convex hull to be segmented includes any one of the original convex hull whose concavity value is greater than the preset concavity threshold and the sub-convex hull whose concavity value is greater than the preset concavity threshold.

5. The method according to claim 4, characterized in that The calculating, based on the simulated segmentation result corresponding to the segmentation method, a segmentation score corresponding to the segmentation method, comprises: Based on the concavity value of the convex hull to be segmented, obtaining a quality score of the convex hull to be segmented, wherein the quality score is negatively correlated with the concavity value; Determine a first simulated segmentation number of the convex hull to be segmented and a second simulated segmentation number of the parent convex hull corresponding to the convex hull to be segmented; The segmentation score is obtained based on the quality score, the first simulated segmentation times, and the second simulated segmentation times.

6. The method according to claim 1, characterized in that The determining of preset face reduction parameters, wherein the face reduction parameters include the number of target vertices or the reduction ratio of the number of target vertices, includes: Determining the surface area of ​​the spare sub-convex hull; Determining a target vertex density of the alternate sub-convex hull; The target number of vertices or the reduction ratio of the target number of vertices of the spare sub-convex hull is obtained based on the surface area of ​​the spare sub-convex hull and the target vertex density of the spare sub-convex hull.

7. The method according to claim 1, characterized in that The reducing the surface of the spare sub-convex hull comprises: Determine a pair of target vertices of the surface of the alternate subconvex hull; The position where the sum of squares of distances to the planes to which the adjacent triangular faces of the triangular face to which the target vertex belongs is minimized is used as the position of the merged vertex obtained after merging the target vertex.

8. The method according to claim 7, characterized in that The step of determining a pair of target vertices of the surface of the alternate sub-convex hull comprises: A pair of adjacent vertices on the surface of the backup sub-convex hull or whose distance is less than or equal to a distance threshold is determined as the target vertices.

9. The method according to claim 1, characterized in that: The reducing the surface of the spare sub-convex hull based on the preset surface reduction parameter includes: In response to an adjustment instruction for the number of vertices of the spare sub-convex hull, determining a target vertex number reduction ratio between the number of vertices of the sub-convex hull obtained after surface reduction of the spare sub-convex hull and the number of vertices of the spare sub-convex hull before surface reduction; The spare sub-convex hull is reduced in number based on the target vertex number reduction ratio until a ratio between the number of vertices of the sub-convex hull after the reduction in number and the number of vertices of the spare sub-convex hull before the reduction in number is less than or equal to the target vertex number reduction ratio.

10. The method according to claim 1, characterized in that The reducing the surface of the spare sub-convex hull based on the preset surface reduction parameter includes: In response to an adjustment instruction for the number of vertices of the standby sub-convex hull, determining a target number of vertices of a sub-convex hull obtained by reducing the number of faces of the standby sub-convex hull; The spare sub-convex hull is reduced in number based on the target number of vertices until the number of vertices of the sub-convex hull after the reduction is less than or equal to the target number of vertices.

11. The method according to claim 1, characterized in that: The method further comprises: In response to a selection operation on a target virtual model in a virtual scene, taking the target virtual model as the original mesh body, and generating an original convex hull corresponding to the original mesh body; In response to an input operation for a concavity threshold, determining a concavity value of the original convex hull, and if the concavity value of the original convex hull is greater than the concavity threshold, iteratively segmenting the original convex hull until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the concavity threshold, thereby obtaining a plurality of spare sub-convex hulls; In response to an input operation for a face reduction parameter, based on the face reduction parameter, the spare sub-convex hull is subjected to face reduction to obtain a sub-convex hull set after face reduction, and the sub-convex hull set after face reduction is determined as a target convex hull set corresponding to the original mesh body; The target convex hull set is imported into the virtual scene.

12. The method according to claim 1, characterized in that The method further comprises: In response to the data format of the original mesh body being in FBX format, converting the data format of the original mesh body into OBJ format to obtain the original mesh body in OBJ format; Generate an original convex hull in OBJ format corresponding to the original mesh in OBJ format; Determine the concavity value of the original convex hull in the OBJ format; If the concavity value of the original convex hull in the OBJ format is greater than a preset concavity threshold, the original convex hull in the OBJ format is iteratively segmented until the concavity value of the sub-convex hull in the OBJ format obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls in the OBJ format; Determining a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a target vertex number reduction ratio; Based on the preset face reduction parameters, the spare sub-convex hull in the OBJ format is reduced in face to obtain a sub-convex hull set in the OBJ format after face reduction, and the sub-convex hull set in the OBJ format after face reduction is determined as a target convex hull set in the OBJ format corresponding to the original mesh body in the OBJ format; The target convex hull set in the OBJ format is converted into a target convex hull set in the FBX format.

13. A convex hull generating device, characterized in that: include: An original convex hull generation module is configured to determine an original mesh volume and generate an original convex hull corresponding to the original mesh volume; a concavity value determining module, configured to determine a concavity value of the original convex hull; A convex hull segmentation module is configured to iteratively segment the original convex hull if the concavity value of the original convex hull is greater than a preset concavity threshold, until the concavity value of the sub-convex hull obtained by segmentation is less than or equal to the preset concavity threshold, thereby obtaining a plurality of spare sub-convex hulls; A face reduction parameter determination module is configured to determine a preset face reduction parameter, wherein the face reduction parameter includes a target vertex number or a reduction ratio of a target vertex number; The convex hull face reduction module is configured to reduce the face of the spare sub-convex hull based on the preset face reduction parameters to obtain a sub-convex hull set after face reduction, and determine the sub-convex hull set after face reduction as the target convex hull set corresponding to the original mesh body.

14. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 12 is implemented.

15. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 12.