Mesh generation method and apparatus, computer-readable storage medium and electronic apparatus

By obtaining the attribute information and ray detection of the surface of the three-dimensional scene, a grid that can accurately fit the surface of the three-dimensional scene is generated, which solves the problems related to visible objects in the field of view in traditional rendering technology, and realizes dynamic rendering of the three-dimensional scene.

WO2025001719A1PCT designated stage expired Publication Date: 2025-01-02NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/096112
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-25
Filing Date
2024-05-29
Publication Date
2025-01-02

AI Technical Summary

Technical Problem

Traditional rendering decal technology can only be bonded on the rendering layer, resulting in data generation related to objects visible in the field of view, with great limitations and failing to effectively solve the dynamic rendering problem of three-dimensional scenes.

Method used

By obtaining the target grid attribute information of the three-dimensional scene surface, determining the detection parameters of the target vertex, and using ray detection to determine the fitting position, a grid that can accurately fit the three-dimensional scene surface is generated to achieve dynamic rendering.

Benefits of technology

Dynamically generated fitting mesh based on any three-dimensional scene is realized, ensuring that the mesh can accurately display the surface of the three-dimensional scene, and solving the problem of the limitations of dynamic rendering in traditional technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024096112_02012025_PF_FP_ABST
    Figure CN2024096112_02012025_PF_FP_ABST
Patent Text Reader

Abstract

A mesh generation method and apparatus, a computer-readable storage medium, and an electronic apparatus. The mesh generation method comprises: acquiring attribute information of a target mesh to be fitted to the surface of a three-dimensional scene (S202); on the basis of a mesh rendering attribute in the attribute information, determining casting parameters corresponding to a target vertex on the target mesh (S204); performing ray casting on the surface of the three-dimensional scene on the basis of the casting parameters, and determining a fitting position of the target vertex with respect to the surface of the three-dimensional scene (S206); and, on the basis of the fitting position of the target vertex and a mesh structural attribute in the attribute information, generating the target mesh (S208). The present disclosure achieves the technical effect of dynamically generating fitted meshes on the basis of an arbitrary three-dimensional scene, thus solving the technical problem of relatively large limitations of dynamic rendering of three-dimensional scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Grid generation method, device, computer-readable storage medium, and electronic device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This disclosure claims priority to Chinese patent application number 202310761282.6, filed on June 25, 2023, entitled “Grid generation method, device, computer-readable storage medium and electronic device”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the field of graphics rendering, and in particular to a grid generation method, device, computer-readable storage medium, and electronic device. Background Art

[0004] At present, in order to improve the texture of design elements in virtual game scenes, it is necessary to dynamically render the architectural scenes, environments, etc. in the virtual game. Most related technologies use decals to dynamically render the design elements in the virtual game scenes. However, traditional rendering decals can only be attached to the rendering layer to generate data on the rendering layer, resulting in data generation being related to the visible objects in the current field of view, which has great limitations.

[0005] To address the above-mentioned problems, no effective solutions have been proposed so far.

[0006] Summary of the Invention

[0007] At least some embodiments of the present disclosure provide a mesh generation method, apparatus, computer-readable storage medium, and electronic device to at least address the technical problem of significant limitations in dynamic rendering of three-dimensional scenes.

[0008] According to one embodiment of the present disclosure, a mesh generation method is provided, which provides a graphical user interface through a terminal device, and the content displayed by the graphical user interface includes a three-dimensional scene. The method includes: obtaining attribute information of a target mesh to be fitted to the surface of the three-dimensional scene; determining detection parameters corresponding to target vertices on the target mesh based on mesh rendering attributes in the attribute information; performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface; and generating a target mesh based on the fitting position of the target vertex and the mesh structure attributes in the attribute information.

[0009] According to one embodiment of the present disclosure, a mesh generation device is also provided, which includes: an acquisition module for acquiring attribute information of a target mesh to be fitted to a three-dimensional scene surface; a determination module for determining detection parameters corresponding to target vertices on the target mesh based on mesh rendering attributes in the attribute information; a detection module for performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface; and a generation module for generating a target mesh based on the fitting position of the target vertex and the mesh structure attributes in the attribute information.

[0010] According to one embodiment of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored. The computer program is configured to execute the grid generation method in the above embodiment when executed by a processor.

[0011] According to one embodiment of the present disclosure, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the grid generation method in the above embodiment.

[0012] In at least some embodiments of the present disclosure, attribute information of a target mesh to be fitted to a three-dimensional scene surface is obtained; based on the mesh rendering attributes in the attribute information, detection parameters corresponding to target vertices on the target mesh are determined; based on the detection parameters, ray detection is performed on the three-dimensional scene surface to determine the fitting position of the target vertex relative to the three-dimensional scene surface; and based on the fitting position of the target vertex and the mesh structure attributes in the attribute information, a target mesh is generated. It is easy to notice that by performing ray detection on the target vertex on the target mesh, the fitting position of the target vertex relative to the three-dimensional scene surface can be obtained, which facilitates the generation of a target mesh that can be accurately fitted to the three-dimensional scene surface through the fitting position, thereby ensuring that the target mesh can dynamically display the three-dimensional scene surface, achieving the technical effect of dynamically generating a fitting mesh based on any three-dimensional scene, thereby solving the technical problem that the dynamic rendering of the three-dimensional scene has large limitations. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:

[0014] FIG1 is a hardware structure block diagram of a mobile terminal according to a grid generation method according to an embodiment of the present disclosure;

[0015] FIG2 is a flow chart of a grid generation method according to one embodiment of the present disclosure;

[0016] FIG3 is a schematic diagram of structural attribute information of a target grid according to one embodiment of the present disclosure;

[0017] FIG4 is a schematic diagram of rendering attribute information of a target mesh according to one embodiment of the present disclosure;

[0018] FIG5 is a schematic diagram showing that the target vertex is in a coverage type according to one embodiment of the present disclosure;

[0019] FIG6 is a schematic diagram showing that the target vertex is fitted in an outward folding manner according to one embodiment of the present disclosure;

[0020] FIG7 is a schematic diagram showing that the target vertex is fitted in an inward folding manner according to one embodiment of the present disclosure;

[0021] FIG8 is a schematic diagram of determining detection parameters for an outward fold type according to one embodiment of the present disclosure;

[0022] FIG9 is a schematic diagram of determining detection parameters for an inward fold type according to one embodiment of the present disclosure;

[0023] FIG10 is a schematic diagram of determining an angle under a coverage type according to one embodiment of the present disclosure;

[0024] FIG11 is a flowchart of performing a covering operation on a target vertex according to one embodiment of the present disclosure;

[0025] FIG12 is a schematic diagram of determining an auxiliary vector according to one embodiment of the present disclosure;

[0026] FIG13 is a schematic diagram of determining a folding angle in an outward folding type according to one embodiment of the present disclosure;

[0027] FIG14 is a schematic diagram of determining the minimum folding angle in an outward folding type according to one embodiment of the present disclosure;

[0028] FIG15 is a flowchart of performing an outward folding operation on a target vertex according to one embodiment of the present disclosure;

[0029] FIG16 is a schematic diagram of determining a detection direction in an inward folding type according to one embodiment of the present disclosure;

[0030] FIG17 is a schematic diagram of ignoring a plane that blocks a target vertex and a mirror point under an inward folding type according to one embodiment of the present disclosure;

[0031] FIG18 is a schematic diagram of determining a folding angle in an inward folding type according to one embodiment of the present disclosure;

[0032] FIG19 is a flowchart of performing an inward folding operation on a target vertex according to one embodiment of the present disclosure;

[0033] FIG20 is a structural block diagram of a grid generating apparatus according to one embodiment of the present disclosure;

[0034] FIG21 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0035] In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present disclosure.

[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0037] Generally, the industry uses deferred decaling to address mesh-fitting requirements. This is a screen-based post-processing technique that is unaffected by scene object complexity and can achieve near-perfect fit. The main principle is to convert screen-space pixels to world space, then generate texture coordinates through inverse projection transformations, and then overwrite the original colors. This is somewhat expensive, and in practice, a stencil buffer is often used in addition to the depth buffer.

[0038] The above solution is based on the fact that rendering and data generation are related to the viewing angle. Mesh vertex data cannot be obtained in areas that are not covered by the viewing angle, and vertex data cannot be obtained directly at the logical layer. The vertex data required by the logical layer must be constructed by reading back the screen pixels.

[0039] In one possible implementation, for the rendering decal background in the field of graphics rendering, which is usually only able to fit on the rendering layer and generate data on the rendering layer, without generating data on the logic layer, the inventors, after practice and careful research, still found that the data generation is related to the visible objects in the current field of view, which has great limitations. Based on this, the embodiment of the present disclosure proposes a method for grid generation. The technical concept adopted is based on the principle of ray detection, by generating a number of sampling points for the grid that needs to be fitted to the scene. At these sampling points, according to the intersection and direction of the grid center and the scene, a ray detection is emitted from the scene, and the collision point of the ray detection is used to generate a fitted grid to meet the requirements. Since the fitting position is a vertex obtained by performing ray detection on the target vertex on the target grid of the three-dimensional scene surface based on the principle of ray detection, each fitting position vertex accurately replicates the target vertex, so that the target grid composed of the fitting position can dynamically display the three-dimensional scene surface, achieving the technical effect of dynamically generating a fitting grid based on any three-dimensional scene, thereby solving the technical problem of large limitations in the dynamic rendering of the three-dimensional scene.

