Dynamic fluid effect processing method, apparatus, electronic device, and readable medium

By modeling objects and fluids as particles on mobile devices and adjusting the positions of fluid particles through particle collisions, the problem of complex and time-consuming fluid simulation calculations on mobile devices is solved, enabling real-time dynamic display of fluid motion.

CN114067030BActive Publication Date: 2025-11-04DOUYIN VISION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010797808.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-10
Publication Date
2025-11-04
Estimated Expiration
2041-04-26

AI Technical Summary

Technical Problem

Existing technologies for location-based fluid simulation on mobile devices are computationally complex and time-consuming, failing to meet the resource-constrained requirements and real-time demands of mobile devices.

Method used

By modeling object models and fluid particles as particles, and using particle collisions to adjust the position of fluid particles, the calculation of the sign distance function is avoided, simplifying the calculation process and reducing storage requirements.

Benefits of technology

Real-time dynamic display of fluid motion was achieved on mobile terminals, reducing computational complexity and storage resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114067030B_ABST
    Figure CN114067030B_ABST
Patent Text Reader

Abstract

The present disclosure provides a dynamic fluid effect processing method and device, electronic equipment and readable medium, and relates to the technical field of computers. The method comprises: displaying a first object and a fluid in a user display interface; obtaining the position of each model particle in the object model corresponding to the first object; obtaining the position of each fluid particle corresponding to the fluid; when the first object collides with the fluid, for each fluid particle, adjusting the position of the fluid particle according to the position of the model particle colliding with the fluid particle, to dynamically display the motion change of the fluid in the user display interface. The technical scheme provided by the present disclosure adjusts the position of the fluid particle according to the position of the model particle colliding with the fluid particle when the first object collides with the fluid, without calculating the SDF of the first object, simplifying the calculation process and being able to present the motion change effect of the fluid in real time on a mobile terminal.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and in particular, the present disclosure relates to a dynamic fluid effect processing method and device, electronic equipment and computer readable medium. BACKGROUND

[0002] Computer Graphics (CG) is a science of using mathematical algorithms to convert two-dimensional or three-dimensional graphics into a grid form of a computer display. Simply put, the main research content of computer graphics is to study how to represent graphics in a computer, and the related principles and algorithms of using a computer to calculate, process and display graphics.

[0003] Fluid simulation based on physical animation is an important research field of computer graphics. Position Based Fluids (PBF) simulation is widely used in three-dimensional fluid simulation due to its unconditional stability and the advantage of allowing large time steps. In PBF simulation, the collision between fluid and rigid body is usually implemented by using signed distance functions (SDF). However, this method needs to calculate the SDF of the rigid body model in three-dimensional space, which is computationally complex and consumes a large amount of video memory. Moreover, after the movement of the rigid body model, the SDF of the model needs to be recalculated, which is time-consuming. If this method is applied to mobile terminals, the computing and storage resources on mobile terminals are very limited, and the use of this method usually cannot meet the resource requirements and real-time requirements of mobile terminals. SUMMARY

[0004] The present disclosure provides a dynamic fluid effect processing method, device, electronic equipment and readable medium to solve the problems in the prior art.

[0005] In a first aspect, a dynamic fluid effect processing method is provided, comprising:

[0006] displaying a first object and a fluid in a user display interface;

[0007] obtaining the positions of each model particle in the object model corresponding to the first object;

[0008] obtaining the positions of each fluid particle corresponding to the fluid;

[0009] when the first object collides with the fluid, for each fluid particle, adjusting the position of the fluid particle according to the position of the model particle colliding with the fluid particle, to dynamically display the motion change of the fluid in the user display interface.

[0010] In a second aspect, a dynamic fluid effect processing apparatus is provided, and the apparatus includes:

[0011] a display module configured to display the first object and the fluid in a user display interface;

[0012] a first obtaining module configured to obtain positions of model particles in an object model corresponding to the first object;

[0013] a second obtaining module configured to obtain positions of fluid particles corresponding to the fluid;

[0014] a position adjusting module configured to, when the first object collides with the fluid, adjust, for each fluid particle, the position of the fluid particle according to a position of a model particle that collides with the fluid particle, to dynamically display a motion change of the fluid in the user display interface.

[0015] In a third aspect, the present disclosure provides an electronic device, and the electronic device includes:

[0016] one or more processors;

[0017] a memory storing one or more application programs, wherein the one or more application programs, when executed by the one or more processors, cause the electronic device to perform operations corresponding to the dynamic fluid effect processing method according to the first aspect of the present disclosure.

[0018] In a fourth aspect, the present disclosure provides a computer readable medium for storing computer instructions, wherein the computer instructions, when executed by a computer, cause the computer to perform the dynamic fluid effect processing method according to the first aspect of the present disclosure.

[0019] The beneficial effects brought by the technical solutions provided in the present disclosure can include:

