Processing Method, Device, Computer Equipment and Storage Medium of Virtual Object Model

By determining the candidate rotation center point and rotation axis direction vector of the virtual object model, and combining the normal vector and area of ​​the model surface to correct the position, the problem of inaccurate determination of the axis center and rotation axis direction of the virtual object model is solved, and the accuracy of rotation effect and bone binding is improved.

CN116342846BActive Publication Date: 2025-07-04NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310179596.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2025-07-04
Estimated Expiration
2043-02-22

AI Technical Summary

Technical Problem

In the prior art, there is a deviation in the determination of the axis center and rotation axis direction of the virtual object model, resulting in inaccurate rotation effect and it is difficult to locate the corresponding bone position and inclination angle during animation binding.

Method used

By obtaining the coordinates of each model vertex of the virtual object model, determining the candidate rotation center point and radius, calculating the tilt vector and rotation axis direction vector, obtaining the model surface normal vector and area, performing position correction, and obtaining the accurate rotation center point and axis position.

Benefits of technology

The accurate axis position and rotation axis direction of the virtual object model are achieved, and the accuracy of rotation operation and the effect of bone binding are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116342846B_ABST
    Figure CN116342846B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a method, apparatus, computer device, and computer-readable storage medium for processing a virtual object model. A temporary center point is determined through the coordinates of the left and right vertices of the virtual object model, the distances between each vertex and the temporary center are calculated, and in combination with the horizontal coordinates of each vertex, candidate vertices whose distances from the temporary center are above a preset threshold and whose horizontal axis coordinates are more than another preset threshold away from the temporary center are screened out. The candidate vertices are used to calculate the inclination vector of the virtual object model in the vertical direction to obtain the direction of the rotation axis perpendicular to the inclination direction; candidate model faces adjacent to the screened candidate vertices are obtained, and based on the normal vector and area of the candidate model faces, a correction parameter for the temporary center point of the virtual object model is calculated, and the position of the temporary center point is corrected based on the correction parameter to obtain the rotation axis position coordinates. In this way, the accurate axis position and rotation axis direction of the virtual object model can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and particularly to a method, apparatus, computer device, and computer-readable storage medium for processing a virtual object model. Background Art

[0002] In polygon model making, irregular near-circular objects are often encountered, such as a steering wheel, or some special-shaped notch near-circular parts. These models usually come from 3D scanning or are manually made by production staff, lacking an accurate axis center and axis rotation direction, and it is difficult to locate the corresponding bone positions and inclinations during animation binding.

[0003] In the related art, the production staff manually selects the axis center to make the axis center more accurately aligned with the center of the left and right sides of the model. For the up and down position of the axis center and the inclination of its rotation axis, only a general position and direction can be evaluated through visual observation. As a result, a relatively large deviation in the axis center position and the rotation axis direction is obtained, thus affecting the rotation effect of the virtual object model. Summary of the Invention

[0004] Embodiments of the present application provide a method, apparatus, computer device, and computer-readable storage medium for processing a virtual object model, to obtain an accurate axis center position and rotation axis direction of the virtual object model.

[0005] Embodiments of the present application provide a method for processing a virtual object model, including:

[0006] Obtain the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine a first model vertex with the largest coordinate value on a first coordinate axis and a second model vertex with the smallest coordinate value, where the shape of the virtual object model in a specified plane is a near-circular shape;

[0007] Determine a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex;

[0008] Based on the coordinates of the candidate rotation center point and the candidate radius, determine candidate model vertices from the respective model vertices, where the candidate model vertices are the model vertices corresponding to the circle coaxial with the candidate rotation center point in the specified plane of the virtual object model;

[0009] Based on the candidate model vertices, determine an inclination vector of the virtual object model in the specified plane and a rotation axis direction vector perpendicular to the inclination vector, to obtain the rotation axis direction of the virtual object model;

[0010] Obtain the model faces of the virtual object model, and determine a candidate model face facing the candidate rotation center point from the model faces;

[0011] Based on the normal vector and area of the candidate model face, determine the position correction parameter of the candidate rotation center point in the direction of the rotation axis, and correct the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model.

[0012] Correspondingly, an embodiment of the present application further provides a processing device for a virtual object model, including:

[0013] A first acquisition unit, configured to acquire the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine a first model vertex with the largest coordinate value on the first coordinate axis and a second model vertex with the smallest coordinate value, where the shape of the virtual object model on a specified plane is a nearly circular shape;

[0014] A first determination unit, configured to determine a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex;

[0015] A second determination unit, configured to determine candidate model vertices from the respective model vertices based on the coordinates of the candidate rotation center point and the candidate radius, where the candidate model vertices are the model vertices corresponding to the circle coaxial with the candidate rotation center point on the specified plane of the virtual object model;

[0016] A third determination unit, configured to determine an inclination vector of the virtual object model on the specified plane and a rotation axis direction vector perpendicular to the inclination vector based on the candidate model vertices, to obtain the rotation axis direction of the virtual object model;

[0017] A second acquisition unit, configured to acquire the model faces of the virtual object model, and determine a candidate model face facing the candidate rotation center point from the model faces;

[0018] A fourth determination unit, configured to determine the position correction parameter of the candidate rotation center point in the direction of the rotation axis based on the normal vector and area of the candidate model face, and correct the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model.

[0019] Correspondingly, an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the processing method for a virtual object model provided in any embodiment of the present application.

[0020] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, which stores multiple instructions adapted to be loaded by a processor to execute the above-described method for processing a virtual object model.

[0021] In an embodiment of the present application, a temporary center point is determined based on the coordinates of the left and right vertices of the virtual object model, the distances between each vertex and the temporary center are calculated, and in combination with the horizontal coordinates of each vertex, candidate vertices whose distances from the temporary center are above a preset threshold and whose horizontal axis coordinates are more than another preset threshold away from the temporary center are screened out. The inclination vector of the virtual object model in the vertical direction is calculated using the candidate vertices to obtain the direction of the rotation axis perpendicular to the inclination direction; candidate model faces adjacent to the screened candidate vertices are obtained, and based on the normal vector and area of the candidate model faces, a correction parameter for the temporary center point of the virtual object model is calculated, and the position of the temporary center point is corrected based on the correction parameter to obtain the position coordinates of the rotation axis. In this way, the accurate axis position and the direction of the rotation axis of the virtual object model can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.

[0023] Figure 1 It is a schematic flowchart of a method for processing a virtual object model provided by an embodiment of the present application.

[0024] Figure 2 It is a schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0025] Figure 3 It is a schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0026] Figure 4 It is a schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0027] Figure 5 It is a schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0028] Figure 6 It is a schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0029] Figure 7Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0030] Figure 8 Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0031] Figure 9 Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0032] Figure 10 Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0033] Figure 11 Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0034] Figure 12 Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0035] Figure 13 Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0036] Figure 14 Schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application.

[0037] Figure 15 Block diagram of the structure of a processing device for a virtual object model provided by an embodiment of the present application.

[0038] Figure 16 Schematic diagram of the structure of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0039] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.

[0040] The embodiments of the present application provide a method, an apparatus, a computer-readable storage medium, and a computer device for processing a virtual object model. Specifically, the method for processing the virtual object model in the embodiments of the present application can be executed by a computer device, where the computer device can be a terminal or a server, etc. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a personal computer (PC), a personal digital assistant (PDA), etc. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0041] For example, the computer device can be a terminal. The terminal can obtain the vertex coordinates of each model vertex in the virtual object model and, based on the vertex coordinates, determine a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on the first coordinate axis, where the shape of the virtual object model in a specified plane is approximately circular; determine a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex; based on the coordinates of the candidate rotation center point and the candidate radius, determine candidate model vertices from each model vertex, where the candidate model vertices are the model vertices corresponding to the circle coaxial with the candidate rotation center point in the specified plane of the virtual object model; determine the inclination vector of the virtual object model in the specified plane and the rotation axis direction vector perpendicular to the inclination vector based on the candidate model vertices to obtain the rotation axis direction of the virtual object model; obtain the model faces of the virtual object model and determine a candidate model face facing the candidate rotation center point from the model faces; determine the position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model face, and correct the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model.

[0042] Based on the above problems, the embodiments of the present application provide a first method, an apparatus, a computer device, and a computer-readable storage medium for processing a virtual object model, to obtain the accurate axis position and rotation axis direction of the virtual object model.

[0043] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.

[0044] An embodiment of the present application provides a method for processing a virtual object model. This method can be executed by a terminal or a server. In this embodiment of the present application, the method for processing the virtual object model executed by the terminal is taken as an example for illustration.

[0045] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a method for processing a virtual object model provided by an embodiment of the present application. The specific process of this method for processing the virtual object model can be as follows:

[0046] 101. Obtain the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on the first coordinate axis.

[0047] In the embodiment of the present application, the virtual object model refers to an object model created according to the shape of the virtual object, and the virtual object model can be a three-dimensional model. After creating the virtual object model, some editing operations are usually required, such as rotation, scaling, etc.

[0048] Before performing the rotation operation on the virtual object model, it is first necessary to determine the rotation axis point in order to control the rotation operation of the virtual object model based on the rotation axis point. Specifically, the rotation axis point can be determined according to the geometric shape of the virtual object model in a specified plane. For a virtual object model with a circular shape in the specified plane, the rotation axis point can be determined according to the center of the circle; while for a virtual object model with a non-circular shape (i.e., a near-circular shape) in the specified plane, in the related art, the rotation axis point is mainly determined manually, and there will be deviation when determining the rotation axis point manually, which will cause the virtual object model to perform eccentric motion during the rotation operation, making it inconvenient to position the virtual object model during the rotation process.

[0049] Therefore, in the solution of the present application, the determination method of the rotation axis of the above-mentioned near-circular virtual object model is mainly improved to determine the rotation axis point corresponding to various near-circular virtual object models.

[0050] Among them, the shape of the virtual object model in a specified plane can be a near-circular shape, and the near-circular shape refers to a shape that is close to a circle but not a perfect circle. For example, the near-circular shape can be an ellipse, an irregular circle, a notched circle, etc.

[0051] For example, please refer to Figure 2 , Figure 2 which is a schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application. Figure 2 It shows a variety of near-circular shapes, which can include: ellipses, irregular circles, and notched circles.

[0052] In some embodiments, the virtual object model may be a steering wheel model.

[0053] For example, please refer to Figure 3 , Figure 3 which is a schematic diagram of an application scenario of a method for processing a virtual object model provided by an embodiment of the present application. Figure 3 It shows a variety of virtual object models with different nearly circular shapes in a specified plane.

[0054] Among them, the first coordinate axis may be the coordinate axis of the virtual object model in the horizontal direction.

[0055] For example, please refer to Figure 4 , Figure 4 which is a schematic diagram of an application scenario of another method for processing a virtual object model provided by an embodiment of the present application. The virtual object model may be a three-dimensional model of a steering wheel, that is, a steering wheel model. This solution can be described by taking the Figure 4 shown steering wheel as an example. Let the symmetry axis of the steering wheel be the Y-axis of the coordinate system, that is, the left and right of the cockpit are in the Y-axis direction, the front and back are in the X-axis direction, and the up and down are in the Z-axis direction. Among them, the Y-axis is also the first coordinate axis.