[0040] The grid generation method in one embodiment of the present disclosure can be run on a local terminal device or a server. When the grid generation method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0041] In an optional embodiment, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a gaming method based on cloud computing. In the cloud game operation mode, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the grid generation method are completed on the cloud game server. The role of the client device is to receive and send data and present the game 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, TV, computer, PDA, etc.; but the cloud game server in the cloud is responsible for information processing. When playing the game, the player operates the client device to send operation instructions to the cloud game server. The cloud game server runs the game according to the operation instructions, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0042] In an alternative embodiment, taking a game as an example, a local terminal device stores the game program and is used to present the game screen. The local terminal device is used to interact with the player via a graphical user interface (GUI), i.e., the game program is downloaded, installed, and run via a conventional electronic device. The local terminal device can present the GUI to the player in a variety of ways, such as rendering it on the terminal's display screen or presenting it to the player via holographic projection.

[0043] For example, the local terminal device can be a mobile terminal, a computer terminal or a similar computing device, which may include a display screen and a processor, wherein the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate the graphical user interface and control the display of the graphical user interface on the display screen.

[0044] Taking running on a mobile terminal as an example, the mobile terminal can be a smartphone, tablet computer, PDA, mobile internet device, PAD, game console, or other terminal device. Figure 1 is a hardware block diagram of a mobile terminal for a mesh generation method according to an embodiment of the present disclosure. As shown in Figure 1 , the mobile terminal may include one or more processors 102 (only one is shown in Figure 1 ) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106, input / output devices 108, and a display device 110.

[0045] Those skilled in the art will appreciate that the structure shown in FIG1 is merely illustrative and does not limit the structure of the mobile terminal. For example, the mobile terminal may include more or fewer components than shown in FIG1 , or have a configuration different from that shown in FIG1 .

[0046] According to one embodiment of the present disclosure, an embodiment of a grid generation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0047] In one possible implementation, an embodiment of the present disclosure provides a mesh generation method, wherein a graphical user interface is provided via a terminal device, where the terminal device can be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system. Figure 2 is a flow chart of a mesh generation method according to one embodiment of the present disclosure, wherein a graphical user interface is provided via a terminal device, and the content displayed by the graphical user interface includes a three-dimensional scene. As shown in Figure 2, the method includes the following steps:

[0048] Step S202: Acquire attribute information of a target mesh to be fitted to the surface of the three-dimensional scene.

[0049] Specifically, the above-mentioned three-dimensional scene surface can be used to represent a scene surface with a three-dimensional structure, which can be a building scene in a game, or an environmental scene in a game, etc., and the three-dimensional scene surface is not uniquely limited here. The above-mentioned target grid can be used to represent a grid that is fitted to a three-dimensional scene. By fitting the grid to the three-dimensional scene surface, effective rendering of the three-dimensional scene surface can be achieved. The above-mentioned attribute information includes but is not limited to the structural attribute information and rendering attribute information of the target grid, wherein the structural attribute information can be used to represent the basic information of the target grid, including but not limited to the shape of the grid, the center point of the grid, etc.; the rendering attribute information can be used to represent the information used when the target grid needs to be rendered, including but not limited to the plane normal direction, tangent direction and secondary tangent direction of the grid, etc., wherein the tangent direction and the secondary tangent direction are perpendicular to each other.

[0050] Figure 3 is a schematic diagram of the structural attribute information of a target mesh according to one embodiment of the present disclosure. As shown in Figure 3, the target mesh can be defined as a regular hexagon, with arrows pointing to the center of the mesh. Figure 4 is a schematic diagram of the rendering attribute information of a target mesh according to one embodiment of the present disclosure. As shown in Figure 4, the dotted arrow represents the direction of the plane normal. The solid arrow and dashed arrow represent the tangent direction and the bitangent direction, respectively.

[0051] In an optional embodiment, the target grid can be pre-set, and the attribute information of the target grid can also be pre-set, including information such as the shape of the grid and the center point of the grid. After reading the grid information pre-set by the user, the placement position of the target grid is determined based on the attribute information.

[0052] Step S204 : determining detection parameters corresponding to target vertices on the target mesh based on the mesh rendering attributes in the attribute information.

[0053] Specifically, the aforementioned mesh rendering attributes can be used to represent attribute information required for rendering the target mesh, including but not limited to the target mesh's normal vector, tangent vector, and bitangent vector. The aforementioned detection parameters can be used to represent parameters required for ray detection, including the detection starting point and detection direction. The detection starting point represents the starting point of ray emission in ray detection, and the detection direction represents the direction of ray emission in ray detection. Generally, due to different ways in which the target mesh fits onto the surface of a three-dimensional scene, the fitting methods here can be covering, folding outward, or folding inward. Therefore, different vertex types in the target mesh have different corresponding detection starting points and detection directions. Specifically, if the mesh vertices are coplanar with the center point after placement, a covering operation is required for the mesh vertices. If the mesh vertices are not coplanar with the center point after placement, and the vertices to be folded are connected to the center point, a folding operation is required for the mesh vertices. If the mesh vertices are not coplanar with the center point after placement, and the vertices to be folded are not connected to the center point, a folding operation is required for the mesh vertices.

[0054] In an optional embodiment, it is necessary to determine the detection starting point and detection direction of ray detection based on the normal vector, tangent vector, secondary tangent vector and the type of target vertex. Specifically, for the detection starting point, the target vertex itself or a point related to the target vertex can be used as the detection starting point of ray detection. For the detection direction, the opposite direction of the normal vector can be used as the detection direction. At the same time, an auxiliary vector can be constructed based on the tangent vector and the secondary tangent vector to achieve fitting with the target vertex. Therefore, it is necessary to determine the detection parameters based on the mesh rendering properties.

[0055] Step S206 : performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface.

[0056] Specifically, the above-mentioned fitting position can be used to represent the position corresponding to the intersection point of the ray and the three-dimensional scene surface obtained by performing ray detection on the three-dimensional scene surface, that is, the position of the collision point where the ray collides with the three-dimensional scene surface.

[0057] In an optional embodiment, after determining detection parameters such as the detection starting point and detection direction for each target vertex in the target mesh based on the mesh rendering properties, ray detection can be performed on each target vertex to determine the ray detection collision point between each ray and the three-dimensional scene surface. The ray detection collision point can be determined as the corresponding alignment position of the target vertex. Generally, different alignment positions will result in different placement results for the corresponding aligned mesh.

[0058] Step S208: generating the target mesh based on the fit positions of the target vertices and the mesh structure attributes in the attribute information.

[0059] Specifically, in an optional embodiment, after determining the fitting position of the target vertex, it is necessary to generate a target mesh fitted to the three-dimensional scene surface through the mesh shape of the target mesh, the mesh center point and the fitting position corresponding to the target vertex.

[0060] Through the above steps, the attribute information of the target mesh to be fitted to the three-dimensional scene surface is obtained; based on the mesh rendering attributes in the attribute information, the detection parameters corresponding to the target vertices on the target mesh are determined; based on the detection parameters, the ray detection is performed on the three-dimensional scene surface to determine the fitting position of the target vertex relative to the three-dimensional scene surface; based on the fitting position of the target vertex and the mesh structure attributes in the attribute information, the target mesh is generated to achieve the purpose of dynamically generating a fitting mesh based on the three-dimensional scene. It is easy to notice that by performing ray detection on the target vertex on the target mesh, the fitting position of the target vertex relative to the three-dimensional scene surface can be obtained, which facilitates the generation of a target mesh that can be accurately fitted to the three-dimensional scene surface through the fitting position, thereby ensuring that the target mesh can dynamically display the three-dimensional scene surface, achieving the technical effect of dynamically generating a fitting mesh based on any three-dimensional scene, thereby solving the technical problem that the dynamic rendering of the three-dimensional scene has large limitations.

[0061] In the above embodiment of the present disclosure, based on the mesh rendering properties, the detection parameters corresponding to the target vertex on the target mesh are determined, including: determining the relative position relationship between the fit vertex and the center point of the target mesh, wherein the fit vertex is used to represent the vertex obtained after the target vertex is fit to the surface of the three-dimensional scene; based on the relative position relationship, determining the fit type of the target vertex; based on the fit type and the mesh rendering properties, determining the detection parameters corresponding to the target vertex.

[0062] Optionally, the fit type of the target vertex can be determined in the following manner: in response to the relative position relationship that the fit vertex and the center point are coplanar, the fit type of the target vertex is determined to be a covering type; in response to the relative position relationship that the fit vertex and the center point are connected, the fit type of the target vertex is determined to be an outward folding type; in response to the relative position relationship that the fit vertex and the center point are not connected, the fit type of the target vertex is determined to be an inward folding type.

[0063] Specifically, the aforementioned "fitting vertices" can be used to represent vertices in the target mesh that can fit onto the surface of the 3D scene. It's important to note that while fitting vertices are included in the target vertices, not all target vertices are "fitting" vertices. These vertices also include non-fitting vertices, which need to be removed during the 3D scene mesh generation process.

[0064] The above relative position relationship can be used to indicate whether the fitting vertex and the center point of the target mesh are coplanar or connected, wherein coplanarity can be understood as the fitting vertex and the center point of the target mesh being in the same plane; connectivity can be understood as the fitting vertex and the center point of the target mesh being not coplanar, but being in a connected state without scene occlusion; and disconnection can be understood as the fitting vertex and the center point of the target mesh being not coplanar, but being in a disconnected state with scene occlusion. It should be noted that the above relative position relationship is not uniquely set. The above fitting type can be used to indicate the type of fitting that the target vertex needs to be fitted to, that is, what type of fitting is to be performed on the target vertex. Specifically, the fitting type corresponds to the above relative position relationship.