[0020] In the dynamic fluid effect processing method, apparatus, electronic device, and computer readable medium provided in the embodiments of the present disclosure, the first object and the fluid are displayed in a user display interface, positions of model particles in an object model corresponding to the first object are obtained, positions of fluid particles corresponding to the fluid are obtained, and when the first object collides with the fluid, for each fluid particle, the position of the fluid particle is adjusted according to a position of a model particle that collides with the fluid particle, to dynamically display a motion change of the fluid in the user display interface. By using the technical solutions provided in the present disclosure, the first object is modeled and each particle in the model is obtained, and when the first object collides with the fluid, the position of the fluid particle is adjusted according to a position of a model particle that collides with the fluid particle, thereby avoiding the calculation of the SDF of the first object, simplifying the calculation process and the time length, and saving the calculation and storage resources, so that the motion change effect of the fluid can be presented in real time on a mobile terminal. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments of the present disclosure will be briefly introduced.

[0022] Figure 1 A flow chart of a dynamic fluid effect processing method provided by the embodiments of the present disclosure;

[0023] Figure 2 A structural schematic diagram of a dynamic fluid effect processing device provided by the embodiments of the present disclosure;

[0024] Figure 3 A structural schematic diagram of an electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION

[0025] The embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein, rather these embodiments are provided to make the present disclosure more thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.

[0026] It should be understood that each step recorded in the method embodiments of the present disclosure can be executed in different order, and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.

[0027] The term “comprising” and variations thereof as used herein are open-ended, that is, “including but not limited to”. The term “based on” is “based, at least in part, on”. The term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; the term “some embodiments” means “at least some embodiments”. Related definitions of other terms will be given in the description below.

[0028] It should be noted that the “first”, “second”, and the like concepts mentioned in the present disclosure are only used to distinguish the devices, modules or units, and are not intended to limit the devices, modules or units to be different devices, modules or units, nor to limit the order or interdependence of the functions performed by the devices, modules or units.

[0029] It should be noted that the modification of “one”, “multiple” mentioned in the present disclosure is illustrative rather than limiting, and those skilled in the art should understand that, unless otherwise explicitly indicated in the context, it should be understood as “one or more”.

[0030] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.

[0031] The technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples. The embodiments of the present disclosure will be described below with reference to the accompanying drawings.

[0032] The technical solutions of the present disclosure can be applied in applications related to dynamic fluid effect production, application and use, etc. The technical solutions of the present disclosure can be applied in terminal devices, which can include, for example, smart phones, palmtop computers, tablet computers, wearable devices with display screens, etc.; computer devices can include, for example, desktop computers, notebook computers, all-in-one computers, smart televisions, etc. Through the technical solutions of the present disclosure, the first object and the fluid are modeled in three-dimensional space, and the rendered image of the object model and the fluid model is projected in the two-dimensional user display interface for display (for the sake of brevity, the rendered image of the model of the first object displayed in the user display interface is referred to as the "first object" in the following, and similarly, the rendered image of the model of the fluid displayed in the user display interface is referred to as the "fluid"). The first object can be in contact with the fluid in the interface, for example, the first object contains the fluid, when the first object is moved by an external force, the fluid contained therein moves accordingly, when the first object and the fluid collide, the movement of the fluid is dynamically displayed in the user display interface. For another example, the fluid is outside the first object, when the fluid is moved by an external force, the fluid and the first object collide, and the movement of the fluid is dynamically displayed in the user display interface. Those skilled in the art should understand that the position and movement of the first object and the fluid are not limited by the present disclosure.

[0033] Figure 1 A flowchart of a dynamic fluid effect processing method provided by an embodiment of the present disclosure is shown in FIG. 1, which can include the following steps. Figure 1

[0034] ​In step S101, the first object and the fluid are displayed in a user display interface. The user display interface can be a display interface in an application. The solution provided by the embodiments of the present disclosure can be implemented as an application or a functional plug-in of an application. When the terminal device detects a starting instruction of the application from a user, the application is started to display the user display interface. Alternatively, when the terminal device detects a triggering instruction (e.g., clicking a virtual button) of the functional plug-in of the application from the user, the user display interface is displayed, in which the images of the first object and the fluid are displayed. In an embodiment, the terminal device can model the first object and the fluid in a three-dimensional space, and project the rendered effect image of the object model and the fluid model in a two-dimensional user display interface, so as to display the first object and the fluid in the user display interface.

[0035] The first object can be an object with relatively stable shape and volume in motion or under the action of force, such as a rigid body or a soft body. The first object can be in contact with the fluid in the interface. For example, the fluid can be contained in the first object, and when the first object moves, the fluid contained therein also moves to present a dynamic effect.

[0036] In step S102, the positions of the model particles in the object model corresponding to the first object are obtained.

