Virtual object shake control method and device, electronic equipment and storage medium

By compressing and displacement calculations of the UV maps of each virtual object in the virtual object combination, flexible shaking control of virtual objects is achieved, solving the problems of low flexibility in shaking control and poor animation effects in the existing technology, and improving the user experience.

CN119810283APending Publication Date: 2025-04-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311302174.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art has low flexibility when controlling the shaking of virtual objects and poor animation effects, and cannot realize the animation effect of individuals in the composition object in conjunction with shaking, which affects the user's viewing experience.

Method used

By obtaining the UV map of each virtual object in the virtual object combination, compressing it into UV lines, and calculating the displacement offset through a preset periodic function based on the arrangement position and time parameters, adjusting the displacement offset to achieve the displacement effect of different heights, and finally controlling the model vertices of the virtual object to be displaced.

Benefits of technology

It improves the flexibility of virtual object shaking control, improves animation effect, and realizes the shaking animation effect of the cooperation between individual virtual objects in the virtual object combination, improving the user's viewing experience and game experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810283A_ABST
    Figure CN119810283A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual object shake control method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a UV map of each virtual object in a virtual object combination in a first UV coordinate system; the UV maps are compressed to obtain UV lines; storing the UV lines in a second UV coordinate system according to the arrangement positions of the virtual objects in the virtual object combination; according to the abscissa and the time parameter of the UV line in the second UV coordinate system, the displacement offset of the UV line is obtained through the periodic function; adjusting the displacement offset based on the ordinate of the UV line in the second UV coordinate system to obtain an adjusted displacement offset; and controlling the model vertex of the virtual object corresponding to the height of the UV line to displace according to the adjusted displacement offset of each height of the UV line. Therefore, the displacement of the vertexes of the virtual object model is more flexibly controlled based on the UV chartlet, and the shaking animation effect that all the virtual object individuals in the virtual object combination are matched with one another can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual object shaking control method, device, electronic device and storage medium. Background Art

[0002] The game animation system is one of the systems that has the greatest impact on the expressiveness of the game. With the development of computer technology, users' requirements for game animation effects are getting higher and higher.

[0003] At present, game animation effects are usually achieved through a sprite animation system or a rigid hierarchical animation system. Among them, sprite animation is a two-dimensional animation effect, which is usually used for two-dimensional games, or distant distant parts. For the three-dimensional model of the virtual object that needs to be controlled, it is usually controlled based on a rigid hierarchical animation system to achieve the animation effect. Specifically, the three-dimensional model of the virtual object is divided into multiple rigid objects that will not deform (including scaling), and then each rigid object is driven to move separately. When the virtual object is shaken by this scheme, the flexibility is low, the animation effect obtained is poor, and the animation effect of the coordinated shaking of each individual in the combined object cannot be achieved, which affects the user's viewing experience. Summary of the invention

[0004] The embodiments of the present application provide a virtual object shaking control method, device, electronic device and storage medium, which can improve the flexibility of shaking control of virtual objects, improve animation effects, and achieve animation effects of coordinated shaking of each virtual object in a virtual object combination, thereby improving the user's viewing experience.

[0005] In a first aspect, an embodiment of the present application provides a virtual object shaking control method, comprising:

[0006] Obtain the UV map of each virtual object in the virtual object combination in the first UV coordinate system;

[0007] Compressing the UV maps of the virtual objects to obtain UV lines corresponding to the virtual objects;

[0008] According to the arrangement position of each of the virtual objects in the virtual object combination, each of the UV lines is saved in a second UV coordinate system;

[0009] According to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter, the displacement offset of each of the UV lines is obtained through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function;

[0010] The displacement offset is adjusted based on the ordinate of the UV line in the second UV coordinate system to obtain an adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0;

[0011] According to the adjusted displacement offset at each height of the UV line, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced.

[0012] In a second aspect, an embodiment of the present application provides a virtual object shaking control device, comprising:

[0013] A texture acquisition module, used to acquire a UV texture of each virtual object in the virtual object combination in the first UV coordinate system;

[0014] A texture processing module, used to compress the UV texture of each of the virtual objects to obtain UV lines corresponding to each of the virtual objects;

[0015] A UV line saving module, used for saving each of the UV lines into a second UV coordinate system according to the arrangement position of each of the virtual objects in the virtual object combination;

[0016] A displacement offset calculation module, used to obtain the displacement offset of each of the UV lines according to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function;

[0017] a displacement offset adjustment module, configured to adjust the displacement offset based on the ordinate of the UV line in the second UV coordinate system to obtain an adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0;

[0018] The control module is used to control the displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line.

[0019] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory storing a plurality of instructions; a processor loads instructions from the memory to execute the steps of any one of the virtual object shaking control methods provided in the embodiments of the present application.

[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any virtual object shaking control method provided in an embodiment of the present application.

[0021] By adopting the scheme of the embodiment of the present application, the UV map of each virtual object in the virtual object combination in the first UV coordinate system can be obtained; the UV map of each virtual object is compressed to obtain the UV line corresponding to each virtual object; according to the arrangement position of each virtual object in the virtual object combination, each UV line is saved in the second UV coordinate system; thus, according to the horizontal coordinate of the UV line in the second UV coordinate system and the time parameter, the displacement offset of each UV line is obtained through a preset periodic function; due to the gradual change of the horizontal coordinate, each different UV line obtains a displacement offset with certain differences but showing a certain regularity as a whole; and the displacement offset of a UV line changes back and forth with time within a period of the periodic function; further, based on the UV line The displacement offset of each height is adjusted according to the vertical coordinate, and the adjusted displacement offset of each UV line decreases as the height of the UV line decreases, and the adjusted displacement offset at the lowest height in each UV line is 0; thereby, the closer to the bottom, the smaller the shaking amplitude, and the bottom (the contact position with other virtual objects) is fixed can be achieved; according to the adjusted displacement offset at each height of the UV line, the model vertices of the virtual object corresponding to the above height of the above UV line are controlled to be displaced; the flexibility of shaking control of the virtual object can be improved, the animation effect can be improved, and the shaking animation effect of the individual virtual objects in the virtual object combination can be achieved, which is beneficial to improving the user's viewing experience and game experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 This is a flow chart of an embodiment of a virtual object shaking control method provided in an embodiment of the present application;

[0024] Figure 2 It is a schematic diagram of a UV line saved in a second UV coordinate system provided by an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of a sine function provided in an embodiment of the present application;

[0026] Figure 4 This is a schematic diagram of the effect of color rendering of a virtual object according to a displacement offset provided by an embodiment of the present application;

[0027] Figure 5 This is a schematic diagram of the effect of controlling the displacement of a virtual object according to a displacement offset provided by an embodiment of the present application;

[0028] Figure 6 is a schematic diagram of the effect of controlling the displacement of a virtual object according to an adjusted displacement offset provided by an embodiment of the present application;

[0029] Figure 7 The embodiment of this application provides Figure 6 The corresponding schematic diagram of another viewing angle effect;

[0030] Figure 8 is a structural schematic diagram of a virtual object shaking control device provided in an embodiment of the present application;

[0031] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0033] Embodiments of the present application provide a virtual object shaking control method, device, electronic device, and computer-readable storage medium.