[0065] Optionally, when the relative positional relationship between the fitting vertex and the center point of the target mesh is coplanar, the target vertex needs to be fitted with a covering type; when the relative positional relationship between the fitting vertex and the center point of the target mesh is connected, the target vertex needs to be fitted with an outward folding type; when the relative positional relationship between the fitting vertex and the center point of the target mesh is disconnected, the target vertex needs to be fitted with an inward folding type.

[0066] In an optional embodiment, when performing different types of fitting on the target vertex, due to the different fitting types, the detection parameters required for ray detection of the target vertex are also different. Therefore, after determining the fitting type of the target vertex, the normal vector, tangent vector and sub-tangent vector in the mesh rendering properties can be combined to determine the detection parameters corresponding to the target vertex.

[0067] Specifically, Figure 5 is a schematic diagram illustrating an overlay-type target vertex alignment according to one embodiment of the present disclosure. As shown in Figure 5 , plane A represents the original mesh, and a represents the normal vector. The mesh can be offset a certain distance based on the normal vector to form plane B.

[0068] Figure 6 is a schematic diagram illustrating an outward folding type of target vertex alignment according to one embodiment of the present disclosure. As shown in Figure 6, some vertices of the mesh are flattened onto the wall surface by covering it, forming Area A. Some vertices cannot be covered, forming Area B, and need to be folded inward onto the wall surface to form Area C. Finally, some vertices in Area D cannot be attached to the plane by folding, and therefore need to be eliminated.

[0069] Figure 7 is a schematic diagram illustrating an inward-folding target vertex alignment type according to one embodiment of the present disclosure. As shown in Figure 7, some vertices of the mesh are flattened onto the wall surface in an overlay manner to form area C, while another portion is also flattened onto the wall surface in an overlay manner to form area A. Since the vertices in area A are not connected to the center point, they need to be folded inward onto the ground to form area B.

[0070] Optionally, the mesh rendering attributes include: a normal vector, a first tangent vector and a second tangent vector, the first tangent vector and the second tangent vector are perpendicular to each other, and the detection parameters include: a detection starting point and a detection direction, wherein, based on the mesh rendering attributes, the detection parameters corresponding to the target vertex on the target mesh are determined, including: in response to the fitting type being an overlay type, determining the offset vertex as the detection starting point, and determining the opposite direction of the normal vector as the detection direction, wherein the offset vertex is the vertex obtained by offsetting the target vertex according to the target offset; in response to the fitting type being an outward folding type, determining the target vertex as the detection starting point, and determining the detection direction based on the opposite direction of the normal vector, the first tangent vector and the second tangent vector; in response to the fitting type being an inward folding type, determining the mirror point corresponding to the target vertex as the detection starting point, and determining the detection direction based on the normal vector and the blocking normal vector of the first blocking plane, wherein the first blocking plane is used to represent a plane on the three-dimensional scene that blocks the target vertex and the center point, and the mirror point is used to represent a position that has a mirror relationship with the target vertex relative to the first blocking plane.

[0071] Specifically, the target offset mentioned above can be used to represent a preset offset for offsetting the target vertex.

[0072] For example, as shown in Figure 5, by offsetting mesh A by a certain distance based on the normal vector a, the offset mesh B can be obtained. Optionally, the target offset is calculated by using the native mesh vertex as the starting point, the normal direction as the search vector, and the defined maximum offset distance as the search distance. If the distance obtained by ray detection is less than the current maximum offset distance, the maximum offset distance of the vertex is corrected to the ray detection distance. The red vector, the opposite direction of the normal, is then used as the search vector for ray detection, and the vertex obtained by ray detection is used as the final covered vertex, forming mesh C.

[0073] The above-mentioned normal vector can be used to represent the normal direction of the plane where the target mesh is located, as shown by the short horizontal arrow in Figure 4. The above-mentioned first tangent vector can be used to represent the tangent vector of the target mesh, as shown by the solid arrow in Figure 4. The above-mentioned second tangent vector can be used to represent a vector perpendicular to the first tangent vector, as shown by the dotted arrow in Figure 4.

[0074] FIG8 is a schematic diagram of determining detection parameters under the outward folding type according to one embodiment of the present disclosure. When the fitting type is the outward folding type, the target vertex (that is, the original vertex position) needs to be used as the starting point. At the same time, since the outward folding type includes vertical folding and horizontal folding, the detection direction can be determined by the reverse direction of the normal vector and the auxiliary vector of the first tangent vector, the reverse direction of the normal vector and the auxiliary vector of the second tangent vector, respectively. As shown in FIG8 , point P is the vertical folding point obtained by vertically folding the target vertex, and the detection direction can be represented by vector b.

[0075] Figure 9 is a schematic diagram illustrating the determination of detection parameters for an inward fold type according to one embodiment of the present disclosure. When the inward fold type is used, since some vertices to be folded are not connected to the center point, it is necessary to first determine a mirror point P2 for these vertices P1 based on the blocking plane. Ray detection is then performed based on the mirror point to determine the inward fold result.

[0076] The above-mentioned target vertex can be represented by point P1 in Figure 9. The above-mentioned detection starting point can be used to represent the mirror point corresponding to the target vertex, that is, point P2 in Figure 9. The above-mentioned normal vector can be represented by vector a in Figure 9. The above-mentioned first blocking plane can be used to represent the plane in the three-dimensional scene where the target vertex and the center point cannot be connected and there is an obstruction, which can be represented by plane A in Figure 9. The above-mentioned blocking normal vector can be used to represent the normal vector of the first blocking plane, which can be represented by vector f in Figure 9. The above-mentioned detection direction can be used to represent the detection vector obtained by subtracting the normal vector and the blocking normal vector.

[0077] Optionally, the method also includes: starting from the target vertex, performing ray detection on the three-dimensional scene surface according to the normal vector to obtain the ray detection distance; determining the target offset distance of the target vertex by comparing the ray detection distance and the preset offset distance; offsetting the target vertex based on the target offset distance of the target vertex to obtain an offset vertex.

[0078] Specifically, the above-mentioned ray detection distance can be used to represent the distance between the detection starting point and the detection collision point. The distance obtained by performing ray detection on the surface of a three-dimensional scene with the target vertex as the detection starting point and the opposite direction of the normal vector as the detection direction. The above-mentioned preset offset distance can be used to represent the preset maximum offset distance. The above-mentioned target offset distance can be used to represent the offset distance obtained by comparing the ray detection distance with the preset offset distance. Optionally, the target offset distance can be determined as follows: in response to the ray detection distance being less than the preset offset distance, the ray detection distance is determined to be the target offset distance; in response to the ray detection distance being greater than or equal to the preset offset distance, the preset offset distance is determined to be the target offset distance.

[0079] In an optional embodiment, when the ray detection distance is less than the preset offset distance, it means that the ray detection distance is within the set maximum offset distance range. The actual ray detection distance can be determined as the target offset distance, and then the target vertex is offset based on the target offset distance to obtain the offset vertex.

[0080] In another optional embodiment, if the ray detection distance is greater than or equal to the preset offset distance, it indicates that the ray detection distance exceeds the set maximum offset distance range. Since the ray detection distance cannot exceed the set maximum offset distance, the preset offset distance is determined as the target offset distance. Then, based on the target offset distance, the target vertex is offset to obtain the offset vertex. By comparing the ray detection distance with the preset offset distance to determine the target offset distance, an unlimited search for the offset vertex is avoided, and the search distance remains within the preset offset distance range.

[0081] For example, as shown in Figure 5, since the vertices that need to be covered are not necessarily strictly on a plane, but may be on a surface with certain undulations, it is necessary to offset all the vertices of the mesh in the normal direction of the center point, and then perform a ray detection in the opposite direction of the normal direction. The collision point of the ray detection is used to rearrange the positions of the mesh vertices. Taking Figure 5 as an example, plane A is the original mesh, and vector a is the normal vector. First, the mesh is offset a certain distance according to the normal vector to form mesh B. Then, the opposite direction of the normal direction, that is, vector b, is used as the search vector for ray detection, and the vertices obtained by ray detection are used as the final covered vertices to form mesh C.

[0082] Optionally, in response to the fitting type being an overlay type, after performing ray detection on the three-dimensional scene surface based on the detection parameters and determining the fitting position of the target vertex relative to the three-dimensional scene surface, the method further includes: determining a first vector between the center point and the fitting position of the target vertex; obtaining a first angle between the first vector and the inverse vector of the normal vector; in response to the first angle being greater than a first preset angle, updating the fitting position of the target vertex to the original position of the target vertex.

[0083] Specifically, the first vector can be used to represent the vector formed by the center point and the overlapped position obtained by the overlap calculation for the target vertex. The first angle can be used to represent the angle formed by the first vector and the inverse vector of the normal vector. The first preset angle can be used to represent the preset maximum overlap tilt angle between the first vector and the inverse vector of the normal vector.