[0037] Specifically, the terminal device can model the first object, process the obtained object model into model particles, and obtain the positions of the model particles. The positions of the model particles include the position of the object model in a static state, and the positions of the model particles in a motion process when the static state is changed and the motion occurs.

[0038] The terminal device processes the object model of the first object into a particle form, processes the fluid into a particle form, and converts the collision between the fluid and the first object into the collision between the model particles and the fluid particles, so as to simulate the collision effect between the object model and the fluid. Compared with the prior art of simulating the collision effect by calculating the SDF of the object model, the calculation steps are reduced, the calculation efficiency is improved, the calculation process and time consumption are simplified, and the calculation and storage resources are saved.

[0039] In a possible implementation, obtaining the positions of the model particles in the object model corresponding to the first object includes:

[0040] Modeling the first object to obtain the object model corresponding to the first object;

[0041] Obtaining point cloud data of the object model;

[0042] Determining the positions of the model particles based on the point cloud data.

[0043] In actual application, the terminal device models the first object in three-dimensional space to obtain a three-dimensional object model corresponding to the first object, and exports the object model to point cloud data through a three-dimensional modeling software (for example, 3Dmax, Maya, etc.), the point cloud data being data in a point cloud format (for example, a point cloud format file with a suffix of.ply), each point cloud data corresponding to a model particle, and each point cloud data being the position and normal information of each model particle in the model, each normal information being directed to the outside of the object model.

[0044] In step S103, the positions of the fluid particles corresponding to the fluid are obtained.

[0045] When the fluid moves, the motion of the fluid is simulated according to the size of the external force acting on the fluid, the position of each fluid particle after the motion is estimated, the estimated position is obtained, and the estimated position is taken as the position of each fluid particle corresponding to the fluid. In an embodiment, the terminal device can calculate the estimated position of each fluid particle through the PBF method.

[0046] In step S104, when the first object collides with the fluid, for each fluid particle, the position of the fluid particle is adjusted according to the position of the model particle colliding with the fluid particle, so as to dynamically display the motion change of the fluid in the user display interface.

[0047] When the fluid or the first object moves in the user interface, all or part of the fluid particles in the fluid may collide with the model particles of the first object. For the fluid particles colliding with the model particles, the position of the fluid particles is adjusted according to the position of the model particles colliding with the fluid particles, and the adjusted position is taken as the position of the fluid particles displayed in the user display interface. Therefore, the motion change process of the fluid particles colliding with the model particles displayed in the user display interface can include: moving from the position before the motion to the adjusted position, wherein the adjusted position is a position obtained by adjusting the estimated position of the fluid particle obtained in step S103 by using the position of the model particle colliding therewith.

[0048] In a possible implementation, the method further includes:

[0049] For each fluid particle that does not collide with the model particle, the fluid particle is displayed in the user display interface according to the estimated position of the fluid particle.

[0050] In actual application, for the fluid particles which do not collide with the model particles, the terminal device estimates the estimated positions according to the positions of the fluid particles before movement, and displays the estimated positions as the positions of the fluid particles after movement in the user display interface. Therefore, the movement change process of the fluid particles displayed in the user display interface is from the positions before movement to the estimated positions.

[0051] In an example, assuming that the positions of the fluid particles in the fluid before movement are A1 (A11, A12, …, A1n), for the fluid which moves together with the first object or the fluid itself, the terminal device can estimate the positions of the fluid after movement by using the PBF method, and obtain the estimated positions A2 (A21, A22, …, A2n) of the fluid particles. When the first object collides with the fluid, a part of the fluid particles B (B1, B2, …, Bn) collide with the model particles, the terminal device can adjust the estimated positions A2 (A21, A22, …, A2n) of the part of the particles B to obtain the adjusted positions A3 (A31, A32, …, A3n); the remaining part of the fluid particles C do not collide with the model particles. Therefore, the movement change process of the part of the fluid particles B displayed in the user display interface is from A1 (A11, A12, …, A1n) to A3 (A31, A32, …, A3n), and the movement change process of the part of the fluid particles C displayed in the user display interface is from the respective corresponding positions A1 to the respective corresponding estimated positions A2. n n j k j j+1 k j j+1 k j j+1 k j j+1 k

[0052] In a possible implementation, for each fluid particle, the model particle which collides with the fluid particle is determined in the following manner:

[0053] Based on the position of the fluid particle and the position of each model particle, the model particle which collides with the fluid particle is determined.

[0054] In actual application, since the first object displayed in the user display interface is in contact with the fluid, the model particles are distributed around the fluid particles, and the terminal device can determine which model particles collide with the fluid particles and which model particles do not collide with the fluid particles according to the estimated positions of the fluid particles and the positions of each model particle after movement. ​​​​​​​​​​​​​​​​

[0055] In a possible implementation, for each fluid particle, the model particle colliding with the fluid particle is determined based on the position of the fluid particle and the position of each model particle, including:

[0056] The distance between the fluid particle and each model particle is determined based on the position of the fluid particle and the position of each model particle.