[0034] Specifically, this embodiment will be described from the perspective of a virtual object shaking control device, which can be integrated into an electronic device, that is, the virtual object shaking control method of the embodiment of the present application can be executed by an electronic device, and optionally, the electronic device can include: a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and other devices.

[0035] The virtual object shaking control method provided in the embodiment of the present application can be applied to a virtual object shaking control system. The virtual object shaking control system may include a player terminal device and a server, and the terminal may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server may perform two-way communication via a network.

[0036] Optionally, the electronic device may be a server, which may be an independent server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0037] In one embodiment of the present application, the virtual object shaking control method can be run on a local terminal device or a server. When the virtual object shaking control method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0038] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the interactive method in the game are completed on the cloud game server. The client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0039] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0040] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0041] The first aspect of the present application embodiment provides a virtual object shaking control method, please refer to Figure 1 The specific process of the virtual object shaking control method may be as follows: Step 101 to Step 106:

[0042] Step 101: Obtain a UV map of each virtual object in the virtual object combination in a first UV coordinate system.

[0043] The virtual object combination includes a plurality of virtual objects, and the virtual objects are objects that need to be shaken. Specifically, in this embodiment, the virtual objects in the virtual object combination are shaken to achieve a wave-like shaking effect of the entire virtual object combination, and the shaking effects of the individual virtual objects are different to a certain extent, and the individual virtual objects cooperate with each other to make the overall shaking effect of the virtual object combination have a certain regularity, so that a more realistic shaking animation effect can be obtained, and the user's gaming experience can be improved.

[0044] In a specific application scenario, the virtual object combination can be a software such as an animal, a person, or clothes, and a better shaking animation effect can be obtained according to the virtual object shaking control method in the embodiment of the present application. For example, when the virtual object combination is an animal, the virtual object can be the hair of the animal. The virtual object shaking control method according to the embodiment of the present application can flexibly control a large number of hairs, and can also achieve a fixed effect of the virtual object contact position (such as the hair root), thereby achieving a better animation effect.

[0045] It should be noted that the above-mentioned virtual object is a three-dimensional model in a three-dimensional coordinate system. In the embodiment of the present application, the three-dimensional model is mapped to the UV coordinate system (i.e., UV space) to obtain the UV map of the virtual object, and there is a mapping relationship between the UV map and the vertices of the three-dimensional model. Therefore, the displacement offset of each vertex of the three-dimensional model can be calculated based on the UV map, thereby realizing the shaking control of the three-dimensional model of the virtual object. The above-mentioned vertex is a point of the three-dimensional model in the three-dimensional coordinate space, which contains information about the normal direction, texture coordinates and other mesh attributes.

[0046] Optionally, the step of obtaining a UV map of each virtual object in the virtual object combination in the first UV coordinate system includes:

[0047] Perform front view projection on each virtual object in the virtual object combination to obtain a UV map of each virtual object in the first UV coordinate system.

[0048] The first UV coordinate system is a coordinate system used to perform UV unfolding of a three-dimensional model to obtain a UV map. Specifically, by performing front view projection on a virtual object combination, the UV map can be made consistent with the silhouette of each virtual object in the front view, thereby making it more convenient and flexible to perform shaking control. In this embodiment, the front view projection of a virtual object is used as an example for specific description, but it is not a specific limitation. In actual use, projection can also be performed from other views.

[0049] Step 102: compress the UV maps of the virtual objects to obtain UV lines corresponding to the virtual objects.

[0050] Based on the UV map obtained in step 101, which is consistent with the silhouette of the virtual object front view, in this embodiment, the UV map is compressed to obtain UV lines with only height, so as to improve the efficiency and flexibility of subsequent calculation of displacement offset. And the displacement offset obtained by the same virtual object in the virtual object combination can be kept consistent, showing an overall regular shaking.

[0051] In this embodiment, the arrangement of virtual objects in the horizontal direction is taken as an example for specific description, that is, in the virtual object combination, each virtual object is arranged in the horizontal direction, and the extension direction of the virtual object itself is the vertical direction, and the bottom of the virtual object in the vertical direction is the fixed position of the virtual object (that is, the position in contact with other objects). At this time, the UV map of each virtual object is compressed from both sides to the middle along the horizontal direction to obtain the above-mentioned UV lines. Among them, the above-mentioned horizontal direction is the direction along the horizontal axis of the first UV coordinate system, and the above-mentioned vertical direction is the direction along the vertical axis of the first UV coordinate system.

[0052] Step 103: save the UV lines into a second UV coordinate system according to the arrangement positions of the virtual objects in the virtual object combination.

[0053] Among them, the above-mentioned second UV coordinate system is a pre-set coordinate system for saving the sorted UV lines. It should be noted that the above-mentioned first UV coordinate system is used for texture sampling (i.e. UV unfolding) of the three-dimensional model. There is a mapping relationship between the UV texture and UV lines in the first UV coordinate system and the vertices of the three-dimensional model. If the position of the UV lines is moved in the first UV coordinate system, the mapping relationship will become complicated, making the subsequent control process more complicated. Therefore, in order to reduce the complexity of the mapping relationship, in this embodiment, the second UV coordinate system is used to calculate the offset during the shaking control process. However, in actual use, the UV lines can also be sorted directly in the first UV coordinate system, which is not specifically limited here.