[0056] Specifically, based on the vertex coordinates, determining the first model vertex with the largest coordinate value on the first coordinate axis and the second model vertex with the smallest coordinate value may include the following operations: First, obtain the partial faces of the steering wheel model selected by the production staff in the virtual object model, or obtain the faces of the entire steering wheel model, record them in the set F, and convert and obtain the model vertices that make up these faces, and record these model vertices in the set V.

[0057] Then, obtain the three-dimensional coordinates of each model vertex in the order of the model vertices V0, V1, V2... Vi in the set V, and record the X-axis coordinate value (that is, the coordinate value on the X-axis) of each model vertex Vi in the 3*i-th position of the floating-point set P, record the Y-axis coordinate value (that is, the coordinate value on the Y-axis) in the 3*i + 1-th position of the set P, and record the Z-axis coordinate value (that is, the coordinate value on the Z-axis) in the 3*i + 2-th position of the set P.

[0058] Among them, i is the serial number of the model vertex in the set V (numbered from 0, the same below). In this process, record the Y-axis coordinate value of the first model vertex V0 in the set in Ymin and Ymax. When the Y-axis coordinate value of the subsequent model vertex is greater than Ymax, record the Y-axis coordinate value of this model vertex as the new Ymax. When the Y-axis coordinate value of the subsequent model vertex is less than Ymin, record the Y-axis coordinate of this model vertex as the new Ymin.

[0059] Among them, Ymin represents the minimum coordinate value on the Y-axis, and Ymax represents the maximum coordinate value on the Y-axis.

[0060] Further, after traversing all the model vertices in the set V, the value range of the entire model vertex set on the Y-axis is obtained, that is, [Ymin, Ymax]. The sequence numbers of the Ymin and Ymax values in the set P are found and denoted as l and r respectively. Then, the XYZ coordinate values of the model vertices with the maximum and minimum values on the Y-axis of the steering wheel model are <<P(l - 1), Pl, P(l + 1)>> and <<P(r - 1), Pr, P(r + 1)>> respectively. Based on the model vertex with the vertex coordinate <<P(l - 1), Pl, P(l + 1)>> in the virtual object model, a first model vertex is obtained. Based on the model vertex with the vertex coordinate <<P(r - 1), Pr, P(r + 1)>> in the virtual object model, a second model vertex is obtained.

[0061] 102. Determine the candidate rotation center point and candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex.

[0062] In some embodiments, the step of "determining the candidate rotation center point and candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex" may include the following operations:

[0063] Obtain the first coordinate values on each coordinate axis in the vertex coordinates of the first model vertex, and the second coordinate values on each coordinate axis in the vertex coordinates of the second model vertex;

[0064] Calculate the mean value of the first coordinate value and the second coordinate value on the same coordinate axis to obtain the third coordinate value on each coordinate axis;

[0065] Determine the candidate rotation center based on the positions corresponding to the third coordinate values on each coordinate axis;

[0066] Obtain the candidate radius based on the numerical value corresponding to the third coordinate value on the first coordinate axis.

[0067] Specifically, the calculation formula for the coordinate value of the candidate rotation center on the X-axis can be as follows:

[0068]

[0069] where Pcx refers to the coordinate value of the candidate rotation center on the X-axis, P (l-1) refers to the coordinate value of the first model vertex on the X-axis, P (r-1) refers to the coordinate value of the second model vertex on the X-axis.

[0070] Specifically, the calculation formula for the coordinate value of the candidate rotation center on the Y-axis can be as follows:

[0071]

[0072] Among them, Pcy refers to the coordinate axis of the candidate rotation center on the Y-axis, and P l refers to the coordinate value of the first model vertex on the Y-axis, and P r refers to the coordinate value of the second model vertex on the Y-axis.

[0073] Specifically, the calculation formula for the coordinate value of the candidate rotation center on the Z-axis can be as follows:

[0074]

[0075] Among them, Pcz refers to the coordinate axis of the candidate rotation center on the Z-axis, and P (l+1) refers to the coordinate value of the first model vertex on the Z-axis, and P (r+1) refers to the coordinate value of the second model vertex on the Z-axis.

[0076] Thus, the X-axis coordinate value Pcx, Y-axis coordinate value Pcy, and Z-axis coordinate value Pcz of the candidate rotation center point Ctemp are obtained, and the candidate center point is obtained.

[0077] Among them, based on the value corresponding to the third coordinate value on the first coordinate axis, the candidate radius is obtained, and the calculation formula can be as follows:

[0078] Radius Thus, the candidate radius is obtained.

[0079] For example, please refer to Figure 5 , Figure 5 which is a schematic diagram of the application scenario of another method for processing a virtual object model provided by an embodiment of the present application. In Figure 5 , a schematic diagram of the shape of the virtual object model on the specified plane is shown. Among them, model vertex A refers to the first model vertex with coordinates <<P(l - 1), Pl, P(l + 1)>>, and model vertex B refers to the second model vertex with coordinates <<P(r - 1), Pr, P(r + 1)>>. Ctemp is also the candidate rotation center point determined according to the coordinates of model vertex A and model vertex B, and the candidate radius R is the average value of the coordinate values of model vertex A and model vertex B on the Y-axis.

[0080] 103. Determine candidate model vertices from each model vertex based on the coordinates of the candidate rotation center point and the candidate radius.

[0081] Among them, the candidate model vertices are the model vertices corresponding to the circle with the same axis as the candidate rotation center point on the specified plane of the virtual object model.

[0082] In some embodiments, to screen out accurate model vertices for determining the rotation axis position of the virtual object model, the step of "determining candidate model vertices from each model vertex based on the coordinates of the candidate rotation center point and the candidate radius" may include the following operations:

[0083] Calculate the first distance between each model vertex and the candidate rotation center point according to the vertex coordinates of each model vertex and the coordinates of the candidate rotation center point;

[0084] Determine the first candidate model vertices with the first distance greater than the first distance threshold from each model vertex;

[0085] Determine the model vertices that are greater than the first coordinate threshold or less than the second coordinate threshold on the first coordinate axis from the first candidate model vertices to obtain the candidate model vertices.

[0086] Specifically, calculating the first distance between each model vertex and the candidate rotation center point according to the vertex coordinates of each model vertex and the coordinates of the candidate rotation center point can be based on the following calculation formula:

[0087]

[0088] where d represents the first distance, (Px, Py, Pz) represents the vertex coordinates of the model vertex, and (Pcx, Pcy, Pcz) represents the coordinates of the candidate rotation center point.

[0089] Among them, the first distance threshold is determined based on the candidate radius.

[0090] In some embodiments, the following steps may further be included:

[0091] Obtain a preset distance coefficient, calculate the product of the preset distance coefficient and the candidate radius to obtain the first distance threshold.

[0092] In the solution of the present application, a screening radius R lom = R factor *R, and the screening radius R lom is used as the first distance threshold. Among them, R factor is an empirical value, that is, the preset distance coefficient, and can take the value of 0.8, which is used to screen out the vertices whose distance from the candidate rotation center point Ctemp exceeds R lim to obtain the first candidate model vertices.

[0093] Specifically, model vertices that are greater than the first coordinate threshold or less than the second coordinate threshold on the first coordinate axis can be determined from the first candidate model vertices. The coordinate value of the first candidate model vertex on the Y-axis can be compared with the first coordinate threshold and the second coordinate threshold respectively. The first candidate model vertex with a coordinate value on the Y-axis greater than the first coordinate threshold or less than the second coordinate threshold is used as the candidate model vertex.

[0094] Among them, the first coordinate threshold is determined based on the coordinate value of the first model vertex on the first coordinate axis, and the second coordinate threshold is determined based on the coordinate value of the second model vertex on the first coordinate axis.

[0095] In some embodiments, the following steps may further be included:

[0096] Obtain a preset coordinate floating value, calculate the difference between the coordinate value of the first model vertex on the first coordinate axis and the preset coordinate floating value to obtain the first coordinate threshold;

[0097] Calculate the sum of the coordinate value of the second model vertex on the first coordinate axis and the preset coordinate floating value to obtain the second coordinate threshold.

[0098] In the embodiments of the present application, set the upper and lower limits for screening the width of the coordinate value:

[0099] Wmax = Ymax - W factor *R, and use Wmax as the first coordinate threshold;

[0100] Wmin = Ymin + W factor *R, and use Wmin as the second coordinate threshold for screening vertices with a Y-axis coordinate value greater than Wmax or less than Wmin. Among them, W factor is an empirical value, that is, the preset coordinate floating value, and can take the value of 0.2.

[0101] For example, denote the Z-axis coordinate axis Pcz of the candidate rotation center point Ctemp as Zmin and Zmax. Traverse the model vertices in the set V starting from V0. Let the serial number of the current vertex Vi in the set V be i. Then the coordinate values of the vertex Vi on the XYZ axes are Px = P(i * 3), Py = P(i * 3 + 1), and Pz = P(i * 3 + 2). If Py ∈ [Wmin, Wmax], then skip this vertex and start calculating the next vertex. If Py < Wmin or Py > Wmax, then calculate the distance d between this model vertex and the candidate rotation center point Ctemp. If d > R lim, then add vertex Vi to set Vc and add its serial number i to set T. On this basis, if Pz > Zmax, then record i as H and record Pz as the new Zmax; if Pz < Zmin, then record i as L and record Pz as the new Zmin. Finally, obtain set T of the serial numbers of all vertices in set V whose distance from Ctemp is greater than Rlim and whose Y-axis coordinates are outside the range of [Wmin, Wmax] (the purpose is to screen out the vertices on the grip in most steering wheel models that have the highest coincidence degree with the circle of the same axis and the same radius and can be used to locate the axis reference).

[0102] For example, please refer to Figure 6 , Figure 6 which is a schematic diagram of the application scenario of another method for processing a virtual object model provided by an embodiment of the present application. In Figure 6 the shown steering wheel model, the model vertices at the grip positions on both sides of the steering wheel model are the vertices with the highest coincidence degree with the circle of the same axis and the same radius that are screened out and can be used to locate the axis reference.

[0103] 104. Determine the tilt vector of the virtual object model in the specified plane based on the candidate model vertices, and the rotation axis direction vector perpendicular to the tilt vector, to obtain the rotation axis direction of the virtual object model.

[0104] Among them, the specified plane is the plane formed by the first coordinate axis and the second coordinate axis, that is, Figure 5 as shown, the plane formed by the first coordinate axis Y-axis and the second coordinate axis Z-axis.

[0105] Among them, the tilt vector refers to the tilt vector of the part corresponding to the candidate model vertex in the virtual object model in the vertical direction (which can be the Z-axis direction). Then, based on the vector perpendicular to this tilt vector, the rotation axis direction vector of the virtual object model is obtained, so that the rotation axis direction perpendicular to the tilt direction can be obtained.

[0106] In some embodiments, in order to accurately calculate the rotation axis direction of the virtual object model, the step of "determining the tilt vector of the virtual object model in the specified plane based on the candidate model vertices, and the rotation axis direction vector perpendicular to the tilt vector" may include the following steps:

