Virtual section movement control method, electronic equipment and storage medium
Adjusting the vertex position of the virtual version through stress collision simulation, the problem of poor fitting effect of the virtual version is solved, and better fitting effect and tightness are achieved.
Patent Information
- Application Number
- CN202410011965.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the fitting effect of the virtual version on the virtual model is poor, which can easily lead to gaps and jitters, affecting tightness.
The vertex position coordinates of the virtual plate are adjusted through the force collision simulation, and the plate is deformed according to the simulation results, and the deformed plate is bonded to the specified area.
It improves the fit between the virtual version and the virtual model, reduces gaps and jitters, and improves the tightness of the fit.
Smart Images

Figure CN120257558A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly, to a method for controlling the movement of virtual pattern pieces, an electronic device, and a storage medium. Background Art
[0002] With the continuous development of technology, in the field of clothing design and production, the use of clothing simulation software is becoming more and more widespread. Generally speaking, in the virtual environment constructed by clothing simulation software, by fitting the virtual pattern pieces of clothing onto a virtual model, and then observing its shaking, tightness, etc., the fitting effect of real clothing pattern pieces on the human body can be tested. In this process, it is often necessary to first move the virtual pattern pieces to a position that fits the virtual model. Therefore, how to move the virtual pattern pieces to a position that fits the virtual model is crucial. For example, currently, after selecting the virtual pattern pieces and the virtual model, the virtual pattern pieces are usually directly dragged to the corresponding fitting area on the virtual model, but this method is likely to result in a poor fitting effect of the virtual pattern pieces on the virtual model. Summary of the Invention
[0003] The purpose of the embodiments of this application is to provide a method for controlling the movement of virtual pattern pieces, an electronic device, and a storage medium to solve the problems in the prior art.
[0004] The first aspect of the embodiments of this application provides a method for controlling the movement of virtual pattern pieces, including:
[0005] Performing a force collision simulation between the target virtual pattern piece and a specified fitting area on the virtual model;
[0006] Deforming the target virtual pattern piece according to the result of the force collision simulation;
[0007] Fitting the deformed target virtual pattern piece to the specified fitting area.
[0008] Preferably, the target virtual pattern piece is provided with a plurality of virtual vertices; the virtual model is provided with a virtual collision grid; and,
[0009] Performing a force collision simulation between the target virtual pattern piece and a specified fitting area on the virtual model specifically includes: performing a force collision simulation between at least one virtual vertex of the target virtual pattern piece and the virtual collision grid of the specified fitting area.
[0010] Preferably, the target virtual pattern piece is provided with a plurality of virtual vertices, and the position coordinates of each vertex reflect the shape of the target virtual pattern piece;
[0011] And,
[0012] Deform the target virtual plate according to the result of the force collision simulation, specifically including:
[0013] Adjust the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation, so as to deform the target virtual plate.
[0014] Preferably, adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation specifically includes:
[0015] Adjust the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation and the elastic coefficient of the fabric simulated by the target virtual plate.
[0016] Preferably, adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation specifically includes:
[0017] Determine the candidate position coordinates after deformation of each virtual vertex on the target virtual plate according to the result of the force collision simulation and the elastic coefficient of the fabric simulated by the target virtual plate;
[0018] For each virtual vertex, determine the distance between the candidate position coordinate of the virtual vertex and the position coordinate before deformation, and judge whether the distance is less than or equal to the limit distance;
[0019] If so, adjust the vertex to the candidate position coordinate; or,
[0020] If not, determine the new position coordinate according to the position coordinate before deformation of the virtual vertex and the limit distance, and adjust the vertex to the new position coordinate.
[0021] Preferably, perform a force collision simulation on the specified fitting area between the target virtual plate and the virtual model, specifically including:
[0022] When it is determined that the target virtual plate meets the force deformation condition, perform a force collision simulation on the specified fitting area between the target virtual plate and the virtual model.
[0023] Preferably, the method further includes:
[0024] Determine whether the target virtual plate meets the force deformation condition according to the distance between the target virtual plate and the fitting area, wherein if the distance is less than the preset distance, it is determined that the target virtual plate meets the force deformation condition; or, if the distance is greater than or equal to the preset distance, it is determined that the target virtual plate does not meet the force deformation condition.
[0025] Preferably, before performing a force collision simulation on the target virtual plate piece and the specified fitting area on the virtual model, the method further includes:
[0026] In response to the plate piece selection instruction and the fitting area selection instruction, the target virtual plate piece and the specified fitting area are respectively selected.
[0027] Preferably, the method further includes: obtaining the plate piece selection instruction and the fitting area selection instruction input through the operation interface.
[0028] Preferably, each virtual plate piece is respectively configured with sewing thread data, and the sewing thread data is used to characterize the relative position relationship between the virtual plate pieces; and,
[0029] Before performing a force collision simulation on the target virtual plate piece and the specified fitting area on the virtual model, the method further includes:
[0030] In response to the plate piece selection instruction, the target virtual plate piece is selected;
[0031] Obtain the sewing thread data configured on the target virtual plate piece;
[0032] According to the relative position relationship characterized by the obtained sewing thread data with the virtual plate pieces already fitted on the virtual model, determine the specified fitting area.
[0033] Preferably, after fitting the deformed target virtual plate piece to the specified fitting area, the method further includes:
[0034] According to the fitting position fine-tuning instruction input by the user, fine-tune the fitting position of the target virtual plate piece.
[0035] Preferably, fitting the deformed target virtual plate piece to the specified fitting area specifically includes: fitting the back surface of the deformed target virtual plate piece to the specified fitting area.
[0036] Preferably, fitting the back surface of the deformed target virtual plate piece to the specified fitting area specifically includes:
[0037] When the back surface of the deformed target virtual plate piece faces the virtual model, fit the back surface of the deformed target virtual plate piece to the specified fitting area; or,
[0038] When the back surface of the deformed target virtual plate piece does not face the virtual model, rotate the deformed target virtual plate piece so that its back surface faces the virtual model, and then fit it to the specified fitting area.
[0039] A second aspect of the embodiments of the present application provides an electronic device, including:
[0040] A memory for storing a computer program;
[0041] A processor for executing the method described in any one of the method embodiments of the present application.
[0042] A third aspect of the embodiments of the present application provides a storage medium, including: a program, which when running on an electronic device, enables the electronic device to execute the method described in any one of the method embodiments of the present application.
[0043] The virtual plate movement control method provided by the embodiments of the present application includes performing a force collision simulation on a target virtual plate and a specified fitting area on a virtual model, then deforming the target virtual plate according to the result of the force collision simulation, and then fitting the deformed target virtual plate to the specified fitting area. Since the target virtual plate is deformed according to the result of the force collision simulation before being fitted to the specified fitting area, through this deformation, the deformed target virtual plate can be more adapted to the specified fitting area, making the fitting effect between the two better, thus solving the problems in the prior art. Description of the Drawings
[0044] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.
[0045] Figure 1 A specific structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0046] Figure 2 A specific flowchart of the virtual plate movement control method provided by an embodiment of the present application;
[0047] Figure 3 A specific structural schematic diagram of the virtual plate movement control device provided by an embodiment of the present application. Detailed Embodiments
[0048] The following will describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. In the description of the present application, terms such as "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance or sequence.
[0049] As described above, currently, after selecting a virtual pattern piece and a virtual model, the virtual pattern piece is usually directly dragged onto the corresponding fitting area on the virtual model. However, this method is likely to result in a poor fitting effect of the virtual pattern piece on the virtual model. For example, there are a large number of gaps between the two, which is likely to cause jitter and affect tightness, etc.
[0050] Based on this, the embodiments of the present application provide a method, a device, an electronic device, and a storage medium for controlling the movement of a virtual pattern piece, which can be used to solve the problems in the prior art. As Figure 1 shown in FIG. 1 is an electronic device 1 provided in this embodiment. The electronic device 1 includes: at least one processor 11 and a memory 12. Figure 1 Here, one processor is taken as an example. Among them, the processor 11 and the memory 12 can be connected through a bus 10. The memory 12 stores instructions executable by the processor 11. When the instructions are executed by the processor 11, the electronic device 1 can execute all or part of the processes of the methods in the following embodiments.
[0051] In practical applications, the electronic device 1 can be an electronic device at the user end, such as the user's mobile phone, computer, etc. Of course, the electronic device 1 can also be an electronic device at the server end, such as a server or a server cluster at the server end, etc.
[0052] Generally speaking, a clothing simulation software can be pre-installed on the electronic device 1. Multiple virtual pattern pieces and multiple virtual models are set on the clothing simulation software. In this way, during the clothing design process using the clothing simulation software, in the virtual environment constructed by the clothing simulation software, by fitting the virtual pattern piece of the clothing on the virtual model, the jitter, tightness, etc. can be observed to test the fitting effect of the real clothing pattern piece on the human body. At this time, if the fitting effect is good, the clothing simulation software can be further used for clothing modeling, etc. Of course, if the fitting effect is poor, the virtual pattern piece can be adjusted.
[0053] Of course, in addition to being applicable to clothing simulation software, the method provided by the embodiments of the present application can generally also be applied to similar scenarios. For example, in an electronic game or an animation, this method can also be used to control the movement of virtual pattern pieces on the game page or the animation page. Here, the specific scenarios to which this method can be applied will not be elaborated further. Subsequently, the method will be mainly described by taking the application to clothing simulation software as an example.
[0054] The embodiments of the present application provide a method for controlling the movement of a virtual pattern piece. This method can be executed by Figure 1 the electronic device 1 shown in FIG. 1. As Figure 2 shown in FIG. 2 is a schematic diagram of the specific process of this method. This method includes the following steps:
[0055] Step S21: Perform a force collision simulation on the specified fitting area of the target virtual pattern piece and the virtual model.
[0056] Among them, this force collision simulation can be used to simulate the collision force situation when a real clothing pattern piece is worn on a human body. Since real clothing and clothing pattern pieces are both soft, this collision force can cause the real clothing pattern piece to deform. Thus, in the method provided in the embodiments of the present application, it is precisely through this force collision simulation that this collision force is simulated, and then based on the result of the force collision simulation, the target virtual pattern piece is deformed to fit the specified fitting area on the virtual model. Through this deformation, the deformed target virtual pattern piece can be more suitable for the specified fitting area.
[0057] In practical applications, multiple virtual vertices can be set on the target virtual pattern piece. For example, multiple vertices can be set on the edge of the target virtual pattern piece, or multiple vertices can be evenly set on the surface of the target virtual pattern piece (such as the surface that fits the specified fitting area), or multiple vertices can be evenly set by extending a short distance outward from the surface of the target virtual pattern piece. The position coordinates of these vertices reflect the shape of the target virtual pattern piece. For example, when the position coordinates of a certain vertex change, it can drive the shape of the target virtual pattern piece to change; multiple virtual collision grids can also be set on the virtual model. The virtual collision grids can be directly set on the surface of the virtual model, or a short distance can be extended outward from the surface of the virtual model to generate the multiple virtual collision grids. Thus, for this step S21, the specific implementation method of this force collision simulation can be to perform a force collision simulation between at least one virtual vertex of the target virtual pattern piece and the virtual collision grid of the specified fitting area.
[0058] In addition, for the target virtual pattern piece in this step S21, it can be any one of the virtual pattern pieces in the clothing simulation software, or a selected virtual pattern piece. For example, an operation interface is usually set on the clothing simulation software, and selection controls for each virtual model are configured on this operation interface. At this time, the user can input a selection instruction through the selection control of the virtual model on this operation interface to select a certain virtual model. Thus, the clothing simulation software can load the virtual model selected by the user into the virtual space of the clothing simulation software. Therefore, the virtual model in this step S21 can be a selected virtual model among all the virtual models in the clothing simulation software.
[0059] For example, in clothing design, taking a T-shirt as an example at this time, usually four virtual pattern pieces are required to design a T-shirt, namely a front virtual pattern piece, a back virtual pattern piece, a left sleeve virtual pattern piece, and a right sleeve virtual pattern piece. Therefore, these four virtual pattern pieces need to be attached to a virtual model, including attaching the front virtual pattern piece to the front of the virtual model, attaching the back virtual pattern piece to the back of the virtual model, attaching the left sleeve virtual pattern piece as the left sleeve to the left hand of the virtual model, and attaching the right sleeve virtual pattern piece as the right sleeve to the right hand of the virtual model. In this scenario, these four virtual pattern pieces can be respectively used as target virtual pattern pieces, so that by executing the method provided in the embodiments of the present application, the target virtual pattern pieces can be attached to the corresponding areas on the virtual model; alternatively, any one of these four virtual pattern pieces can be used as the target virtual pattern piece, or a specified virtual pattern piece can be used as the target virtual pattern piece. For example, since the coverage area of the front virtual pattern piece is relatively large, the front virtual pattern piece can be specified as the target virtual pattern piece at this time.
[0060] It should be noted that before performing this step S21, there can be various ways to pre-determine the target virtual pattern piece and the specified attachment area on the virtual model. For example, for the target virtual pattern piece, selection controls for each virtual pattern piece can also be configured on the operation interfaces of clothing simulation software, video games, or animations. At this time, the user can also input a pattern piece selection instruction through the selection control of the virtual pattern piece on the operation interface to select a certain virtual pattern piece as the target virtual pattern piece. Therefore, before the electronic device performs the above step S21, it can also respond to the pattern piece selection instruction to select the virtual pattern piece as the target virtual pattern piece, where the pattern piece selection instruction can be the pattern piece selection instruction input by the user on the operation interface of clothing simulation software, video games, or animations. For example, the electronic device first obtains the pattern piece selection instruction input by the user through the operation interface, and then responds to the pattern piece selection instruction to select the virtual pattern piece as the target virtual pattern piece.
[0061] For the specified attachment area on the virtual model, for example, after the user selects a certain virtual model, and the clothing simulation software loads the virtual model into the virtual space, the user can input an attachment area selection instruction by clicking or touching a certain area on the virtual model with the mouse, so as to select this area as the attachment area, so that before the electronic device performs the above step S21, it can also respond to the attachment area selection instruction to select the specified attachment area, where the attachment area selection instruction can be the attachment area selection instruction input by the user on the operation interface of clothing simulation software, video games, or animations. For example, the electronic device first obtains the attachment area selection instruction input by the user through the operation interface, and then responds to the attachment area selection instruction to select the specified attachment area.
[0062] Therefore, before performing step S21, one way to pre-determine the target virtual pattern piece and the specified bonding area can be to respond to the pattern piece selection instruction and the bonding area selection instruction, so as to respectively select the target virtual pattern piece and the specified bonding area. Specifically, for example, the pattern piece selection instruction and the bonding area selection instruction input by the user through the operation interface can be obtained first, and then, in response to the pattern piece selection instruction and the bonding area selection instruction, the target virtual pattern piece and the specified bonding area can be respectively selected. This method mainly enables the electronic device to respond to the instruction by the user inputting an instruction on the operation interface, so as to select the target virtual pattern piece and the specified bonding area.
[0063] Step S22: Deform the target virtual pattern piece according to the result of the force collision simulation.
[0064] As mentioned above, the force collision simulation can be used to simulate the collision force situation when the real clothing pattern piece is worn on the human body, and multiple virtual vertices are set on the target virtual pattern piece, and the position coordinates of each vertex reflect the shape of the target virtual pattern piece. At this time, for the specific implementation method of this step S22, it can be to adjust the position coordinates of each virtual vertex on the target virtual pattern piece according to the result of the force collision simulation, so as to deform the target virtual pattern piece.
[0065] For example, there are n virtual vertices on the target virtual pattern piece, and the position coordinates of these virtual vertices before deformation are respectively (x1, y1), (x2, y2),..., (xn, yn). In this way, the shape of the target virtual pattern piece before deformation is limited by the position coordinates of these virtual vertices. In this way, in step S22, according to the result of the force collision simulation, the position coordinates of each virtual vertex on the target virtual pattern piece are adjusted to (x1', y1'), (x2', y2'),..., (xn', yn'). For example, after the force collision simulation of the first vertex, it is adjusted from the position coordinate (x1, y1) to the position coordinate (x1', y1'), and after the force collision simulation of the second vertex, it is adjusted from the position coordinate (x2, y2) to the position coordinate (x2', y2')... In this way, since the position coordinates of these virtual vertices change due to the result of the force collision simulation, the deformation of the target virtual pattern piece can be achieved.
[0066] It should be further noted that when the target virtual plate deforms, the amplitude of its deformation, that is, the distance between the position coordinates of the virtual vertex after deformation and the position coordinates of the virtual vertex before deformation, in addition to being affected by the result of the force collision simulation, is usually also related to the elastic coefficient of the fabric simulated by the target virtual plate. For example, if the elastic coefficient is large, it means that the fabric has relatively high elasticity. At this time, when subjected to the same force, the amplitude of its deformation is relatively small. If the elastic coefficient is small, it means that the fabric has relatively low elasticity. At this time, when subjected to the same force, the amplitude of its deformation is relatively large. Therefore, in step S22, when adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation, it may specifically include adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation and the elastic coefficient of the fabric simulated by the target virtual plate.
[0067] For example, for a certain virtual vertex on the target virtual plate, the position coordinates of the virtual vertex are adjusted according to the result of the force collision simulation between the virtual vertex and the virtual collision grid in the specified fitting area, as well as the elastic coefficient of the fabric.
[0068] Among them, there are various ways to determine the elastic coefficient of the fabric simulated by the target virtual plate. For example, for each virtual plate set in the clothing simulation software, the elastic coefficient of the fabric simulated by each virtual plate can be preset in advance, so as to determine the elastic coefficient of the fabric simulated by the target virtual plate. Another way is to first identify the type of the fabric simulated by the target virtual plate, and then obtain the elastic coefficient corresponding to the type of the fabric according to the type of the fabric. It is also possible to obtain the elastic coefficient input by the user as the elastic coefficient of the fabric simulated by the target virtual plate. Of course, there are also other ways to determine the elastic coefficient of the fabric simulated by the target virtual plate, which will not be elaborated here one by one.
[0069] It should be further noted that in practical applications, the limit distance of the position coordinates during deformation can usually be set, so that the change range of the position coordinates during deformation is less than or equal to the limit distance, avoiding excessive deformation. For the specific implementation of adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation and the elastic coefficient of the simulated fabric of the target virtual plate, it can also be to first determine the position coordinates of each virtual vertex on the target virtual plate after deformation according to the result of the force collision simulation and the elastic coefficient of the simulated fabric of the target virtual plate (at this time, the position coordinates of the vertex are not adjusted, so it is called the candidate position coordinates), and then for each virtual vertex, determine the distance between the candidate position coordinates of the virtual vertex and the position coordinates before deformation, and then determine whether the distance is less than or equal to the limit distance. If so, adjust the vertex to the candidate position coordinates for deformation. If not, it means that the distance exceeds the limit distance. Therefore, one processing method can be not to adjust the position coordinates of the vertex, and another processing method can be to determine the new position coordinates according to the position coordinates of the vertex before deformation and the limit distance, and adjust the vertex to the new position coordinates.
[0070] Step S23: Attach the deformed target virtual plate to the specified attachment area.
[0071] After deforming the target virtual plate through the above step S22, the deformed target virtual plate can be obtained. Since the deformation method is realized according to the force collision simulation, the deformed target virtual plate is more suitable for the specified attachment area. In this way, in this step S23, the deformed target virtual plate can be attached to the specified attachment area.
[0072] Adopting the virtual plate movement control method provided by the embodiment of the present application, including performing a force collision simulation on the target virtual plate and the specified attachment area on the virtual model, then deforming the target virtual plate according to the result of the force collision simulation, and then attaching the deformed target virtual plate to the specified attachment area. Since the target virtual plate is deformed according to the result of the force collision simulation before being attached to the specified attachment area, through this deformation, the deformed target virtual plate can be more suitable for the specified attachment area, making the attachment effect between the two better, thus solving the problems in the prior art.
[0073] In step S21 mentioned above, before executing step S21, there are various ways to pre-determine the target virtual pattern piece and the specified fitting area on the virtual model. It is also specifically described that the target virtual pattern piece and the specified fitting area can be selected according to the pattern piece selection instruction and the fitting area selection instruction input by the user on the operation interface of the clothing simulation software. This method is mainly achieved by the user inputting instructions on the operation interface. Of course, in practical applications, there can be other ways to determine the target virtual pattern piece and the specified fitting area. In particular, in practical applications, multiple different modes can be set in the clothing simulation software, and different methods are used to implement in different modes. For example, the clothing simulation software can be set with a moving pattern piece mode and a moving along sewing line mode.
[0074] For example, the clothing simulation software can be first set to the moving pattern piece mode. At this time, when the clothing simulation software is in the moving pattern piece mode, the target virtual pattern piece and the specified fitting area can be selected respectively according to the pattern piece selection instruction and the fitting area selection instruction input on the operation interface of the clothing simulation software.
[0075] For example, when the clothing simulation software is in the moving pattern piece mode, if the user inputs the fitting area selection instruction by clicking or touching a certain area on the virtual model with the mouse, and thus selects this area as the specified fitting area, the electronic device can select the specified fitting area according to this fitting area selection instruction; or the user inputs the pattern piece selection instruction by clicking or touching the selection control of a certain virtual pattern piece to select a certain virtual pattern piece as the target virtual pattern piece. At this time, the electronic device can select the target virtual pattern piece according to the pattern piece selection instruction input by the user on the operation interface of the clothing simulation software.
[0076] If the clothing simulation software is in the moving along sewing line mode, the user only needs to select a certain virtual pattern piece on the operation interface of the clothing simulation software, and there is no need for the user to further select a certain area on the virtual model as the fitting area. Specifically, sewing line data is respectively configured for each virtual pattern piece on the clothing simulation software, and this sewing line data is used to represent the relative position relationship between each virtual pattern piece. For example, sewing line data is respectively set in the 4 virtual pattern pieces of a T-shirt, and the sewing line data on these virtual pattern pieces is used to represent their relative position relationship.
[0077] At this time, before performing a force collision simulation on the specified fitting area on the target virtual pattern piece and the virtual model, the clothing simulation software can be set to the moving mode along the sewing line first. Then, the user inputs a pattern piece selection instruction by clicking the mouse or touching the selection control of a certain virtual pattern piece to select a certain virtual pattern piece as the target virtual pattern piece. At this time, the electronic device can obtain the pattern piece selection instruction input by the user on the operation interface of the clothing simulation software, and then in response to this pattern piece selection instruction, select this target virtual pattern piece. Then, further obtain the sewing line data configured on this target virtual pattern piece, and then determine this specified fitting area according to the relative position relationship between the sewing line data configured on this target virtual pattern piece and the virtual pattern pieces already fitted on the virtual model.
[0078] For example, the virtual pattern piece already fitted on the virtual model is the front chest virtual pattern piece of a T-shirt, and this target virtual pattern piece is the left sleeve virtual pattern piece. At this time, in this moving mode along the sewing line, after selecting the left sleeve virtual pattern piece as this target virtual pattern piece according to the pattern piece selection instruction input by the user on the operation interface of the clothing simulation software, it is possible to determine this specified fitting area according to the relative position relationship between the sewing line data configured on the left sleeve virtual pattern piece and the front chest virtual pattern piece. At this time, this specified fitting area does not need to be input by the user through a fitting area selection instruction.
[0079] Therefore, in practical applications, for example, the clothing simulation software can be set to the pattern piece moving mode first, and then a certain virtual model can be selected on the operation interface of the clothing simulation software, so that the clothing simulation software loads this virtual model into the virtual space.
[0080] Then the user can further select a certain virtual pattern piece (as the target virtual pattern piece) on the operation interface, and select a certain fitting area (as the specified fitting area) on the virtual model. In this way, when the clothing simulation software is in the moving pattern piece mode, the target virtual pattern piece and the specified fitting area can be respectively selected according to the pattern piece selection instruction and the fitting area selection instruction input on the operation interface, so that through the above steps S21 to S23, the target virtual pattern piece can be deformed and then fitted to the specified fitting area; then the clothing simulation software is switched to the moving mode along the sewing line, and then the user can further select another virtual pattern piece (referred to as the new target virtual pattern piece) on this operation interface. In this way, the electronic device can select the new target virtual pattern piece according to the pattern piece selection instruction input by the user on the operation interface of the clothing simulation software, then obtain the sewing line data configured on the target virtual pattern piece, and further be able to determine the new specified fitting area according to the relative position relationship between the sewing line data configured on the new target virtual pattern piece and the target virtual pattern piece, and then through the above steps S21 to S23, the new target virtual pattern piece can be deformed and then fitted to the new specified fitting area, so that through different moving control methods for the virtual pattern pieces in these two modes, the moving control of each virtual pattern piece is realized.
[0081] It should be further noted that after performing the above step S23, that is, fitting the deformed target virtual pattern piece to the specified fitting area, it may still be necessary to finely adjust its fitting position. Therefore, the method may further include finely adjusting the fitting position of the target virtual pattern piece according to the fitting position fine adjustment instruction input by the user, so as to further improve the fitting effect through this fine adjustment. Among them, the user can input the fitting position fine adjustment instruction by dragging the target virtual pattern piece.
[0082] It should be further noted that the user usually moves the target virtual pattern piece to the specified fitting area by dragging. At this time, a force-deformation condition can be set. First, it can be determined whether the target virtual pattern piece meets the force-deformation condition, and only when it meets, the above step S21 is executed to perform a force collision simulation between the target virtual pattern piece and the specified fitting area on the virtual model.
[0083] Among them, there can be various force-deformation conditions. For example, in one way, based on the distance between the target virtual plate and the specified fitting area, it can be determined whether the target virtual plate meets the force-deformation condition. Among them, if the distance is less than the preset distance, it is determined that the target virtual plate meets the force-deformation condition; or, if the distance is greater than or equal to the preset distance, it is determined that the target virtual plate does not meet the force-deformation condition. For example, during the process of moving the target virtual plate closer to the specified fitting area, the distance between the target virtual plate and the specified fitting area can be monitored at this time, and it can be judged whether the distance is less than the preset distance. If so, it is determined that the target virtual plate meets the force-deformation condition, otherwise it is determined that the target virtual plate does not meet the force-deformation condition.
[0084] Regarding the specific size of the preset distance, it can usually be set according to the actual situation. For example, considering that when a person looks at an object, the image of the object stays in the brain nerves for about 1 / 24 seconds. Therefore, during the process of moving the target virtual plate closer to the specified fitting area, in order to ensure the coherence of the moving closer to the picture, the preset distance can be set by combining the human nerve memory retention time (i.e., 1 / 24 seconds), the picture refresh frequency, and the moving closer speed, so that the moving closer to the picture can be coherent.
[0085] In addition, it should be noted that considering that the virtual plate has a front and a back, its front is used to simulate the front of real clothing, and its back is used to simulate the back of real clothing, while the virtual model is used to simulate a real human body. Therefore, the way the virtual plate is attached to the fitting area on the virtual model is usually to attach the back of the virtual plate to the fitting area, so that the front of the virtual plate faces outwards. Therefore, in the above step S23, the specific way to attach the deformed target virtual plate to the specified fitting area can be to attach the back of the deformed target virtual plate to the specified fitting area on the virtual model.
[0086] For example, it can be first judged whether the back of the deformed target virtual plate faces the virtual model. If so, it means that the back of the deformed target virtual plate faces the virtual model. At this time, the back of the deformed target virtual plate can be directly attached to the specified fitting area; or, if not, it means that the back of the deformed target virtual plate does not face the virtual model (the front faces the virtual model). At this time, one processing method can be to attach the deformed target virtual plate to the specified fitting area, and another processing method can be to first rotate the deformed target virtual plate so that its back faces the virtual model, and then attach it to the specified fitting area.
[0087] Based on the same inventive concept as the virtual plate movement control method provided in the embodiments of the present application, the embodiments of the present application also provide a virtual plate movement control device. For the embodiments of this device, if there are any unclear points, reference can be made to the corresponding content of the method embodiments. As Figure 3 Shown in the figure is a schematic structural diagram of the specific structure of the device 30. The device 30 includes: a force collision simulation unit 301, a deformation unit 302, and a fitting unit 303, where:
[0088] The force collision simulation unit 301 is configured to perform a force collision simulation on a target virtual plate and a specified fitting area on a virtual model;
[0089] The deformation unit 302 is configured to deform the target virtual plate according to the result of the force collision simulation;
[0090] The fitting unit 303 is configured to fit the deformed target virtual plate to the specified fitting area
[0091] By using the device 30 provided in the embodiments of the present application, since the device 30 adopts the same inventive concept as the method provided in the embodiments of the present application, on the premise that the method can solve the technical problem, the device 30 can also solve the technical problem, and details are not described herein again.
[0092] In addition, in practical applications, the technical effects obtained by combining the device 30 with specific software and hardware, cloud technology, etc. are also within the protection scope of the present application. For example, by adopting a distributed cluster method, different units in the device 30 are arranged in different nodes in the distributed cluster, so as to improve efficiency, etc.
[0093] Among them, the target virtual plate is provided with a plurality of virtual vertices; the virtual model is provided with a virtual collision grid; and performing a force collision simulation on the target virtual plate and a specified fitting area on the virtual model may specifically include: performing a force collision simulation on at least one virtual vertex of the target virtual plate and the virtual collision grid of the specified fitting area.
[0094] Among them, the target virtual plate is provided with a plurality of virtual vertices, and the position coordinates of each vertex reflect the shape of the target virtual plate; and deforming the target virtual plate according to the result of the force collision simulation may specifically include: adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation, so as to deform the target virtual plate.
[0095] Among them, according to the result of the force collision simulation, adjusting the position coordinates of each virtual vertex on the target virtual panel may specifically include: according to the result of the force collision simulation and the elastic coefficient of the fabric simulated by the target virtual panel, adjusting the position coordinates of each virtual vertex on the target virtual panel.
[0096] Among them, according to the result of the force collision simulation, adjusting the position coordinates of each virtual vertex on the target virtual panel may specifically include:
[0097] According to the result of the force collision simulation and the elastic coefficient of the fabric simulated by the target virtual panel, determining the candidate position coordinates after deformation of each virtual vertex on the target virtual panel;
[0098] For each virtual vertex, determining the distance between the candidate position coordinate of the virtual vertex and the position coordinate before deformation, and judging whether the distance is less than or equal to the limit distance;
[0099] If so, adjusting the vertex to the candidate position coordinate; or,
[0100] If not, determining a new position coordinate according to the position coordinate of the virtual vertex before deformation and the limit distance, and adjusting the vertex to the new position coordinate.
[0101] Among them, performing a force collision simulation on the specified fitting area on the target virtual panel and the virtual model may specifically include: when it is determined that the target virtual panel meets the force deformation condition, performing a force collision simulation on the specified fitting area on the target virtual panel and the virtual model.
[0102] Among them, the device 30 may further include a judgment unit for determining whether the target virtual panel meets the force deformation condition according to the distance between the target virtual panel and the fitting area, where if the distance is less than the preset distance, it is determined that the target virtual panel meets the force deformation condition; or, if the distance is greater than or equal to the preset distance, it is determined that the target virtual panel does not meet the force deformation condition.
[0103] Among them, the device 30 may further include a selection unit for respectively selecting the target virtual panel and the specified fitting area in response to the panel selection instruction and the fitting area selection instruction before performing a force collision simulation on the specified fitting area on the target virtual panel and the virtual model.
[0104] Among them, the device 30 may further include an instruction acquisition unit for acquiring the panel selection instruction and the fitting area selection instruction input through the operation interface.
[0105] Wherein, each virtual panel is respectively configured with sewing thread data, and the sewing thread data is used to characterize the relative position relationship between each virtual panel; and, the device 30 may further include a second selection unit, configured to select the target virtual panel in response to a panel selection instruction; obtain the sewing thread data configured on the target virtual panel; and determine the specified fitting area according to the relative position relationship between the virtual panel already fitted on the virtual model and the virtual panel characterized by the obtained sewing thread data.
[0106] The device 30 may further include a fine-tuning unit, configured to fine-tune the fitting position of the target virtual panel according to a fitting position fine-tuning instruction input by the user after fitting the deformed target virtual panel to the specified fitting area.
[0107] Wherein, fitting the deformed target virtual panel to the specified fitting area may specifically include: fitting the back surface of the deformed target virtual panel to the specified fitting area.
[0108] Wherein, fitting the back surface of the deformed target virtual panel to the specified fitting area specifically includes: when the back surface of the deformed target virtual panel faces the virtual model, fitting the back surface of the deformed target virtual panel to the specified fitting area; or, when the back surface of the deformed target virtual panel does not face the virtual model, rotating the deformed target virtual panel so that its back surface faces the virtual model and then fitting it to the specified fitting area.
[0109] An embodiment of the present invention further provides a storage medium, including: a program, which when running on an electronic device enables the electronic device to execute all or part of the processes of the methods in the above embodiments. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc. The storage medium may also include a combination of the above types of memories.
[0110] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for controlling the movement of virtual plates, characterized in that Including: Performing a force collision simulation on a specified fitting area of a target virtual plate and a virtual model; Deforming the target virtual plate according to the result of the force collision simulation; Attaching the deformed target virtual plate to the specified fitting area.
2. The method according to claim 1, wherein The target virtual plate is provided with a plurality of virtual vertices; the virtual model is provided with a virtual collision grid; and, Performing a force collision simulation on a specified fitting area of a target virtual plate and a virtual model specifically includes: performing a force collision simulation on at least one virtual vertex of the target virtual plate and the virtual collision grid of the specified fitting area.
3. The method according to claim 1, characterized in that, The target virtual plate is provided with a plurality of virtual vertices, and the position coordinates of each vertex reflect the shape of the target virtual plate; And, Deforming the target virtual plate according to the result of the force collision simulation specifically includes: Adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation for deforming the target virtual plate.
4. The method according to claim 3, characterized in that, Adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation specifically includes: Adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation and the elastic coefficient of the fabric simulated by the target virtual plate.
5. The method according to claim 3, characterized in that Adjusting the position coordinates of each virtual vertex on the target virtual plate according to the result of the force collision simulation specifically includes: Determining the candidate position coordinates after deformation of each virtual vertex on the target virtual plate according to the result of the force collision simulation and the elastic coefficient of the fabric simulated by the target virtual plate; For each virtual vertex, determining the distance between the candidate position coordinates of the virtual vertex and the position coordinates before deformation, and determining whether the distance is less than or equal to the limit distance; If so, adjusting the vertex to the candidate position coordinates; or, If not, determining new position coordinates according to the position coordinates before deformation of the virtual vertex and the limit distance, and adjusting the vertex to the new position coordinates.
6. The method according to claim 1, characterized in that, Performing a force collision simulation on a specified fitting area of a target virtual plate and a virtual model specifically includes: Performing a force collision simulation on a specified fitting area of a target virtual plate and a virtual model when it is determined that the target virtual plate meets the force deformation condition.
7. The method according to claim 6, wherein The method further includes: Determining whether the target virtual plate meets the force deformation condition according to the distance between the target virtual plate and the fitting area, wherein if the distance is less than a preset distance, it is determined that the target virtual plate meets the force deformation condition; or, if the distance is greater than or equal to the preset distance, it is determined that the target virtual plate does not meet the force deformation condition.
8. The method according to claim 1, wherein Before performing a force collision simulation on a specified fitting area of a target virtual plate and a virtual model, the method further includes: In response to a plate selection instruction and a fitting area selection instruction, respectively selecting the target virtual plate and the specified fitting area.
9. The method according to claim 8, wherein The method further includes: obtaining a plate selection instruction and a fitting area selection instruction input through an operation interface.
10. The method according to claim 1, characterized in that, Each virtual plate is respectively configured with sewing thread data, and the sewing thread data is used to characterize the relative positional relationship between each virtual plate; And, Before performing a force collision simulation on the target virtual plate and a specified fitting area on the virtual model, the method further includes: Responding to a plate selection instruction to select the target virtual plate; Obtaining the sewing thread data configured on the target virtual plate; Determining the specified fitting area according to the relative positional relationship characterized by the obtained sewing thread data with the virtual plates already fitted on the virtual model.
11. The method according to claim 1, wherein After fitting the deformed target virtual plate to the specified fitting area, the method further includes: Fine-tuning the fitting position of the target virtual plate according to the fitting position fine-tuning instruction input by the user.
12. The method according to claim 1, characterized in that, Fitting the deformed target virtual plate to the specified fitting area specifically includes: fitting the back surface of the deformed target virtual plate to the specified fitting area.
13. The method according to claim 12, wherein Fitting the back surface of the deformed target virtual plate to the specified fitting area specifically includes: When the back surface of the deformed target virtual plate faces the virtual model, fitting the back surface of the deformed target virtual plate to the specified fitting area; or, When the back surface of the deformed target virtual plate does not face the virtual model, rotating the deformed target virtual plate so that its back surface faces the virtual model and then fitting it to the specified fitting area.
14. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for executing the method according to any one of claims 1 to 13.
15. A storage medium, characterized in that, Comprising: a program which, when running on an electronic device, enables the electronic device to execute the method according to any one of claims 1 to 13.