[0054] Specifically, the first UV coordinate system and the second UV coordinate system are both two-dimensional coordinate systems with a horizontal axis value range from 0 to 1 and a vertical axis value range from 0 to 1. The position of the virtual object in the virtual object combination is fixed, and the arrangement order of each UV line can be determined according to the position of the virtual object in the virtual object combination and a specified sorting direction (e.g., left first, then right, top first, then bottom), and then saved in the second UV coordinate system.

[0055] Figure 2 is a schematic diagram of a UV line saved in a second UV coordinate system provided by an embodiment of the present application, such as Figure 2 As shown, each UV line is sequentially stored in the second UV coordinate system along the horizontal direction (ie, the horizontal axis direction of the second coordinate system).

[0056] Optionally, compressing the UV maps of the virtual objects to obtain UV lines corresponding to the virtual objects includes:

[0057] According to the arrangement direction of the virtual objects in the virtual object combination, the UV map of each of the virtual objects is compressed to obtain UV lines corresponding to each of the virtual objects;

[0058] The step of saving the UV lines into the second UV coordinate system according to the arrangement positions of the virtual objects in the virtual object combination includes:

[0059] According to the arrangement position of each of the virtual objects in the virtual object combination, each of the UV lines is saved in the second UV coordinate system in a manner of being arranged along the horizontal axis of the second UV coordinate.

[0060] Wherein, the bottom end of each of the above UV lines intersects with the horizontal axis of the above second UV coordinate system. Figure 2As shown, each UV line intersects the horizontal axis of the second UV coordinate system perpendicularly to better calculate the displacement offset.

[0061] In one application scenario, considering that the direction in which the virtual objects are arranged in the virtual combination is not necessarily in the horizontal direction, the corresponding virtual object's own extension direction is not necessarily in the vertical direction. For example, each virtual object in the virtual object combination is arranged in the vertical direction, and each virtual object's own extension direction is the horizontal direction. At this time, the UV map of the virtual object is compressed in combination with the direction in which the virtual objects are arranged in the virtual object combination and / or the extension direction of the virtual objects themselves, so as to obtain a better compression effect and improve the convenience in the subsequent shaking control process.

[0062] Furthermore, in the process of saving the UV lines to the second UV coordinate system after compression, the UV lines can be rotated and saved in the second UV coordinate system in a manner arranged along the horizontal axis of the second UV coordinate system to ensure that the bottom end of the UV lines intersects perpendicularly with the horizontal axis of the second UV coordinate system.

[0063] It should be noted that a certain interval is maintained between two adjacent UV lines in the second UV coordinate system, and the specific intervals may be the same or different. In one application scenario, the intervals in the second UV coordinate system are the same and are determined according to the number of UV lines, that is, the UV lines are evenly distributed and stored in the second UV coordinate system. In another application scenario, the interval between two adjacent UV lines in the second UV coordinate system is determined according to the distance between the corresponding two virtual objects in the virtual object combination. The closer the distance between the two virtual objects, the smaller the interval corresponding to them. In this way, the shaking amplitude between virtual objects that are closer is closer, and a more realistic shaking animation effect can be obtained.

[0064] Step 104: According to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter, a displacement offset of each of the UV lines is obtained through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function.

[0065] Among them, the above-mentioned UV lines intersect perpendicularly with the horizontal axis of the above-mentioned second UV coordinate system, so for each UV line, the horizontal coordinate corresponding to each point on it is the same. Different UV lines are arranged along the horizontal axis direction of the second UV coordinate system, and the horizontal coordinates of each UV line increase from left to right along the horizontal axis of the second UV coordinate system. The above-mentioned preset periodic function is a pre-set periodic function for calculating the displacement offset. The specific function can be set and adjusted according to actual needs. The above-mentioned displacement offset is a parameter for the movement distance during the shaking process.

[0066] In this embodiment, the displacement offset changes back and forth with time within a function period of the periodic function. It should be noted that the time parameter can be used as a part of the independent variable of the periodic function, so the function value of the periodic function will change back and forth with the time parameter. Specifically, the function value of the periodic function changes back and forth once within a preset offset range as the independent variable changes, the minimum value of the preset offset range is less than 0, and the maximum value of the preset offset range is greater than 0. In this way, it is possible to control the virtual object to shake back and forth within each period to obtain a better shaking effect.

[0067] Optionally, the displacement offset of each UV line is obtained by a preset periodic function according to the horizontal coordinate of the UV line in the second UV coordinate system and the time parameter, including:

[0068] Determine a first displacement distance control parameter of each of the UV lines according to the horizontal coordinate of the UV line in the second UV coordinate system, and determine a second displacement distance control parameter of each of the UV lines according to the time parameter;

[0069] The displacement offset of each of the UV lines is obtained by calculating the periodic function according to the first displacement distance control parameter and the second displacement distance control parameter.

[0070] Optionally, the sum of the first displacement distance control parameter and the second displacement distance control parameter is used as the independent variable of the periodic function, and the function value corresponding to the periodic function is used as the displacement offset of the UV line. In actual use, the difference between the first displacement distance control parameter and the second displacement distance control parameter can also be used as the independent variable of the periodic function, and the independent variable of the periodic function can also be determined by other calculation methods, which are not specifically limited here.

[0071] Optionally, the determining of the first displacement distance control parameter of each of the UV lines according to the horizontal coordinate of the UV line in the second UV coordinate system, and the determining of the second displacement distance control parameter of each of the UV lines according to the time parameter include:

[0072] Obtain displacement cycle frequency parameters and displacement speed parameters;

[0073] Determine the first displacement distance control parameter of the UV line according to the product of the abscissa of the UV line in the second UV coordinate system and the displacement cycle frequency parameter;

[0074] The second displacement distance control parameter of the UV line is determined according to the product of the time parameter and the displacement speed parameter.