[0057] The model particle closest to the fluid particle is taken as the adjacent model particle of the fluid particle; and

[0058] If the distance between the adjacent model particle and the fluid particle is less than a preset distance, it is determined that the adjacent model particle collides with the fluid particle.

[0059] In actual application, for each fluid particle, the distance between the fluid particle and each model particle can be calculated according to the position of the fluid particle and the position of each model particle, the adjacent model particle of the fluid particle is determined according to the distance between the particles, and the model particle closest to the fluid particle is taken as the adjacent model particle of the fluid particle. The adjacent model particle of the fluid particle is the model particle most likely to collide with the fluid particle. In an embodiment, if the distance between the adjacent model particle and the fluid particle is less than a preset distance r, the adjacent model particle is the model particle colliding with the fluid particle, and thus the position of the model particle colliding with the fluid particle is obtained.

[0060] In a possible implementation, the position of the fluid particle is adjusted according to the position of the model particle colliding with the fluid particle, including:

[0061] For each fluid particle colliding with the model particle, the position correction amount of the fluid particle is determined based on the position of the fluid particle and the position of the model particle colliding with the fluid particle.

[0062] The position of the fluid particle is adjusted according to the position correction amount, to obtain the adjusted position of the fluid particle.

[0063] According to the adjusted position, the motion of the fluid particle colliding with the model particle in the fluid is controlled, to dynamically display the motion change of the fluid in the user display interface.

[0064] In actual application, if the fluid collides with the object model, the collision changes the positions of some or all fluid particles in the fluid, so the positions of these fluid particles are no longer the estimated positions obtained when simulating the movement of the fluid, and thus the positions of these fluid particles need to be adjusted. For each fluid particle that collides with a model particle, the position of the fluid particle and the position of the model particle that collides with the fluid particle can each be a vector in a three-dimensional space. The terminal device can calculate the difference between the two vectors, determine a position correction amount of the fluid particle according to the difference between the two vectors, and adjust the position of the fluid particle that collides according to the position correction amount, and display the fluid particle moving from the position before movement to the adjusted position in the user display interface, so as to present the dynamic change effect of the fluid in the user display interface.

[0065] In a possible implementation, for each fluid particle that collides with a model particle, the position correction amount of the fluid particle is determined based on the position of the fluid particle and the position of the model particle that collides with the fluid particle, and includes:

[0066] Obtaining normal information of the model particle that collides with the fluid particle;

[0067] Obtaining a first weight corresponding to the normal information and a second weight corresponding to a first distance between the fluid particle and the model particle that collides with the fluid particle;

[0068] Determining the position correction amount of the fluid particle based on the first distance, the normal information, the first weight, the second weight, and a preset distance r used to determine whether the fluid particle collides with an adjacent particle.

[0069] In actual application, the terminal device exports the object model as point cloud data, each point cloud data corresponds to a model particle, and the point cloud data includes, in addition to the positions of the model particles in the model, normal information of the model particles, and each normal information can point to the outside of the object model. The terminal device can pre-configure the first weight and the second weight, where the first weight is a weight corresponding to the normal information of the model particle that collides with the fluid particle, and the second weight is a weight corresponding to the distance between the fluid particle and the model particle that collides with the fluid particle. The terminal device determines the position correction amount of the fluid particle based on the distance between the fluid particle and the model particle that collides with the fluid particle, the normal information, the first weight, the second weight, and a preset distance.

[0070] In one embodiment, by modeling the first object as an object model and exporting the object model as point cloud data, the position and normal information of the model particles in the model (also referred to as the model coordinate system) can be obtained. In order to calculate the position correction amount of the fluid particles, the position and normal information of the model particles can be coordinate-transformed into the coordinate system (also referred to as the fluid coordinate system) for calculating the position correction amount of the fluid particles. The model particles can be coordinate-transformed by the following formulas (1)-(2):

[0071] P ω =RP m +T (1)

[0072] n ω =Rn m (2)

[0073] wherein P ω represents the position of each model particle in the fluid coordinate system; P m represents the position of each model particle in the model coordinate system; n ω represents the normal vector of each model particle in the fluid coordinate system; n m represents the normal vector of each model particle in the model coordinate system; R represents a rotation matrix, and T represents a translation vector. R and T can be pre-configured according to specific needs.

[0074] After the position and normal information of the model particles are converted into the fluid coordinate system, the position correction amount of the fluid particles is calculated by the following formulas (3)-(4):

[0075] Δp=(r-||d||)*abs(n ω ·d)*(-ω1n ω +ω2d) (3)

[0076] d=p-x (4)