[0107] Determine the third model vertex with the largest coordinate value on the second coordinate axis and the fourth model vertex with the smallest coordinate value from the candidate model vertices;

[0108] Based on the vertex coordinates of the third model vertex and the fourth model vertex, determine the vector pointing from the fourth model vertex to the third model vertex to obtain the tilt vector;

[0109] Calculate the perpendicular vector of the tilt vector in the direction perpendicular to the specified plane to obtain the rotation axis direction vector.

[0110] Specifically, the third model vertex with the largest coordinate value on the second coordinate axis and the fourth model vertex with the smallest coordinate value can be determined from the candidate model vertices. The candidate model vertex with the largest coordinate value on the Z-axis can be selected from the candidate model vertices to obtain the third model vertex, and the candidate model vertex with the smallest coordinate value on the Z-axis can be selected to obtain the fourth model vertex.

[0111] For example, please continue to refer to Figure 6 , the vertex Vh (the model vertex with serial number h) with the largest Z-axis coordinate value is selected from the model vertices at the grip position of the steering wheel model to obtain the third model vertex, and the vertex Vl (the model vertex with serial number l) with the smallest Z-axis coordinate value is selected to obtain the fourth model vertex.

[0112] In the embodiments of the present application, instead of directly recording the model vertices in the set, serial numbers are used. This is to quickly find the coordinate information of the corresponding vertices in the set P based on the correspondence between the vertex serial numbers and the set P serial numbers, without repeatedly reading the vertex coordinates, saving calculation time.

[0113] Specifically, based on the vertex coordinates of the third model vertex and the fourth model vertex, the vector pointing from the fourth model vertex to the third model vertex can be determined according to the following calculation formula:

[0114]