[0075] Among them, the displacement cycle frequency parameter is a parameter used to control the frequency of the reciprocating change of the displacement offset, and the above-mentioned displacement speed parameter is a parameter used to control the changing speed of the displacement offset. The above-mentioned displacement cycle frequency parameter and displacement speed parameter can be pre-set or adjusted in real time according to actual needs, and are not specifically limited here.

[0076] Step 105: adjusting the displacement offset based on the vertical coordinate of the UV line in the second UV coordinate system to obtain the adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0.

[0077] Specifically, in this embodiment, the height information of the UV lines is used as a mask, so that the lower the height, the smaller the shaking amplitude, thereby obtaining a better shaking effect, and the calculation process is simple, convenient and flexible.

[0078] Optionally, before step 105, the method further includes:

[0079] Stretch each of the above UV lines to be the same height as the vertical axis of the UV coordinate system where it is located;

[0080] The above-mentioned displacement offset is adjusted based on the ordinate of the above-mentioned UV line to obtain the adjusted displacement offset of each of the above-mentioned UV lines, including:

[0081] The displacement offset of each UV line at each height is multiplied by the ordinate corresponding to the height in the second UV coordinate system to obtain the adjusted displacement offset of each UV line as it changes with height.

[0082] The stretching of the UV lines can be performed in the first UV coordinate system or in the second UV coordinate system, which is not specifically limited here. In this embodiment, the stretching of the UV lines in the second UV coordinate system is taken as an example for specific description. Figure 2 As shown, Figure 2 Each UV line in the image has been stretched to the same height as the vertical axis height of the second UV coordinate system. In this way, the vertical coordinates of each point in the UV line can be directly used as a mask to adjust the displacement offset, so that the adjusted displacement offset at the lowest height of each UV line is 0, which is conducive to simplifying the calculation process and improving the efficiency of shaking control.

[0083] It should be noted that, for any UV line, the displacement offsets corresponding to points at different heights are the same, and after the offsets are adjusted, the adjusted displacement offsets corresponding to points at different heights are different.

[0084] Step 106: Control the displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line.

[0085] Specifically, according to the mapping relationship between the three-dimensional model of the virtual object and the UV map, the adjusted displacement offset corresponding to the model vertices of the virtual object can be determined, so as to control the displacement of the model vertices and realize the back-and-forth shaking animation effect of the virtual object.

[0086] In this embodiment, Figure 2 As shown, a UV line includes multiple mapping points, and a mapping point corresponds to at least one model vertex of the virtual object corresponding to the UV line. The displacement of the corresponding model vertex is controlled according to the adjusted displacement offset of the mapping point.

[0087] In an application scenario, a specific displacement direction may be determined, and the calculated displacement offset is the value of the displacement along the specific displacement direction. It should be noted that, in this embodiment, if no clear displacement direction is specified, a default direction pre-set by the user is used as the specific displacement direction. For example, the default direction may be set to the horizontal direction of the front view of the virtual object combination.

[0088] Optionally, the above-mentioned obtaining of the displacement cycle frequency parameter and the displacement speed parameter includes:

[0089] Acquire a displacement cycle frequency parameter and a displacement speed parameter in a target displacement direction, wherein the target displacement direction includes at least one coordinate axis direction in the coordinate system where the virtual object is located;

[0090] The controlling of displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line includes:

[0091] According to the adjusted displacement offset of the UV line at each height in the target displacement direction, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced along the target displacement direction.

[0092] The target displacement direction is the direction in which the displacement of the virtual object needs to be controlled. In this embodiment, the shaking control can be performed for at least one target displacement direction. If there are multiple target displacement directions, the displacement control of the multiple target displacement directions will be superimposed and implemented on the model vertices of the virtual object. For each target displacement direction, the corresponding displacement cycle frequency parameter and displacement speed parameter are obtained respectively, so as to calculate the displacement offset corresponding to each target displacement direction, and then obtain the adjusted displacement offset corresponding to each target displacement direction, so as to realize the displacement control for multiple displacement directions.

[0093] In this embodiment, the virtual object control method is described in detail based on a specific application scenario. Specifically, a sine function (ie, sin function) is selected as a periodic function for calculating the displacement offset. Figure 3 is a schematic diagram of a sine function provided in an embodiment of the present application, such as Figure 3 As shown, the function value of the sine function ranges from -1 to 1. By calculating the displacement offset according to the sine function, the back-and-forth swinging effect can be well achieved, wherein a negative number represents a displacement along the negative direction of the target displacement direction, and a positive number represents a displacement along the positive direction of the target displacement direction.

[0094] In this embodiment, three target displacement directions are set, namely, the directions corresponding to the x-axis, y-axis, and z-axis in the three-dimensional coordinate system where the three-dimensional model of the virtual object is located. For the three target displacement directions, three sets of displacement cycle frequency parameters and displacement speed parameters need to be set. Therefore, in this embodiment, Float3 is used to define the corresponding parameters to more conveniently call the parameters corresponding to the three target displacement directions and reduce unnecessary parameter naming. For example, the displacement cycle frequency parameter can be defined as Float3_Frequency, and the displacement speed parameter can be defined as Float3_Speed. It should be noted that the use of Float3 to define parameters actually includes 3 specific values, for example Float3_Frequency = (A, B, C), A, B and C are the values ​​of the displacement cycle frequency parameters in the three target displacement directions, respectively.

[0095] According to the horizontal coordinate uv.x of the above-mentioned UV line in the second UV coordinate system, combined with the above-mentioned displacement cycle frequency parameter and displacement speed parameter, the corresponding displacement offset can be calculated through the sine function. For example, by defining the target horizontal coordinate Float_Vector = uv.x, the sin function can be called to calculate the displacement offset in each target displacement direction: Float3 offset = sin(_Vector*_Frequency+_GameTime*_Speed). Among them, Float3 offset includes the displacement offset in three target displacement directions, _GameTime is the time parameter. In this embodiment, the game running time is used as the time parameter, and the calculation is combined with the game running time to achieve the animation effect of the virtual object shaking back and forth over time.