[0077] wherein Δp represents the position correction amount to be calculated, r represents a preset distance, d represents the difference between the position vectors of the fluid particle and the model particle colliding with the fluid particle in the three-dimensional space, ||d|| represents the distance between the fluid particle and the model particle colliding with the fluid particle in the three-dimensional space, i.e., the norm of d, represents the length of the vector, p represents the position vector of the fluid particle position, x represents the position vector of the model particle position colliding with the fluid particle; n p represents the normal vector of the model particle colliding with the fluid particle, ω1 represents a first weight, ω2 represents a second weight, and abs() represents an absolute value function. By using the above formulas (3) and (4), the position correction amount Δp of the fluid particle colliding with the first object can be obtained.

[0078] After obtaining the position correction amount Δp of the fluid particle colliding with the model particle, the terminal device can adjust the position of the fluid particle colliding with the model particle by using the position correction amount Δp through the following formula (5):

[0079] p t+1 = p t + Δp (5)

[0080] wherein p t represents the position of the fluid particle before position adjustment (for example, the estimated position calculated through the PBF method), Δp represents the position correction amount, p t+1 represents the position of the fluid particle after position adjustment, t represents the time corresponding to before position adjustment, and t+1 represents the time corresponding to after position adjustment.

[0081] In the dynamic fluid effect processing method provided in the embodiments of the present disclosure, the first object and the fluid are displayed in the user display interface, the positions of the model particles in the object model corresponding to the first object are obtained, the positions of the fluid particles in the fluid model corresponding to the fluid are obtained, and when the first object collides with the fluid, for each fluid particle, the position of the fluid particle is adjusted according to the position of the model particle colliding with the fluid particle, so as to dynamically display the motion change of the fluid in the user display interface. By using the technical solution provided in the present disclosure, the first object is modeled and the particles in the model are obtained, the fluid is modeled and the fluid particles in the fluid model are obtained, and when the first object collides with the fluid, the position of the fluid particle is adjusted according to the position of the model particle colliding with the fluid particle, so that the SDF of the first object is avoided to be calculated, the calculation process and the time-consuming length are simplified, and the calculation and storage resources are saved, and therefore, the motion change effect of the fluid can be presented in real time in the mobile terminal.

[0082] Based on the same principle as the method shown in Figure 1 , the embodiments of the present disclosure further provide a dynamic fluid effect processing device 20, as shown in Figure 2 , which can include:

[0083] The display module 21 is configured to display the first object and the fluid in the user display interface.

[0084] The first obtaining module 22 is configured to obtain the positions of the model particles in the object model corresponding to the first object.

[0085] The second obtaining module 23 is configured to obtain the positions of the fluid particles in the fluid model corresponding to the fluid.

[0086] The position adjusting module 24 is configured to, when the first object collides with the fluid, for each fluid particle, adjust the position of the fluid particle according to the position of the model particle colliding with the fluid particle, to dynamically display the motion change of the fluid in the user display interface.

[0087] In a possible implementation, for each fluid particle, the position adjusting module 24 can determine the model particle colliding with the fluid particle by the following manner:

[0088] determining the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle.

[0089] In a possible implementation, for each fluid particle, when the position adjusting module 24 determines the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle, the position adjusting module 24 is configured to:

[0090] determining the distance between the fluid particle and each model particle based on the position of the fluid particle and the position of each model particle;

[0091] taking the model particle closest to the fluid particle as the adjacent model particle of the fluid particle; and

[0092] determining that the adjacent model particle collides with the fluid particle if the distance between the adjacent model particle and the fluid particle is less than a preset distance.

[0093] In a possible implementation, the position adjusting module 24 includes a determining unit, an adjusting unit and a control unit.

[0094] The determining unit is configured to, for each fluid particle colliding with a model particle, determine a position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle colliding with the fluid particle.

[0095] The adjusting unit is configured to adjust the position of the fluid particle according to the position correction amount to obtain an adjusted position of the fluid particle.

[0096] The control unit is configured to control the motion of the fluid particle colliding with the model particle in the fluid according to the adjusted position, to dynamically display the motion change of the fluid in the user display interface.

[0097] In a possible implementation, the determining unit is specifically configured to:

[0098] for each fluid particle colliding with a model particle, obtain normal information of the model particle colliding with the fluid particle.

[0099] acquire a first weight corresponding to the normal information, and a second weight corresponding to a first distance between the fluid particle and the model particle colliding with the fluid particle;

[0100] determine a position correction amount of the fluid particle based on the first distance, the normal information, the first weight, the second weight, and a preset distance.

[0101] In a possible implementation, the display module 21 is further configured to:

[0102] For each fluid particle not colliding with the model particle, display the fluid particle in the user display interface according to the position of the fluid particle.

[0103] In a possible implementation, the first acquisition module 22 is specifically configured to:

[0104] acquire an object model corresponding to the first object for modeling the first object;

[0105] acquire point cloud data of the object model;

[0106] determine the position of each model particle based on the point cloud data.