[0115] Among them, represents the projection of the vector pointing from the fourth model vertex to the third model vertex on the XZ plane, that is, the tilt vector; P(H*3) is the coordinate value of the third model vertex on the X-axis, P(L*3) is the coordinate value of the fourth model vertex on the X-axis, (P(H*3 + 2) is the coordinate value of the third model vertex on the Z-axis, and P(L*3 + 2) is the coordinate value of the fourth model vertex on the Z-axis.

[0116] In the embodiments of the present application, for the convenience of calculation, the tilt vector can be normalized, that is, normalization Specifically, the normalization of is: x 2 + y 2 + z 2 = 1, where x, y, and z represent the values of the vector components that make up the vector.

[0117] For example, please refer to Figure 7 , Figure 7 is a schematic diagram of an application scenario of another method for processing a virtual object model provided by the embodiments of the present application. In Figure 7 , is the normalized vector of the projection of the vector pointing from vertex Vl to vertex Vh on the XZ plane.

[0118] Specifically, to calculate the vertical vector of the tilt vector in the direction perpendicular to the specified plane, the following calculation formula can be used:

[0119]

[0120] Where represents the direction vector of the rotation axis. By calculating the cross product with the Y-axis vector <<0, 1, 0>>, the result is Similarly, for the convenience of calculation, the direction vector of the rotation axis can be normalized, that is, normalize Then the obtained normalized vector is perpendicular to both and the Y-axis.

[0121] For example, please refer to Figure 8 , Figure 8 is a schematic diagram of the application scenario of another method for processing a virtual object model provided by an embodiment of the present application. In Figure 8 , is the normalized vector of the projection of the vector pointing from vertex Vl to vertex Vh on the XZ plane, is perpendicular to and perpendicular to the Y-axis vector.

[0122] In some embodiments, in order to obtain the correct rotation axis direction of the virtual object model, the following steps may further be included:

[0123] Determine the first vector pointing from the candidate rotation center point to each candidate model vertex;

[0124] Based on the first vector, the tilt vector, and the rotation axis direction vector, calculate the weighted distance from the candidate rotation center point to each candidate model vertex;

[0125] Determine the candidate model vertex with the maximum weighted distance to obtain the fifth model vertex;

[0126] Obtain the model vertex on the second coordinate axis that is on the other side of the candidate rotation center point from the fifth model vertex to obtain the sixth model vertex;

[0127] Based on the vertex coordinates of the fifth model vertex and the sixth model vertex, correct the tilt vector to obtain the corrected tilt vector, and correct the rotation axis direction vector based on the tilt vector to obtain the corrected rotation axis direction vector.

[0128] Specifically, to determine the first vector pointing from the candidate rotation center point to each candidate model vertex, the following operations may be included:

[0129] Traverse set T, and read the vertex numbers in set T (set T is a set including the vertices of the candidate models): T0, T1, T2, …, Ti. Let x = T(i * 3), and let z = x + 2. Then the X-axis coordinate of vertex VTi is the decimal number Px with the number x in set P, and the Z-axis coordinate is the decimal number Pz with the number z in set P. Then, to calculate the first vector from the candidate rotation center point to each candidate model vertex, the following calculation formula can be used:

[0130]

[0131] Among them, refers to the vector of the projection of the line segment from the candidate rotation center point Ctemp to the candidate model vertex VTi on the XZ plane as the first vector; Px refers to the coordinate value of the candidate model vertex VTi on the X-axis, Pcx refers to the coordinate value of the candidate rotation center point Ctemp on the X-axis, Pz refers to the coordinate value of the candidate model vertex VTi on the Z-axis, and Pcz refers to the coordinate value of the candidate rotation center point Ctemp on the Z-axis.

[0132] In some embodiments, the step of "calculating the weighted distance from the candidate rotation center point to each candidate model vertex based on the first vector, the tilt vector, and the rotation axis direction vector" may include the following operations:

[0133] Based on the first vector and the tilt vector, calculate the length of the first component of the first vector in the direction of the tilt vector;

[0134] Based on the first vector and the rotation axis direction vector, calculate the length of the second component of the first vector in the direction of the rotation axis direction vector;

[0135] Based on the length of the first component and the length of the second component, calculate the weighted distance from the candidate rotation center point to each candidate model vertex.

[0136] Among them, based on the first vector and the tilt vector, the calculation formula for calculating the length of the first component of the first vector in the direction of the tilt vector is as follows:

[0137]

[0138] That is, by calculating and the ratio of the dot product of and the length of, obtain the length of the component of vector in the direction, and obtain the length of the first component.

[0139] Among them, based on the first vector and the rotation axis direction vector, the length of the second component of the first vector in the direction of the rotation axis direction vector can be calculated according to the following calculation formula:

[0140]

[0141] That is, by calculating and the ratio of the dot product of to the length of in the direction of to obtain the length of the component of the vector

[0142] In some embodiments, the step of "calculating the weighted distance from the candidate rotation center point to each candidate model vertex based on the first component length and the second component length" may include the following operations:

[0143] Calculate the product of the first component length and the preset weight coefficient to obtain the weighted component length;

[0144] Calculate the sum of the weighted component length and the second component length to obtain the weighted distance.

[0145] In the embodiments of the present application, the calculation formula of the weighted distance is designed as follows:

[0146]

[0147] Among them, d represents the weighted distance, and d factor represents the preset weight coefficient. represents the first component length, represents the second component length.

[0148] Specifically, by calculating and the ratio of the dot product of to the length of in the direction of to obtain the length of the component of the vector in the direction of and adding the product of this length and the weight coefficient dfactor (dfactor can be empirically set to 0.1) to

[0149] In some embodiments, since are all normalized, therefore Therefore, the calculation formula of the weighted distance can be simplified to:

[0150]

[0151] If d > dmax, record the vertex number Ti of vertex VTi as the new Ta, record d as the new dmax, and calculate the next vertex number until all vertex numbers in set T are traversed. Finally, obtain the vertex VTa with the maximum weighted distance from Ctemp and its number Ta, that is, VTa is the fifth model vertex. Then, the X-axis coordinate Ppinx = P(Ta * 3) and Z-axis coordinate Ppinz = P(Ta * 3 + 2) of vertex VTa can be found in set P.

[0152] For example, please refer to Figure 9 , Figure 9 which is a schematic diagram of the application scenario of another method for processing a virtual object model provided by an embodiment of the present application. In Figure 9 , the model vertex VTa is the model vertex calculated to have the maximum weighted distance from the candidate rotation center point Ctemp.

[0153] In some embodiments, the step of "obtaining the model vertex on the other side of the candidate rotation center point from the fifth model vertex on the second coordinate axis to obtain the sixth model vertex" may include the following operations:

[0154] Determine the model vertices among the candidate model vertices whose coordinate values on the second coordinate axis are greater than the candidate rotation center to obtain the second candidate model vertices;

[0155] Calculate the second vector from the second candidate model vertex to the fifth model vertex;

[0156] Calculate the projection length of the second vector in the direction of the tilt vector;

[0157] Calculate the ratio parameter corresponding to each second candidate model vertex based on the angle between the rotation axis direction vector and the second vector and the projection length;

[0158] Determine the sixth model vertex based on the model vertex with the minimum ratio parameter.

[0159] Specifically, determining the model vertices among the candidate model vertices whose coordinate values on the second coordinate axis are greater than the candidate rotation center may include the following steps:

[0160] First, set the comparison parameter Sign, and the calculation formula of Sign can be:

[0161]

[0162] where Pcz is the coordinate value of the candidate rotation center point Ctemp on the Z axis, and Ppinx refers to the coordinate value of the fifth model vertex VTa on the Z axis.

[0163] Then, traverse the set T (the set including the candidate model vertices), read the vertex numbers in the set T: T0, T1, T2, …, Ti. Let x = T(i * 3), let z = x + 2. Then the X-axis coordinate value of the vertex VTi is the decimal Px with the number x in the set P, and the Z-axis coordinate value is the decimal Pz with the number z in the set P. If (Pz – Pcz) * Sign > 0, then skip to the next vertex. This step is to filter out the vertices whose Z-axis coordinate values are on the other side of the candidate rotation center point Ctemp from the vertex VTa. If its Z-axis coordinate value is on the same side as the Z-axis of Ctemp, then skip this vertex and enter the next loop; if its Z-axis coordinate value is not on the same side as the Z-axis of Ctemp, then this model vertex can be used as the second candidate model vertex.

[0164] Further, calculate the projection of the line segment from the second candidate model vertex to the vertex VTa on the XZ plane It can be:

[0165]

[0166] Among them, Px is the coordinate value of the second candidate model vertex on the X-axis, and Pz is the coordinate value of the second candidate model vertex on the Z-axis; Ppinx is the coordinate value of VTa on the X-axis, and Ppinz is the coordinate value of VTa on the Z-axis. Thus, the second vector can be calculated

[0167] Specifically, calculating the projection length of the second vector in the direction of the inclined vector can include the following:

[0168]

[0169] That is, by calculating and the dot product of and the ratio of the length of, obtain the projection length of the vector in the direction.

[0170] Among them, in the embodiment of the present application, a preset initial ratio parameter A is set, and Amin = 180.

[0171] Specifically, based on the angle between the rotation axis direction vector and the second vector and the projection length, calculate the ratio parameter corresponding to each second candidate model vertex, which can be calculated according to the following ratio calculation formula:

[0172]

[0173] Among them, θ is the angle between the vector and is in the The projected length in the [direction], Sfactor is the sensitivity coefficient. The smaller this coefficient is, In the greater the influence on the projected distance comparison value A in the [direction]. The larger this coefficient is, the smaller the influence on the comparison value A. In the current case, Sfactor can be taken as 50 according to experience.

[0174] Further, compare the ratio parameter A corresponding to the second candidate model vertex with the initial wallpaper parameter Amin. If A < Amin, then record the serial number Ti of the vertex VTi as the new Tb, record A as the new Amin, and calculate the next vertex serial number until all vertex serial numbers in the set T are traversed. Screen out in the vertex set V with the ratio A, and the obtained vector When calculating the distance weighted between the vertex and VTa in the [direction], and the vertex VTb closest to it, to obtain the determined sixth model vertex and its serial number Tb, and look up the set P to obtain the X-axis coordinate Pspinx = P(Tb * 3) and the Z-axis coordinate Pspinz = P(Tb * 3 + 2) of the vertex VTb.

[0175] For example, please refer to Figure 10 , Figure 10 which is a schematic diagram of the application scenario of another method for processing a virtual object model provided by an embodiment of the present application. In Figure 10 , the model vertex VTb is the vertex calculated to be the closest to the obtained vector when calculating the distance weighted between the vertex and VTa in the [direction], and it.

[0176] Finally, correct the tilt vector based on the vertex coordinates of the fifth model vertex and the sixth model vertex to obtain the corrected tilt vector, and correct the rotation axis direction vector based on the tilt vector to obtain the corrected rotation axis direction vector.

[0177] Specifically, the projection correction vector of the fifth model vertex VTa and the sixth model vertex VTb on the XZ plane.

[0178]

[0179] If Pspinz > Ppinz, that is, the coordinate value of VTb on the Z-axis is greater than the coordinate value of VTa on the Z-axis, then the corrected tilt vector can be calculated:

[0180] If Pspinz ≤ Ppinz, that is, the coordinate value of VTb on the Z-axis is less than or equal to the coordinate value of VTa on the Z-axis, then the corrected tilt vector can be calculated:

[0180]

[0181] In some embodiments, the corrected tilt vector can be normalized to ensure that it points from the lower part to the higher part of the Z-axis. At the same time, update according to the corrected tilt vector. Let and normalize

[0182] For example, please refer to Figure 11 , Figure 11 which is a schematic diagram of an application scenario of another method for processing a virtual object model provided by an embodiment of the present application. Figure 11 It shows the updated and

[0183] In some embodiments, the step of "determining the position correction parameter of the candidate rotation center point in the direction of the rotation axis" may include the following operations:

[0184] Determine the position correction parameter of the candidate rotation center point in the direction of the rotation axis corresponding to the corrected rotation axis direction vector.

[0185] 105. Obtain the model faces of the virtual object model, and determine the candidate model face facing the candidate rotation center point from the model faces.

[0186] Specifically, obtain all the model faces of the virtual object model, and record all the model faces in the set F.

[0187] In some embodiments, in order to determine the accurate rotation axis of the virtual object model, the step of "determining the candidate model face facing the candidate rotation center point from the model faces" may include the following operations:

[0188] Determine the model faces adjacent to the candidate model vertices from the model faces to obtain the first candidate model faces;

[0189] Obtain the normal vector of the first candidate model face;

[0190] Based on the normal vector, determine the candidate model face from the first candidate model faces.

[0191] ​Specifically, obtain the faces adjacent to the vertices in set Vc (the set of candidate model vertices) in set F (the set including all model faces) to obtain the first candidate model faces, and store the obtained first candidate model faces in set Fc. Obtain the three-dimensional coordinates of the centers of the faces in set Fc in the order of each face Fc0, Fc1, Fc2... Fci in set Fc, record the X-axis coordinate of the center of face Fci in the 3*i-th position of the floating-point number set Pf, record the Y-axis coordinate in the 3*i + 1-th position of set Pf, and record the Z-axis coordinate in the 3*i + 2-th position of set Pf, where i is the serial number of the face in set Fc.

[0192] Then, obtain the normalized normal vector of face Fci and record it in the i-th position of set NOR, and obtain the area of face Fci and record it in the i-th position of set SA.

[0193] In some embodiments, the step of "determining candidate model faces from the first candidate model faces based on the normal vectors" may include the following operations:

[0194] Obtain a third vector pointing from the candidate rotation center point to the center point of the first candidate model face;

[0195] Calculate the first angle between the third vector and the normal vector;

[0196] Determine the first candidate model faces with the first angle not greater than the preset angle to obtain the candidate model faces.

[0197] Specifically, traverse set Fc, and perform the following operations on the i-th face Fci in the set. Let x = i * 3, y = x + 1, z = y + 1, and obtain the vector pointing from the candidate rotation center point Ctemp to the center point of face Fci That is

[0198]

[0199] Among them, is the third vector pointing from the candidate rotation center point to the center point of the first candidate model face. The coordinates of the candidate rotation center point are: (Pcx, Pcy, Pcz), and the coordinates of the center point of the first candidate model face are: (Pfx, Pfy, Pfz).

[0200] Furthermore, record the vector The three-axis values on the XYZ axes are <<Nx, Ny, Nz>>, and obtain the angle Angle between the current face normal and That is, obtain the first angle.

[0201] Compare the first included angle with a preset angle, which can be: 20° (20° is an empirical value). If Angle is greater than 20°, it is considered that the surface Fci is not facing Ctemp directly and cannot be used as a reference for correcting the position of Ctemp.

[0202] If Angle is less than or equal to 20°, it is considered that the surface Fci is facing Ctemp directly, that is, if and the included angle is less than 20°.

[0203] For example, please refer to Figure 12 , Figure 12 which is a schematic diagram of an application scenario of another method for processing a virtual object model provided by an embodiment of the present application. Figure 12 In , the included angle Angle between the normal vector of the surface Fci and

[0204] 106. Determine the position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model surface, and correct the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model.

[0205] In some embodiments, the step of "determining the position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model surface" may include the following operations:

[0206] Determine the extension point where the normal vector extends along the negative direction to have the same coordinate value as the candidate rotation center point on the first coordinate axis;

[0207] Obtain the fourth vector pointing from the candidate rotation center point to the extension point;

[0208] Calculate the length of the third component of the fourth vector in the direction of the tilt vector;

[0209] Based on the product of the length of the third component and the area, obtain the position correction parameter of the candidate model surface with respect to the candidate rotation center point.

[0210] After determining the candidate model surface used to correct the position of the candidate rotation center point, calculate the cumulative correction value of the surface Fci to the Ctemp position according to the following method:

[0211] First, determine the extension point where the normal vector extends along the negative direction to have the same coordinate value as the candidate rotation center point on the first coordinate axis, and obtain the fourth vector pointing from the candidate rotation center point to the extension point, as follows:

[0212] <<(Pfx – k * Nx - Pcx), 0, (Pfz – k * Nz - Pcz)>>;

[0213] Among them, Pfx refers to the coordinate value of the center point of the candidate model surface Fci on the X-axis, and Pfz refers to the coordinate value of the center point of the candidate model surface Fci on the Z-axis; Nx refers to the projection coordinate value of the directed line segment from the origin (0, 0, 0) to the point with coordinates (Nx, Ny, Nz) on the X-axis, Nz refers to the projection coordinate value of the directed line segment from the origin to the point with coordinates (Nx, Ny, Nz) on the Z-axis, Pcx refers to the coordinate value of the candidate rotation center point on the X-axis, and Pcz refers to the coordinate value of the candidate rotation center point on the Z-axis.

[0214] Among them, k is a preset coefficient, and the calculation formula of k can be:

[0215] k = dy / Ny; where dy refers to the difference in the Y-axis coordinates between the center point of the candidate model surface Fci and the candidate rotation center point Ctemp, and Ny refers to the projection coordinate value of the directed line segment from the origin to the point with coordinates (Nx, Ny, Nz) on the Y-axis.

[0216] Specifically, calculate the length of the third component of the fourth vector in the direction of the tilt vector, and the calculation formula can be as follows:

[0217]

[0218] That is, by calculating the dot product of <<(Pfx – k * Nx - Pcx), 0, (Pfz – k * Nz - Pcz)>> and dividing by the length 1 of to obtain the component dc of this vector in the direction, and obtain the length of the third component.

[0219] For example, please refer to Figure 13 , Figure 13 which is a schematic diagram of the application scenario of another method for processing a virtual object model provided by an embodiment of the present application. If dc > 0, it means that Ctemp points to the positive direction, otherwise it means that Ctemp points to the negative direction.

[0220] Furthermore, calculate the product of the length of the third component and the area to obtain the position correction parameter of the candidate model surface with respect to the candidate rotation center point.

[0221] For example, if the length of the third component corresponding to the candidate model face Fci is dc and the weight coefficient is SAi, the position correction parameter of the candidate model face Fci with respect to the candidate rotation center point is: dc * SAi. Among them, let SAi be the area of the corresponding face Fci, and SAi is used as the weight coefficient and incorporated into the correction value.

[0222] In some embodiments, the step of "obtaining the position correction parameter of the candidate model face with respect to the candidate rotation center point based on the product of the length of the third component and the area" may include the following operations:

[0223] Superimpose the position correction parameters of each candidate model face with respect to the candidate rotation center point to obtain the superimposed position correction parameter;

[0224] Then, the step of "correcting the position of the candidate rotation center point based on the position correction parameter" may include the following operations:

[0225] Calculate the sum of the areas of all candidate model faces to obtain the total area;

[0226] Calculate the ratio of the superimposed position correction parameter to the total area;

[0227] Calculate the sum of the coordinates of the candidate rotation center point and the ratio to obtain the coordinates of the corrected candidate rotation center point.

[0228] In the embodiments of the present application, preset the initial correction value Adj and the total area SAsum of the faces, and initialize the initial correction value Adj and the total area SAsum of the faces. For example, Adj = SAsum = 0 can be set.

[0229] Furthermore, add the product of dc and the weight coefficient SAi to the current cumulative correction value Adj (dc * SAi + Adj) and record the result as the new Adj, and add SAi to the current cumulative area SAsum and record it as the new SAsum, that is, the total area.

[0230] Among them, calculating the ratio of the superimposed position correction parameter to the total area can be:

[0231]

[0232] Specifically, after traversing all the model faces in the set Fc, the position P axis of the steering wheel axis center point finally

[0233]

[0234] Among them, P axis is the position of the corrected candidate rotation center,

[0235] <<Pcx, Pcy, Pcz>> is the initial position of the candidate rotation center. is the corrected tilt vector.

[0236] Specifically, P axis refers to the cumulative correction value weighted by the area of each candidate model surface based on the position of the current Ctemp, which can be corrected axially. The coordinate of P is the position starting from Ctemp and moving axis in the direction by unit distance.

[0237] For example, please refer to Figure 14 , Figure 14 which is a schematic diagram of the application scenario of another method for processing a virtual object model provided by an embodiment of the present application. Figure 13 It shows the effect demonstration of generating a cylinder with the same radius and aligning its axis and inclination angle after obtaining the axis position and inclination angle of various steering wheel models by applying this case.

[0238] In some embodiments, for the virtual object model whose corrected rotation center point is determined, multiple operations can be performed. Then, the method may further include the following steps:

[0239] In response to the rotation operation of the virtual object model, control the virtual object model to rotate based on the corrected rotation center point.

[0240] Among them, the rotation operation refers to the rotation of the virtual object model by the designer through the design software. Specifically, the corrected rotation center point can be used as the center point for the rotation of the virtual object model, and then control the virtual object model to rotate according to the corrected rotation center point, so as to ensure that the rotation surface of the nearly circular virtual object model remains in the same plane during the rotation process and avoid the eccentric movement of the nearly circular virtual object model.

[0241] In some embodiments, for the virtual object model whose corrected rotation center point is determined, model editing operations such as moving and scaling the virtual object model based on the axis and direction can also be performed.

[0242] In some embodiments, if the virtual object model needs to implement a motion animation in the application scenario, after the virtual object model is made, skinning processing can be performed on the virtual object model. By determining the corrected rotation center point of the virtual object model through this solution, obtaining the skeletal model corresponding to the virtual object model, positioning the positions between the model vertices of the virtual object model and the skeletal model based on the corrected rotation center point, and then quickly binding the positioned virtual object model and the skeletal model, the skeletal binding effect of the virtual object model can be improved.

[0243] In this solution, first, the horizontal center coordinates of the model to be calculated are obtained through the relatively regular left and right outer endpoints on the steering wheel grip. Then, a temporary center point is set up, and the distances between each vertex on the model and the temporary center are calculated. Combining with the horizontal coordinates of each vertex on the steering wheel, the vertices whose distances from the temporary center are above a preset threshold and whose horizontal axis coordinates are at a distance from the temporary center above another preset threshold are selected. These vertices are the parts of the vast majority of steering wheels or nearly circular parts that overlap the most with the concentric circle. By using the vertices of these parts to find the inclination vector of the grip in the vertical direction, the direction of the rotation axis perpendicular to the inclination direction can be obtained.

[0244] Furthermore, the faces adjacent to the selected vertices are obtained, and the faces whose included angles between the vectors from the temporary center to the geometric centers of the faces and the normal directions of the faces themselves are within a certain threshold range are selected (it can be considered that these faces are near the true rotation axis). The correction distance of the face to the temporary center point in the inclination direction is obtained by traversing the positions where the normal lines of these selected faces pass through the horizontal axis coordinates of the steering wheel center. Then, the total correction distance of these faces is weighted and accumulated by the area of the faces. Finally, the position of the temporary center point is corrected in the direction perpendicular to the rotation axis and the horizontal coordinate axis by this distance to obtain the position coordinates of the rotation axis.

[0245] An embodiment of the present application discloses a method for processing a virtual object model. The method includes: obtaining the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determining a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on the first coordinate axis, where the shape of the virtual object model in a specified plane is a nearly circular shape; determining a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex; determining candidate model vertices from each model vertex based on the coordinates of the candidate rotation center point and the candidate radius, where the candidate model vertices are the model vertices corresponding to the circle concentric with the candidate rotation center point in the specified plane of the virtual object model; determining the inclination vector of the virtual object model in the specified plane and the direction vector of the rotation axis perpendicular to the inclination vector based on the candidate model vertices to obtain the direction of the rotation axis of the virtual object model; obtaining the model faces of the virtual object model and determining a candidate model face facing the candidate rotation center point from the model faces; determining a position correction parameter of the candidate rotation center point in the direction of the rotation axis based on the normal vector and area of the candidate model face, and correcting the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model. In this way, the accurate axis position and the rotation axis direction of the virtual object model are obtained.

[0246] To facilitate the better implementation of the processing method of the virtual object model provided in the embodiments of the present application, the embodiments of the present application further provide a processing device for the virtual object model based on the above-mentioned processing method of the virtual object model. The meanings of the nouns are the same as those in the above-mentioned processing method of the virtual object model, and the specific implementation details can refer to the descriptions in the method embodiments.

[0247] Please refer to Figure 15 , Figure 15 which is a structural block diagram of a processing device for a virtual object model provided in the embodiments of the present application. The device includes:

[0248] A first acquisition unit 301, configured to acquire the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on the first coordinate axis, where the shape of the virtual object model on a specified plane is nearly circular;

[0249] A first determination unit 302, configured to determine a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex;

[0250] A second determination unit 303, configured to determine candidate model vertices from the respective model vertices based on the coordinates of the candidate rotation center point and the candidate radius, where the candidate model vertices are the model vertices corresponding to the circle coaxial with the candidate rotation center point of the virtual object model on the specified plane;

[0251] A third determination unit 304, configured to determine an inclination vector of the virtual object model on the specified plane and a rotation axis direction vector perpendicular to the inclination vector based on the candidate model vertices, to obtain the rotation axis direction of the virtual object model;

[0252] A second acquisition unit 305, configured to acquire the model faces of the virtual object model and determine a candidate model face facing the candidate rotation center point from the model faces;

[0253] A fourth determination unit 306, configured to determine a position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model face, and correct the position of the candidate rotation center point based on the position correction parameter to obtain a corrected rotation center point of the virtual object model.

[0254] In some embodiments, the second determination unit 303 may include:

[0255] A first calculation subunit, configured to calculate a first distance between each model vertex and the candidate rotation center point according to the vertex coordinates of each model vertex and the coordinates of the candidate rotation center point;

[0256] A first determination subunit, configured to determine, from each of the model vertices, a first candidate model vertex whose first distance is greater than a first distance threshold, where the first distance threshold is determined based on the candidate radius;

[0257] A second determination subunit, configured to determine, from the first candidate model vertices, model vertices that are greater than a first coordinate threshold or less than a second coordinate threshold on the first coordinate axis, to obtain the candidate model vertices, where the first coordinate threshold is determined based on the coordinate value of the first model vertex on the first coordinate axis, and the second coordinate threshold is determined based on the coordinate value of the second model vertex on the first coordinate axis.

[0258] In some embodiments, the apparatus may further include:

[0259] A first calculation unit, configured to obtain a preset distance coefficient, calculate a product of the preset distance coefficient and the candidate radius, to obtain the first distance threshold;

[0260] A second calculation unit, configured to obtain a preset coordinate floating value, calculate a difference between the coordinate value of the first model vertex on the first coordinate axis and the preset coordinate floating value, to obtain the first coordinate threshold;

[0261] A third calculation unit, configured to calculate a difference between the coordinate value of the second model vertex on the first coordinate axis and the preset coordinate floating value, to obtain the second coordinate threshold.

[0262] In some embodiments, the third determination unit 304 may include:

[0263] A third determination subunit, configured to determine, from the candidate model vertices, a third model vertex with the largest coordinate value and a fourth model vertex with the smallest coordinate value on the second coordinate axis;

[0264] A fourth determination subunit, configured to determine a vector pointing from the fourth model vertex to the third model vertex based on the vertex coordinates of the third model vertex and the fourth model vertex, to obtain the tilt vector;

[0265] A second calculation subunit, configured to calculate a perpendicular vector of the tilt vector in a direction perpendicular to the specified plane, to obtain the rotation axis direction vector.

[0266] In some embodiments, the apparatus may further include:

[0267] A fourth determination unit, configured to determine a first vector from the candidate rotation center point to each candidate model vertex;

[0268] A fourth calculation unit, configured to calculate a weighted distance from the candidate rotation center point to each candidate model vertex based on the first vector, the tilt vector, and the rotation axis direction vector;

[0269] A fifth determination unit, configured to determine a candidate model vertex with the maximum weighted distance to obtain a fifth model vertex;

[0270] A third acquisition unit, configured to acquire a model vertex on the second coordinate axis and on the other side of the candidate rotation center point with respect to the fifth model vertex to obtain a sixth model vertex;

[0271] A correction unit, configured to correct the tilt vector based on the vertex coordinates of the fifth model vertex and the sixth model vertex to obtain a corrected tilt vector, and correct the rotation axis direction vector based on the tilt vector to obtain a corrected rotation axis direction vector.

[0272] In some embodiments, the fourth determination unit 306 may include:

[0273] A fifth determination subunit, configured to determine a position correction parameter of the candidate rotation center point in the rotation axis direction corresponding to the corrected rotation axis direction vector.

[0274] In some embodiments, the fourth calculation unit may include:

[0275] A third calculation subunit, configured to calculate a length of a first component of the first vector in the direction of the tilt vector based on the first vector and the tilt vector;

[0276] A fourth calculation subunit, configured to calculate a length of a second component of the first vector in the direction of the rotation axis direction vector based on the first vector and the rotation axis direction vector;

[0277] A fifth calculation subunit, configured to calculate a weighted distance from the candidate rotation center point to each candidate model vertex based on the length of the first component and the length of the second component.

[0278] In some embodiments, the fifth calculation subunit may specifically be configured to:

[0279] Calculate a product of the length of the first component and a preset weight coefficient to obtain a weighted component length;

[0280] Calculate a sum value of the weighted component length and the length of the second component to obtain the weighted distance.

[0281] In some embodiments, the third acquisition unit may include:

[0282] A sixth determination subunit, configured to determine, from the candidate model vertices, the model vertices whose coordinate values on the second coordinate axis are greater than those of the candidate rotation center, so as to obtain second candidate model vertices;

[0283] A sixth calculation subunit, configured to calculate a second vector from the second candidate model vertex to the fifth model vertex;

[0284] A seventh calculation subunit, configured to calculate the projection length of the second vector in the direction of the tilt vector;

[0285] A seventh determination subunit, configured to calculate a ratio parameter corresponding to each second candidate model vertex based on the angle between the rotation axis direction vector and the second vector and the projection length;

[0286] An eighth determination subunit, configured to determine the sixth model vertex based on the model vertex with the smallest ratio parameter.

[0287] In some embodiments, the second acquisition unit 305 may include:

[0288] A ninth determination subunit, configured to determine, from the model faces, the model faces adjacent to the candidate model vertices, so as to obtain first candidate model faces;

[0289] An acquisition subunit, configured to acquire the normal vector of the first candidate model face;

[0290] A tenth determination subunit, configured to determine the candidate model face from the first candidate model faces based on the normal vector.

[0291] In some embodiments, the tenth determination subunit may specifically be configured to:

[0292] Acquire a third vector from the candidate rotation center point to the center point of the first candidate model face;

[0293] Calculate a first angle between the third vector and the normal vector;

[0294] Determine the first candidate model face whose first angle is not greater than a preset angle, so as to obtain the candidate model face.

[0295] In some embodiments, the fourth determination unit 306 may include:

[0296] A tenth determination subunit, configured to determine an extension point where the normal vector extends in the negative direction and has the same coordinate value on the first coordinate axis as the candidate rotation center point;

[0297] A second obtaining subunit, configured to obtain a fourth vector pointing from the candidate rotation center point to the extension point;

[0298] A seventh calculating subunit, configured to calculate a length of a third component of the fourth vector in the direction of the inclination vector;

[0299] A third obtaining subunit, configured to obtain a position correction parameter of the candidate model facing the candidate rotation center point based on a product of the length of the third component and the area.

[0300] In some embodiments, the third obtaining subunit may specifically be configured to:

[0301] Superimpose the position correction parameters of each candidate model facing the candidate rotation center point to obtain a superimposed position correction parameter.

[0302] In some embodiments, the fourth determining unit 306 may include:

[0303] An eighth calculating subunit, configured to calculate a sum of areas of all candidate model faces to obtain a total area;

[0304] A ninth calculating subunit, configured to calculate a ratio of the superimposed position correction parameter to the total area;

[0305] A tenth calculating subunit, configured to calculate a sum value of the coordinates of the candidate rotation center point and the ratio to obtain coordinates of a corrected candidate rotation center point.

[0306] In some embodiments, the first determining unit 302 may include:

[0307] A fourth obtaining subunit, configured to obtain first coordinate values of the vertex coordinates of the first model vertex on each coordinate axis, and second coordinate values of the vertex coordinates of the second model vertex on each coordinate axis;

[0308] An eleventh calculating subunit, configured to calculate an average value of the first coordinate value and the second coordinate value on the same coordinate axis to obtain a third coordinate value on each coordinate axis;

[0309] An eleventh determining subunit, configured to determine the candidate rotation center based on positions corresponding to the third coordinate values on each coordinate axis;

[0310] A twelfth determining subunit, configured to obtain the candidate radius based on a value corresponding to the third coordinate value on the first coordinate axis.

[0311] In some embodiments, the apparatus may further include:

[0312] A control unit, configured to control the virtual object model to rotate based on the corrected rotation center point in response to a rotation operation of the virtual object model.

[0313] An embodiment of the present application discloses a processing device for a virtual object model. The first acquisition unit 301 acquires the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determines a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on the first coordinate axis, where the shape of the virtual object model in a specified plane is approximately circular; the first determination unit 302 determines a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex; the second determination unit 303 determines candidate model vertices from the respective model vertices based on the coordinates of the candidate rotation center point and the candidate radius, where the candidate model vertices are the model vertices corresponding to the circle coaxial with the candidate rotation center point in the specified plane of the virtual object model; the third determination unit 304 determines an inclination vector of the virtual object model in the specified plane and a rotation axis direction vector perpendicular to the inclination vector based on the candidate model vertices, to obtain the rotation axis direction of the virtual object model; the second acquisition unit 305 acquires the model faces of the virtual object model, and determines a candidate model face facing the candidate rotation center point from the model faces; the fourth determination unit 306 determines a position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model face, and corrects the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model. In this way, an accurate axis position and rotation axis direction of the virtual object model are obtained.

[0314] Correspondingly, an embodiment of the present application further provides a computer device, which may be a terminal. As Figure 16 shown, Figure 16 is a schematic structural diagram of the computer device provided by the embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored on the memory 502 and executable on the processor. Among them, the processor 501 is electrically connected to the memory 502. Those skilled in the art can understand that the structure of the computer device shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine some components, or arrange different components.

[0315] The processor 501 is the control center of the computer device 500, connecting various parts of the entire computer device 500 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 502, and invoking data stored in the memory 502, it executes various functions of the computer device 500 and processes data, thereby monitoring the entire computer device 500.

[0316] In the embodiments of the present application, the processor 501 in the computer device 500 will load the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:

[0317] Obtain the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine the first model vertex with the largest coordinate value and the second model vertex with the smallest coordinate value on the first coordinate axis, where the shape of the virtual object model on a specified plane is nearly circular;

[0318] Determine the candidate rotation center point and candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex;

[0319] Based on the coordinates of the candidate rotation center point and the candidate radius, determine candidate model vertices from each model vertex, where the candidate model vertices are the model vertices corresponding to the circle with the same axis as the candidate rotation center point on the specified plane of the virtual object model;

[0320] Based on the candidate model vertices, determine the inclination vector of the virtual object model on the specified plane and the rotation axis direction vector perpendicular to the inclination vector to obtain the rotation axis direction of the virtual object model;

[0321] Obtain the model surface of the virtual object model, and determine the candidate model surface facing the candidate rotation center point from the model surface;

[0322] Based on the normal vector and area of the candidate model surface, determine the position correction parameter of the candidate rotation center point in the rotation axis direction, and correct the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model.

[0323] In some embodiments, determining candidate model vertices from each model vertex based on the coordinates of the candidate rotation center point and the candidate radius includes:

[0324] Calculate the first distance between each model vertex and the candidate rotation center point according to the vertex coordinates of each model vertex and the coordinates of the candidate rotation center point;

[0325] Determine first candidate model vertices among all model vertices whose first distance is greater than a first distance threshold, where the first distance threshold is determined based on a candidate radius;

[0326] Determine model vertices among the first candidate model vertices that are greater than a first coordinate threshold or less than a second coordinate threshold on a first coordinate axis to obtain candidate model vertices, where the first coordinate threshold is determined based on the coordinate value of a first model vertex on the first coordinate axis, and the second coordinate threshold is determined based on the coordinate value of a second model vertex on the first coordinate axis.

[0327] In some embodiments, it further includes:

[0328] Obtain a preset distance coefficient, calculate the product of the preset distance coefficient and the candidate radius to obtain the first distance threshold;

[0329] Obtain a preset coordinate floating value, calculate the difference between the coordinate value of the first model vertex on the first coordinate axis and the preset coordinate floating value to obtain the first coordinate threshold;

[0330] Calculate the sum of the coordinate value of the second model vertex on the first coordinate axis and the preset coordinate floating value to obtain the second coordinate threshold.

[0331] In some embodiments, the specified plane is the plane formed by the first coordinate axis and the second coordinate axis;

[0332] Based on the candidate model vertices, determine the tilt vector of the virtual object model in the specified plane and the rotation axis direction vector perpendicular to the tilt vector, including:

[0333] Determine a third model vertex with the largest coordinate value and a fourth model vertex with the smallest coordinate value on the second coordinate axis among the candidate model vertices;

[0334] Based on the vertex coordinates of the third model vertex and the fourth model vertex, determine the vector pointing from the fourth model vertex to the third model vertex to obtain the tilt vector;

[0335] Calculate the perpendicular vector of the tilt vector in the direction perpendicular to the specified plane to obtain the rotation axis direction vector.

[0336] In some embodiments, before determining the position correction parameter of the candidate rotation center point in the rotation axis direction, the method further includes:

[0337] Determine the first vectors pointing from the candidate rotation center point to each candidate model vertex;

[0338] Based on the first vectors, the tilt vector, and the rotation axis direction vector, calculate the weighted distances from the candidate rotation center point to each candidate model vertex;

[0339] Determine the candidate model vertex with the largest weighted distance to obtain the fifth model vertex;

[0340] Obtain the model vertex on the second coordinate axis that is on the other side of the candidate rotation center point from the fifth model vertex to obtain the sixth model vertex;

[0341] Based on the vertex coordinates of the fifth model vertex and the sixth model vertex, correct the tilt vector to obtain the corrected tilt vector, and based on the tilt vector, correct the rotation axis direction vector to obtain the corrected rotation axis direction vector;

[0342] Determine the position correction parameter of the candidate rotation center point in the direction of the rotation axis, including:

[0343] Determine the position correction parameter of the candidate rotation center point in the direction of the rotation axis corresponding to the corrected rotation axis direction vector.

[0344] In some embodiments, based on the first vector, the tilt vector, and the rotation axis direction vector, calculate the weighted distance from the candidate rotation center point to each candidate model vertex, including:

[0345] Based on the first vector and the tilt vector, calculate the length of the first component of the first vector in the direction of the tilt vector;

[0346] Based on the first vector and the rotation axis direction vector, calculate the length of the second component of the first vector in the direction of the rotation axis direction vector;

[0347] Based on the length of the first component and the length of the second component, calculate the weighted distance from the candidate rotation center point to each candidate model vertex.

[0348] In some embodiments, based on the length of the first component and the length of the second component, calculate the weighted distance from the candidate rotation center point to each candidate model vertex, including:

[0349] Calculate the product of the length of the first component and the preset weight coefficient to obtain the weighted length of the component;

[0350] Calculate the sum value of the weighted length of the component and the length of the second component to obtain the weighted distance.

[0351] In some embodiments, obtain the model vertex on the second coordinate axis that is on the other side of the candidate rotation center point from the fifth model vertex to obtain the sixth model vertex, including:

[0352] Determine, from the candidate model vertices, the model vertices whose coordinate values on the second coordinate axis are greater than the candidate rotation center to obtain the second candidate model vertices;

[0353] Calculate the second vector from the second candidate model vertex to the fifth model vertex;

[0354] Calculate the projection length of the second vector in the direction of the inclination vector;

[0355] Calculate the ratio parameter corresponding to each second candidate model vertex based on the angle between the rotation axis direction vector and the second vector and the projection length;

[0356] Determine the sixth model vertex based on the model vertex with the minimum ratio parameter.

[0357] In some embodiments, determining the candidate model face facing the candidate rotation center point from the model faces includes:

[0358] Determine the model faces adjacent to the candidate model vertex from the model faces to obtain the first candidate model faces;

[0359] Obtain the normal vector of the first candidate model face;

[0360] Determine the candidate model face from the first candidate model faces based on the normal vector.

[0361] In some embodiments, determining the candidate model face from the first candidate model faces based on the normal vector includes:

[0362] Obtain the third vector from the candidate rotation center point to the center point of the first candidate model face;

[0363] Calculate the first angle between the third vector and the normal vector;

[0364] Determine the first candidate model faces with the first angle not greater than the preset angle to obtain the candidate model faces.

[0365] In some embodiments, determining the position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model face includes:

[0366] Determine the extension point where the normal vector extends along the negative direction to have the same coordinate value on the first coordinate axis as the candidate rotation center point;

[0367] Obtain the fourth vector from the candidate rotation center point to the extension point;

[0368] Calculate the third component length of the fourth vector in the direction of the inclination vector;

[0369] Obtain the position correction parameter of the candidate model face with respect to the candidate rotation center point based on the product of the third component length and the area.

[0370] In some embodiments, obtaining the position correction parameter of the candidate model face with respect to the candidate rotation center point based on the product of the third component length and the area includes:

[0371] Superimpose the position correction parameters of each candidate model with respect to the candidate rotation center point to obtain the superimposed position correction parameters.

[0372] Correct the position of the candidate rotation center point based on the position correction parameters, including:

[0373] Calculate the sum of the areas of all candidate model faces to obtain the total area.

[0374] Calculate the ratio of the superimposed position correction parameters to the total area.

[0375] Calculate the sum of the coordinates of the candidate rotation center point and the ratio to obtain the coordinates of the corrected candidate rotation center point.

[0376] In some embodiments, determining the candidate rotation center point and candidate radius of the virtual object model according to the vertex coordinates of the first model and the second model includes:

[0377] Obtain the first coordinate values of the vertex coordinates of the first model vertices on each coordinate axis, and the second coordinate values of the vertex coordinates of the second model vertices on each coordinate axis.

[0378] Calculate the mean value of the first coordinate value and the second coordinate value on the same coordinate axis to obtain the third coordinate value on each coordinate axis.

[0379] Determine the candidate rotation center based on the positions corresponding to the third coordinate values on each coordinate axis; obtain the candidate radius based on the values corresponding to the third coordinate values on the first coordinate axis.

[0380] In some embodiments, it further includes:

[0381] In response to the rotation operation of the virtual object model, control the virtual object model to rotate based on the corrected rotation center point.

[0382] In the embodiments of the present application, the temporary center point is determined through the coordinates of the left and right vertices of the virtual object model, the distances between each vertex and the temporary center are calculated, and in combination with the horizontal coordinates of each vertex, candidate vertices whose distances from the temporary center are above a preset threshold and whose horizontal axis coordinates are more than another preset threshold from the temporary center are screened out. The inclination vector of the virtual object model in the vertical direction is calculated using the candidate vertices to obtain the rotation axis direction perpendicular to the inclination direction; the candidate model faces adjacent to the screened candidate vertices are obtained, and based on the normal vector and area of the candidate model faces, the correction parameters for the temporary center point of the virtual object model are calculated, and the position of the temporary center point is corrected based on the correction parameters to obtain the rotation axis position coordinates. In this way, the accurate axis position and rotation axis direction of the virtual object model can be obtained.

[0383] For the specific implementation of each of the above operations, reference may be made to the foregoing embodiments and will not be elaborated herein.

[0384] Optionally, as Figure 16 shown, the computer device 500 further includes: a touch display screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. Among them, the processor 501 is electrically connected to the touch display screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507 respectively. Those skilled in the art can understand that Figure 16 the structure of the computer device shown in

[0385] does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0386] The radio frequency circuit 504 can be used to receive and transmit radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and to receive and transmit signals between the network device or other computer devices.