[0096] In one application scenario, a displacement distance multiplier Float3_Strength in each target displacement direction may also be defined. The above displacement distance multiplier may be used to adjust and update the displacement offset. For example, directly multiplying the displacement offset by the above displacement distance multiplier may adjust the value of the displacement offset originally ranging from -1 to 1. The value of the above displacement distance multiplier may be set and adjusted according to actual needs and is not specifically limited here.

[0097] In this embodiment, in order to clearly see the displacement control effect of the displacement offset on the virtual object, color rendering is used for exemplary display. Figure 4 is a schematic diagram of the effect of color rendering of a virtual object according to a displacement offset provided by an embodiment of the present application, Figure 5 is a schematic diagram of the effect of controlling the displacement of a virtual object according to a displacement offset provided by an embodiment of the present application. Figure 4 Each tentacle in represents a virtual object. Figure 5 Each circle represents Figure 4 The corresponding tentacle in the figure should be explained in order to better demonstrate. Figure 4 is the left view of the virtual object combination, Figure 5 It is a top view of the combination of virtual objects. Figure 4 and Figure 5 In the example, the closer the color of the tentacles is to white, the closer the displacement offset is to 1, and the closer the color is to black, the closer the displacement offset is to -1. Figure 4 and Figure 5 It can be seen that the tentacle with a displacement offset close to 1 Figure 5 The tentacles below 0 move to the right. Figure 5 The larger the absolute value of the displacement offset is, the greater the movement is.

[0098] However, when the virtual object is directly controlled according to the displacement offset, it moves as a whole. In this embodiment, it is necessary to achieve an animation effect in which the contact position is fixed and the closer to the contact position, the smaller the movement amplitude, that is, the closer to the bottom, the closer the displacement distance is to 0. Therefore, in this embodiment, the vertical coordinate of the UV line (i.e., height information) is further used as a mask to obtain the adjusted displacement offset.

[0099] Figure 6 is a schematic diagram of the effect of controlling the displacement of a virtual object according to the adjusted displacement offset provided by an embodiment of the present application, Figure 7 The embodiment of this application provides Figure 6 The corresponding schematic diagram of another viewing angle. Figure 6 and Figure 7It can be seen that when the adjusted displacement offset is used for control, the contact position can be fixed, and the animation effect of the smaller the movement amplitude is closer to the contact position, that is, a better animation effect can be obtained.

[0100] By adopting the scheme of the embodiment of the present application, the UV map of each virtual object in the virtual object combination in the first UV coordinate system can be obtained; the UV map of each virtual object is compressed to obtain the UV line corresponding to each virtual object; according to the arrangement position of each virtual object in the virtual object combination, each UV line is saved in the second UV coordinate system; thus, according to the horizontal coordinate of the UV line in the second UV coordinate system and the time parameter, the displacement offset of each UV line is obtained through a preset periodic function; due to the gradual change of the horizontal coordinate, each different UV line obtains a displacement offset with certain differences but showing a certain regularity as a whole; and the displacement offset of a UV line changes back and forth with time within a period of the periodic function; further, based on the UV line The displacement offset of each height is adjusted according to the vertical coordinate, and the adjusted displacement offset of each UV line decreases as the height of the UV line decreases, and the adjusted displacement offset at the lowest height in each UV line is 0; thereby, the closer to the bottom, the smaller the shaking amplitude, and the bottom (the contact position with other virtual objects) is fixed can be achieved; according to the adjusted displacement offset at each height of the UV line, the model vertices of the virtual object corresponding to the above height of the above UV line are controlled to be displaced; the flexibility of shaking control of the virtual object can be improved, the animation effect can be improved, and the shaking animation effect of the individual virtual objects in the virtual object combination can be achieved, which is beneficial to improving the user's viewing experience and game experience.

[0101] In this way, the UV map is used to accurately control the overall movement of the virtual object combination, the UV maps of the virtual object combination are merged according to the arrangement order (or arrangement position) of the virtual objects, and after compression and sorting, the dynamic function values ​​calculated by the program are used to control the vertices of the virtual objects to achieve the swaying animation effect of the virtual object combination.

[0102] Furthermore, independent shift cycle frequency parameters and displacement speed parameters may be used in multiple target displacement directions (eg, three target displacement directions). By adjusting and combining the shift cycle frequency parameters and the displacement speed parameters, the virtual object combination may be controlled to obtain a richer swaying animation effect.

[0103] This embodiment also provides a virtual object shaking control device, which can be integrated into a terminal device. Figure 8 As shown, the virtual object shaking control device may include:

[0104] A texture acquisition module 801 is used to acquire a UV texture of each virtual object in the virtual object combination in a first UV coordinate system;

[0105] A texture processing module 802 is used to compress the UV texture of each of the virtual objects to obtain UV lines corresponding to each of the virtual objects;

[0106] A UV line saving module 803, used for saving each of the UV lines into a second UV coordinate system according to the arrangement position of each of the virtual objects in the virtual object combination;

[0107] The displacement offset calculation module 804 is used to obtain the displacement offset of each UV line according to the horizontal coordinate of the UV line in the second UV coordinate system and the time parameter through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function;

[0108] The displacement offset adjustment module 805 is used to adjust the displacement offset based on the ordinate of the UV line in the second UV coordinate system to obtain the adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0;

[0109] The control module 806 is used to control the displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line.

[0110] In an optional example, the displacement offset calculation module 804 is specifically used to: determine the first displacement distance control parameter of each of the UV lines according to the horizontal coordinate of the UV line in the second UV coordinate system, and determine the second displacement distance control parameter of each of the UV lines according to the time parameter; and obtain the displacement offset of each of the UV lines by calculating the first displacement distance control parameter and the second displacement distance control parameter through the periodic function.

[0111] In an optional example, the displacement offset calculation module 804 is further specifically used to: obtain a displacement cycle frequency parameter and a displacement speed parameter;

[0112] Determine the first displacement distance control parameter of the UV line according to the product of the abscissa of the UV line in the second UV coordinate system and the displacement cycle frequency parameter;

[0113] The second displacement distance control parameter of the UV line is determined according to the product of the time parameter and the displacement speed parameter.