[0084] In an optional embodiment, FIG10 is a schematic diagram of determining the angle under the coverage type according to one embodiment of the present disclosure. As shown in FIG10, after the coverage calculation of vertex A, vertex B is obtained, the y vector formed by vertex B and the center vertex (i.e., the first vector mentioned above), and the angle formed by the y vector and the x vector in the opposite direction of the normal (i.e., the first angle mentioned above). When the first angle is greater than the first preset angle, the coverage result corresponding to the first angle (i.e., the fitting position of the target vertex) needs to be eliminated, and the fitting position of the target vertex is updated to the original position of the target vertex.

[0085] FIG11 is a flow chart of performing a cover operation on a target vertex according to one embodiment of the present disclosure. As shown in FIG11 , the operation flow includes the following steps:

[0086] S1101, defining the attribute information of the target grid;

[0087] The attribute information includes the shape of the target mesh, the center point of the mesh, and the plane normal direction, tangent direction, and bitangent direction of the mesh.

[0088] S1102, calculating the covered vertices;

[0089] S1103, defining the outward displacement of the maximum normal vector calculated by the covered vertex;

[0090] That is, a maximum distance is preset for the offset distance to obtain a preset offset distance.

[0091] S1104, offsetting the original vertex by the outward displacement amount, and determining whether an obstruction is encountered during the outward displacement process. If so, the obstruction result is used as the position after the outward displacement; if not, the original vertex is offset by the outward displacement amount as the position after the outward displacement;

[0092] If an obstruction is encountered during the outward movement, it means that the ray detection distance is greater than or equal to the preset offset distance, and the preset offset distance is determined as the target offset distance; if no obstruction is encountered during the outward movement, it means that the ray detection distance is less than the preset offset distance, and the ray detection distance is determined as the target offset distance.

[0093] S1105, the outward-shifted vertex is used as the starting point of ray detection, the negative direction of the normal vector is used as the ray detection direction, and the ray detection result is used as the position of the covered vertex;

[0094] S1106: Eliminate the coverage angle.

[0095] Coverage angles greater than a first preset angle are eliminated.

[0096] Optionally, the detection direction is determined based on the reverse direction of the normal vector, the first tangent vector and the second tangent vector, including: determining a horizontal auxiliary vector and a vertical auxiliary vector based on the first tangent vector and the second tangent vector, wherein the horizontal auxiliary vector is used to characterize the offset direction of the target vertex and the center point in the horizontal direction, and the horizontal auxiliary vector is used to characterize the offset direction of the target vertex and the center point in the vertical direction; determining the horizontal detection direction based on the difference between the reverse direction of the normal vector and the horizontal auxiliary vector; determining the vertical detection direction based on the difference between the reverse direction of the normal vector and the vertical auxiliary vector; and obtaining the detection direction based on the horizontal detection direction and the vertical detection direction.

[0097] Specifically, the horizontal auxiliary vector can be used to represent the auxiliary vector for horizontal folding during the fold calculation process. The vertical auxiliary vector can be used to represent the auxiliary vector for vertical folding during the fold calculation process. The horizontal detection direction can be used to represent the vector obtained by subtracting the horizontal auxiliary vector from the opposite direction of the normal vector. The vertical detection direction can be used to represent the vector obtained by subtracting the vertical auxiliary vector from the opposite direction of the normal vector.

[0098] In an alternative embodiment, as shown in Figure 8, using the vertical detection direction as an example, the inflection point search vector b is derived by subtracting the opposite normal vector c from vector a. A ray trace is then performed with the scene, starting from the original vertex position and using the search vector as the direction. The intersection point P obtained from the ray trace is the vertical inflection point.

[0099] Similarly, if we use the horizontal detection direction as an example, we can use the inflection point search vector to find the difference between the opposite direction of the normal and the horizontal auxiliary vector. Then, using the original vertex position as the starting point and the search vector as the direction, we perform a ray detection with the scene. The intersection point obtained from the ray detection is the horizontal inflection point.

[0100] It should be noted that the difference between the horizontal inflection point calculation and the vertical inflection point calculation is that the search vector is obtained by subtracting the horizontal auxiliary vector from the opposite direction of the normal.

[0101] In another optional embodiment, a target vertex may have either a horizontal or vertical fold. Therefore, to ensure accurate folding of the target vertex and complete alignment of the fold point, a detection direction needs to be determined based on both the horizontal and vertical detection directions. Alternatively, if both a horizontal and vertical fold point exist, the detection direction can be determined based on either the horizontal or vertical detection direction. That is, the position of one of the two detected vertices is selected as the alignment position.

[0102] Optionally, based on the first tangent vector and the second tangent vector, a horizontal auxiliary vector and a vertical auxiliary vector are determined, including: constructing a two-dimensional coordinate system based on the center point, the first tangent vector and the second tangent vector; determining the quadrant of the target vertex in the two-dimensional coordinate system; and determining the horizontal auxiliary vector and the vertical auxiliary vector based on the quadrant of the target vertex.

[0103] Specifically, the above-mentioned two-dimensional coordinate system can be used to represent a coordinate system constructed based on the center point and the mutually perpendicular first and second tangent vectors. Optionally, a two-dimensional coordinate system can be constructed with the center point as the origin of the coordinate system, the first tangent vector as the horizontal axis (x-axis), and the second tangent vector as the vertical axis (y-axis).

[0104] Figure 12 is a schematic diagram of determining auxiliary vectors according to one embodiment of the present disclosure. As shown in Figure 12, a two-dimensional coordinate system is constructed based on the center and the directions of the tangent and bitangent lines, thereby determining the quadrant to which the target vertex belongs in the two-dimensional coordinate system. Each quadrant has its own vector b, which serves as the horizontal auxiliary vector for the fold calculation, and vector a, which serves as the vertical auxiliary vector for the fold calculation. As shown in Figure 12, these two auxiliary vectors are required for both outward and inward fold calculations.

[0105] Optionally, ray detection is performed on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface, including: performing ray detection on the three-dimensional scene surface based on the horizontal detection direction to obtain a horizontal detection result, and performing ray detection on the three-dimensional scene surface based on the vertical detection direction to obtain a vertical detection result; in response to the horizontal detection result containing a horizontal detection vertex and the vertical detection result containing a vertical detection vertex, determining the fitting position based on the position of the horizontal detection vertex or the vertical detection vertex; in response to the horizontal detection result containing a horizontal detection vertex and the vertical detection result not containing a vertical detection vertex, determining the fitting position based on the position of the horizontal detection vertex; in response to the horizontal detection result not containing a horizontal detection vertex and the vertical detection result containing a vertical detection vertex, determining the fitting position based on the position of the vertical detection vertex.

[0106] Specifically, the horizontal detection result can be used to represent the ray detection result obtained by horizontally flipping the target vertex. The vertical detection result can be used to represent the ray detection result obtained by vertically flipping the target vertex. The horizontal detection vertex can be used to represent the horizontal detection vertex obtained by horizontally flipping the target vertex. The vertical detection vertex can be used to represent the vertical detection vertex obtained by vertically flipping the target vertex.

[0107] In an optional embodiment, when the horizontal detection result includes a horizontally detected vertex and the vertical detection result includes a vertically detected vertex, the target vertex can be flipped either horizontally or vertically. In this case, the position of the horizontally detected vertex can be determined as the snapping position, or the position of the vertically detected vertex can be determined as the snapping position. In other words, only one of the horizontally detected vertex position and the vertically detected vertex position needs to be determined as the snapping position, avoiding repeated determination of the snapping position of the target vertex.

[0108] In another optional embodiment, when the horizontal detection result includes a horizontal detection vertex and the vertical detection result does not include a vertical detection vertex, it indicates that the target vertex can only be flipped horizontally but not vertically. At this time, the position of the horizontal detection vertex can be determined as the fitting position without considering the vertical detection result.

[0109] In another optional embodiment, when the horizontal detection result does not include a horizontal detection vertex and the vertical detection result includes a vertical detection vertex, it indicates that the target vertex can only be flipped vertically but not horizontally. At this time, the position of the vertical detection vertex can be determined as the fitting position without considering the horizontal detection result.

[0110] Optionally, based on the position of the horizontal detection vertex or the vertical detection vertex, the fitting position is determined, including: determining the horizontal detection vector between the horizontal detection vertex and the corresponding target vertex, and the vertical detection vector between the vertical detection vertex and the corresponding target vertex; obtaining the horizontal angle between the horizontal detection vector and the inverse vector of the horizontal auxiliary vector, and the vertical angle between the vertical detection vector and the inverse vector of the vertical auxiliary vector; determining the target angle among the horizontal angle and the vertical angle, wherein the target angle is smaller than other angles among the horizontal angle and the vertical angle except the target angle; and determining the position of the detection vertex corresponding to the target angle as the fitting position.

[0111] Specifically, the horizontal detection vector can be used to represent the vector between the target vertex and the corresponding horizontal detection vertex. The vertical detection vector can be used to represent the vector between the target vertex and the corresponding vertical detection vertex. The horizontal angle can be used to represent the angle between the horizontal detection vector and the inverse vector of the horizontal auxiliary vector. The vertical angle can be used to represent the angle between the vertical detection vector and the inverse vector of the vertical auxiliary vector. The target angle can be used to represent the minimum folding angle between the horizontal angle and the vertical angle.

[0112] In an optional embodiment, Figure 13 is a schematic diagram illustrating how to determine the fold angle for an outward fold type according to one embodiment of the present disclosure. As shown in Figure 13, taking a horizontal fold as an example, the horizontal solid arrow represents the horizontal fold auxiliary vector, and the vertical dashed arrow represents the vertical fold auxiliary vector. Point A is the front vertex of the fold, and Point B is the back vertex of the fold. These points form a horizontal angle ∠AOB with another auxiliary vector, perpendicular to the auxiliary vector. If ∠AOB is greater than the defined maximum fold angle, the back vertex B is ignored.