[0387] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and then converted into audio data. After the audio data is output to the processor 501 for processing, it is sent through the radio frequency circuit 504 to, for example, another computer device, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between the peripheral earphone and the computer device.

[0388] The input unit 506 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0389] The power supply 507 is used to supply power to each component of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 507 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0390] Although Figure 16 not shown in the figure, the computer device 500 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.

[0391] In the above embodiments, the descriptions of each embodiment have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0392] As can be seen from the above, the computer device provided in this embodiment can obtain the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on the first coordinate axis, where the shape of the virtual object model on a specified plane is nearly circular; determine the candidate rotation center point and candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex; based on the coordinates of the candidate rotation center point and the candidate radius, determine candidate model vertices from each model vertex, where the candidate model vertices are the model vertices corresponding to the circle with the same axis as the candidate rotation center point in the specified plane of the virtual object model; determine the inclination vector of the virtual object model in the specified plane and the rotation axis direction vector perpendicular to the inclination vector based on the candidate model vertices to obtain the rotation axis direction of the virtual object model; obtain the model faces of the virtual object model, and determine the candidate model face facing the candidate rotation center point from the model faces; determine the position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model face, and correct the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model.

[0393] Those of ordinary skill in the art can understand that all or part of the steps in the above various methods can be completed by instructions or by controlling related hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0394] For this reason, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. These computer programs can be loaded by a processor to execute the steps in any of the virtual object model processing methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:

[0395] Obtain the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on the first coordinate axis, where the shape of the virtual object model on a specified plane is nearly circular;

[0396] Determine the candidate rotation center point and candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex;

[0397] Based on the coordinates of the candidate rotation center point and the candidate radius, determine candidate model vertices from each model vertex, where the candidate model vertices are the model vertices corresponding to the circle with the same axis as the candidate rotation center point in the specified plane of the virtual object model;

[0398] Determine the inclination vector of the virtual object model in the specified plane based on the candidate model vertices, and the rotation axis direction vector perpendicular to the inclination vector, to obtain the rotation axis direction of the virtual object model;

[0399] Obtain the model faces of the virtual object model, and determine the candidate model face facing the candidate rotation center point from the model faces;

[0400] Based on the normal vector and area of the candidate model face, determine the position correction parameter of the candidate rotation center point in the rotation axis direction, and correct the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model.

[0401] In some embodiments, determining candidate model vertices from each model vertex based on the coordinates of the candidate rotation center point and the candidate radius includes:

[0402] According to the vertex coordinates of each model vertex and the coordinates of the candidate rotation center point, calculate the first distance between each model vertex and the candidate rotation center point;

[0403] Determine the first candidate model vertices with the first distance greater than the first distance threshold from each model vertex, where the first distance threshold is determined based on the candidate radius;