[0114] In an optional example, the displacement offset calculation module 804 is further specifically used to obtain displacement cycle frequency parameters and displacement speed parameters in a target displacement direction, wherein the target displacement direction includes at least one coordinate axis direction in the coordinate system where the virtual object is located; the control module 806 is specifically used to control the model vertices of the virtual object corresponding to the height of the UV line to be displaced along the target displacement direction according to the adjusted displacement offset of the UV line at each height in the target displacement direction.

[0115] In an optional example, the virtual object shaking control device also includes a line stretching module for stretching each of the UV lines to be the same height as the vertical axis of the UV coordinate system in which it is located; the displacement offset adjustment module 805 is specifically used to: multiply the displacement offset at each height of the UV line by the vertical coordinate corresponding to the height in the second UV coordinate system to obtain the adjusted displacement offset of each of the UV lines that changes with height.

[0116] In an optional example, the above-mentioned map acquisition module 801 is specifically used to: perform front view projection on each virtual object in the above-mentioned virtual object combination to obtain a UV map of each of the above-mentioned virtual objects in the above-mentioned first UV coordinate system.

[0117] In an optional example, the above-mentioned mapping processing module 802 is specifically used to: compress the UV mapping of each of the above-mentioned virtual objects according to the arrangement direction of the above-mentioned virtual objects in the above-mentioned virtual object combination, and obtain the UV lines corresponding to each of the above-mentioned virtual objects; the above-mentioned UV line saving module 803 is specifically used to: according to the arrangement position of each of the above-mentioned virtual objects in the above-mentioned virtual object combination, save each of the above-mentioned UV lines in the above-mentioned second UV coordinate system in a manner of being arranged along the horizontal axis of the second UV coordinate.

[0118] By adopting the scheme of the embodiment of the present application, the UV map of each virtual object in the virtual object combination in the first UV coordinate system can be obtained; the UV map of each virtual object is compressed to obtain the UV line corresponding to each virtual object; according to the arrangement position of each virtual object in the virtual object combination, each UV line is saved in the second UV coordinate system; thus, according to the horizontal coordinate of the UV line in the second UV coordinate system and the time parameter, the displacement offset of each UV line is obtained through a preset periodic function; due to the gradual change of the horizontal coordinate, each different UV line obtains a displacement offset with certain differences but showing a certain regularity as a whole; and the displacement offset of a UV line changes back and forth with time within a period of the periodic function; further, based on the UV line The displacement offset of each height is adjusted according to the vertical coordinate, and the adjusted displacement offset of each UV line decreases as the height of the UV line decreases, and the adjusted displacement offset at the lowest height in each UV line is 0; thereby, the closer to the bottom, the smaller the shaking amplitude, and the bottom (the contact position with other virtual objects) is fixed can be achieved; according to the adjusted displacement offset at each height of the UV line, the model vertices of the virtual object corresponding to the above height of the above UV line are controlled to be displaced; the flexibility of shaking control of the virtual object can be improved, the animation effect can be improved, and the shaking animation effect of the individual virtual objects in the virtual object combination can be achieved, which is beneficial to improving the user's viewing experience and game experience.

[0119] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.

[0120] like Fig. 9 As shown, Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 900 includes a processor 901 having one or more processing cores, a memory 902 having one or more computer-readable storage media, and a computer program stored in the memory 902 and executable on the processor. The processor 901 is electrically connected to the memory 902. It will be understood by those skilled in the art that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0121] The processor 901 is the control center of the electronic device 900, and uses various interfaces and lines to connect various parts of the entire electronic device 900. By running or loading software programs and / or units stored in the memory 902, and calling data stored in the memory 902, the processor 901 executes various functions of the electronic device 900 and processes data, thereby monitoring the electronic device 900 as a whole. The processor 901 can be a processor CPU, a graphics processor GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0122] In the embodiment of the present application, the processor 901 in the electronic device 900 loads instructions corresponding to the processes of one or more application programs into the memory 902 according to the following steps, and the processor 901 runs the application programs stored in the memory 902, thereby realizing various functions, for example:

[0123] Obtain the UV map of each virtual object in the virtual object combination in the first UV coordinate system;

[0124] Compressing the UV maps of the virtual objects to obtain UV lines corresponding to the virtual objects;

[0125] According to the arrangement position of each of the virtual objects in the virtual object combination, each of the UV lines is saved in a second UV coordinate system;

[0126] According to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter, the displacement offset of each of the UV lines is obtained through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function;

[0127] The displacement offset is adjusted based on the ordinate of the UV line in the second UV coordinate system to obtain an adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0;

[0128] According to the adjusted displacement offset at each height of the UV line, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced.

[0129] In an optional example, the displacement offset of each of the UV lines is obtained by a preset periodic function according to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter, including:

[0130] Determine a first displacement distance control parameter of each of the UV lines according to the horizontal coordinate of the UV line in the second UV coordinate system, and determine a second displacement distance control parameter of each of the UV lines according to the time parameter;

[0131] The displacement offset of each of the UV lines is obtained by calculating the periodic function according to the first displacement distance control parameter and the second displacement distance control parameter.

[0132] In an optional example, determining the first displacement distance control parameter of each of the UV lines according to the horizontal coordinate of the UV line in the second UV coordinate system, and determining the second displacement distance control parameter of each of the UV lines according to the time parameter, includes:

[0133] Obtain displacement cycle frequency parameters and displacement speed parameters;

[0134] Determine the first displacement distance control parameter of the UV line according to the product of the abscissa of the UV line in the second UV coordinate system and the displacement cycle frequency parameter;

[0135] The second displacement distance control parameter of the UV line is determined according to the product of the time parameter and the displacement speed parameter.

[0136] In an optional example, the above-mentioned obtaining of the displacement cycle frequency parameter and the displacement speed parameter includes:

[0137] Acquire a displacement cycle frequency parameter and a displacement speed parameter in a target displacement direction, wherein the target displacement direction includes at least one coordinate axis direction in the coordinate system where the virtual object is located;

[0138] The controlling of displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line includes:

[0139] According to the adjusted displacement offset of the UV line at each height in the target displacement direction, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced along the target displacement direction.

