Balloon model deformation simulation method and system
By collecting and calculating the physical parameters when the balloon model collides with the hand model in the Unity scene in real time, the problem of difficulty in accurately simulating the balloon interaction scenario in the prior art is solved, and a high-reality virtual reality experience is achieved.
Patent Information
- Application Number
- CN202411223431.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-03
AI Technical Summary
The prior art is difficult to accurately control the transmission, deformation and recovery characteristics of force when simulating balloon interactive scenarios, resulting in a reduced user experience.
In the Unity scenario, the balloon model and hand model are created in real time, and the physical parameters during collision are collected in real time through the first simulation component and the second simulation component, the local deformation degree and recovery force are calculated, and the elastic recovery of the balloon model is completed.
It realizes precise simulation of physical interaction with virtual balloons in a virtual reality environment, improving the user experience.
Smart Images

Figure CN118736172B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual reality technology, and in particular to a balloon model deformation simulation method and system. Background Art
[0002] As virtual reality technology becomes increasingly mature, users have higher requirements for the realism of the interactive experience, which is particularly important in simulating interactions with soft objects (such as balloons).
[0003] Among them, in the existing balloon interaction scene, since the existing technology is difficult to accurately control the force transmission, deformation and recovery characteristics in the simulated world during the simulation process, it is impossible to simulate the balloon interaction scene realistically and accurately, thereby reducing the user's immersion and further reducing the user's experience.
[0004] Based on this, in view of the shortcomings of the existing technology, it is necessary to provide a method for simulating the deformation of a balloon model with high fidelity. Summary of the invention
[0005] Based on this, the purpose of the present invention is to provide a balloon model deformation simulation method and system, so as to provide a method that can highly realistically restore the balloon model deformation simulation.
[0006] The first aspect of the embodiment of the present invention proposes:
[0007] A balloon model deformation simulation method, wherein the method comprises:
[0008] Creating a balloon model in real time in a Unity scene, and adding a corresponding first simulation component to the balloon model;
[0009] Creating a hand model corresponding to the VR handle in real time in the Unity scene, and adding a corresponding second simulation component to the hand model;
[0010] When it is detected in real time that the balloon model collides with the hand model, the physical parameters corresponding to the collision are collected in real time based on the first simulation component and the second simulation component, and the local deformation degree corresponding to the balloon model is calculated in real time according to the physical parameters;
[0011] The restoring force corresponding to the balloon model is calculated in real time according to the degree of the local deformation, and the elastic restoration of the balloon model is completed according to the magnitude of the restoring force.
[0012] The beneficial effect of the present invention is that by collecting the corresponding physical parameters in real time during the collision between the balloon model and the hand model, the corresponding collision situation can be objectively and accurately obtained. Based on this, the corresponding local deformation degree and the restoring force required for recovery can be calculated respectively, so as to accurately simulate the physical interaction between the user and the virtual balloon in the virtual reality environment, thereby correspondingly improving the user experience.
[0013] Furthermore, the step of collecting corresponding physical parameters generated during the collision in real time based on the first simulation component and the second simulation component includes:
[0014] Acquire mesh vertex data corresponding to the balloon model in real time according to the first simulation component and the second simulation component;
[0015] When it is detected in real time that the balloon model collides with the hand model, a corresponding target ray is emitted toward the balloon model in a direction from the hand model to the balloon model, and the physical parameters are correspondingly collected according to the target ray.
[0016] Furthermore, the step of collecting the physical parameters according to the target ray includes:
[0017] According to the target ray, a collision point corresponding to the hand model is detected in real time on the surface of the balloon model;
[0018] The normal direction corresponding to the target ray is detected in real time at the collision point, and the deformation force corresponding to the hand model is detected in real time at the collision point according to the normal direction, so as to obtain the physical parameters accordingly.
[0019] Furthermore, the step of calculating in real time the degree of local deformation corresponding to the balloon model according to the physical parameters includes:
[0020] When mesh vertex data corresponding to the balloon model is acquired in real time, a plurality of mesh vertices corresponding to the balloon model are detected in real time from the mesh vertex data;
[0021] The target vector between the collision point and the mesh vertex is calculated in real time according to the normal direction and the deformation force, and the vertex velocity corresponding to the mesh vertex is calculated in real time according to the target vector, so as to calculate the local deformation degree according to the vertex velocity.
[0022] Furthermore, the step of calculating the local deformation degree according to the vertex velocity includes:
[0023] When the vertex velocity is acquired in real time, the deformation time corresponding to the balloon model is detected in real time;
[0024] The local deformation degree corresponding to the balloon model is calculated according to the vertex velocity and the deformation time.
[0025] Furthermore, the step of calculating the restoring force corresponding to the balloon model in real time according to the local deformation degree includes:
[0026] When the target vectors corresponding to each of the collision points are acquired in real time, the initial position and the changed position corresponding to the target vectors are detected in real time;
[0027] Calculating in real time a target offset between the initial position and the changed position, and determining in real time an elastic coefficient corresponding to the collision point according to the target offset;
[0028] The restoring force is calculated according to the target offset and the elastic coefficient, and the restoring force includes a specific value.
[0029] Furthermore, the step of completing the elastic recovery of the balloon model according to the magnitude of the recovery force includes:
[0030] Calculating a restoring force vector corresponding to the collision point in real time according to the restoring force, and updating the vertex velocity by using the restoring force vector to generate a corresponding restoring velocity;
[0031] The elastic recovery of the balloon model is completed according to the recovery speed and the recovery force.
[0032] The second aspect of the embodiment of the present invention proposes:
[0033] A balloon model deformation simulation system, wherein the system comprises:
[0034] A first creation module, used to create a balloon model in real time in a Unity scene, and add a corresponding first simulation component to the balloon model;
[0035] A second creation module is used to create a hand model corresponding to the VR handle in real time in the Unity scene, and add a corresponding second simulation component to the hand model;
[0036] a calculation module, configured to collect corresponding physical parameters generated during the collision based on the first simulation component and the second simulation component in real time when a collision between the balloon model and the hand model is detected in real time, and calculate the local deformation degree corresponding to the balloon model in real time based on the physical parameters;
[0037] The processing module is used to calculate the restoring force corresponding to the balloon model in real time according to the degree of the local deformation, and complete the elastic restoration of the balloon model according to the magnitude of the restoring force.
[0038] Furthermore, the calculation module is specifically used for:
[0039] Acquire mesh vertex data corresponding to the balloon model in real time according to the first simulation component and the second simulation component;
[0040] When it is detected in real time that the balloon model collides with the hand model, a corresponding target ray is emitted toward the balloon model in a direction from the hand model to the balloon model, and the physical parameters are correspondingly collected according to the target ray.
[0041] Furthermore, the calculation module is specifically used for:
[0042] According to the target ray, a collision point corresponding to the hand model is detected in real time on the surface of the balloon model;
[0043] The normal direction corresponding to the target ray is detected in real time at the collision point, and the deformation force corresponding to the hand model is detected in real time at the collision point according to the normal direction, so as to obtain the physical parameters accordingly.
[0044] Furthermore, the calculation module is specifically used for:
[0045] When mesh vertex data corresponding to the balloon model is acquired in real time, a plurality of mesh vertices corresponding to the balloon model are detected in real time from the mesh vertex data;
[0046] The target vector between the collision point and the mesh vertex is calculated in real time according to the normal direction and the deformation force, and the vertex velocity corresponding to the mesh vertex is calculated in real time according to the target vector, so as to calculate the local deformation degree according to the vertex velocity.
[0047] Furthermore, the calculation module is specifically used for:
[0048] When the vertex velocity is acquired in real time, the deformation time corresponding to the balloon model is detected in real time;
[0049] The local deformation degree corresponding to the balloon model is calculated according to the vertex velocity and the deformation time.
[0050] Furthermore, the processing module is specifically used for:
[0051] When the target vectors corresponding to each of the collision points are acquired in real time, the initial position and the changed position corresponding to the target vectors are detected in real time;
[0052] Calculating in real time a target offset between the initial position and the changed position, and determining in real time an elastic coefficient corresponding to the collision point according to the target offset;
[0053] The restoring force is calculated according to the target offset and the elastic coefficient, and the restoring force includes a specific value.
[0054] Furthermore, the processing module is specifically used for:
[0055] Calculating a restoring force vector corresponding to the collision point in real time according to the restoring force, and updating the vertex velocity by using the restoring force vector to generate a corresponding restoring velocity;
[0056] The elastic recovery of the balloon model is completed according to the recovery speed and the recovery force.
[0057] The third aspect of the embodiment of the present invention proposes:
[0058] A computer comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the balloon model deformation simulation method as described above is implemented when the processor executes the computer program.
[0059] The fourth aspect of the embodiments of the present invention proposes:
[0060] A readable storage medium stores a computer program, wherein the program, when executed by a processor, implements the balloon model deformation simulation method as described above.
[0061] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A flowchart of a balloon model deformation simulation method provided by a first embodiment of the present invention;
[0063] Figure 2 This is a structural block diagram of a balloon model deformation simulation system provided in the third embodiment of the present invention.
[0064] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0065] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0066] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0068] See also Figure 1 , which shows the balloon model deformation simulation method provided by the first embodiment of the present invention. The balloon model deformation simulation method provided by this embodiment can accurately simulate the physical interaction between the user and the virtual balloon in the virtual reality environment, thereby correspondingly improving the user experience.
[0069] Specifically, this embodiment provides:
[0070] A balloon model deformation simulation method specifically comprises the following steps:
[0071] Step S10, creating a balloon model in real time in the Unity scene, and adding a corresponding first simulation component to the balloon model;
[0072] Step S20, creating a hand model corresponding to the VR handle in real time in the Unity scene, and adding a corresponding second simulation component to the hand model;
[0073] Step S30, when it is detected in real time that the balloon model collides with the hand model, physical parameters corresponding to the collision are collected in real time based on the first simulation component and the second simulation component, and a local deformation degree corresponding to the balloon model is calculated in real time based on the physical parameters;
[0074] Step S40, calculating the restoring force corresponding to the balloon model in real time according to the degree of the local deformation, and completing the elastic restoration of the balloon model according to the magnitude of the restoring force.
[0075] Specifically, in this embodiment, it should be noted that in order to truly simulate the interactive experience between the user and the virtual balloon, it is necessary to accurately obtain the corresponding information generated when the user collides with the virtual balloon and perform corresponding analysis and processing. Based on this, the present invention will first create the required balloon model in the virtual reality scene through the existing Unity (creation platform) engine. Similarly, a hand model corresponding to the VR handle used by the user will also be created. At the same time, corresponding collision and physical properties will be added respectively, that is, corresponding collision components and physical property components will be added respectively to support corresponding physical interactions.
[0076] Furthermore, in the actual simulation process, when the server set in the background detects in real time that the balloon model collides with the hand model, the present invention can collect the physical parameters corresponding to the current collision in real time based on the first simulation component and the second simulation component. Based on this, the local deformation degree corresponding to the surface of the current balloon model, that is, the collision degree of the current balloon model, can be objectively calculated according to the current physical parameters. On this basis, the interaction scene corresponding to the collision between the user and the balloon can be simulated. Correspondingly, after the collision between the user and the balloon model is completed, in order to complete the recovery of the balloon model, it is necessary to further calculate the specific restoring force required by the current balloon model in the recovery process according to the current local deformation degree in real time. Based on this, the elastic recovery of the current balloon model is completed in real time according to the magnitude of the current restoring force, so that the recovery scene of the balloon model can be simulated, so that the physical interaction between the user and the balloon model can be accurately simulated, and the user's experience is improved accordingly.
[0077] Second embodiment
[0078] Furthermore, the step of collecting corresponding physical parameters generated during the collision in real time based on the first simulation component and the second simulation component includes:
[0079] Acquire mesh vertex data corresponding to the balloon model in real time according to the first simulation component and the second simulation component;
[0080] When it is detected in real time that the balloon model collides with the hand model, a corresponding target ray is emitted toward the balloon model in a direction from the hand model to the balloon model, and the physical parameters are correspondingly collected according to the target ray.
[0081] Furthermore, the step of collecting the physical parameters according to the target ray includes:
[0082] According to the target ray, a collision point corresponding to the hand model is detected in real time on the surface of the balloon model;
[0083] The normal direction corresponding to the target ray is detected in real time at the collision point, and the deformation force corresponding to the hand model is detected in real time at the collision point according to the normal direction, so as to obtain the physical parameters accordingly.
[0084] Furthermore, the step of calculating in real time the degree of local deformation corresponding to the balloon model according to the physical parameters includes:
[0085] When mesh vertex data corresponding to the balloon model is acquired in real time, a plurality of mesh vertices corresponding to the balloon model are detected in real time from the mesh vertex data;
[0086] The target vector between the collision point and the mesh vertex is calculated in real time according to the normal direction and the deformation force, and the vertex velocity corresponding to the mesh vertex is calculated in real time according to the target vector, so as to calculate the local deformation degree according to the vertex velocity.
[0087] Furthermore, the step of calculating the local deformation degree according to the vertex velocity includes:
[0088] When the vertex velocity is acquired in real time, the deformation time corresponding to the balloon model is detected in real time;
[0089] The local deformation degree corresponding to the balloon model is calculated according to the vertex velocity and the deformation time.
[0090] Furthermore, the step of calculating the restoring force corresponding to the balloon model in real time according to the local deformation degree includes:
[0091] When the target vectors corresponding to each of the collision points are acquired in real time, the initial position and the changed position corresponding to the target vectors are detected in real time;
[0092] Calculating in real time a target offset between the initial position and the changed position, and determining in real time an elastic coefficient corresponding to the collision point according to the target offset;
[0093] The restoring force is calculated according to the target offset and the elastic coefficient, and the restoring force includes a specific value.
[0094] Furthermore, the step of completing the elastic recovery of the balloon model according to the magnitude of the recovery force includes:
[0095] Calculating a restoring force vector corresponding to the collision point in real time according to the restoring force, and updating the vertex velocity by using the restoring force vector to generate a corresponding restoring velocity;
[0096] The elastic recovery of the balloon model is completed according to the recovery speed and the recovery force.
[0097] In addition, in the present embodiment, it should be noted that after the required balloon model and hand model are respectively obtained through the above steps, the corresponding simulation can be performed at this time. Preferably, the present invention will touch the current hand model to the current balloon model to simulate the user's interactive operation. Specifically, when it is detected that the hand model touches the balloon model, a target ray will be immediately emitted according to the position touched by the current hand model. Preferably, the target ray can detect the normal direction corresponding to the surface of the collision point between the current hand model and the current balloon model, and then apply a deformation force to the current balloon model according to the current normal direction, and further calculate the direction and distance of the force generated when the two collide in real time according to the current deformation force.
[0098] Furthermore, it should be pointed out that in the field of virtual reality, the three-dimensional models created are composed of a series of mesh vertex data, that is, they are composed of a series of meshes and corresponding vertices. Based on this, the present invention will detect the corresponding mesh vertices contained in the current balloon model, and in the process of the hand model colliding with the balloon model, the target vector between the above-mentioned collision point and the mesh vertex corresponding to it will be calculated in real time according to the normal direction and deformation force generated between the two. Based on this, the attenuation force corresponding to each mesh vertex will be further calculated according to the existing inverse square law, and the current attenuation force will be multiplied by the collision time between the two to obtain the corresponding speed of each mesh vertex when colliding, and the current speed will be further multiplied by the direction vector of the current mesh vertex, so that the vertex speed of each mesh vertex can be finally obtained. Further, the present invention can immediately calculate the local deformation degree of the current balloon model according to the current vertex speed and deformation time. In addition, it is also necessary to explain that in order to complete the recovery of the balloon model in a timely and effective manner, after a number of collision points are detected in real time through the above steps, the target vector corresponding to each current collision point will be obtained, and the initial position and the change position corresponding to the current target vector will be detected synchronously. At the same time, the target offset between the two is calculated in real time, and the elastic coefficient corresponding to each current collision point is further matched in real time in the existing elastic coefficient database. Based on this, the restoring force required by the current balloon model is finally calculated according to the current target offset and the current elastic coefficient. On this basis, the restoring force vector required for each current collision point is further calculated according to the current restoring force. Furthermore, based on the above-mentioned vertex speed, the current restoring force vector is updated accordingly to generate the corresponding recovery speed. Finally, the current balloon model can be smoothly restored according to the current recovery speed and the restoring force, which correspondingly improves the user experience.
[0099] See also Figure 2 , the third embodiment of the present invention provides:
[0100] A balloon model deformation simulation system, wherein the system comprises:
[0101] The first creation module 100 is used to create a balloon model in real time in a Unity scene and add a corresponding first simulation component to the balloon model;
[0102] The second creation module 200 is used to create a hand model corresponding to the VR handle in the Unity scene in real time, and add a corresponding second simulation component to the hand model;
[0103] The calculation module 300 is used for collecting corresponding physical parameters generated during the collision based on the first simulation component and the second simulation component in real time when the collision between the balloon model and the hand model is detected in real time, and calculating the local deformation degree corresponding to the balloon model in real time according to the physical parameters;
[0104] The processing module 400 is used to calculate the restoring force corresponding to the balloon model in real time according to the degree of the local deformation, and complete the elastic restoration of the balloon model according to the magnitude of the restoring force.
[0105] Furthermore, the calculation module is specifically used for:
[0106] Acquire mesh vertex data corresponding to the balloon model in real time according to the first simulation component and the second simulation component;
[0107] When it is detected in real time that the balloon model collides with the hand model, a corresponding target ray is emitted toward the balloon model in a direction from the hand model to the balloon model, and the physical parameters are correspondingly collected according to the target ray.
[0108] Furthermore, the calculation module is specifically used for:
[0109] According to the target ray, a collision point corresponding to the hand model is detected in real time on the surface of the balloon model;
[0110] The normal direction corresponding to the target ray is detected in real time at the collision point, and the deformation force corresponding to the hand model is detected in real time at the collision point according to the normal direction, so as to obtain the physical parameters accordingly.
[0111] Furthermore, the calculation module is specifically used for:
[0112] When mesh vertex data corresponding to the balloon model is acquired in real time, a plurality of mesh vertices corresponding to the balloon model are detected in real time from the mesh vertex data;
[0113] The target vector between the collision point and the mesh vertex is calculated in real time according to the normal direction and the deformation force, and the vertex velocity corresponding to the mesh vertex is calculated in real time according to the target vector, so as to calculate the local deformation degree according to the vertex velocity.
[0114] Furthermore, the calculation module is specifically used for:
[0115] When the vertex velocity is acquired in real time, the deformation time corresponding to the balloon model is detected in real time;
[0116] The local deformation degree corresponding to the balloon model is calculated according to the vertex velocity and the deformation time.
[0117] Furthermore, the processing module is specifically used for:
[0118] When the target vectors corresponding to each of the collision points are acquired in real time, the initial position and the changed position corresponding to the target vectors are detected in real time;
[0119] Calculating in real time a target offset between the initial position and the changed position, and determining in real time an elastic coefficient corresponding to the collision point according to the target offset;
[0120] The restoring force is calculated according to the target offset and the elastic coefficient, and the restoring force includes a specific value.
[0121] Furthermore, the processing module is specifically used for:
[0122] Calculating a restoring force vector corresponding to the collision point in real time according to the restoring force, and updating the vertex velocity by using the restoring force vector to generate a corresponding restoring velocity;
[0123] The elastic recovery of the balloon model is completed according to the recovery speed and the recovery force.
[0124] A fourth embodiment of the present invention provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the balloon model deformation simulation method as described above when executing the computer program.
[0125] A fifth embodiment of the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the balloon model deformation simulation method as described above.
[0126] In summary, the balloon model deformation simulation method and system provided in the above embodiments of the present invention can accurately simulate the physical interaction between the user and the virtual balloon in the virtual reality environment, further improving the user experience.
[0127] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0128] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0129] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0130] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0131] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0132] The above-described embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A balloon model deformation simulation method, characterized in that: The method comprises: Creating a balloon model in real time in a Unity scene, and adding a corresponding first simulation component to the balloon model; Creating a hand model corresponding to the VR handle in real time in the Unity scene, and adding a corresponding second simulation component to the hand model; When it is detected in real time that the balloon model collides with the hand model, the physical parameters corresponding to the collision are collected in real time based on the first simulation component and the second simulation component, and the local deformation degree corresponding to the balloon model is calculated in real time according to the physical parameters; Calculating in real time the restoring force corresponding to the balloon model according to the degree of local deformation, and completing the elastic restoration of the balloon model according to the magnitude of the restoring force; The step of collecting corresponding physical parameters generated during the collision in real time based on the first simulation component and the second simulation component comprises: Acquire mesh vertex data corresponding to the balloon model in real time according to the first simulation component and the second simulation component; When it is detected in real time that the balloon model collides with the hand model, a corresponding target ray is emitted toward the balloon model in a direction from the hand model to the balloon model, and the physical parameters are correspondingly collected according to the target ray; The step of collecting the physical parameters according to the target ray comprises: According to the target ray, a collision point corresponding to the hand model is detected in real time on the surface of the balloon model; detecting in real time at the collision point the normal direction corresponding to the target ray, and detecting in real time at the collision point the deformation force corresponding to the hand model according to the normal direction, so as to obtain the physical parameter accordingly; The step of calculating the local deformation degree corresponding to the balloon model in real time according to the physical parameters comprises: When mesh vertex data corresponding to the balloon model is acquired in real time, a plurality of mesh vertices corresponding to the balloon model are detected in real time from the mesh vertex data; Calculating in real time the target vector between the collision point and the mesh vertex according to the normal direction and the deformation force, and calculating in real time the vertex velocity corresponding to the mesh vertex according to the target vector, so as to calculate the local deformation degree according to the vertex velocity; The step of calculating the local deformation degree according to the vertex velocity comprises: When the vertex velocity is acquired in real time, the deformation time corresponding to the balloon model is detected in real time; Calculating the local deformation degree corresponding to the balloon model according to the vertex velocity and the deformation time; The step of calculating the vertex velocity corresponding to the mesh vertex in real time according to the target vector comprises: Based on the target vector, the attenuation force corresponding to each mesh vertex is calculated according to the inverse square law, and the attenuation force is multiplied by the collision time between the hand model and the balloon model to obtain the velocity generated by each mesh vertex when the collision occurs. The velocity corresponding to the collision is multiplied by the direction vector of the current mesh vertex to obtain the vertex velocity of each current mesh vertex.
2. The balloon model deformation simulation method according to claim 1, characterized in that: The step of calculating the restoring force corresponding to the balloon model in real time according to the local deformation degree comprises: When the target vectors corresponding to each of the collision points are acquired in real time, the initial position and the changed position corresponding to the target vectors are detected in real time; Calculating in real time a target offset between the initial position and the changed position, and determining in real time an elastic coefficient corresponding to the collision point according to the target offset; The restoring force is calculated according to the target offset and the elastic coefficient, and the restoring force includes a specific value.
3. The balloon model deformation simulation method according to claim 2, characterized in that: The step of completing the elastic restoration of the balloon model according to the magnitude of the restoring force comprises: Calculating a restoring force vector corresponding to the collision point in real time according to the restoring force, and updating the vertex velocity by using the restoring force vector to generate a corresponding restoring velocity; The elastic recovery of the balloon model is completed according to the recovery speed and the recovery force.
4. A balloon model deformation simulation system, characterized in that: For implementing the balloon model deformation simulation method according to any one of claims 1 to 3, the system comprises: A first creation module, used to create a balloon model in real time in a Unity scene, and add a corresponding first simulation component to the balloon model; A second creation module is used to create a hand model corresponding to the VR handle in the Unity scene in real time, and add a corresponding second simulation component to the hand model; a calculation module, configured to collect corresponding physical parameters generated during the collision based on the first simulation component and the second simulation component in real time when a collision between the balloon model and the hand model is detected in real time, and calculate the local deformation degree corresponding to the balloon model in real time based on the physical parameters; The processing module is used to calculate the restoring force corresponding to the balloon model in real time according to the degree of the local deformation, and complete the elastic restoration of the balloon model according to the magnitude of the restoring force.
5. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the balloon model deformation simulation method according to any one of claims 1 to 3 is implemented.
6. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the balloon model deformation simulation method as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Drop test visual virtual reality system and method based on normal self-correction
CN110136269A
Deformation control method and device of virtual model and electronic equipment
CN115700779A