[0113] Similarly, taking vertical folding as an example, it is necessary to determine the vertical angle based on the vertical detection vector and another auxiliary vector, the horizontal auxiliary vector.

[0114] In another optional embodiment, when folding the target vertex on an inclined plane, more than one fold point may be obtained. To achieve a better presentation, the fold point with a smaller angle can be selected as the final fold result. Figure 14 is a schematic diagram of determining the minimum fold angle for an outward fold type according to one embodiment of the present disclosure. As shown in Figure 14, point A is folded horizontally and vertically to obtain points B and C, respectively. Since C has a smaller fold angle, C is ultimately selected as the final result.

[0115] Optionally, after performing ray detection on the three-dimensional scene surface based on the detection parameters and determining the fitting position of the target vertex relative to the three-dimensional scene surface, the method also includes: determining the fitting vector between the target vertex and the fitting position of the target vertex; determining the first auxiliary vector corresponding to the fitting position based on the type of the detection vertex corresponding to the fitting position; obtaining a second angle between the fitting vector and the first auxiliary vector; and eliminating the target vertex in response to the second angle being greater than a second preset angle.

[0116] Specifically, the aforementioned first auxiliary vector can be determined based on the type of detected vertex. Optionally, when the detected vertex is represented by a vertex obtained by horizontally folding a ray beam from the target vertex, the corresponding first auxiliary vector can be represented by a vertical auxiliary vector. When the detected vertex is represented by a vertex obtained by vertically folding a ray beam from the target vertex, the corresponding first auxiliary vector can be represented by a horizontal auxiliary vector. The aforementioned second preset angle can be used to represent a pre-set maximum folding angle.

[0117] In an optional embodiment, as shown in Figure 13, the above-mentioned fitting vector can be expressed as vector AB, the above-mentioned first auxiliary vector can be expressed as vector UpAxis, and the above-mentioned second angle can be expressed as ∠AOB, and then it is determined whether ∠AOB is greater than the second preset angle. If it is greater, the target vertex is eliminated, otherwise it is retained.

[0118] FIG15 is a flow chart of performing an outward folding operation on a target vertex according to one embodiment of the present disclosure. As shown in FIG15 , the operation process includes the following steps:

[0119] S1501, calculating the folding vertex;

[0120] S1502: Determine a horizontal auxiliary vector for horizontal folding and a vertical auxiliary vector for vertical flipping based on the tangent line, the bitangent line, and the position of the target vertex relative to the center point.

[0121] S1503, determine whether there is an obstruction between the target vertex and the center point. If not, execute S1504; if so, calculate the inverted vertex.

[0122] The above judgment can be made through radiographic detection.

[0123] S1504, calculating the vertices of the eversion fold;

[0124] S1505, subtract the negative direction of the normal from the vertical auxiliary vector to obtain a search vector;

[0125] S1506 , using the original position of the target vertex as the ray detection starting point and the search vector as the ray detection direction, ray detection is performed on the target vertex to obtain a vertical outward folding result;

[0126] S1507, subtract the negative direction of the normal from the horizontal auxiliary vector to obtain a search vector;

[0127] S1508 , using the original position of the target vertex as the ray detection starting point and the search vector as the ray detection direction, ray detection is performed on the target vertex to obtain a horizontal folding result;

[0128] S1509, determine whether there is a folding result, if so, execute S1510;

[0129] S1510, determining whether there are multiple folding results. If so, selecting the result with the smallest folding angle as the final folding result. If not, selecting the only result as the final folding result.

[0130] S1511, eliminating the folding angle;

[0131] S1512, eliminating invalid vertices in the target mesh;

[0132] S1513, eliminating the proportion of the target grid;

[0133] S1514, obtaining the target mesh after culling.

[0134] Optionally, determining the detection direction based on the normal vector and a blocking normal vector of the first blocking plane includes: determining the detection direction based on a difference between the normal vector and the blocking normal vector.

[0135] Specifically, the above detection direction can be used to represent the detection direction obtained by subtracting the normal vector from the blocking normal vector.

[0136] In an optional embodiment, since some of the vertices that need to be folded are not connected to the center point, it is necessary to first find a mirror point for these vertices that need to be folded based on the blocking plane, and then perform ray detection based on the mirror point to obtain the inward folding result.

[0137] Figure 16 is a schematic diagram illustrating how to determine the detection direction for an inward-folded device according to one embodiment of the present disclosure. As shown in Figure 16 , the normal vector can be represented by vector c, and the blocking normal vector can be represented by vector a. Subtracting the normal vector from the blocking normal vector yields the detection direction, represented by vector b.

[0138] Optionally, the method includes: determining a correlation vector between the target vertex and the center point; determining a mirror vector based on the correlation vector, the normal vector and the blocking normal vector; and translating the target vertex based on the mirror vector to obtain a mirror point.

[0139] Specifically, the above-mentioned association vector can be used to represent the association vector between the center point and the target vertex, as shown in Figure 9, which can be represented as vector p. The above-mentioned normal vector can be represented as vector a in Figure 9, and the above-mentioned blocking normal vector HitNormal can be represented as vector f in Figure 9. The above-mentioned mirror vector can be used to represent the vector calculated by calculating the association vector, normal vector and blocking normal vector, which can be represented as vector P1P2 in Figure 9. The above-mentioned mirror point can be used to represent the mirror point obtained by translating the target vertex through the mirror vector, which can be shown as vertex P2 in Figure 9.

[0140] In an optional embodiment, the vector between the center point and the vertex is Dir, and the mirror vector MirrorDir can be calculated by the following formula:

[0141] MirrorDir=Dot(-Dir,HitNormal)*HitNormal*SlopeScale,

[0142] Among them, Dot is the vector dot product function, SlopeScale is the slope scaling, and the calculation formula is:

[0143] SlopeScale=1.0+sin(acos(Dot(Normal,HitNormal))).

[0144] Optionally, in response to the fitting type being an inward fold type, the method further includes: responding to a second blocking plane between the target vertex and the mirror point, wherein the second blocking plane is used to represent a plane that blocks the target vertex and the mirror point; in the process of performing ray detection on the three-dimensional scene surface based on the detection parameters, ignoring the second blocking plane.

[0145] Specifically, the second blocking plane can be used to represent a plane where there is blocking between the target vertex and the mirror point. It should be noted that the second blocking plane is different from the first blocking plane where there is blocking between the target vertex and the center point.

[0146] In an optional embodiment, Figure 17 is a schematic diagram illustrating ignoring obstructing planes between the target vertex and the mirror point under an inward fold type according to one embodiment of the present disclosure. As shown in Figure 17, before performing ray detection, if an obstructing plane (plane A) exists between the mirror point and the original vertex, this plane must be added to the ignore list for ray detection.

[0147] Optionally, in response to the fitting type being an inward folding type, after performing ray detection on the three-dimensional scene surface based on the detection parameters and determining the fitting position of the target vertex relative to the three-dimensional scene surface, the method further includes: determining a horizontal auxiliary vector and a vertical auxiliary vector based on the first tangent vector and the second tangent vector, wherein the horizontal auxiliary vector is used to characterize the offset direction of the target vertex and the center point in the horizontal direction, and the vertical auxiliary vector is used to characterize the offset direction of the target vertex and the center point in the vertical direction; determining the second auxiliary vector corresponding to the fitting position based on the horizontal auxiliary vector, the vertical auxiliary vector and the blocking normal vector; determining the fitting vector between the target vertex and the fitting position of the target vertex; obtaining a third angle between the fitting vector and the second auxiliary vector; and eliminating the target vertex in response to the third angle being greater than the third preset angle.

[0148] Optionally, the second auxiliary vector corresponding to the fitting position can be determined by the following steps: obtaining the dot product between the horizontal auxiliary vector and the blocking normal vector to obtain a first dot product result, and obtaining the dot product between the vertical auxiliary vector and the blocking normal vector to obtain a second dot product result; in response to the absolute value of the first dot product result being less than or equal to the absolute value of the second dot product result, determining that the second auxiliary vector is a vertical auxiliary vector; in response to the absolute value of the first dot product result being greater than the absolute value of the second dot product result, determining that the second auxiliary vector is a horizontal auxiliary vector.

[0149] Specifically, the second auxiliary vector can be determined by the folding type. The third preset angle can be used to represent a preset maximum folding angle.

[0150] In an optional embodiment, if the absolute value of the dot product of the vertical flip auxiliary vector UpAxis and the blocking plane normal HitNormal is less than the absolute value of the dot product of the horizontal flip auxiliary vector RightAxis and the blocking plane normal HitNormal, the inversion is considered to be a vertical flip. If the flip type is vertical, the corresponding second auxiliary vector can be represented as the horizontal flip auxiliary vector RightAxis.

[0151] In an alternative embodiment, if the absolute value of the dot product of the vertical flip auxiliary vector UpAxis and the blocking plane normal HitNormal is greater than or equal to the absolute value of the dot product of the horizontal flip auxiliary vector RightAxis and the blocking plane normal HitNormal, the inversion is considered to be a horizontal flip. If the flip type is horizontal, the corresponding second auxiliary vector can be represented as the vertical flip auxiliary vector UpAxis.