[0107] The dynamic fluid effect processing apparatus provided in the embodiments of the present disclosure can execute the dynamic fluid effect processing method provided in the embodiments of the present disclosure, and the implementation principles are similar. The actions performed by each module in the dynamic fluid effect processing apparatus in the embodiments of the present disclosure are corresponding to the steps in the dynamic fluid effect processing method in the embodiments of the present disclosure. The detailed functions of each module of the dynamic fluid effect processing apparatus can be referred to the description of the corresponding dynamic fluid effect processing method in the foregoing description, and will not be described herein.

[0108] In the dynamic fluid effect processing apparatus provided in the embodiments of the present disclosure, the first object and the fluid are displayed in the user display interface, the positions of each model particle in the object model corresponding to the first object are acquired, the positions of each fluid particle in the fluid are acquired, and when the first object collides with the fluid, the position of each fluid particle is adjusted according to the position of the model particle colliding with the fluid particle, so as to dynamically display the motion change of the fluid in the user display interface. By using the technical solutions provided in the present disclosure, each particle in the model is acquired by modeling the first object, and the fluid particle in the fluid model is acquired by modeling the fluid, and when the first object collides with the fluid, the position of the fluid particle is adjusted according to the position of the model particle colliding with the fluid particle, so as to avoid calculating the SDF of the first object, simplify the calculation process and the time length, and save the calculation and storage resources. Therefore, the motion change effect of the fluid can be presented in real time in the mobile terminal.

[0109] The following will be described with reference toFigure 3 The diagram illustrates a structural schematic of an electronic device 600 suitable for implementing embodiments of the present disclosure. The implementers of the technical solutions of the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), wearable electronic devices, and fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0110] The electronic device includes a memory and a processor. The memory stores a program for performing the methods described in the various method embodiments above. The processor is configured to execute the program stored in the memory to implement the functions of the embodiments of this disclosure described above and / or other desired functions. The processor may be referred to as processing device 601 below, and the memory may include at least one of read-only memory (ROM) 602, random access memory (RAM) 603, and storage device 608 below, as specifically shown below:

[0111] like Figure 3 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0112] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0113] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program stored on a non-transitory computer-readable medium, the computer program storing program code for performing the methods described above in the various embodiments. In such embodiments, the computer program can be downloaded and installed from a network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-described functions defined in the methods of the embodiments of the present disclosure are performed.

[0114] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal that propagates in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take a variety of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that is not a computer-readable storage medium and that can be used to carry or store a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted using any suitable medium, including, but not limited to, a wire, an optical fiber, an RF (radio frequency) or the like, or any suitable combination thereof.

[0115] In some embodiments, the client, server, or both can communicate using any known or later developed network protocol, such as the HyperText Transfer Protocol (HTTP), and can be interconnected with any form or medium of digital data communication (for example, communication networks) including the Internet. Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet, and peer-to-peer networks (for example, ad hoc peer-to-peer networks), as well as any known or later developed network.

[0116] The computer-readable medium described above can be included in the electronic device described above; alternatively, the computer-readable medium can exist as a standalone entity.

[0117] The computer-readable medium described above carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire positions of each model particle in an object model corresponding to a first object; acquire positions of each fluid particle corresponding to a fluid; when the first object collides with the fluid, for each fluid particle, adjust the position of the fluid particle according to the position of the model particle that collides with the fluid particle, to dynamically display the motion change of the fluid on a user display interface.

[0118] Computer program code for carrying out operations of the present disclosure can be written in any of one or more programming languages, including but not limited to object oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network ("LAN") or a wide area network ("WAN"), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0119] The flow and block diagrams in the drawings represent possible architectural, functional, and operational architectures of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block can represent a module, a segment, or a portion of code that comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or combinations of hardware and software.

[0120] The modules or units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of the module or unit does not constitute a limitation on the module or unit itself.

[0121] The functions described in this document above can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, example types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.

[0122] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0123] According to one or more embodiments of the present disclosure, the present disclosure provides a dynamic fluid effect processing method, the method comprising: displaying a first object and a fluid in a user interface;

[0124] obtaining a position of each model particle in an object model corresponding to the first object;

[0125] obtaining a position of each fluid particle corresponding to the fluid;

[0126] when the first object collides with the fluid, for each fluid particle, adjusting the position of the fluid particle according to the position of the model particle colliding with the fluid particle, to dynamically show the motion change of the fluid in the user display interface.

[0127] In a possible implementation, for each fluid particle, the model particle colliding with the fluid particle is determined by the following manner:

[0128] determining the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle.

[0129] In a possible implementation, for each fluid particle, the determination of the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle comprises:

[0130] determining the distance between the fluid particle and each model particle based on the position of the fluid particle and the position of each model particle;

[0131] taking the model particle closest to the fluid particle as the adjacent model particle of the fluid particle; and

[0132] if the distance between the adjacent model particle and the fluid particle is less than a preset distance, determining that the adjacent model particle collides with the fluid particle.