[0140] In an optional example, before adjusting the displacement offset based on the vertical coordinate of the UV line in the second UV coordinate system to obtain the adjusted displacement offset of each UV line, the method further includes:

[0141] Stretch each of the above UV lines to be the same height as the vertical axis of the UV coordinate system where it is located;

[0142] The above-mentioned displacement offset is adjusted based on the ordinate of the above-mentioned UV line to obtain the adjusted displacement offset of each of the above-mentioned UV lines, including:

[0143] The displacement offset of each UV line at each height is multiplied by the ordinate corresponding to the height in the second UV coordinate system to obtain the adjusted displacement offset of each UV line as it changes with height.

[0144] In an optional example, the step of obtaining the UV map of each virtual object in the virtual object combination in the first UV coordinate system includes:

[0145] Perform front view projection on each virtual object in the virtual object combination to obtain a UV map of each virtual object in the first UV coordinate system.

[0146] In an optional example, compressing the UV maps of the virtual objects to obtain UV lines corresponding to the virtual objects includes:

[0147] According to the arrangement direction of the virtual objects in the virtual object combination, the UV map of each of the virtual objects is compressed to obtain UV lines corresponding to each of the virtual objects;

[0148] The step of saving the UV lines into the second UV coordinate system according to the arrangement positions of the virtual objects in the virtual object combination includes:

[0149] According to the arrangement position of each of the virtual objects in the virtual object combination, each of the UV lines is saved in the second UV coordinate system in a manner of being arranged along the horizontal axis of the second UV coordinate.

[0150] Thereby, a better shaking animation effect of the virtual object combination can be obtained.

[0151] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0152] Optional, such as Fig. 9 As shown, the electronic device 900 further includes: a touch screen 903, a radio frequency circuit 904, an audio circuit 905, an input unit 906, and a power supply 907. The processor 901 is electrically connected to the touch screen 903, the radio frequency circuit 904, the audio circuit 905, the input unit 906, and the power supply 907, respectively. Those skilled in the art can understand that Fig. 9 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0153] The touch display screen 903 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 903 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 901, and can receive the command sent by the processor 901 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 901 to determine the type of touch event, and then the processor 901 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 903 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 903 can also be used as a part of the input unit 906 to realize the input function.

[0154] The radio frequency circuit 904 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0155] The audio circuit 905 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 905 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 905 and converted into audio data, and then the audio data is output to the processor 901 for processing, and then sent to another electronic device through the radio frequency circuit 904, or the audio data is output to the memory 902 for further processing. The audio circuit 905 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0156] The input unit 906 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0157] The power supply 907 is used to supply power to various components of the electronic device 900. Optionally, the power supply 907 can be logically connected to the processor 901 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 907 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0158] although Fig. 9 Not shown, the electronic device 900 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0159] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0160] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0161] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute any virtual object shaking control method provided in the embodiment of the present application. The computer program can execute the following steps of the virtual object shaking control method:

[0162] Obtain the UV map of each virtual object in the virtual object combination in the first UV coordinate system;

[0163] Compressing the UV maps of the virtual objects to obtain UV lines corresponding to the virtual objects;

[0164] According to the arrangement position of each of the virtual objects in the virtual object combination, each of the UV lines is saved in a second UV coordinate system;

[0165] According to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter, the displacement offset of each of the UV lines is obtained through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function;

[0166] The displacement offset is adjusted based on the ordinate of the UV line in the second UV coordinate system to obtain an adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0;

[0167] According to the adjusted displacement offset at each height of the UV line, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced.

[0168] In an optional example, the displacement offset of each of the UV lines is obtained by a preset periodic function according to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter, including:

[0169] Determine a first displacement distance control parameter of each of the UV lines according to the horizontal coordinate of the UV line in the second UV coordinate system, and determine a second displacement distance control parameter of each of the UV lines according to the time parameter;

[0170] The displacement offset of each of the UV lines is obtained by calculating the periodic function according to the first displacement distance control parameter and the second displacement distance control parameter.

[0171] In an optional example, determining the first displacement distance control parameter of each of the UV lines according to the horizontal coordinate of the UV line in the second UV coordinate system, and determining the second displacement distance control parameter of each of the UV lines according to the time parameter, includes:

[0172] Obtain displacement cycle frequency parameters and displacement speed parameters;

[0173] Determine the first displacement distance control parameter of the UV line according to the product of the abscissa of the UV line in the second UV coordinate system and the displacement cycle frequency parameter;

[0174] The second displacement distance control parameter of the UV line is determined according to the product of the time parameter and the displacement speed parameter.

[0175] In an optional example, the above-mentioned obtaining of the displacement cycle frequency parameter and the displacement speed parameter includes:

[0176] Acquire a displacement cycle frequency parameter and a displacement speed parameter in a target displacement direction, wherein the target displacement direction includes at least one coordinate axis direction in the coordinate system where the virtual object is located;

[0177] The controlling of displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line includes:

[0178] According to the adjusted displacement offset of the UV line at each height in the target displacement direction, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced along the target displacement direction.

[0179] In an optional example, before adjusting the displacement offset based on the vertical coordinate of the UV line in the second UV coordinate system to obtain the adjusted displacement offset of each UV line, the method further includes:

[0180] Stretch each of the above UV lines to be the same height as the vertical axis of the UV coordinate system where it is located;

[0181] The above-mentioned displacement offset is adjusted based on the ordinate of the above-mentioned UV line to obtain the adjusted displacement offset of each of the above-mentioned UV lines, including:

[0182] The displacement offset of each UV line at each height is multiplied by the ordinate corresponding to the height in the second UV coordinate system to obtain the adjusted displacement offset of each UV line as it changes with height.

[0183] In an optional example, the step of obtaining the UV map of each virtual object in the virtual object combination in the first UV coordinate system includes:

[0184] Perform front view projection on each virtual object in the virtual object combination to obtain a UV map of each virtual object in the first UV coordinate system.

[0185] In an optional example, compressing the UV maps of the virtual objects to obtain UV lines corresponding to the virtual objects includes:

[0186] According to the arrangement direction of the virtual objects in the virtual object combination, the UV map of each of the virtual objects is compressed to obtain UV lines corresponding to each of the virtual objects;

[0187] The step of saving the UV lines into the second UV coordinate system according to the arrangement positions of the virtual objects in the virtual object combination includes:

[0188] According to the arrangement position of each of the virtual objects in the virtual object combination, each of the UV lines is saved in the second UV coordinate system in a manner of being arranged along the horizontal axis of the second UV coordinate.

[0189] Thereby, a better shaking animation effect of the virtual object combination can be obtained.

[0190] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0191] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0192] Since the computer program stored in the computer-readable storage medium can execute any virtual object shaking control method provided in the embodiments of the present application, the beneficial effects that can be achieved by any virtual object shaking control method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0193] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

[0194] In the above-mentioned embodiments of the virtual object shaking control device, computer-readable storage medium, electronic device, and computer program product, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the virtual object shaking control device, computer-readable storage medium, computer program product, electronic device and its corresponding units described above can refer to the description of the virtual object shaking control method in the above embodiment, and will not be repeated here.

[0195] The above is a detailed introduction to a virtual object shaking control method, device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A virtual object shaking control method, characterized in that: include: Obtain the UV map of each virtual object in the virtual object combination in the first UV coordinate system; Compressing the UV map of each virtual object to obtain UV lines corresponding to each virtual object; According to the arrangement position of each virtual object in the virtual object combination, each UV line is saved in a second UV coordinate system; According to the horizontal coordinates of the UV lines in the second UV coordinate system and the time parameter, a displacement offset of each of the UV lines is obtained through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function; The displacement offset is adjusted based on the ordinate of the UV line in the second UV coordinate system to obtain an adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0; According to the adjusted displacement offset at each height of the UV line, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced.

2. The virtual object shaking control method according to claim 1, wherein the displacement offset of each UV line is obtained by a preset periodic function according to the horizontal coordinate of the UV line in the second UV coordinate system and the time parameter, comprising: Determine a first displacement distance control parameter of each UV line according to the horizontal coordinate of the UV line in the second UV coordinate system, and determine a second displacement distance control parameter of each UV line according to the time parameter; The displacement offset of each of the UV lines is calculated by the periodic function according to the first displacement distance control parameter and the second displacement distance control parameter.

3. The virtual object shaking control method according to claim 2, characterized in that: The step of determining the first displacement distance control parameter of each UV line according to the horizontal coordinate of the UV line in the second UV coordinate system, and determining the second displacement distance control parameter of each UV line according to the time parameter, comprises: Obtain displacement cycle frequency parameters and displacement speed parameters; Determine a first displacement distance control parameter of the UV line according to the product of the abscissa of the UV line in the second UV coordinate system and the displacement cycle frequency parameter; A second displacement distance control parameter of the UV line is determined according to the product of the time parameter and the displacement speed parameter.

4. The virtual object shaking control method according to claim 3, characterized in that: The step of obtaining the displacement cycle frequency parameter and the displacement speed parameter comprises: Acquire a displacement cycle frequency parameter and a displacement speed parameter in a target displacement direction, wherein the target displacement direction includes at least one coordinate axis direction in the coordinate system where the virtual object is located; The step of controlling the displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line includes: According to the adjusted displacement offset of the UV line at each height in the target displacement direction, the model vertices of the virtual object corresponding to the height of the UV line are controlled to be displaced along the target displacement direction.

5. The virtual object shaking control method according to claim 1, characterized in that: Before adjusting the displacement offset based on the ordinate of the UV line in the second UV coordinate system to obtain the adjusted displacement offset of each UV line, the method further includes: Stretching each of the UV lines to have the same height as the vertical axis of the UV coordinate system where it is located; The adjusting the displacement offset based on the ordinate of the UV line to obtain the adjusted displacement offset of each UV line includes: The displacement offset of each UV line at each height is multiplied by the ordinate corresponding to the height in the second UV coordinate system to obtain the adjusted displacement offset of each UV line that changes with height.

6. The virtual object shaking control method according to any one of claims 1 to 5, characterized in that: The step of obtaining a UV map of each virtual object in the virtual object combination in the first UV coordinate system includes: Perform front view projection on each virtual object in the virtual object combination to obtain a UV map of each virtual object in the first UV coordinate system.

7. The virtual object shaking control method according to any one of claims 1 to 5, characterized in that: The compressing the UV map of each virtual object to obtain the UV lines corresponding to each virtual object includes: According to the arrangement direction of the virtual objects in the virtual object combination, compressing the UV map of each virtual object to obtain UV lines corresponding to each virtual object; The step of saving each of the UV lines to a second UV coordinate system according to the arrangement position of each of the virtual objects in the virtual object combination includes: According to the arrangement position of each virtual object in the virtual object combination, each UV line is saved in the second UV coordinate system in a manner of being arranged along the horizontal axis of the second UV coordinate.

8. A virtual object shaking control device, characterized in that: include: A texture acquisition module, used to acquire a UV texture of each virtual object in the virtual object combination in the first UV coordinate system; A texture processing module, used to compress the UV texture of each virtual object to obtain UV lines corresponding to each virtual object; A UV line saving module, used for saving each UV line in a second UV coordinate system according to the arrangement position of each virtual object in the virtual object combination; A displacement offset calculation module, used to obtain the displacement offset of each UV line according to the horizontal coordinate of the UV line in the second UV coordinate system and the time parameter through a preset periodic function, wherein the displacement offset changes back and forth with time within a period of the periodic function; a displacement offset adjustment module, configured to adjust the displacement offset based on the ordinate of the UV line in the second UV coordinate system to obtain an adjusted displacement offset of each UV line, wherein the adjusted displacement offset at each height of each UV line decreases as the height decreases, and the adjusted displacement offset at the lowest height of each UV line is 0; The control module is used to control the displacement of the model vertices of the virtual object corresponding to the height of the UV line according to the adjusted displacement offset at each height of the UV line.

9. An electronic device, characterized in that: It comprises a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the virtual object shaking control method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the virtual object shaking control method according to any one of claims 1 to 7.