[0152] Figure 18 is a schematic diagram illustrating how to determine the fold angle for an inward fold according to one embodiment of the present disclosure. As shown in Figure 18 , taking a vertical fold as an example, the aforementioned snapping vector can be represented as vector AB, and the aforementioned second auxiliary vector can be represented as a horizontal fold auxiliary vector. The aforementioned third angle can then be represented as ∠AOB between the snapping vector and the horizontal fold auxiliary vector. This determines whether ∠AOB is greater than the third preset angle. If so, the target vertex is removed; otherwise, it is retained.

[0153] Similarly, taking horizontal folding as an example, the above-mentioned second auxiliary vector can be expressed as ∠AOB between the fitting vector and the vertical folding auxiliary vector, and then determine whether ∠AOB is greater than the third preset angle. If it is greater, the target vertex is eliminated, otherwise it is retained.

[0154] Optionally, before determining the detection parameters corresponding to the target vertices on the target mesh based on the mesh rendering attributes, the method further includes: removing vertices that fail to fit into the three-dimensional scene from the target vertices on the target mesh to obtain the target vertices.

[0155] Specifically, some of the target vertices mentioned above may be unable to be covered or flipped, such as the target vertices in area D in Figure 6. Since these points cannot be covered or flipped, they fail to fit into the 3D scene. To achieve a more accurate fit, these vertices need to be culled. That is, vertices that fail to fit into the 3D scene are removed from the target vertices on the target mesh to ensure that the remaining target vertices can be covered or flipped.

[0156] Optionally, after performing ray detection on the three-dimensional scene surface based on the detection parameters and determining the fitting position of the target vertex relative to the three-dimensional scene surface, the method also includes: obtaining a first number of target vertices on the target mesh, and a second number of target vertices; determining the ratio of the second number to the first number to obtain a target ratio; and in response to the target ratio being less than a preset ratio, eliminating the target mesh.

[0157] Specifically, the first number can be used to represent the number of original vertices on the target mesh. The second number can be used to represent the number of target vertices obtained after invalid culling of the original vertices. The target ratio can be used to represent the remaining ratio of the number of target vertices to the number of original vertices. The preset ratio can be used to represent a preset ratio of the number of target vertices to the number of original vertices.

[0158] Through an optional embodiment, if the target ratio is smaller than the preset ratio, it means that the final number of vertices after culling is too small, and it is difficult to accurately mesh the three-dimensional scene. The mesh construction can be considered to have failed. The condition for successful construction is that the number of remaining vertices divided by the original number of vertices is greater than or equal to the preset ratio.

[0159] FIG19 is a flow chart of performing an inward folding operation on a target vertex according to one embodiment of the present disclosure. As shown in FIG19 , the operation process includes the following steps:

[0160] S1901, calculate the inverted fold vertex;

[0161] S1902, calculating a mirror vector based on a vector between the center point of the grid and the target vertex of the inverted fold;

[0162] S1903, calculating the mirror point using the mirror vector;

[0163] S1904: Using the mirror point as the ray detection starting point, subtracting the normal from the blocking plane normal to obtain a ray detection search vector as the ray detection direction, and using the ray detection result as the vertical inversion result;

[0164] Before ray detection, the blocking plane between the mirror point and the original vertex is added to the ignore list of ray detection.

[0165] S1905, eliminating the flip angle;

[0166] S1906, eliminating invalid vertices in the target mesh;

[0167] S1907, culling the proportions of the target grid;

[0168] S1908, obtaining the target mesh after culling.

[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.

[0170] This embodiment also provides a grid generation device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0171] FIG20 is a structural block diagram of a grid generation apparatus according to one embodiment of the present disclosure. A graphical user interface is provided by a terminal device, and the content displayed by the graphical user interface includes a touch area. As shown in FIG20 , the apparatus includes:

[0172] An acquisition module 2002 is configured to acquire attribute information of a target mesh to be fitted to a three-dimensional scene surface;

[0173] The determination module 2004 is configured to determine detection parameters corresponding to target vertices on the target mesh based on the mesh rendering attributes in the attribute information;

[0174] The detection module 2006 is configured to perform ray detection on the surface of the three-dimensional scene based on the detection parameters to determine the fitting position of the target vertex relative to the surface of the three-dimensional scene;

[0175] The generation module 2008 is configured to generate a target mesh based on the fit positions of the target vertices and the mesh structure attributes in the attribute information.

[0176] Optionally, the determination module includes: a relative position relationship determination module, configured to determine the relative position relationship between the fitting vertex and the center point of the target mesh, wherein the fitting vertex is configured to represent the vertex obtained after fitting the target vertex to the surface of the three-dimensional scene; a fitting type determination module, configured to determine the fitting type of the target vertex based on the relative position relationship; and a detection parameter determination module, configured to determine the detection parameters corresponding to the target vertex based on the fitting type and mesh rendering properties.

[0177] Optionally, the fitting type determination module includes: a covering type determination module, configured to execute a determination that the fitting type of the target vertex is a covering type in response to the relative position relationship being that the fitting vertex and the center point are coplanar; an outward folding type determination module, configured to execute a determination that the fitting type of the target vertex is an outward folding type in response to the relative position relationship being that the fitting vertex and the center point are connected; an inward folding type determination module, configured to execute a determination that the fitting type of the target vertex is an inward folding type in response to the relative position relationship being that the fitting vertex and the center point are not connected.

[0178] Optionally, the detection parameter determination module includes: an offset vertex determination module, configured to determine the offset vertex as the detection starting point in response to the fitting type being the covering type, and determine the opposite direction of the normal vector as the detection direction, wherein the offset vertex is the vertex obtained after offsetting the target vertex according to the target offset; a target vertex determination module, configured to determine the target vertex as the detection starting point in response to the fitting type being the outward folding type, and determine the detection direction based on the opposite direction of the normal vector, the first tangent vector and the second tangent vector; a mirror point determination module, configured to determine the mirror point corresponding to the target vertex as the detection starting point in response to the fitting type being the inward folding type, and determine the detection direction based on the normal vector and the blocking normal vector of the first blocking plane, wherein the first blocking plane is configured to represent a plane that blocks the target vertex and the center point on the three-dimensional scene, and the mirror point is configured to represent a position that has a mirror relationship with the target vertex relative to the first blocking plane.

[0179] Optionally, the device also includes: a ray detection module, configured to perform ray detection on the three-dimensional scene surface starting from the target vertex according to the normal vector to obtain the ray detection distance; a target offset distance determination module, configured to determine the target offset distance of the target vertex by comparing the ray detection distance and the preset offset distance; a target vertex offset module, configured to offset the target vertex based on the target offset distance of the target vertex to obtain an offset vertex.

[0180] Optionally, the target offset distance determination module includes: a ray detection distance determination module, configured to execute, in response to the ray detection distance being less than a preset offset distance, determining the ray detection distance as the target offset distance; and a preset offset distance determination module, configured to execute, in response to the ray detection distance being greater than or equal to the preset offset distance, determining the preset offset distance as the target offset distance.

[0181] Optionally, the device also includes: a first vector determination module, configured to determine the first vector between the center point and the fitting position of the target vertex; a first angle determination module, configured to obtain the first angle between the first vector and the inverse vector of the normal vector; and a target vertex culling module, configured to update the fitting position of the target vertex to the original position of the target vertex in response to the first angle being greater than a first preset angle.

[0182] Optionally, the target vertex determination module includes: an auxiliary vector determination module, configured to determine a horizontal auxiliary vector and a vertical auxiliary vector based on a first tangent vector and a second tangent vector, wherein the horizontal auxiliary vector is configured to represent the offset direction of the target vertex and the center point in the horizontal direction, and the horizontal auxiliary vector is configured to represent the offset direction of the target vertex and the center point in the vertical direction; a horizontal detection direction determination module, configured to determine the horizontal detection direction based on the difference between the reverse direction of the normal vector and the horizontal auxiliary vector; a vertical detection direction determination module, configured to determine the vertical detection direction based on the difference between the reverse direction of the normal vector and the vertical auxiliary vector; and a detection direction determination module, configured to obtain the detection direction based on the horizontal detection direction and the vertical detection direction.

[0183] Optionally, the auxiliary vector determination module includes: a coordinate system construction module, configured to construct a two-dimensional coordinate system based on the center point, the first tangent vector and the second tangent vector; a quadrant determination module, configured to determine the quadrant of the target vertex in the two-dimensional coordinate system; and an auxiliary vector determination module, configured to determine the horizontal auxiliary vector and the vertical auxiliary vector based on the quadrant of the target vertex.

[0184] Optionally, the detection module includes: a detection result obtaining module, configured to perform ray detection on the three-dimensional scene surface based on the horizontal detection direction to obtain a horizontal detection result, and to perform ray detection on the three-dimensional scene surface based on the vertical detection direction to obtain a vertical detection result; a first fitting position determination module, configured to determine the fitting position based on the position of the horizontal detection vertex or the vertical detection vertex in response to the horizontal detection result containing the horizontal detection vertex and the vertical detection result containing the vertical detection vertex; a second fitting position determination module, configured to determine the fitting position based on the position of the horizontal detection vertex in response to the horizontal detection result containing the horizontal detection vertex and the vertical detection result not containing the vertical detection vertex; a third fitting position determination module, configured to determine the fitting position based on the position of the vertical detection vertex in response to the horizontal detection result not containing the horizontal detection vertex and the vertical detection result containing the vertical detection vertex.

