Trampling Imprint Display Method and Device Based on Trampling Operation
By detecting the pedal operation in virtual reality and correcting the collision parameters of the surface object unit, the pedal mark is directly displayed, which solves the problem of excessive resource consumption in the prior art, and achieves smooth operation and real pedal simulation.
Patent Information
- Application Number
- CN202111629618.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-12-28
AI Technical Summary
When stomping operations in virtual reality, the prior art requires the physical engine to simulate real visual effects, resulting in excessive consumption of computer resources, resulting in lag in the interface and poor operation.
By detecting the pedaling operation in the virtual scene, the surface pedaling position is determined, and the unit count value stored in the unit counter of the surface object unit is obtained. The unit collision parameters are corrected according to the unit count value, and the corresponding pedaling mark is directly displayed to avoid real simulation through the physical engine.
On the premise of reducing system resource consumption, the real simulation of the pedal mark is realized, which avoids the problem of interface lag, and makes the state of the pedal mark related to the number of pedals of the surface object unit, and changes dynamically to achieve the effect of truly simulating the surface state.
Smart Images

Figure CN116351050B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of virtual reality, and particularly to a method and apparatus for displaying trampling imprints based on trampling operations. Background Art
[0002] In a virtual reality scenario, the surface area may change with trampling operations. For example, when a character object tramples on snow, virtual footprints will appear on the snow; when a character object tramples on the desert, a sunken visual effect will appear on the desert. In the related art, the physical engine is used to calculate in real time the sunken effect generated after the character object comes into contact with the surface area, and then the corresponding trampling imprints are presented according to the calculation results.
[0003] However, the inventors found that the existing methods have at least the following defects during the implementation of the present invention: When simulating real visual effects through a physical engine, a large amount of computer resources are consumed, resulting in a large resource consumption, and thus technical problems such as interface lag and unsmooth operations are likely to occur. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a method and apparatus for displaying trampling imprints based on trampling operations that overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of the present invention, there is provided a method for displaying trampling imprints based on trampling operations, including:
[0006] Responding to detecting a trampling operation in a virtual scene, determining a surface trampling position corresponding to the trampling operation;
[0007] Obtaining a unit count value stored in a unit counter of a surface object unit corresponding to the surface trampling position;
[0008] Modifying unit collision parameters of the surface object unit according to the unit count value to obtain modified unit collision parameters;
[0009] Determining an imprint state corresponding to the trampling operation according to the modified unit collision parameters, and displaying a trampling imprint matching the imprint state.
[0010] According to another aspect of the present invention, there is provided an apparatus for displaying trampling imprints based on trampling operations, including:
[0011] A response module, adapted to respond to detecting a trampling operation in a virtual scene and determine a surface trampling position corresponding to the trampling operation;
[0012] An acquisition module, adapted to acquire the unit count value stored in the unit counter of the surface object unit corresponding to the surface trampling position;
[0013] A correction module, adapted to correct the unit collision parameter of the surface object unit according to the unit count value to obtain a corrected unit collision parameter;
[0014] A display module, adapted to determine the imprint state corresponding to the trampling operation according to the corrected unit collision parameter and display a trampling imprint matching the imprint state.
[0015] According to another aspect of the present invention, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus;
[0016] The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operations corresponding to the above-mentioned trampling imprint display method based on a trampling operation.
[0017] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, and at least one executable instruction is stored in the storage medium, and the executable instruction causes the processor to execute the operations corresponding to the above-mentioned trampling imprint display method based on a trampling operation.
[0018] In the trampling imprint display method and device based on a trampling operation provided by the present invention, the surface trampling position corresponding to the detected trampling operation and the unit count value stored in the unit counter of the corresponding surface object unit are determined, the unit collision parameter of the surface object unit is corrected according to the unit count value, and the trampling imprint corresponding to the trampling operation is determined and displayed according to the corrected unit collision parameter. It can be seen that this method does not need to perform real simulation through a physical engine, directly determines the trampling imprint of the trampling operation according to the unit collision parameter of the surface object unit, and can realize the real simulation of the trampling imprint on the premise of reducing system resource consumption. Moreover, this method sets a unit counter for the surface object unit, and can correct the unit collision parameter in combination with the unit count value stored in the unit counter, so that the state of the trampling imprint is related to the number of trampling times of the surface object unit, and further enables the trampling imprint to change dynamically with the number of trampling times of the surface, achieving the effect of realistically simulating the surface state. In short, this method can avoid the problem of interface lag while saving computing power.
[0019] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the description. And in order to make the above and other purposes, features, and advantages of the present invention more obvious and understandable, the following specifically describes the specific embodiments of the present invention. Description of the Drawings
[0020] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered as limiting the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0021] Figure 1 A flowchart of a method for displaying a trampling mark based on a trampling operation provided by an embodiment of the present invention is shown;
[0022] Figure 2 A flowchart of a method for displaying a trampling mark based on a trampling operation provided by another embodiment of the present invention is shown;
[0023] Figure 3 A schematic diagram of the system architecture of the method for displaying a trampling mark based on a trampling operation provided by this embodiment is shown;
[0024] Figure 4 A structural diagram of a device for displaying a trampling mark based on a trampling operation provided by another embodiment of the present invention is shown;
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided by another embodiment of the present invention is shown. Detailed Embodiments
[0026] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although the exemplary 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 limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be completely conveyed to those skilled in the art.
[0027] Figure 1 A flowchart of a method for displaying a trampling mark based on a trampling operation provided by an embodiment of the present invention is shown. As Figure 1 shown, the method includes:
[0028] Step S110: In response to detecting a trampling operation in the virtual scene, determine the ground trampling position corresponding to the trampling operation.
[0029] Among them, the trampling operation is an operation generated by the contact between a virtual object in the virtual scene and the surface area object. The surface area object is a virtual object used to display the ground area in the virtual scene, and can be specifically presented in the form of a 3D mesh. The virtual object used to trigger the trampling operation can be a human object, an animal object, etc. For example, when a human object lies prostrate on the ground or lands on both feet, it will come into contact with the surface area object, thereby triggering the trampling operation.
[0030] By detecting whether the collision bodies of the virtual object and the surface area object collide, it can be determined whether the virtual object and the surface area object are in contact. When the virtual object and the surface area object are in contact, the trampling operation will be triggered. Among them, the trampling operation can specifically be various forms such as a trampling event, a collision instruction, a collision trigger message, etc., and the present invention does not limit this.
[0031] When a trampling operation in the virtual scene is detected, determine the surface trampling position corresponding to the trampling operation. Among them, the surface trampling position can be described by position coordinates, and specifically, the position coordinates can be obtained by acquiring the parameter information corresponding to the trampling event, the collision instruction, or the collision trigger message.
[0032] Step S120: Obtain the unit count value stored in the unit counter of the surface object unit corresponding to the surface trampling position.
[0033] Since the surface area object covers the entire ground area, for the convenience of describing the geomorphic characteristics of different regions, the surface area object is divided into multiple surface object units. Correspondingly, determine the surface object unit corresponding to the surface trampling position, and obtain the unit count value stored in the unit counter of this surface object unit.
[0034] Among them, each surface object unit corresponds to a unit counter, and this unit counter is used to record the trampling records associated with this surface object unit. The unit count value stored in the unit counter of the surface object unit can be the number of tramplings of this surface object unit, or it can also be the result obtained after performing a preset operation on the number of tramplings of this surface object unit. The present invention does not limit the specific determination method of the unit count value, as long as it can reflect the historical trampling situation of the surface object unit.
[0035] Step S130: Modify the unit collision parameter of the surface object unit according to the unit count value to obtain the modified unit collision parameter.
[0036] Each surface object unit has a corresponding unit collision parameter, which is used to describe the collision response characteristics of the corresponding surface object unit. Usually, the collision response characteristics of surface object units of different materials are different, and even for surface object units of the same material, the collision response characteristics may also vary with the different attribute information such as water content and hardness of the material. Therefore, the collision response characteristics of the surface object unit can be accurately described by the unit collision parameter. The type and number of unit collision parameters can be flexibly set according to the specific scenario. For example, the unit collision parameter can be a single-dimensional parameter or a composite parameter of multiple dimensions, which is not limited in the present invention.
[0037] The unit collision parameters are set according to the material characteristics, landform characteristics, and characteristics of the associated objects contained in the surface object unit. Under normal circumstances, the unit collision parameters of the same surface object unit are fixed. In this embodiment, the unit collision parameters of the surface object unit are corrected by the unit count value, so that the corrected unit collision parameters change dynamically with the change of the unit count value. Among them, there can be multiple correction methods, which can be specifically determined according to the material characteristics of the surface object unit. For example, the surface object units of a part of the material become harder as the number of trampling increases, and the surface object units of another part of the material become softer as the number of trampling increases. Therefore, there can be multiple correction methods for the unit collision parameters, and the present invention does not limit this.
[0038] Step S140: determining a mark state corresponding to the stepping operation according to the corrected unit collision parameter, and displaying a stepping mark matching the mark state.
[0039] There is a certain correspondence between the unit collision parameter and the imprint state of the trampling operation. Therefore, the imprint state corresponding to the trampling operation can be determined according to the corrected unit collision parameter. The imprint state includes at least one of the following: imprint depth, imprint influence range, and imprint additional special effects. The imprint depth is used to describe the degree of surface subsidence after trampling, and the imprint influence range is used to describe the scope of surface collapse after trampling. The imprint additional special effects include: a splashing special effect for describing whether water splashes after trampling, and a dust effect for describing whether sand and dust fly after trampling.
[0040] The specific connotation of the mark state can be flexibly adjusted with the change of the dimension of the unit collision parameter, and the present invention does not limit this. In addition, the trample mark can be presented in the form of a map.
[0041] It can be seen that this method does not require real simulation through a physical engine. Instead, it directly determines the trampling mark of the trampling operation based on the unit collision parameters of the surface object unit, and can achieve the real simulation of the trampling mark on the premise of reducing system resource consumption. Moreover, this method sets a unit counter for the surface object unit, and can correct the unit collision parameters in combination with the unit count value stored in the unit counter, so that the state of the trampling mark is related to the number of trampling times of the surface object unit, and then the trampling mark can change dynamically with the number of trampling times of the surface, achieving the effect of realistically simulating the surface state. In short, this method can avoid the problem of interface freezing while saving computing power.
[0042] Figure 2 The flowchart of a method for displaying a trampling mark based on a trampling operation provided by another embodiment of the present invention is shown. As Figure 2 shown, the method includes:
[0043] Step S210: Detect a trampling operation in the virtual scene.
[0044] Among them, the virtual scene includes various scenes such as game virtual scenes and interactive virtual reality scenes. In the virtual scene, when a virtual object contacts a surface area object, a trampling operation will be triggered. In this embodiment, the trampling operation can be detected in various ways.
[0045] In the first detection method, obtain the key state of the trampling control key associated with the trampling operation, and detect the trampling operation in the virtual scene according to the key state. Among them, the trampling control key is used to control the character object to perform a trampling operation. For example, the direction key, space key, etc. can all be used as the trampling control key, which specifically depends on the game settings. In addition, in addition to physical keys, the trampling control key can also be in other forms such as virtual keys and shortcut keys. The present invention does not limit the specific types and quantities of the trampling control keys. For example, whenever it is detected that the direction key is pressed, it is determined that a trampling operation is detected; when the direction key is pressed multiple times, it is determined that multiple trampling operations are detected. This method can quickly determine the trampling operation according to the trampling control key without performing complex calculations, so it will not consume additional system resources, can be achieved at a low cost, and will not affect the game performance.
[0046] In addition, considering that the response of the trampling control key requires a certain duration, an interval threshold can also be set according to the response duration. When the trigger interval of the trampling control key is less than the interval threshold, the trigger times of the trampling control key are adjusted according to the interval threshold, and the number of trampling times is determined according to the adjusted trigger times. For example, when the user frequently operates the trampling control key, the character object may not have time to respond, which may cause the situation that the user presses the trampling control key twice, but the character object only performs one trampling operation. Therefore, the number of trampling times can be adjusted through the interval threshold, thereby improving the accuracy of the number of trampling times.
[0047] In the second detection method, a trampling operation in the virtual scene is detected according to the playing state of the virtual animation and / or the relative distance between the trampling part in the virtual object and the unit collision body of the surface object unit. Among them, when detecting according to the playing state of the virtual animation, when the playing state of the virtual object is in a state of contacting the ground, it is determined that a trampling operation is detected. When detecting according to the relative distance between the trampling part in the virtual object and the unit collision body of the surface object unit, when the relative distance between the trampling part in the virtual object and the unit collision body of the surface object unit is zero, it is determined that a trampling operation is detected.
[0048] In the third detection method, a trampling operation in the virtual scene is detected according to the collision result between the virtual object in the virtual scene and the unit collision body of the surface object unit. For example, the virtual object in the virtual scene has an object collision body, and the surface object unit has a unit collision body. By detecting whether a collision occurs between the object collision body and the unit collision body, a trampling operation in the virtual scene can be detected.
[0049] Of course, in addition to the above detection methods, other methods can also be flexibly used for detection. For example, the IK ray detection method can be used. Among them, the IK switch is used to control the foot movement of the character object, so that after one foot of the character object touches the ground, the other foot can leave the ground, thereby preventing the visual effect of slipping. Correspondingly, by detecting the trigger times of the IK switch, the execution times of the trampling operation can also be determined. In addition, when the distance between the foot object and the surface area object is detected to be zero, it can also be determined that a trampling operation has been executed.
[0050] Step S220: In response to detecting a trampling operation in the virtual scene, determine the surface trampling position corresponding to the trampling operation.
[0051] When a trampling operation in the virtual scene is detected, determine the surface trampling position corresponding to the trampling operation. Among them, the trampling operation can specifically be various forms such as a trampling event, a collision instruction, a collision trigger message, etc., and the present invention does not limit this. Among them, the surface trampling position can be described by position coordinates, and specifically, the position coordinates can be obtained by obtaining the parameter information corresponding to the trampling event, the collision instruction, or the collision trigger message.
[0052] Step S230: Obtain the unit count value stored in the unit counter of the surface object unit corresponding to the surface trampling position.
[0053] Among them, the surface area object is divided into multiple surface object units. Correspondingly, the surface object unit corresponding to the surface trampling position is determined. Among them, each surface object unit corresponds to a unit counter, and the unit counter is used to record the trampling records associated with the surface object unit.
[0054] Optionally, in one implementation, after detecting a trampling operation in the virtual scene and determining the corresponding surface trampling position, further update the unit count value associated with the number of trampling times of the surface object unit stored in the unit counter of the surface object unit according to the detected trampling operation this time. Correspondingly, the unit count value obtained in this step is the latest value obtained after updating the unit counter according to this trampling operation.
[0055] Among them, when updating the unit count value stored in the unit counter of the surface object unit according to the detected trampling operation this time, it can be implemented in various ways: in one way, the unit count value can be directly updated according to the number of trampling times corresponding to the trampling operation; in another way, it can also be updated in combination with the relevant information of the trampling operation. For example, obtain the object attribute information and / or trampling state information of the target object performing the trampling operation, and determine the weight coefficient of this trampling operation according to the object attribute information and / or trampling state information; obtain the trampling count value according to the weight coefficient, and update the unit count value stored in the unit counter of the surface object unit according to the trampling count value. For example, when it is determined according to the object attribute information that the weight of the target object performing the trampling operation is large and the power is high, a larger weight coefficient can be set; when it is determined according to the trampling state information that the trampling force this time is large, a larger weight coefficient can be set. Among them, when the trampling control keys include multiple types, the trampling state information can be determined according to the key type of the trampling control key. For example, the trampling force corresponding to the space bar is greater than the trampling force corresponding to the arrow keys.
[0056] Step S240: Obtain the unit collision parameter of the surface object unit corresponding to the surface trampling position.
[0057] Among them, each surface object unit has a corresponding unit collision parameter, and the unit collision parameter is used to describe the collision response characteristics of the corresponding surface object unit. The unit collision parameter can be implemented in various ways.
[0058] In the first implementation, the unit collision parameter is a material-type collision parameter. The material-type collision parameter contains material data of multiple dimensions, which is used to reflect the multi-dimensional material characteristics of the surface. Accordingly, when generating a surface area object, the corresponding material-type collision parameter is determined, and the specific implementation process is as follows: First, a surface area object is generated. According to the regional material characteristics of the surface area and / or the object characteristics of the associated objects associated with the surface area, a physical material generation calculation is performed on the basis of the three-dimensional terrain through an evolutionary algorithm, so as to calculate the multi-dimensional material information such as the material particle size, material depth, material hardness, material water content, and material load-bearing ratio contained in the surface area. For example, taking a desert-type surface area object as an example, an evolutionary algorithm is used on the basis of the existing 3D terrain to perform a physical desert generation calculation to determine the particle size of the desert and the density of trees growing in the desert, so as to calculate the information such as the gravel size, gravel hardness, gravel water content, and gravel load-bearing ratio of the desert according to the surrounding environment to simulate the real ecosystem. Then, the above-mentioned material information of the surface object unit contained in the surface area object is recorded through the unit collision parameters, specifically including: a first collision parameter corresponding to the material depth, a second collision parameter corresponding to the material hardness, a third collision parameter corresponding to the material water content, and a fourth collision parameter corresponding to the material load-bearing ratio.
[0059] In the second implementation, the unit collision parameter is a material softness parameter, which is used to indicate the softness of the surface material and is usually a single-dimensional value. In specific implementation, the material softness parameter can be set according to the multi-dimensional material characteristics of the surface.
[0060] The unit collision parameters of the surface object unit can be stored through the surface material data table. Accordingly, the unit collision parameters of the surface object unit are determined in the following manner: querying the preset surface material data table, obtaining the surface material information of the surface object unit corresponding to the surface trampled position according to the surface material data table; determining the unit collision parameters of the surface object unit according to the surface material information; wherein, whenever a surface object creation operation is detected, the surface material data table is updated according to the surface object creation operation; wherein the surface material information of the surface object unit includes at least two of the following dimensions: first dimension information corresponding to material depth, second dimension information corresponding to material hardness, third dimension information corresponding to material water content, and fourth dimension information corresponding to material load-bearing ratio; wherein the surface material includes at least one of the following: desert material, snow material, grass material, and swamp material.
[0061] Step S250: Correcting the acquired unit collision parameter of the surface object unit according to the unit count value to obtain the corrected unit collision parameter.
[0062] In the process of implementing the present invention, the inventor found that the number of times and the degree of trampling on the surface area will affect the unit collision parameters of the surface object unit. Therefore, correction processing is performed according to the correlation between the number of trampling times on the surface area and the unit collision parameters of the surface object unit. Among them, the correction processing methods include at least one of the following:
[0063] In the first correction method, a preset operation is directly performed on the unit collision parameters according to the unit count value. For example, the larger the unit count value, the larger the unit collision parameter; or, the smaller the unit count value, the smaller the unit collision parameter. In short, through the preset operation relationship, the corrected unit collision parameter is determined.
[0064] In the second correction method, correction is performed according to the influence coefficient corresponding to the unit count value. Specifically, the numerical interval to which the unit count value belongs is determined, and the influence coefficient corresponding to the numerical interval stored in the influence coefficient table is queried; the unit collision parameter of the surface object unit is corrected according to the queried influence coefficient to obtain the corrected unit collision parameter. For example, when the unit count value is in the first numerical interval (0, 50), it corresponds to the first influence coefficient 0.8; when the unit count value is in the second numerical interval (50, 100), it corresponds to the second influence coefficient 0.6... and so on. In actual situations, when the number of times the surface is trampled is small, the influence degree on the footprint collapse is high; when the number of times the surface is trampled is large, the influence degree on the footprint collapse is low. The above numerical intervals and influence coefficients can be flexibly set according to the characteristics of the surface address.
[0065] In the third correction method, the unit collision parameters are divided into two categories: positive change parameters and negative change parameters. Among them, the positive change parameters increase with the increase of the unit count value, and the negative change parameters decrease with the increase of the unit count value. And, the types and quantities of the positive change parameters and the negative change parameters are determined according to the surface material type of the surface object unit. Specifically, the positive change parameter and / or the negative change parameter include at least one of the following: collapse depth parameter, water content parameter, and collapse range parameter. For example, taking snow as an example, the more the number of trampling times, the harder the snow, and the shallower the collapse degree; the more the number of trampling times, the smaller the collapse range of the snow. Another example is the desert. The more the number of trampling times, the more the water content, and even a splashing special effect will appear after trampling many times. In short, the unit collision parameters of different dimensions included in the surfaces of different materials may be positively or negatively correlated with the number of trampling times. The unit collision parameters that are positively correlated with the number of trampling times are used as positive change parameters, and the unit collision parameters that are negatively correlated with the number of trampling times are used as negative change parameters, so that the corrected unit collision parameters can better conform to the real physical situation.
[0066] Step S260: Determine the imprint state corresponding to the trampling operation according to the corrected unit collision parameter, and display a trampling imprint that matches the imprint state.
[0067] Among them, there is a certain corresponding relationship between the unit collision parameter and the imprint state of the trampling operation. Therefore, the imprint state corresponding to the trampling operation can be determined according to the corrected unit collision parameter. Among them, the imprint state includes at least one of the following: imprint depth, imprint influence range, and imprint additional special effects. Among them, the imprint depth is used to describe the degree of surface depression after trampling, and the imprint influence range is used to describe the range of surface collapse after trampling. The imprint additional special effects include: a splash special effect used to describe whether water splashes after trampling, a dust-raising special effect used to describe whether dust is flying after trampling, and a quicksand special effect used to describe whether the sand presents a liquid quicksand effect after trampling.
[0068] The inventor found during the implementation of the present invention that there is a specific corresponding relationship between the unit collision parameter and the imprint state of the trampling operation. Therefore, the corresponding imprint state can be determined according to the unit collision parameter.
[0069] In order to determine the corresponding relationship between the unit collision parameter and the imprint state of the trampling operation, calculations can be performed through formulas or imprint models. For example, the unit collision parameter can be input into a pre-trained imprint model, and the imprint state corresponding to the unit collision parameter can be determined according to the output result of the imprint model.
[0070] In this embodiment, the unit collision parameters of the surface object unit samples can be obtained in advance, and moreover, the imprint states corresponding to each surface object unit sample can be determined in advance by means of physical engine calculation, so as to obtain sample data for training the imprint model, and the imprint model is trained through the sample data. This imprint model is used to determine the imprint state corresponding to the input unit collision parameter.
[0071] The unit counter in this embodiment can be set in the local terminal or the cloud server. Among them, when the unit counter is set in the local terminal, the result can be quickly read, thereby improving the display speed. When the unit counter is set in the cloud server, the operations performed by the user on different terminals can be synchronized, improving the accuracy of the result. Preferably, a local unit counter is set for the surface object unit, and a cloud unit counter is set in the cloud. Correspondingly, the local unit counter uploads the counting result to the cloud unit counter, and the cloud unit counter aggregates and synchronizes the counting result of the local unit counter, so that the change effect of the ground state with the trampling operation is more accurate. Among them, when the cloud unit counter aggregates the counting results of the local unit counters, it can be aggregated according to the user dimension. For example, the trampling results of the same user on the same surface object unit during the game are aggregated, so that the trampling operations triggered by the same user through different game terminals can be synchronously updated to the cloud. Another example is to aggregate the trampling results for the same surface object unit. Whether the trampling execution entity corresponds to the same user or not, this method can aggregate the trampling results of multiple players, so as to more realistically reflect the trampling situation of the ground in the online game.
[0072] In addition, the operation of updating the unit value stored in the unit counter of the surface object unit, which is associated with the number of trampling times of the surface object unit, in this embodiment can be performed after detecting a trampling operation in the virtual scene and determining the corresponding surface trampling position; or, it can also be performed after displaying the trampling mark that matches the imprint state. The present invention does not limit the specific details.
[0073] For ease of understanding, Figure 3 the system architecture diagram of this embodiment is shown. As Figure 3 shown, this embodiment is implemented based on the following system, which includes: a plot counting module, a local data storage module, a cloud data module, a character animation performance module, an algorithm module, and a terrain generation module. Among them, Figure 3 the user changes the specific value of the unit value Count stored in the unit counter through the trampling operation. For example, assume that the user's left foot performs A1 trampling operations and the right foot performs A2 trampling operations. Then, the count value in the plot counting module (i.e., the unit counter of the surface object unit) is updated and stored in the local data storage module. Among them, baseCount is the unit value obtained after the plot counting module is updated, and the updated unit value is stored in the local data storage module. In addition, the local data storage module stores the unit value in the cloud data to achieve data synchronization between different terminals. In addition, the algorithm module is used to perform calculation functions and generate corresponding surface object units through the terrain generation module. The character animation performance module is used to present the character animation corresponding to the trampling mark.
[0074] In summary, this method does not require real simulation through a physics engine. Instead, it directly determines the trampling mark of the trampling operation based on the unit collision parameters of the surface object unit, and can achieve the real simulation of the trampling mark on the premise of reducing system resource consumption. Moreover, this method sets a unit counter for the surface object unit, and can correct the unit collision parameters by combining the unit count value stored in the unit counter, so that the state of the trampling mark is related to the number of trampling times of the surface object unit, and further enables the trampling mark to change dynamically with the number of trampling times of the surface, achieving the effect of realistically simulating the surface state. In short, this method can avoid interface jamming problems while saving computing power. In addition, this method can further divide the unit collision parameters into forward change parameters and reverse change parameters, so as to facilitate realistically reflecting the mark state of the surface after trampling according to the landform and material characteristics.
[0075] Embodiment III
[0076] Figure 4 FIG. shows a schematic structural diagram of a trampling mark display device provided in Embodiment III of the present invention, including:
[0077] A response module 31, adapted to respond to detecting a trampling operation in a virtual scene and determine a surface trampling position corresponding to the trampling operation;
[0078] An acquisition module 32, adapted to acquire a unit count value stored in a unit counter of a surface object unit corresponding to the surface trampling position;
[0079] A correction module 33, adapted to correct the unit collision parameters of the surface object unit according to the unit count value to obtain corrected unit collision parameters;
[0080] A display module 34, adapted to determine a mark state corresponding to the trampling operation according to the corrected unit collision parameters and display a trampling mark matching the mark state.
[0081] Optionally, the device further includes:
[0082] An update module, adapted to update the unit count value associated with the number of trampling times of the surface object unit stored in the unit counter of the surface object unit according to the trampling operation detected this time;
[0083] Wherein, the unit counter is set in a local terminal or a cloud server.
[0084] Optionally, the trampling operation in the virtual scene is detected by at least one of the following methods:
[0085] Obtain the key state of the stepping control key associated with the stepping operation, and detect the stepping operation in the virtual scene according to the key state;
[0086] Detect the stepping operation in the virtual scene according to the playing state of the virtual animation and / or the relative distance between the stepping part in the virtual object and the unit collision body of the ground object unit;
[0087] Detect the stepping operation in the virtual scene according to the collision result between the virtual object and the unit collision body of the ground object unit in the virtual scene.
[0088] Optionally, the correction module is specifically adapted to:
[0089] Determine the numerical range to which the unit count value belongs, and query the influence coefficient stored in the influence coefficient table corresponding to the numerical range;
[0090] Correct the unit collision parameters of the ground object unit according to the influence coefficient to obtain the corrected unit collision parameters.
[0091] Optionally, the unit collision parameters include: forward change parameters and / or reverse change parameters;
[0092] Among them, the forward change parameter increases with the increase of the unit count value, and the reverse change parameter decreases with the increase of the unit count value;
[0093] And, the types and quantities of the forward change parameter and the reverse change parameter are determined according to the ground material type of the ground object unit;
[0094] Among them, the forward change parameter and / or the reverse change parameter include at least one of the following: collapse depth parameter, water content parameter, and collapse range parameter.
[0095] Optionally, the update module is specifically adapted to:
[0096] Obtain the object attribute information and / or stepping state information of the target object performing the stepping operation, and determine the weight coefficient of this stepping operation according to the object attribute information and / or stepping state information;
[0097] Obtain the stepping count value according to the weight coefficient, and update the unit count value stored in the unit counter of the ground object unit according to the stepping count value.
[0098] Optionally, the unit collision parameters of the ground object unit are determined by the following method:
[0099] A preset surface material data table is queried, and surface material information of a surface object unit corresponding to the surface stepping position is obtained according to the surface material data table; a unit collision parameter of the surface object unit is determined according to the surface material information; wherein, whenever a surface object creation operation is detected, the surface material data table is updated according to the surface object creation operation;
[0100] Among them, the surface material information of the surface object unit includes at least two of the following dimensions: first dimensional information corresponding to material depth, second dimensional information corresponding to material hardness, third dimensional information corresponding to material water content, and fourth dimensional information corresponding to material load-bearing ratio; wherein the surface material includes at least one of the following: desert material, snow material, grass material, and swamp material.
[0101] Optionally, the imprint status includes: imprint depth, imprint influence range, and / or imprint additional special effects; wherein the imprint additional special effects include: splashing special effects, and / or dust special effects.
[0102] The specific structure and working principle of each of the above modules can be referred to the description of the corresponding part of the method embodiment, which will not be repeated here.
[0103] Another embodiment of the present application provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the stepping mark display method based on stepping operation in any of the above method embodiments. The executable instruction can be specifically used to enable the processor to execute the corresponding operations in the above method embodiments.
[0104] Figure 5 A schematic structural diagram of an electronic device according to another embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0105] like Figure 5 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 506 , a memory (memory) 504 , and a communication bus 508 .
[0106] in:
[0107] The processor 502 , the communication interface 506 , and the memory 504 communicate with each other via a communication bus 508 .
[0108] The communication interface 506 is used to communicate with other devices such as clients or other servers.
[0109] A processor 502 is configured to execute a program 510, and specifically, can execute the relevant steps in the above-described method embodiments for displaying a trampling mark based on a trampling operation.
[0110] Specifically, the program 510 may include program code, and the program code includes computer operation instructions.
[0111] The processor 502 may be a central processing unit (CPU), or a specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the electronic device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.
[0112] A memory 504 is configured to store the program 510. The memory 504 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0113] The program 510 is specifically configured to cause the processor 502 to execute the corresponding operations in the above-described method embodiments.
[0114] The algorithms and displays provided herein are not inherently related to any particular computer, virtual apparatus, or other device. Various general-purpose apparatuses may also be used in conjunction with the teachings provided herein. The structure required to construct such apparatuses will be apparent from the above description. In addition, the present invention is not directed to any particular programming language. It should be understood that the content of the present invention described herein can be implemented using various programming languages, and the description of a specific language above is for the purpose of disclosing the best mode of the present invention.
[0115] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0116] Similarly, it should be understood that, in order to streamline this disclosure and assist in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0117] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be adopted to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise explicitly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.
[0118] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, any one of the claimed embodiments can be used in any combination.
[0119] Each component embodiment of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the device according to the embodiments of the present invention. The present invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0120] It should be noted that the above embodiments illustrate the present invention rather than limit the present invention, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In the unit claims listing several devices, several of these devices can be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names.
Claims
1. A method for displaying a trampling mark based on a trampling operation, comprising: In response to detecting a trampling operation in a virtual scene, determine the ground trampling position corresponding to the trampling operation; Obtain the unit count value stored in the unit counter of the ground object unit corresponding to the ground trampling position; Modify the unit collision parameters of the ground object unit according to the unit count value to obtain modified unit collision parameters; wherein, the unit collision parameters are used to describe the collision response characteristics of the corresponding ground object unit, and the unit collision parameters include: material class collision parameters including material data in multiple dimensions; Input the modified unit collision parameters into a pre-trained imprint model, determine the imprint state corresponding to the trampling operation according to the output result of the imprint model, and display a trampling imprint matching the imprint state; wherein, the imprint state includes at least two of the following: imprint depth, imprint influence range, imprint additional special effects, and the imprint state corresponds to the change of the unit collision parameters; wherein, the unit collision parameters include: forward change parameters and / or reverse change parameters; wherein, the forward change parameters increase as the unit count value increases, and the reverse change parameters decrease as the unit count value increases; and, the types and quantities of the forward change parameters and the reverse change parameters are determined according to the ground material type of the ground object unit; Wherein, the modifying the unit collision parameters of the ground object unit according to the unit count value to obtain modified unit collision parameters includes: determining the numerical interval to which the unit count value belongs, and querying the influence coefficient stored in the influence coefficient table corresponding to the numerical interval; modifying the unit collision parameters of the ground object unit according to the influence coefficient to obtain modified unit collision parameters.
2. The method according to claim 1, wherein After displaying the trampling imprint matching the imprint state, it further includes: updating the unit count value associated with the trampling times of the ground object unit stored in the unit counter of the ground object unit according to the trampling operation detected this time; or, After determining the ground trampling position corresponding to the trampling operation in response to detecting a trampling operation in a virtual scene, it further includes: updating the unit count value associated with the trampling times of the ground object unit stored in the unit counter of the ground object unit according to the trampling operation detected this time; Wherein, the unit counter is set on a local terminal or a cloud server.
3. The method according to claim 1 or 2, wherein Detect the trampling operation in the virtual scene by at least one of the following methods: Obtain the key state of the trampling control key associated with the trampling operation, and detect the trampling operation in the virtual scene according to the key state; Detect the trampling operation in the virtual scene according to the playback state of the virtual animation and / or the relative distance between the trampling part in the virtual object and the unit collision body of the ground object unit; Detect the trampling operation in the virtual scene according to the collision result between the virtual object in the virtual scene and the unit collision body of the ground object unit.
4. The method according to any one of claims 1-2, wherein The positive variation parameter and / or the negative variation parameter include at least one of the following: a collapse depth parameter, a water content parameter, and a collapse range parameter.
5. The method according to claim 2, wherein The updating of the unit count value associated with the number of times the ground object unit is stepped on and stored in the unit counter of the ground object unit according to the stepped operation detected this time comprises: Acquire object attribute information and / or stepping state information of a target object for performing a stepping operation, and determine a weight coefficient of the current stepping operation according to the object attribute information and / or stepping state information; A trampling count value is obtained according to the weight coefficient, and a unit count value stored in a unit counter of the ground surface object unit is updated according to the trampling count value.
6. The method according to claim 1, wherein The unit collision parameters of the surface object unit are determined by: A preset surface material data table is queried, and surface material information of a surface object unit corresponding to the surface stepping position is obtained according to the surface material data table; a unit collision parameter of the surface object unit is determined according to the surface material information; wherein, whenever a surface object creation operation is detected, the surface material data table is updated according to the surface object creation operation; Among them, the surface material information of the surface object unit includes at least two of the following dimensions: first dimensional information corresponding to material depth, second dimensional information corresponding to material hardness, third dimensional information corresponding to material water content, and fourth dimensional information corresponding to material load-bearing ratio; wherein the surface material includes at least one of the following: desert material, snow material, grass material, and swamp material.
7. The method according to any one of claims 1-2, wherein The imprint status includes: imprint depth, imprint influence range, and / or imprint additional special effects; wherein the imprint additional special effects include: splashing special effects, and / or dust special effects.
8. A device for displaying a trampling mark based on a trampling operation, comprising: A response module, adapted to determine a ground surface stepping position corresponding to the stepping operation in response to detecting the stepping operation in the virtual scene; an acquisition module, adapted to acquire a unit count value stored in a unit counter of a ground surface object unit corresponding to the ground surface stepping position; A correction module, adapted to correct the unit collision parameter of the surface object unit according to the unit count value to obtain the corrected unit collision parameter; wherein the unit collision parameter is used to describe the collision response characteristics of the corresponding surface object unit, and the unit collision parameter includes: a material collision parameter including material data of multiple dimensions; A display module, adapted to input the corrected unit collision parameters into a pre-trained imprint model, determine an imprint state corresponding to the stomping operation according to an output result of the imprint model, and display a stomping imprint matching the imprint state; wherein, the imprint state includes at least two of the following: imprint depth, imprint influence range, imprint additional special effects, and the imprint state corresponds to a change in the unit collision parameters; wherein, the unit collision parameters include: a forward change parameter and / or a reverse change parameter; wherein, the forward change parameter increases as the unit count value increases, and the reverse change parameter decreases as the unit count value increases; and, the types and quantities of the forward change parameter and the reverse change parameter are determined according to the surface material type of the surface object unit; Wherein, the correction module is specifically adapted to: determine a numerical interval to which the unit count value belongs, and query an influence coefficient stored in an influence coefficient table corresponding to the numerical interval; correct the unit collision parameters of the surface object unit according to the influence coefficient to obtain corrected unit collision parameters.
9. An electronic device, comprising: A processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute an operation corresponding to the method for displaying a stomping imprint based on a stomping operation according to any one of claims 1-7.
10. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to perform operations corresponding to the method for displaying a trampling mark based on a trampling operation according to any one of claims 1-7.
Citation Information
Patent Citations
Image display method and device, electronic equipment and readable storage medium
CN111494943A
Method and device for constructing terrain in virtual scene
CN113599808A