Method and device for rotating 3D clothing accessory model and electronic equipment
By pre-rotating and calculating the 3D mesh of the 3D garment accessory model, the problem of chaotic model orientation in garment design software was solved, achieving controllability of orientation and improving simulation effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LINGDI (ZHEJIANG) TECHNOLOGY CO LTD
- Filing Date
- 2024-10-16
- Publication Date
- 2026-04-17
AI Technical Summary
In clothing design software, the orientation of clothing accessory models is often chaotic and difficult to adjust, leading to display abnormalities such as misfitting, asymmetry, and incorrect orientation.
By pre-rotating the 3D mesh of the 3D garment accessory model, the orientation and position in 3D space after rotation are calculated. The orientation of the model is adjusted using a rotation matrix, and an automatic leveling function is provided to achieve a front view.
This achieves controllability and flexibility in the orientation of clothing accessory models, improving the simulation effect and efficiency of clothing modeling.
Smart Images

Figure CN121883776A_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a method, apparatus and electronic device for rotating a 3D clothing accessory model. Background Technology
[0002] Many garment accessories are often used in clothing design, such as buttons, buttonholes, topstitching, and zippers.
[0003] These garment accessories are typically loaded into service modeling software as .obj models, and the 3D garment accessory models are displayed through simulation during the garment design process.
[0004] However, in service modeling software, the orientation of clothing accessory models is often chaotic and difficult to adjust, which leads to display abnormalities (misfitting, asymmetry, incorrect orientation, etc.) when adding 3D clothing accessories to 3D clothing. Summary of the Invention
[0005] This specification provides a method, apparatus, and electronic device for rotating a 3D garment accessory model, which solves the problem of the inability to adjust the orientation of the 3D garment accessory model.
[0006] According to a first aspect of the embodiments of this specification, a method for rotating a 3D garment accessory model is provided, the method comprising:
[0007] Displays a rotatable 3D model of clothing accessories;
[0008] In response to a rotation operation on the 3D garment accessory model, the three-dimensional mesh of the 3D garment accessory model is pre-rotated;
[0009] Based on the mesh data of the three-dimensional mesh, calculate the rotated three-dimensional spatial orientation and three-dimensional spatial position;
[0010] The rotated 3D clothing accessory model is displayed based on the three-dimensional spatial orientation and three-dimensional spatial position.
[0011] Optionally, the rotation operation includes setting rotation parameters;
[0012] The pre-rotation of the 3D mesh of the 3D garment accessory model in response to a rotation operation on the 3D garment accessory model includes:
[0013] In response to the setting operation of the rotation parameters for the 3D garment accessory model, the set rotation parameters are obtained;
[0014] Based on the original three-dimensional mesh of the 3D clothing accessory model, the rotation parameters are superimposed to obtain a pre-rotated three-dimensional mesh.
[0015] Optionally, calculating the rotated three-dimensional spatial orientation and three-dimensional spatial position based on the mesh data of the three-dimensional mesh includes:
[0016] Using the center of the 3D garment accessory model as the rotation center, the 3D garment accessory model is rotated according to the rotation parameters to obtain the rotation matrix;
[0017] Based on the original 3D mesh data and the rotation matrix, calculate the 3D spatial orientation and 3D spatial position after rotation.
[0018] Optionally, the rotation parameters include at least one of the rotation angles of the X-axis, Y-axis, and Z-axis.
[0019] Optionally, the method further includes:
[0020] In response to a trigger operation that automatically levels the 3D garment accessory model, the 3D garment accessory model is rotated to the front view of the 3D garment accessory model.
[0021] Optionally, rotating the 3D garment accessory model to the front view of the 3D garment accessory model includes:
[0022] The orientation of the 3D garment accessory is pre-rotated to the front view, and a three-dimensional mesh is obtained under the front view;
[0023] Construct a directed bounding box with the smallest possible volume to enclose the 3D garment accessory model; wherein the principal axis of the three axes of the directed bounding box is aligned with the orientation of the 3D garment accessory model;
[0024] Calculate the rotation angles required to align the three axes of the directed bounding box with the three-dimensional coordinate axes of the 3D clothing accessory model in the three-dimensional space, and construct a rotation matrix based on the rotation angles of the three axes; wherein, the principal axis of the three axes is aligned with the X-axis of the three-dimensional left coordinate axis;
[0025] Calculate the rotated three-dimensional spatial position based on the original three-dimensional mesh data and the rotation matrix;
[0026] The 3D clothing accessory model is displayed in a front view based on the three-dimensional spatial position.
[0027] Optionally, displaying the rotated 3D garment accessory model based on the three-dimensional spatial orientation and three-dimensional spatial position includes:
[0028] The 3D garment accessory model is rotated to the three-dimensional spatial orientation and position until the three-dimensional spatial orientation and position are achieved.
[0029] Optionally, the 3D garment accessory model includes at least one of the following: New York model, buttonhole model, visible stitching model, and zipper model.
[0030] According to a second aspect of the embodiments of this specification, a rotating device for a 3D garment accessory model is provided, the device comprising:
[0031] The display unit shows a rotatable 3D model of clothing accessories;
[0032] A response unit, in response to a rotation operation on the 3D garment accessory model, pre-rotates the three-dimensional mesh of the 3D garment accessory model;
[0033] The calculation unit calculates the three-dimensional spatial orientation and three-dimensional spatial position based on the mesh data of the three-dimensional mesh;
[0034] The rotation unit displays the rotated 3D garment accessory model based on the three-dimensional spatial orientation and three-dimensional spatial position.
[0035] Optionally, the rotation operation includes setting rotation parameters;
[0036] The response unit further includes responding to the setting operation of rotation parameters for the 3D garment accessory model, acquiring the set rotation parameters, and superimposing the rotation parameters on the original three-dimensional mesh of the 3D garment accessory model to obtain a pre-rotated three-dimensional mesh.
[0037] Optionally, the calculation unit further includes using the center of the 3D garment accessory model as the rotation center, rotating the 3D garment accessory model according to the rotation parameters to obtain a rotation matrix; and calculating the 3D spatial orientation and 3D spatial position after rotation based on the mesh data of the original 3D mesh and the rotation matrix.
[0038] Optionally, the rotation parameters include at least one of the rotation angles of the X-axis, Y-axis, and Z-axis.
[0039] Optionally, the device further includes:
[0040] The leveling unit, in response to a trigger operation for automatic leveling of the 3D garment accessory model, rotates the 3D garment accessory model to the front view of the 3D garment accessory model.
[0041] Optionally, the leveling unit further includes:
[0042] The pre-rotation sub-unit pre-rotates the orientation of the 3D garment accessory to the front view and obtains the three-dimensional mesh under the front view;
[0043] Construct a sub-unit to create a directed bounding box that minimizes the volume of the 3D garment accessory model; wherein the principal axis of the three axes of the directed bounding box is aligned with the orientation of the 3D garment accessory model.
[0044] The first calculation subunit calculates the rotation angles required to align the three axes of the directed bounding box with the three-dimensional coordinate axes of the 3D clothing accessory model in the three-dimensional space, and constructs a rotation matrix based on the rotation angles of the three axes; wherein, the principal axis of the three axes is aligned with the X-axis of the three-dimensional left coordinate axis;
[0045] The second calculation subunit calculates the rotated three-dimensional spatial position based on the original three-dimensional mesh data and the rotation matrix;
[0046] The leveling sub-unit displays the 3D garment accessory model in a front view based on the three-dimensional spatial position.
[0047] Optionally, the rotation unit further includes rotating the 3D garment accessory model toward the three-dimensional spatial orientation and three-dimensional spatial position until the three-dimensional spatial orientation and three-dimensional spatial position are achieved.
[0048] Optionally, the 3D garment accessory model includes at least one of the following: New York model, buttonhole model, visible stitching model, and zipper model.
[0049] According to a third aspect of the embodiments of this specification, an electronic device is provided, comprising:
[0050] processor;
[0051] Memory used to store processor-executable instructions;
[0052] The processor is configured to perform any of the above-mentioned rotation methods for 3D garment accessory models.
[0053] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement any of the above-described methods for rotating a 3D garment accessory model.
[0054] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program that, when executed by a processor, implements the rotation method of any of the above-described 3D clothing accessory models.
[0055] This specification provides an embodiment of a rotation scheme for a 3D garment accessory model. By pre-rotating the three-dimensional mesh of the 3D garment accessory model, the three-dimensional spatial orientation and three-dimensional spatial position after rotation are calculated. Finally, the 3D garment accessory can be rotated to the stated three-dimensional spatial orientation and three-dimensional spatial position, thereby adjusting the orientation of the garment accessory model. Attached Figure Description
[0056] Figure 1 This is a flowchart of a method for rotating a 3D garment accessory model provided in one embodiment of this specification;
[0057] Figure 2 This is a schematic diagram of a zipper model provided in one embodiment of this specification;
[0058] Figure 3 This is a schematic diagram of the user interface of the clothing modeling software provided in one embodiment of this specification;
[0059] Figure 4 This is a schematic diagram of a three-dimensional mesh of a 3D garment accessory model provided in one embodiment of this specification;
[0060] Figure 5 This is a schematic diagram of the rotation of a 3D garment accessory model provided in one embodiment of this specification;
[0061] Figure 6 This is a schematic diagram of an embodiment of the automatic leveling operation provided in this specification;
[0062] Figure 7 This is a schematic diagram of the automatic leveling of a 3D garment accessory model provided in one embodiment of this specification;
[0063] Figure 8 This is a hardware structure diagram of the rotating device for a 3D garment accessory model provided in one embodiment of this specification;
[0064] Figure 9 This is a module of the rotating device for a 3D garment accessory model provided in one embodiment of this specification. Detailed Implementation
[0065] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.
[0066] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0067] It should be understood that although the terms first, second, third, etc., may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0068] In service modeling software, the .obj models of garment accessories generally come from two sources: the first is third-party .obj format models, and the second is data with .obj models generated by Style3D's intelligent conversion feature. However, neither of these sources can guarantee their standardization, resulting in 3D garment accessory models using these materials having incorrect orientations. Therefore, it is necessary to rotate the entire 3D garment accessory model to adjust the modeling effect.
[0069] In related technologies, manipulating OBJ format models typically involves rotating the entire model, which is difficult to achieve the correct orientation. Furthermore, when Style3D software intelligently converts and generates accessories, there is no visual adjustment for the model's "orientation," making subsequent modeling and adjustments difficult when using the 3D garment accessory model.
[0070] To address the aforementioned issues, this specification aims to provide an orientable 3D garment accessory model, allowing users to freely rotate the 3D garment accessory model for better garment modeling and simulation effects.
[0071] The following combination Figure 1 The flowchart shown illustrates a method for rotating a 3D garment accessory model. This method may include the following steps:
[0072] Step 110: Display the 3D clothing accessory model.
[0073] In the process of clothing modeling, various 3D clothing accessory models are used. In order to simulate the actual shape of clothing, the added 3D clothing accessory models need to be in a regular orientation.
[0074] The 3D garment accessory models in this manual may include, but are not limited to, New York models, buttonhole models, visible stitching models, zipper models, etc.
[0075] In some embodiments, more complex 3D garment accessory models can be further subdivided into several accessory sub-models. For example, a zipper model can further include zipper tooth models, zipper pull models, zipper tab models, zipper stop models, etc.
[0076] like Figure 2 As shown, the zipper head model on the left is an irregular 3D garment accessory model; it needs to be adjusted into a regular zipper head model like the one on the right during the 3D garment accessory modeling process.
[0077] Clothing modeling usually requires the use of clothing modeling software. Clothing modeling software can load 3D clothing accessory models and add 3D clothing accessory models to 3D clothing during the clothing design process.
[0078] The clothing modeling software described in this manual supports rotation and adjustment of 3D clothing accessory models to meet the orientation requirements of 3D clothing accessory models during clothing design.
[0079] The following is for reference. Figure 3 The diagram shown is a schematic of the user interface of the garment modeling software that supports the rotation of 3D garment accessory models provided in this manual.
[0080] like Figure 3 As shown, the operation interface may include a display area 21 for displaying a 3D garment accessory model, and an adjustment area 22 for adjusting the displayed 3D garment accessory model. The adjustment area 22 may further include several adjustment controls. By setting the parameters related to these adjustment controls, the displayed 3D garment accessory model can be rotated, moved, and leveled.
[0081] like Figure 3 As shown, a scale bar can be displayed in the background map of the display area 21, and the unit of the scale bar can be adjusted by the "scale" control in the adjustment area 22. For example, the default scale bar can be millimeters, or it can be adjusted to different scale units such as feet, centimeters, inches, meters, etc.
[0082] Adjustment area 22 also displays dimensional data related to the 3D garment accessory model. For example... Figure 3 As shown, the 3D garment accessory model has a length of 111.82 mm, a width of 44.71 mm, and a thickness of 10.05 mm.
[0083] The adjustment area 22 may also include an "axis transformation" control for adjusting the three-dimensional coordinate axes in three-dimensional space. For example... Figure 3 The "Axis Conversion" control shown allows you to reverse the X, Y, and Z axes in three-dimensional space; reversing refers to inverting the direction of the coordinate axes.
[0084] The adjustment area 22 may also include a "move" control for moving the 3D garment accessory model. For example... Figure 3Under the "Move" control shown, you can enter relevant movement parameters on the X, Y, and Z axes to move the 3D garment accessory model. For example, entering 10 millimeters in the X-axis will move the 3D garment accessory model 10 millimeters to the right along the X-axis.
[0085] The adjustment area 22 can also include a "rotate" control for rotating the 3D garment accessory model. For example... Figure 3 The "Rotate" control shows how to enter rotation parameters on the X, Y, and Z axes to rotate the 3D garment accessory model. For example, entering 60.35 degrees on the X-axis will rotate the 3D garment accessory model 60.35 degrees clockwise along the X-axis.
[0086] In addition, such as Figure 3 As shown, the "Rotate" control can also include an "Auto-adjust Rotation" button. By clicking "Auto-adjust Rotation", the 3D garment accessory model can be automatically leveled, that is, adjusted to the front view of the 3D garment accessory model.
[0087] Step 120: In response to a rotation operation on the 3D garment accessory model, pre-rotate the 3D mesh of the 3D garment accessory model.
[0088] The three-dimensional mesh can serve as the basic data required for the subsequent rotation of the 3D garment accessory model. Since the rotation of the 3D garment accessory model is essentially the vertices of the rotation of the three-dimensional mesh, the mesh data of the three-dimensional mesh obtained by pre-rotation is used to calculate the three-dimensional spatial orientation and three-dimensional spatial position after rotation to complete the 3D garment accessory model.
[0089] like Figure 4 As shown, the 3D mesh can be a 3D mesh generated during the simulation of 3D clothing accessories. The 3D clothing accessory model is obtained by rendering physical textures and other techniques on the basis of the 3D mesh.
[0090] like Figure 3 As described above, when the user enters the relevant rotation parameters in the adjustment area 22 and clicks the "OK" button, the software will perform relevant processing based on the entered rotation parameters, i.e., step 120.
[0091] In one exemplary embodiment, step 120 above may include:
[0092] In response to the setting operation of the rotation parameters for the 3D garment accessory model, the set rotation parameters are obtained;
[0093] Based on the original three-dimensional mesh of the 3D clothing accessory model, the rotation parameters are superimposed to obtain a pre-rotated three-dimensional mesh.
[0094] like Figure 3As shown, the rotation parameters may include at least one of the rotation angles of the X-axis, Y-axis, and Z-axis.
[0095] Step 130: Calculate the rotated three-dimensional spatial orientation and three-dimensional spatial position based on the mesh data of the three-dimensional mesh.
[0096] For example, the center of the 3D garment accessory model can be used as the rotation center, and the 3D garment accessory model can be rotated according to the rotation parameters to obtain a rotation matrix;
[0097] Based on the original 3D mesh data and the rotation matrix, calculate the 3D spatial orientation and 3D spatial position after rotation.
[0098] By using pre-rotation and rotation parameters, the orientation and position of 3D garment accessories can be determined, thereby changing the orientation shape of the 3D garment accessory model.
[0099] Step 140: Display the rotated 3D garment accessory model based on the three-dimensional spatial orientation and three-dimensional spatial position.
[0100] like Figure 5 As shown, this is for a button model placed horizontally ( Figure 5 (See the upper half of the diagram). By filling in 39.00 on the X-axis, 54.00 on the Y-axis, and 20.00 on the Z-axis, the rotation parameters (39.00, 54.00, 20.00) can be obtained. Further, by using the three-dimensional orientation and position obtained in steps 120 and 130 above, the rotated button model can be obtained. Figure 5 (Diagram of the lower middle section).
[0101] In practical applications, there is often a need for automatically leveling 3D garment accessory models during clothing design. This automatic leveling refers to rotating the displayed 3D garment accessory model to the front view of the 3D garment accessory model. Since manual rotation is difficult to achieve accurate leveling, this specification, based on the aforementioned embodiments, also provides embodiments for automatic leveling.
[0102] like Figure 6 The user can trigger the automatic leveling of the displayed 3D clothing accessory model by clicking "Auto Adjust Rotation";
[0103] Furthermore, such as Figure 7 The clothing modeling software shown can respond to a trigger operation that automatically flattens the 3D clothing accessory model, rotating the 3D clothing accessory model to the front view orientation.
[0104] In an exemplary embodiment, the 3D garment accessory model rotated to a front view may further include:
[0105] The orientation of the 3D garment accessory is pre-rotated to the front view, and a three-dimensional mesh is obtained under the front view;
[0106] Construct a minimum-volume Oriented Bounding Box (OBB) to enclose the 3D garment accessory model; wherein the principal axes of the three axes of the OBB are aligned with the orientation of the 3D garment accessory model.
[0107] Calculate the rotation angles required to align the three axes of the directed bounding box with the three-dimensional coordinate axes of the 3D garment accessory model in the three-dimensional space, and construct a rotation matrix based on the rotation angles of the three axes. This rotation matrix can be used to rotate the 3D garment accessory model. Among the three axes, the principal axis is aligned with the X-axis of the three-dimensional left coordinate axis.
[0108] Calculate the rotated three-dimensional spatial position based on the original three-dimensional mesh data and the rotation matrix;
[0109] The 3D clothing accessory model is displayed in a front view based on the three-dimensional spatial position.
[0110] Similar to the previous embodiments, this embodiment also requires calculating the 3D mesh through pre-rotation. Specifically, the mesh data of the 3D mesh obtained from the pre-rotation front view is used as the basic data. This mesh data is used to construct a directed bounding box for automatically leveling the 3D clothing accessory model. Then, the rotation angles required to align the three axes of the directed bounding box with the 3D coordinate axes of the 3D space where the 3D clothing accessory model is located are calculated. Finally, a rotation matrix is constructed based on the rotation angles of the three axes, thereby automatically leveling the 3D clothing accessory model according to the rotation matrix.
[0111] For example, the process of constructing a directed bounding box can be as follows:
[0112] Vertex data is extracted from the mesh data of the 3D mesh of the 3D clothing accessory model. The vertices define the boundaries of the object, that is, the geometric boundaries of the 3D clothing accessory model can be determined by the vertices.
[0113] The centroid of the 3D clothing accessory model is calculated based on the vertex data. The centroid refers to the geometric center of the object. Specifically, the geometric center of the 3D clothing accessory model is determined by calculating the average value of all vertex data and using this average value as the centroid.
[0114] Based on the centroid and vertex data, the covariance matrix of the vertices is calculated. Each element in the covariance matrix represents the covariance between different coordinates, and the covariance matrix is used to reflect the main distribution direction of the object.
[0115] The covariance matrix is decomposed into eigenvectors and eigenvalues. Eigenvectors represent the axial directions of the object (X-axis, Y-axis, and Z-axis), and the eigenvalues correspond to the length of the object along those axial directions. By analyzing the eigenvalues and eigenvectors of the covariance matrix, the geometric orientation of the object can be found; that is, the axial directions and length values along each axis of the 3D clothing accessory model can be determined using the covariance matrix. Furthermore, the eigenvector corresponding to the largest eigenvalue is generally used as the principal axial direction (e.g., X-axis), the second largest eigenvalue and its corresponding eigenvector define the secondary principal axial direction (e.g., Y-axis), and the smallest eigenvalue and its corresponding eigenvector are used as the final axial direction (e.g., Z-axis).
[0116] For example, the eigenvalue decomposition may include singular value decomposition, that is, by performing singular value decomposition on the covariance matrix, a left singular vector matrix is obtained; the column vectors of this left singular vector matrix (usually the first two or three) represent the main directions of the object, so three eigenvectors are taken as the three basis vectors of the directed bounding box. They respectively represent the three axial directions of the directed bounding box in space.
[0117] Once the axial directions of the directed bounding box are determined, the next step is to find the maximum and minimum boundaries of the 3D garment accessory model along these directions. In the coordinate system of the directed bounding box, calculate the projection of all vertices of the 3D garment accessory model in each axial direction, and find the minimum and maximum values under the projection. The minimum and maximum values can represent the size of the directed bounding box in that axial direction.
[0118] Based on the three axial directions and the projected boundary values, a directed bounding box is finally constructed. The center of this directed bounding box is the centroid calculated above, and the dimension of the directed bounding box in each axial direction is the difference between the calculated projected boundary values. The geometry of the directed bounding box can be defined by its center, axial directions, and dimensions.
[0119] The core of automatic leveling is to align the three axes of the directed bounding box with the three-dimensional coordinate axes of the three-dimensional space where the 3D garment accessory model is located, and to align the principal axis with the X-axis, thereby obtaining the 3D garment accessory model in the front view.
[0120] In summary, by pre-rotating and constructing a rotation matrix, the orientation of the 3D garment accessory model becomes controllable. This allows for flexible control of the model's free rotation via rotation parameters, resulting in a better simulation effect for garment modeling. Furthermore, automatic model leveling improves garment modeling efficiency and facilitates garment design.
[0121] Corresponding to the aforementioned embodiment of the rotation method for 3D garment accessory models, this specification also provides an embodiment of a rotation device for 3D garment accessory models. This device embodiment can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of its device reading the corresponding computer program from non-volatile memory into memory and running it. From a hardware perspective, such as... Figure 8 The diagram shown is a hardware structure diagram of the rotating device of the 3D garment accessory model in this manual, except for... Figure 8 In addition to the processor, network interface, memory, and non-volatile memory shown, the device in the embodiment may also include other hardware depending on the actual communication function, which will not be described in detail here.
[0122] Please see Figure 9 This is a block diagram of a rotating device for a 3D garment accessory model provided in one embodiment of this specification. The device corresponds to... Figure 1 The illustrated embodiment shows that the apparatus includes:
[0123] Display unit 910 displays a rotatable 3D clothing accessory model;
[0124] The response unit 920, in response to a rotation operation on the 3D garment accessory model, pre-rotates the three-dimensional mesh of the 3D garment accessory model.
[0125] The calculation unit 930 calculates the three-dimensional spatial orientation and three-dimensional spatial position based on the mesh data of the three-dimensional mesh.
[0126] The rotation unit 940 displays the rotated 3D garment accessory model based on the three-dimensional spatial orientation and three-dimensional spatial position.
[0127] Optionally, the rotation operation includes setting rotation parameters;
[0128] The response unit 920 further includes responding to the setting operation of rotation parameters for the 3D garment accessory model, acquiring the set rotation parameters; and superimposing the rotation parameters on the original three-dimensional mesh of the 3D garment accessory model to obtain a pre-rotated three-dimensional mesh.
[0129] Optionally, the calculation unit 930 further includes using the center of the 3D garment accessory model as the rotation center, rotating the 3D garment accessory model according to the rotation parameters to obtain a rotation matrix; and calculating the three-dimensional spatial orientation and three-dimensional spatial position after rotation based on the mesh data of the original three-dimensional mesh and the rotation matrix.
[0130] Optionally, the rotation parameters include at least one of the rotation angles of the X-axis, Y-axis, and Z-axis.
[0131] Optionally, the device further includes:
[0132] The leveling unit, in response to a trigger operation for automatic leveling of the 3D garment accessory model, rotates the 3D garment accessory model to the front view of the 3D garment accessory model.
[0133] Optionally, the leveling unit further includes:
[0134] The pre-rotation sub-unit pre-rotates the orientation of the 3D garment accessory to the front view and obtains the three-dimensional mesh under the front view;
[0135] Construct a sub-unit to create a directed bounding box that minimizes the volume of the 3D garment accessory model; wherein the principal axis of the three axes of the directed bounding box is aligned with the orientation of the 3D garment accessory model.
[0136] The first calculation subunit calculates the rotation angles required to align the three axes of the directed bounding box with the three-dimensional coordinate axes of the 3D clothing accessory model in the three-dimensional space, and constructs a rotation matrix based on the rotation angles of the three axes; wherein, the principal axis of the three axes is aligned with the X-axis of the three-dimensional left coordinate axis;
[0137] The second calculation subunit calculates the rotated three-dimensional spatial position based on the original three-dimensional mesh data and the rotation matrix;
[0138] The leveling sub-unit displays the 3D garment accessory model in a front view based on the three-dimensional spatial position.
[0139] Optionally, the rotation unit 940 further includes rotating the 3D garment accessory model toward the three-dimensional spatial orientation and three-dimensional spatial position until the three-dimensional spatial orientation and three-dimensional spatial position are achieved.
[0140] Optionally, the 3D garment accessory model includes at least one of the following: New York model, buttonhole model, visible stitching model, and zipper model.
[0141] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0142] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0143] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0144] above Figure 9 The diagram describes the internal functional modules and structure of the rotating device for a 3D garment accessory model. Its core execution component can be an electronic device, including:
[0145] processor;
[0146] Memory used to store processor-executable instructions;
[0147] The processor is configured to execute an embodiment of the rotation method for any of the above-described 3D garment accessory models.
[0148] In the embodiments of the above-described electronic device, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor, and the aforementioned memory can be read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or solid-state drive. The steps of the method disclosed in the embodiments of this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0149] A computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of a rotation method for any of the 3D garment accessory models described above.
[0150] A computer program product, including a computer program, which, when executed by a processor, implements the steps of the rotation method for any of the above-described 3D garment accessory models.
[0151] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the electronic device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0152] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this specification are indicated by the following claims.
[0153] It should be understood that this specification is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from its scope. The scope of this specification is limited only by the appended claims.
Claims
1. A method for rotating a 3D garment accessory model, characterized in that, The method includes: Displays a rotatable 3D model of clothing accessories; In response to a rotation operation on the 3D garment accessory model, the three-dimensional mesh of the 3D garment accessory model is pre-rotated; Based on the mesh data of the three-dimensional mesh, calculate the rotated three-dimensional spatial orientation and three-dimensional spatial position; The rotated 3D clothing accessory model is displayed based on the three-dimensional spatial orientation and three-dimensional spatial position.
2. The method according to claim 1, characterized in that, The rotation operation includes setting rotation parameters; The pre-rotation of the 3D mesh of the 3D garment accessory model in response to a rotation operation on the 3D garment accessory model includes: In response to the setting operation of the rotation parameters for the 3D garment accessory model, the set rotation parameters are obtained; Based on the original three-dimensional mesh of the 3D clothing accessory model, the rotation parameters are superimposed to obtain a pre-rotated three-dimensional mesh.
3. The method according to claim 2, characterized in that, The step of calculating the rotated 3D spatial orientation and 3D spatial position based on the mesh data of the 3D mesh includes: Using the center of the 3D garment accessory model as the rotation center, the 3D garment accessory model is rotated according to the rotation parameters to obtain the rotation matrix; Based on the original 3D mesh data and the rotation matrix, calculate the 3D spatial orientation and 3D spatial position after rotation.
4. The method according to claim 3, characterized in that, The rotation parameters include at least one of the rotation angles of the X-axis, Y-axis, and Z-axis.
5. The method according to claim 3, characterized in that, The method further includes: In response to a trigger operation that automatically levels the 3D garment accessory model, the 3D garment accessory model is rotated to the front view of the 3D garment accessory model.
6. The method according to claim 5, characterized in that, The step of rotating the 3D garment accessory model to a front view includes: The orientation of the 3D garment accessory is pre-rotated to the front view, and a three-dimensional mesh is obtained under the front view; Construct a directed bounding box with the smallest possible volume to enclose the 3D garment accessory model; wherein the principal axis of the three axes of the directed bounding box is aligned with the orientation of the 3D garment accessory model; Calculate the rotation angles required to align the three axes of the directed bounding box with the three-dimensional coordinate axes of the 3D clothing accessory model in the three-dimensional space, and construct a rotation matrix based on the rotation angles of the three axes; wherein, the principal axis of the three axes is aligned with the X-axis of the three-dimensional left coordinate axis; Calculate the rotated three-dimensional spatial position based on the original three-dimensional mesh data and the rotation matrix; The 3D clothing accessory model is displayed in a front view based on the three-dimensional spatial position.
7. The method according to claim 1, characterized in that, The method of displaying the rotated 3D garment accessory model based on the three-dimensional spatial orientation and three-dimensional spatial position includes: The 3D garment accessory model is rotated to the three-dimensional spatial orientation and position until the three-dimensional spatial orientation and position are achieved.
8. The method according to claim 1, characterized in that, The 3D garment accessory model includes at least one of the following: New York model, buttonhole model, visible stitching model, and zipper model.
9. A rotating device for a 3D garment accessory model, characterized in that, The device includes: The display unit shows a rotatable 3D model of clothing accessories; A response unit, in response to a rotation operation on the 3D garment accessory model, pre-rotates the three-dimensional mesh of the 3D garment accessory model; The calculation unit calculates the three-dimensional spatial orientation and three-dimensional spatial position based on the mesh data of the three-dimensional mesh; The rotation unit displays the rotated 3D garment accessory model based on the three-dimensional spatial orientation and three-dimensional spatial position.
10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method according to any one of claims 1-8.
11. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the method as described in any one of claims 1-8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-8.