[0185] Optionally, the first fitting position determination module includes: a detection vector determination module, configured to determine the horizontal detection vector between the horizontal detection vertex and the corresponding target vertex, and the vertical detection vector between the vertical detection vertex and the corresponding target vertex; an angle acquisition module, configured to acquire the horizontal angle between the horizontal detection vector and the inverse vector of the horizontal auxiliary vector, and the vertical angle between the vertical detection vector and the inverse vector of the vertical auxiliary vector; a target angle determination module, configured to determine the target angle among the horizontal angle and the vertical angle, wherein the target angle is smaller than other angles among the horizontal angle and the vertical angle except the target angle; and a fitting position determination module, configured to determine that the position of the detection vertex corresponding to the target angle is the fitting position.

[0186] Optionally, the device also includes: a fitting vector determination module, configured to determine the fitting vector between the target vertex and the fitting position of the target vertex; a first auxiliary vector determination module, configured to determine the first auxiliary vector corresponding to the fitting position based on the type of the detected vertex corresponding to the fitting position; a second angle acquisition module, configured to acquire the second angle between the fitting vector and the first auxiliary vector; and a target vertex culling module, configured to cull the target vertex in response to the second angle being greater than a second preset angle.

[0187] Optionally, the mirror point determination module includes: a difference acquisition module configured to determine the detection direction based on the difference between the normal vector and the blocking normal vector.

[0188] Optionally, the device also includes: an association vector determination module, configured to determine the association vector between the target vertex and the center point; a mirror vector determination module, configured to determine the mirror vector based on the association vector, the normal vector and the blocking normal vector; and a mirror point acquisition module, configured to translate the target vertex based on the mirror vector to obtain the mirror point.

[0189] Optionally, the mirror point determination module includes: a second blocking plane acquisition module, configured to execute a second blocking plane in response to a second blocking plane between the target vertex and the mirror point, wherein the second blocking plane is configured to execute a plane indicating that there is an obstruction to the target vertex and the mirror point; and a second blocking plane ignoring module, configured to execute ignoring the second blocking plane in a process of performing ray detection on the three-dimensional scene surface based on the detection parameters.

[0190] Optionally, the device also includes: an auxiliary vector determination module, configured to determine a horizontal auxiliary vector and a vertical auxiliary vector based on the first tangent vector and the second tangent vector, wherein the horizontal auxiliary vector is configured to represent the offset direction of the target vertex and the center point in the horizontal direction, and the vertical auxiliary vector is configured to represent the offset direction of the target vertex and the center point in the vertical direction; a second auxiliary vector determination module, configured to determine the second auxiliary vector corresponding to the fitting position based on the horizontal auxiliary vector, the vertical auxiliary vector and the blocking normal vector; a fitting vector determination module, configured to determine the fitting vector between the target vertex and the fitting position of the target vertex; a third angle acquisition module, configured to obtain a third angle between the fitting vector and the second auxiliary vector; a target vertex culling module, configured to cull the target vertex in response to the third angle being greater than a third preset angle.

[0191] Optionally, the second auxiliary vector determination module includes: a dot product result obtaining module, configured to execute the dot product between the horizontal auxiliary vector and the blocking normal vector to obtain a first dot product result, and to obtain the dot product between the vertical auxiliary vector and the blocking normal vector to obtain a second dot product result; a vertical auxiliary vector determination module, configured to execute, in response to the absolute value of the first dot product result being less than or equal to the absolute value of the second dot product result, determining that the second auxiliary vector is a vertical auxiliary vector; and a horizontal auxiliary vector determination module, configured to execute, in response to the absolute value of the first dot product result being greater than the absolute value of the second dot product result, determining that the second auxiliary vector is a horizontal auxiliary vector.

[0192] Optionally, the determination module includes: a vertex culling module configured to cull vertices that fail to fit into the three-dimensional scene from target vertices on the target mesh, to obtain target vertices.

[0193] Optionally, the detection module includes: a quantity acquisition module, configured to execute acquisition of a first quantity of target vertices on a target mesh, and a second quantity of target vertices; a target ratio determination module, configured to execute determination of a ratio of the second quantity to the first quantity to obtain a target ratio; and a target mesh culling module, configured to execute culling of the target mesh in response to the target ratio being less than a preset ratio.

[0194] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

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

[0196] In exemplary embodiments of the present disclosure, a computer-readable storage medium stores a program product capable of implementing the aforementioned method of the present embodiment. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to execute the steps described in the "Exemplary Method" section of the present embodiment according to various exemplary embodiments of the present disclosure.

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

[0198] The program product may be implemented in any combination of one or more computer-readable media. The 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 thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0199] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any appropriate combination of the above.

[0200] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0201] In the electronic device of this embodiment, a technical solution for mesh generation is provided. A graphical user interface is provided through a terminal device, and the content displayed by the graphical user interface includes a three-dimensional scene. The method includes: obtaining attribute information of a target mesh to be fitted to the surface of the three-dimensional scene; determining detection parameters corresponding to target vertices on the target mesh based on the mesh rendering attributes in the attribute information; performing ray detection on the surface of the three-dimensional scene based on the detection parameters to determine the fitting position of the target vertex relative to the surface of the three-dimensional scene; generating a target mesh based on the fitting position of the target vertex and the mesh structure attributes in the attribute information. It is easy to notice that by performing ray detection on the target vertex on the target mesh of the three-dimensional scene surface, the fitting position of the target vertex relative to the surface of the three-dimensional scene can be obtained, which facilitates mesh fitting of the three-dimensional scene surface through the fitting position, thereby achieving the technical effect of dynamically generating a fitting mesh based on any three-dimensional scene, thereby solving the technical problem that there are large limitations in the dynamic rendering of three-dimensional scenes.

[0202] Figure 21 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. As shown in Figure 21, the electronic device 2100 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.

[0203] As shown in Figure 21, electronic device 2100 is implemented as a general-purpose computing device. Components of electronic device 2100 may include, but are not limited to, the aforementioned at least one processor 2110, the aforementioned at least one memory 2120, a bus 2130 connecting various system components (including memory 2120 and processor 2110), and a display 2140.

[0204] The memory 2120 stores program codes, which can be executed by the processor 2110, so that the processor 2110 executes the steps described in the method section of the embodiment of the present disclosure according to various exemplary embodiments of the present disclosure.

[0205] The memory 2120 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 21201 and / or a cache memory unit 21202, and may further include a read-only memory unit (ROM) 21203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0206] In some examples, the memory 2120 may also include a program / utility 21204 having a set (at least one) of program modules 21205. Such program modules 21205 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The memory 2120 may further include a memory remotely located relative to the processor 2110. These remote memories may be connected to the electronic device 2100 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0207] The bus 2130 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a local bus to the processor 2110, or any of a variety of bus architectures.

[0208] The display 2140 may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 2100 .

[0209] Optionally, the electronic device 2100 can also communicate with one or more external devices 1400 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 2100, and / or any device that enables the electronic device 2100 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 2150. Furthermore, the electronic device 2100 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 2160. As shown in FIG. 21 , the network adapter 2160 communicates with other modules of the electronic device 2100 via a bus 2130. It should be understood that, although not shown in FIG. 21 , other hardware and / or software modules can be used in conjunction with the electronic device 2100, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0210] The electronic device 2100 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.

[0211] It will be understood by those skilled in the art that the structure shown in FIG21 is for illustration only and does not limit the structure of the above-mentioned electronic device. For example, the electronic device 2100 may also include more or fewer components than those shown in FIG21, or have a configuration different from that shown in FIG1. ​​The memory 2120 may be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the patent specification method in the embodiment of the present disclosure. The processor 2110 executes various functional applications and data processing by running the computer program stored in the memory 2120, that is, implements the above-mentioned patent specification method.

[0212] The serial numbers of the above-mentioned embodiments of the present disclosure are for description only and do not represent the advantages or disadvantages of the embodiments.

[0213] In the above embodiments of the present disclosure, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0214] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0215] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0216] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0217] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0218] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present disclosure. These improvements and modifications should also be regarded as within the scope of protection of the present disclosure.

Claims

1. A method for generating a grid, wherein a graphical user interface is provided by a terminal device, wherein the content displayed by the graphical user interface includes a three-dimensional scene, and the method comprises: Acquire attribute information of a target mesh to be attached to the surface of the three-dimensional scene; Determine, based on the mesh rendering attributes in the attribute information, a detection parameter corresponding to a target vertex on the target mesh; Performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface; The target mesh is generated based on the fit positions of the target vertices and the mesh structure attributes in the attribute information.

2. The method according to claim 1, wherein: Determining the detection parameter corresponding to the target vertex on the target mesh based on the mesh rendering attribute includes: Determine a relative positional relationship between a fitting vertex and a center point of the target mesh, wherein the fitting vertex is used to represent a vertex obtained after fitting the target vertex to the surface of the three-dimensional scene; Based on the relative position relationship, determining the fit type of the target vertex; Based on the fit type and the mesh rendering attribute, the detection parameter corresponding to the target vertex is determined.

3. The method according to claim 2, wherein: Determining the fit type of the target vertex based on the relative position relationship includes: In response to the relative position relationship being that the fitting vertex and the center point are coplanar, determining that the fitting type of the target vertex is a covering type; In response to the relative position relationship that the fitting vertex is connected to the center point, determining that the fitting type of the target vertex is an outward fold type; In response to the relative position relationship being that the fitting vertex is not connected to the center point, it is determined that the fitting type of the target vertex is an inward fold type.