[0133] In a possible implementation, the adjustment of the position of the fluid particle according to the position of the model particle colliding with the fluid particle comprises:

[0134] for each fluid particle colliding with a model particle, determining a position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle colliding with the fluid particle;

[0135] adjusting the position of the fluid particle according to the position correction amount, to obtain an adjusted position of the fluid particle;

[0136] controlling the motion of the fluid particle colliding with the model particle in the fluid according to the adjusted position, to dynamically show the motion change of the fluid in the user display interface.

[0137] In a possible implementation, the determining, for each fluid particle colliding with a model particle, the position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle colliding with the fluid particle comprises:

[0138] obtaining normal information of the model particle colliding with the fluid particle;

[0139] obtaining a first weight corresponding to the normal information and a second weight corresponding to a first distance between the fluid particle and the model particle colliding with the fluid particle;

[0140] determining the position correction amount of the fluid particle based on the first distance, the normal information, the first weight, the second weight, and a preset distance.

[0141] In a possible implementation, the obtaining the position of each model particle in the object model corresponding to the first object comprises:

[0142] modeling the first object, obtaining an object model corresponding to the first object;

[0143] obtaining point cloud data of the object model;

[0144] determining the position of each model particle based on the point cloud data.

[0145] In a possible implementation, the method further comprises:

[0146] for each fluid particle not colliding with a model particle, displaying the fluid particle in the user display interface according to the position of the fluid particle.

[0147] According to one or more embodiments of the present disclosure, the present disclosure provides a dynamic fluid effect processing apparatus, which comprises:

[0148] a display module configured to display a first object and a fluid in a user interface;

[0149] a first obtaining module configured to obtain the position of each model particle in an object model corresponding to the first object;

[0150] a second obtaining module configured to obtain the position of each fluid particle corresponding to the fluid;

[0151] a position adjusting module configured to, when the first object collides with the fluid, adjust the position of each fluid particle according to the position of a model particle colliding with the fluid particle, to dynamically display the motion change of the fluid in the user display interface.

[0152] In a possible implementation, for each fluid particle, the position adjustment module is configured to determine the model particle colliding with the fluid particle by:

[0153] determining the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle.

[0154] In a possible implementation, for each fluid particle, when the position adjustment module determines the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle, the position adjustment module is configured to:

[0155] determine the distance between the fluid particle and each model particle based on the position of the fluid particle and the position of each model particle;

[0156] determine the model particle closest to the fluid particle as the adjacent model particle of the fluid particle; and

[0157] determine that the adjacent model particle collides with the fluid particle if the distance between the adjacent model particle and the fluid particle is less than a preset distance.

[0158] In a possible implementation, the position adjustment module includes a determination unit, an adjustment unit, and a control unit.

[0159] The determination unit is configured to determine, for each fluid particle colliding with a model particle, a position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle colliding with the fluid particle.

[0160] The adjustment unit is configured to adjust the position of the fluid particle according to the position correction amount to obtain an adjusted position of the fluid particle.

[0161] The control unit is configured to control the motion of the fluid particle colliding with the model particle in the fluid according to the adjusted position, to dynamically display the motion change of the fluid in the user display interface.

[0162] In a possible implementation, the determination unit is specifically configured to:

[0163] for each fluid particle colliding with a model particle, obtain normal information of the model particle colliding with the fluid particle;

[0164] obtain a first weight corresponding to the normal information, and a second weight corresponding to a first distance between the fluid particle and the model particle colliding with the fluid particle;

[0165] Determine a position correction amount of the fluid particle based on the first distance, the normal information, the first weight, the second weight, and the preset distance.

[0166] In a possible implementation, the first obtaining module is specifically configured to:

[0167] Obtain an object model corresponding to the first object by modeling the first object;

[0168] Obtain point cloud data of the object model;

[0169] Determine a position of each model particle based on the point cloud data.

[0170] In a possible implementation, the display module is further configured to:

[0171] Display the fluid particle in the user display interface according to the position of the fluid particle for each fluid particle that does not collide with a model particle.

[0172] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, comprising:

[0173] One or more processors;

[0174] A memory storing one or more application programs, wherein the one or more application programs, when executed by the one or more processors, cause the electronic device to perform the dynamic fluid effect processing method.

[0175] According to one or more embodiments of the present disclosure, the present disclosure provides a computer readable medium for storing computer instructions, when the computer instructions are executed by a computer, cause the computer to perform the dynamic fluid effect processing method.

[0176] The above description is merely preferred embodiments of the present disclosure and a description of the principles of the technology applied. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combinations of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with each other to form a technical solution with similar functions disclosed in the present disclosure (but not limited to).

[0177] Moreover, while operations are depicted in a particular order, this should not be understood as requiring such an order nor infringing on the scope of the disclosure. Certain of the operations described in the discussion are combinable into a single operation, and certain operations can be separated into several operations. In some embodiments, the operations described in the discussion can be performed in an order different than presented in the discussion. In some embodiments, the operations described in the discussion can be performed concurrently. Also, while several specific implementation details are discussed in the discussion, these should not be interpreted as limiting the scope of the disclosure. Rather, certain features described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.