[0404] Determine the model vertices greater than the first coordinate threshold or less than the second coordinate threshold on the first coordinate axis from the first candidate model vertices to obtain the candidate model vertices, where the first coordinate threshold is determined based on the coordinate value of the first model vertex on the first coordinate axis, and the second coordinate threshold is determined based on the coordinate value of the second model vertex on the first coordinate axis.

[0405] In some embodiments, it further includes:

[0406] Obtain the preset distance coefficient, calculate the product of the preset distance coefficient and the candidate radius to obtain the first distance threshold;

[0407] Obtain the preset coordinate floating value, calculate the difference between the coordinate value of the first model vertex on the first coordinate axis and the preset coordinate floating value to obtain the first coordinate threshold;

[0408] Calculate the sum of the coordinate value of the second model vertex on the first coordinate axis and the preset coordinate floating value to obtain the second coordinate threshold.

[0409] In some embodiments, the specified plane is the plane formed by the first coordinate axis and the second coordinate axis;

[0410] Determining the inclination vector of the virtual object model in the specified plane based on the candidate model vertices, and the rotation axis direction vector perpendicular to the inclination vector, includes:

[0411] Determine a third model vertex with the largest coordinate value on the second coordinate axis and a fourth model vertex with the smallest coordinate value from among the candidate model vertices;

[0412] Based on the vertex coordinates of the third model vertex and the fourth model vertex, determine a vector pointing from the fourth model vertex to the third model vertex to obtain an inclination vector;

[0413] Calculate a perpendicular vector of the inclination vector in a direction perpendicular to the specified plane to obtain a rotation axis direction vector.

[0414] In some embodiments, before determining the position correction parameter of the candidate rotation center point in the rotation axis direction, the method further includes:

[0415] Determine a first vector pointing from the candidate rotation center point to each candidate model vertex;

[0416] Based on the first vector, the inclination vector, and the rotation axis direction vector, calculate a weighted distance from the candidate rotation center point to each candidate model vertex;

[0417] Determine the candidate model vertex with the largest weighted distance to obtain a fifth model vertex;

[0418] Obtain a model vertex on the second coordinate axis that is on the other side of the candidate rotation center point from the fifth model vertex to obtain a sixth model vertex;

[0419] Based on the vertex coordinates of the fifth model vertex and the sixth model vertex, correct the inclination vector to obtain a corrected inclination vector, and correct the rotation axis direction vector based on the inclination vector to obtain a corrected rotation axis direction vector;

[0420] Determine the position correction parameter of the candidate rotation center point in the rotation axis direction, including:

[0421] Determine the position correction parameter of the candidate rotation center point in the rotation axis direction corresponding to the corrected rotation axis direction vector.

[0422] In some embodiments, based on the first vector, the inclination vector, and the rotation axis direction vector, calculating the weighted distance from the candidate rotation center point to each candidate model vertex includes:

[0423] Based on the first vector and the inclination vector, calculate the length of the first component of the first vector in the direction of the inclination vector;

[0424] Based on the first vector and the rotation axis direction vector, calculate the length of the second component of the first vector in the direction of the rotation axis direction vector;

[0425] Based on the length of the first component and the length of the second component, calculate the weighted distance from the candidate rotation center point to each candidate model vertex.

[0426] In some embodiments, calculating the weighted distances from the candidate rotation center point to each candidate model vertex based on the first component length and the second component length includes:

[0427] Calculating the product of the first component length and a preset weight coefficient to obtain the weighted component length;

[0428] Calculating the sum of the weighted component length and the second component length to obtain the weighted distance.

[0429] In some embodiments, obtaining the model vertex on the other side of the candidate rotation center point from the fifth model vertex on the second coordinate axis to obtain the sixth model vertex includes:

[0430] Determining, from the candidate model vertices, the model vertices whose coordinate values on the second coordinate axis are greater than those of the candidate rotation center to obtain the second candidate model vertices;

[0431] Calculating the second vector from the second candidate model vertex to the fifth model vertex;

[0432] Calculating the projection length of the second vector in the direction of the tilt vector;

[0433] Calculating the ratio parameter corresponding to each second candidate model vertex based on the angle between the rotation axis direction vector and the second vector and the projection length;

[0434] Determining the sixth model vertex based on the model vertex with the smallest ratio parameter.

[0435] In some embodiments, determining the candidate model face facing the candidate rotation center point from the model faces includes:

[0436] Determining, from the model faces, the model faces adjacent to the candidate model vertices to obtain the first candidate model faces;

[0437] Obtaining the normal vector of the first candidate model face;

[0438] Determining the candidate model face from the first candidate model faces based on the normal vector.

[0439] In some embodiments, determining the candidate model face from the first candidate model faces based on the normal vector includes:

[0440] Obtaining the third vector from the candidate rotation center point to the center point of the first candidate model face;

[0441] Calculating the first angle between the third vector and the normal vector;

[0442] Determining the first candidate model faces with the first angle not greater than a preset angle to obtain the candidate model face.

[0443] In some embodiments, determining a position correction parameter of a candidate rotation center point in the direction of the rotation axis based on the normal vector and area of a candidate model face includes:

[0444] Determining an extension point where the normal vector extends along the negative direction to have the same coordinate value on the first coordinate axis as the candidate rotation center point;

[0445] Obtaining a fourth vector pointing from the candidate rotation center point to the extension point;

[0446] Calculating the length of the third component of the fourth vector in the direction of the tilt vector;

[0447] Based on the product of the length of the third component and the area, obtaining the position correction parameter of the candidate model face with respect to the candidate rotation center point.

[0448] In some embodiments, obtaining the position correction parameter of the candidate model face with respect to the candidate rotation center point based on the product of the length of the third component and the area includes:

[0449] Superimposing the position correction parameters of each candidate model face with respect to the candidate rotation center point to obtain the superimposed position correction parameter;

[0450] Correcting the position of the candidate rotation center point based on the position correction parameter includes:

[0451] Calculating the sum of the areas of all candidate model faces to obtain the total area;

[0452] Calculating the ratio of the superimposed position correction parameter to the total area;

[0453] Calculating the sum of the coordinates of the candidate rotation center point and the ratio to obtain the coordinates of the corrected candidate rotation center point.

[0454] In some embodiments, determining a candidate rotation center point and a candidate radius of a virtual object model according to the vertex coordinates of a first model vertex and a second model vertex includes:

[0455] Obtaining first coordinate values on each coordinate axis in the vertex coordinates of the first model vertex, and second coordinate values on each coordinate axis in the vertex coordinates of the second model vertex;

[0456] Calculating the mean value of the first coordinate value and the second coordinate value on the same coordinate axis to obtain a third coordinate value on each coordinate axis;

[0457] Determining a candidate rotation center based on the positions corresponding to the third coordinate values on each coordinate axis;

[0458] Obtaining a candidate radius based on the value corresponding to the third coordinate value on the first coordinate axis.

[0459] In some embodiments, it further includes:

[0460] In response to a rotation operation of the virtual object model, control the virtual object model to rotate based on the corrected rotation center point.