4. The method according to claim 2, wherein: The mesh rendering attributes include: a normal vector, a first tangent vector and a second tangent vector, the first tangent vector and the second tangent vector are perpendicular to each other, and the detection parameters include: a detection starting point and a detection direction, wherein, based on the mesh rendering attributes, determining the detection parameters corresponding to the target vertex on the target mesh includes: In response to the fitting type being the covering type, determining an offset vertex as the detection starting point, and determining the opposite direction of the normal vector as the detection direction, wherein the offset vertex is a vertex obtained by offsetting the target vertex according to the target offset amount; In response to the fitting type being an outward fold type, determining the target vertex as the detection starting point, and determining the detection direction based on the reverse direction of the normal vector, the first tangent vector, and the second tangent vector; In response to the fitting type being an inward fold type, the mirror point corresponding to the target vertex is determined as the detection starting point, and the detection direction is determined based on the normal vector and the blocking normal vector of the first blocking plane, wherein the first blocking plane is used to represent the plane on the three-dimensional scene that blocks the target vertex and the center point, and the mirror point is used to represent the position that has a mirror relationship with the target vertex relative to the first blocking plane.

5. The method according to claim 4, wherein: The method further comprises: Starting from the target vertex, performing ray detection on the surface of the three-dimensional scene according to the normal vector to obtain a ray detection distance; Determining a target offset distance of the target vertex by comparing the ray detection distance with a preset offset distance; The target vertex is offset based on the target offset distance of the target vertex to obtain the offset vertex.

6. The method according to claim 5, wherein: Determining the target offset distance of the target vertex by comparing the ray detection distance with a preset offset distance includes: In response to the ray detection distance being less than the preset offset distance, determining the ray detection distance as the target Offset distance; In response to the ray detection distance being greater than or equal to the preset offset distance, the preset offset distance is determined to be the target offset distance.

7. The method according to claim 4, wherein: In response to the fitting type being a covering type, after performing ray detection on the three-dimensional scene surface based on the detection parameter to determine the fitting position of the target vertex relative to the three-dimensional scene surface, the method further includes: Determining a first vector between the center point and the fit position of the target vertex; Obtaining a first angle between the first vector and the inverse vector of the normal vector; In response to the first angle being greater than a first preset angle, the fitting position of the target vertex is updated to the original position of the target vertex.

8. The method according to claim 4, wherein: Determining the detection direction based on the reverse direction of the normal vector, the first tangent vector, and the second tangent vector includes: Based on the first tangent vector and the second tangent vector, determine a horizontal auxiliary vector and a vertical auxiliary vector, wherein the horizontal auxiliary vector is used to represent the offset direction of the target vertex and the center point in the horizontal direction, and the vertical auxiliary vector is used to represent the offset direction of the target vertex and the center point in the vertical direction; Determining a horizontal detection direction based on a difference between the reverse direction of the normal vector and the horizontal auxiliary vector; Determining a vertical detection direction based on a difference between the reverse direction of the normal vector and the vertical auxiliary vector; The detection direction is obtained based on the horizontal detection direction and the vertical detection direction.

9. The method according to claim 8, wherein: Determining the horizontal auxiliary vector and the vertical auxiliary vector based on the first tangent vector and the second tangent vector includes: Constructing a two-dimensional coordinate system based on the center point, the first tangent vector and the second tangent vector; Determining the quadrant of the target vertex in the two-dimensional coordinate system; Based on the quadrant of the target vertex, the horizontal auxiliary vector and the vertical auxiliary vector are determined.

10. The method according to claim 8, wherein: Performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface includes: Performing ray detection on the surface of the three-dimensional scene based on the horizontal detection direction to obtain a horizontal detection result, and performing ray detection on the surface of the three-dimensional scene based on the vertical detection direction to obtain a vertical detection result; In response to the horizontal detection result including a horizontal detection vertex and the vertical detection result including a vertical detection vertex, determining the fitting position based on a position of the horizontal detection vertex or the vertical detection vertex; In response to the horizontal detection result including a horizontal detection vertex and the vertical detection result not including a vertical detection vertex, determining the fitting position based on a position of the horizontal detection vertex; In response to the horizontal detection result not including a horizontal detection vertex and the vertical detection result including a vertical detection vertex, the fitting position is determined based on a position of the vertical detection vertex.

11. The method according to claim 10, wherein: Determining the fitting position based on the position of the horizontal detection vertex or the vertical detection vertex includes: Determine a horizontal detection vector between the horizontal detection vertex and the corresponding target vertex, and a vertical detection vector between the vertical detection vertex and the corresponding target vertex; Acquire a horizontal angle between the horizontal detection vector and the inverse vector of the horizontal auxiliary vector, and a vertical angle between the vertical detection vector and the inverse vector of the vertical auxiliary vector; Determine a target angle among the horizontal angle and the vertical angle, wherein the target angle is smaller than other angles among the horizontal angle and the vertical angle except the target angle; The position of the detection vertex corresponding to the target angle is determined as the fitting position.

12. The method according to claim 8, wherein: After performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface, the method further includes: Determining a fit vector between the target vertex and the fit position of the target vertex; Determining a first auxiliary vector corresponding to the fitting position based on the type of the detection vertex corresponding to the fitting position; Obtaining a second angle between the fitting vector and the first auxiliary vector; In response to the second angle being greater than a second preset angle, the target vertex is eliminated.

13. The method according to claim 4, wherein: Determining the detection direction based on the normal vector and a blocking normal vector of a first blocking plane includes: The detection direction is determined based on a difference between the normal vector and the blocking normal vector.

14. The method according to claim 4, wherein: The method comprises: Determining a correlation vector between the target vertex and the center point; determining a mirror vector based on the association vector, the normal vector and the blocking normal vector; The target vertex is translated based on the mirror vector to obtain the mirror point.

15. The method according to claim 4, wherein: In response to the fitting type being an inward-folding type, the method further includes: In response to a second blocking plane between the target vertex and the mirror point, wherein the second blocking plane is used to represent a plane that blocks the target vertex and the mirror point; In the process of performing ray detection on the three-dimensional scene surface based on the detection parameters, the second blocking plane is ignored.

16. The method according to claim 4, wherein: In response to the fitting type being an inward fold type, after performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface, the method further includes: Based on the first tangent vector and the second tangent vector, determine a horizontal auxiliary vector and a vertical auxiliary vector, wherein the horizontal auxiliary vector is used to represent the offset direction of the target vertex and the center point in the horizontal direction, and the vertical auxiliary vector is used to represent the offset direction of the target vertex and the center point in the vertical direction; Determine a second auxiliary vector corresponding to the fitting position based on the horizontal auxiliary vector, the vertical auxiliary vector and the blocking normal vector; Determining a fit vector between the target vertex and the fit position of the target vertex; Obtaining a third angle between the fitting vector and the second auxiliary vector; In response to the third angle being greater than a third preset angle, the target vertex is eliminated.

17. The method according to claim 16, wherein: Determining the second auxiliary vector corresponding to the fitting position based on the horizontal auxiliary vector, the vertical auxiliary vector and the blocking normal vector includes: Obtaining a dot product between the horizontal auxiliary vector and the blocking normal vector to obtain a first dot product result, and obtaining a dot product between the vertical auxiliary vector and the blocking normal vector to obtain a second dot product result; In response to an absolute value of the first dot product result being less than or equal to an absolute value of the second dot product result, determining that the second auxiliary vector is the vertical auxiliary vector; In response to an absolute value of the first dot product result being greater than an absolute value of the second dot product result, the second auxiliary vector is determined to be the horizontal auxiliary vector.

18. The method according to claim 16, wherein: Before determining the detection parameter corresponding to the target vertex on the target mesh based on the mesh rendering attribute, the method further includes: The target vertices are obtained by removing vertices that fail to fit to the three-dimensional scene from the target vertices on the target mesh.

19. The method according to claim 16, wherein: After performing ray detection on the three-dimensional scene surface based on the detection parameters to determine the fitting position of the target vertex relative to the three-dimensional scene surface, the method further includes: Obtaining a first number of target vertices on the target mesh and a second number of the target vertices; determining a ratio of the second quantity to the first quantity to obtain a target ratio; In response to the target ratio being smaller than a preset ratio, the target mesh is eliminated.

20. A grid generation device, providing a graphical user interface through a terminal device, wherein the content displayed by the graphical user interface includes a three-dimensional scene, the device comprising: An acquisition module, configured to acquire attribute information of a target mesh to be attached to the surface of the three-dimensional scene; A determination module is configured to determine a detection parameter corresponding to the target vertex on the target mesh based on the mesh rendering attribute in the attribute information; A detection module, configured to perform ray detection on the three-dimensional scene surface based on the detection parameters, and determine a fitting position of the target vertex relative to the three-dimensional scene surface; The generating module is configured to generate the target mesh based on the fitting positions of the target vertices and the mesh structure attributes in the attribute information.

21. A computer-readable storage medium having a computer program stored therein, wherein: The computer program is configured to perform the method as claimed in any one of claims 1 to 19 when executed by a processor.

22. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 19.

Citation Information

Patent Citations

  • Method for generating virtual-reality three dimensional road

    CN106327566A

  • Method and device for processing virtual model in game

    CN111167120A

  • Grid generation method and device, computer readable storage medium and electronic device

    CN116883619A

  • Fitting relation detection method, device and equipment and storage medium

    CN116943216A

  • Data processing method and apparatus for virtual scene, and computer program and readable medium

    WO2022057079A1