[0178] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims

1. A dynamic fluid effect processing method, characterized in that, The method comprises: displaying a first object and a fluid in a user display interface; obtaining the position of each model particle in the object model corresponding to the first object; wherein the position of each model particle comprises: the position of the object model in a static state; and the position of each model particle in a motion process when the static state is changed and motion occurs; obtaining the position of each fluid particle corresponding to the fluid; when the first object collides with the fluid, for each fluid particle, adjusting the position of the fluid particle according to the position of the model particle colliding with the fluid particle, to dynamically display the motion change of the fluid in the user display interface; wherein the adjusting the position of the fluid particle according to the position of the model particle colliding with the fluid particle comprises: for each fluid particle colliding with a model particle, determining a position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle colliding with the fluid particle; adjusting the position of the fluid particle according to the position correction amount to obtain an adjusted position of the fluid particle; controlling the motion of the fluid particle colliding with the model particle in the fluid according to the adjusted position, to dynamically display the motion change of the fluid in the user display interface; for each fluid particle colliding with a model particle, the determining a position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle colliding with the fluid particle comprises: obtaining normal information of the model particle colliding with the fluid particle; obtaining a first weight corresponding to the normal information and a second weight corresponding to a first distance between the fluid particle and the model particle colliding with the fluid particle; determining the position correction amount of the fluid particle based on the first distance, the normal information, the first weight, the second weight, and a preset distance; the preset distance represents a preset threshold for judging whether adjacent model particles collide with the fluid particle.

2. The dynamic fluid effect processing method of claim 1, wherein, For each fluid particle, the model particle colliding with the fluid particle is determined in the following manner: determining the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle.

3. The dynamic fluid effect processing method of claim 2, wherein, For each fluid particle, the determining the model particle colliding with the fluid particle based on the position of the fluid particle and the position of each model particle comprises: determining the distance between the fluid particle and each model particle based on the position of the fluid particle and the position of each model particle; determining the model particle closest to the fluid particle as the adjacent model particle of the fluid particle; and if the distance between the adjacent model particle and the fluid particle is less than a preset distance, determining that the adjacent model particle collides with the fluid particle.

4. The dynamic fluid effect processing method of claim 1, wherein, The obtaining the position of each model particle in the object model corresponding to the first object comprises: modeling the first object to obtain the object model corresponding to the first object; obtaining point cloud data of the object model; Determine positions of the model particles based on the point cloud data.

5. The dynamic fluid effect processing method of claim 1, wherein, The method further includes: For each fluid particle that does not collide with the model particles, display the fluid particle in the user display interface according to the position of the fluid particle.

6. A dynamic fluid effects processing apparatus characterized by, The device includes: A display module configured to display the first object and the fluid in a user display interface. A first obtaining module configured to obtain positions of model particles in an object model corresponding to the first object, wherein the positions of the model particles include positions of the object model in a static state and positions of the model particles in a moving process when the static state is changed. A second obtaining module configured to obtain positions of fluid particles corresponding to the fluid. A position adjusting module configured to, when the first object collides with the fluid, for each fluid particle, adjust the position of the fluid particle according to the position of a model particle that collides with the fluid particle, to dynamically display a motion change of the fluid in the user display interface. The adjusting of the position of the fluid particle according to the position of the model particle that collides with the fluid particle includes: For each fluid particle that collides with a model particle, determine a position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle that collides with the fluid particle. Adjust the position of the fluid particle according to the position correction amount to obtain an adjusted position of the fluid particle. Control the motion of the fluid particle that collides with the model particle in the fluid according to the adjusted position, to dynamically display the motion change of the fluid in the user display interface. For each fluid particle that collides with a model particle, the determination of the position correction amount of the fluid particle based on the position of the fluid particle and the position of the model particle that collides with the fluid particle includes: Obtain normal information of the model particle that collides with the fluid particle. Obtain a first weight corresponding to the normal information and a second weight corresponding to a first distance between the fluid particle and the model particle that collides with the fluid particle. Determine the position correction amount of the fluid particle based on the first distance, the normal information, the first weight, the second weight, and a preset distance, wherein the preset distance represents a preset threshold for determining whether adjacent model particles collide with the fluid particle.

7. An electronic device, comprising: The device includes: One or more processors; A memory storing one or more applications, wherein the one or more applications, when executed by the one or more processors, cause the electronic device to perform the dynamic fluid effect processing method according to any one of claims 1-5.

8. A computer readable medium characterized by The computer readable medium is configured to store computer instructions, when the computer instructions are executed by a computer, cause the computer to perform the dynamic fluid effect processing method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Emulation modelling method interacted with movable object and water based on SPH

    CN101329772A