[0461] In the embodiments of the present application, the temporary center point is determined by the coordinates of the left and right vertices of the virtual object model, the distances between each vertex and the temporary center are calculated, and in combination with the horizontal coordinates of each vertex, candidate vertices whose distances from the temporary center are above a preset threshold and whose horizontal axis coordinates are more than another preset threshold away from the temporary center are screened out. The inclination vector of the virtual object model in the vertical direction is calculated using the candidate vertices to obtain the direction of the rotation axis perpendicular to the inclination direction; the candidate model faces adjacent to the screened candidate vertices are obtained, and based on the normal vector and area of the candidate model faces, the correction parameter for the temporary center point of the virtual object model is calculated, and the position of the temporary center point is corrected based on the correction parameter to obtain the rotation axis position coordinates. In this way, the accurate axis position and rotation axis direction of the virtual object model can be obtained.

[0462] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated here.

[0463] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.

[0464] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the virtual object model processing methods provided by the embodiments of the present application, the beneficial effects achievable by any of the virtual object model processing methods provided by the embodiments of the present application can be realized. For details, reference may be made to the previous embodiments and will not be elaborated here.

[0465] The above has introduced in detail a virtual object model processing method, device, computer-readable storage medium, and computer device provided by the embodiments of the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, there will be changes in the specific implementation manner and application scope according to the idea of the present application. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A method for processing a virtual object model, characterized in that The method includes: Obtaining the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determining a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on a first coordinate axis, where the shape of the virtual object model in a specified plane is nearly circular; Determining a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex; Based on the coordinates of the candidate rotation center point and the candidate radius, determining candidate model vertices from the respective model vertices, where the candidate model vertices are the model vertices corresponding to the circle coaxial with the candidate rotation center point in the specified plane of the virtual object model; Based on the candidate model vertices, determining an inclination vector of the virtual object model in the specified plane and a rotation axis direction vector perpendicular to the inclination vector to obtain the rotation axis direction of the virtual object model; Obtaining the model faces of the virtual object model and determining a candidate model face facing the candidate rotation center point from the model faces; Based on the normal vector and area of the candidate model face, determining a position correction parameter of the candidate rotation center point in the rotation axis direction, and correcting the position of the candidate rotation center point based on the position correction parameter to obtain the corrected rotation center point of the virtual object model; Wherein, the determining the position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and area of the candidate model face includes: Determining an extension point where the normal vector extends in the negative direction to have the same coordinate value as the candidate rotation center point on the first coordinate axis; Obtaining a fourth vector pointing from the candidate rotation center point to the extension point; Calculating the length of a third component of the fourth vector in the direction of the inclination vector; Based on the product of the length of the third component and the area, obtaining the position correction parameter of the candidate model face with respect to the candidate rotation center point.

2. The method according to claim 1, wherein The determining the candidate model vertices from the respective model vertices based on the coordinates of the candidate rotation center point and the candidate radius includes: Calculating a first distance between each model vertex and the candidate rotation center point according to the vertex coordinates of each model vertex and the coordinates of the candidate rotation center point; Determining first candidate model vertices with a first distance greater than a first distance threshold from the respective model vertices, where the first distance threshold is determined based on the candidate radius; Determining model vertices greater than a first coordinate threshold or less than a second coordinate threshold on the first coordinate axis from the first candidate model vertices to obtain the candidate model vertices, where the first coordinate threshold is determined based on the coordinate value of the first model vertex on the first coordinate axis, and the second coordinate threshold is determined based on the coordinate value of the second model vertex on the first coordinate axis.

3. The method according to claim 2, characterized in that, It further includes: Obtaining a preset distance coefficient, calculating the product of the preset distance coefficient and the candidate radius to obtain the first distance threshold; Obtain a preset coordinate floating value, calculate the difference between the coordinate value of the vertex of the first model on the first coordinate axis and the preset coordinate floating value, and obtain the first coordinate threshold; Calculate the difference between the coordinate value of the vertex of the second model on the first coordinate axis and the preset coordinate floating value, and obtain the second coordinate threshold.

4. The method according to claim 1, wherein The specified plane is the plane formed by the first coordinate axis and the second coordinate axis; The determining the inclination vector of the virtual object model in the specified plane and the rotation axis direction vector perpendicular to the inclination vector based on the candidate model vertices includes: Determine a third model vertex with the largest coordinate value on the second coordinate axis and a fourth model vertex with the smallest coordinate value from the candidate model vertices; Based on the vertex coordinates of the third model vertex and the fourth model vertex, determine the vector pointing from the fourth model vertex to the third model vertex to obtain the inclination vector; Calculate the perpendicular vector of the inclination vector in the direction perpendicular to the specified plane to obtain the rotation axis direction vector.

5. The method according to claim 4, wherein Before determining the position correction parameter of the candidate rotation center point in the rotation axis direction, the method further includes: Determine the first vector pointing from the candidate rotation center point to each candidate model vertex; Based on the first vector, the inclination vector, and the rotation axis direction vector, calculate the weighted distance from the candidate rotation center point to each candidate model vertex; Determine the candidate model vertex with the largest weighted distance to obtain the fifth model vertex; Obtain the model vertex on the second coordinate axis that is on the other side of the candidate rotation center point from the fifth model vertex to obtain the sixth model vertex; Based on the vertex coordinates of the fifth model vertex and the sixth model vertex, correct the inclination vector to obtain the corrected inclination vector, and correct the rotation axis direction vector based on the inclination vector to obtain the corrected rotation axis direction vector; The determining the position correction parameter of the candidate rotation center point in the rotation axis direction includes: Determine the position correction parameter of the candidate rotation center point in the rotation axis direction corresponding to the corrected rotation axis direction vector.

6. The method according to claim 5, characterized in that, The calculating the weighted distance from the candidate rotation center point to each candidate model vertex based on the first vector, the inclination vector, and the rotation axis direction vector includes: Based on the first vector and the inclination vector, calculate the length of the first component of the first vector in the direction of the inclination vector; Based on the first vector and the rotation axis direction vector, calculate the length of the second component of the first vector in the direction of the rotation axis direction vector; Based on the length of the first component and the length of the second component, calculate the weighted distance from the candidate rotation center point to each candidate model vertex.

7. The method according to claim 6, characterized in that, The calculating the weighted distance from the candidate rotation center point to each candidate model vertex based on the length of the first component and the length of the second component includes: Calculate the product of the length of the first component and a preset weight coefficient to obtain the weighted length of the component; Calculate the sum value of the weighted length of the component and the length of the second component to obtain the weighted distance.

8. The method according to claim 5, characterized in that, Obtaining a model vertex on the second coordinate axis that is on the other side of the candidate rotation center point from the fifth model vertex to obtain a sixth model vertex includes: Determining, from the candidate model vertices, model vertices whose coordinate values on the second coordinate axis are greater than those of the candidate rotation center to obtain second candidate model vertices; Calculating a second vector from the second candidate model vertex to the fifth model vertex; Calculating the projection length of the second vector in the direction of the tilt vector; Calculating a ratio parameter corresponding to each second candidate model vertex based on the angle between the rotation axis direction vector and the second vector and the projection length; Determining the sixth model vertex based on the model vertex with the smallest ratio parameter.

9. The method according to claim 1, wherein Determining, from the model faces, a candidate model face facing the candidate rotation center point includes: Determining, from the model faces, model faces adjacent to the candidate model vertices to obtain first candidate model faces; Obtaining the normal vector of the first candidate model face; Determining the candidate model face from the first candidate model faces based on the normal vector.

10. The method according to claim 9, characterized in that, Determining the candidate model face from the first candidate model faces based on the normal vector includes: Obtaining a third vector from the candidate rotation center point to the center point of the first candidate model face; Calculating a first angle between the third vector and the normal vector; Determining the first candidate model face whose first angle is not greater than a preset angle to obtain the candidate model face.

11. The method according to claim 1, characterized in that, Obtaining the position correction parameter of the candidate model face with respect to the candidate rotation center point based on the product of the third component length and the area includes: Superimposing the position correction parameters of each candidate model face with respect to the candidate rotation center point to obtain a superimposed position correction parameter; Correcting the position of the candidate rotation center point based on the position correction parameter includes: Calculating the sum of the areas of all candidate model faces to obtain a total area; Calculating the ratio of the superimposed position correction parameter to the total area; Calculating the sum of the coordinates of the candidate rotation center point and the ratio to obtain the coordinates of the corrected candidate rotation center point.

12. The method according to claim 1, wherein Determining the candidate rotation center point and candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex includes: Obtaining the first coordinate values of the vertex coordinates of the first model vertex on each coordinate axis and the second coordinate values of the vertex coordinates of the second model vertex on each coordinate axis; Calculating the mean value of the first coordinate value and the second coordinate value on the same coordinate axis to obtain the third coordinate value on each coordinate axis; Determining the candidate rotation center based on the position corresponding to the third coordinate value on each coordinate axis; Obtaining the candidate radius based on the value corresponding to the third coordinate value on the first coordinate axis.

13. The method according to claim 1, wherein The method further includes: In response to a rotation operation on the virtual object model, controlling the virtual object model to rotate based on the corrected rotation center point.

14. A processing device for a virtual object model, characterized in that, The device includes: A first acquisition unit, configured to acquire the vertex coordinates of each model vertex in the virtual object model, and based on the vertex coordinates, determine a first model vertex with the largest coordinate value and a second model vertex with the smallest coordinate value on a first coordinate axis, where the shape of the virtual object model on a specified plane is a nearly circular shape; A first determination unit, configured to determine a candidate rotation center point and a candidate radius of the virtual object model according to the vertex coordinates of the first model vertex and the second model vertex; A second determination unit, configured to determine candidate model vertices from the respective model vertices based on the coordinates of the candidate rotation center point and the candidate radius, where the candidate model vertices are the model vertices corresponding to the circle coaxial with the candidate rotation center point on the specified plane of the virtual object model; A third determination unit, configured to determine an inclination vector of the virtual object model on the specified plane and a rotation axis direction vector perpendicular to the inclination vector based on the candidate model vertices, so as to obtain the rotation axis direction of the virtual object model; A second acquisition unit, configured to acquire the model faces of the virtual object model and determine a candidate model face facing the candidate rotation center point from the model faces; A fourth determination unit, configured to determine a position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and the area of the candidate model face, and correct the position of the candidate rotation center point based on the position correction parameter to obtain a corrected rotation center point of the virtual object model; Wherein, the determining the position correction parameter of the candidate rotation center point in the rotation axis direction based on the normal vector and the area of the candidate model face includes: Determining an extension point where the normal vector extends in the negative direction to have the same coordinate value on the first coordinate axis as the candidate rotation center point; Acquiring a fourth vector pointing from the candidate rotation center point to the extension point; Calculating a third component length of the fourth vector in the direction of the inclination vector; Based on the product of the third component length and the area, obtaining the position correction parameter of the candidate model face with respect to the candidate rotation center point.

15. A computer device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein, When the processor executes the program, it implements the processing method of the virtual object model according to any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the processing method of the virtual object model according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Self-adaption deformation method for three-dimensional model

    CN107798734A

  • Crankshaft animation model binding method, device and equipment based on Maya software

    CN114241095A