Virtual object display method, computer device, and storage medium
Patent Information
- Application Number
- PCT/CN2025/098023
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-02-17
- Filing Date
- 2025-05-29
- Publication Date
- 2026-09-17
Smart Images

Figure CN2025098023_17092026_PF_FP_ABST
Abstract
Description
A method for displaying virtual objects, a computer device, and a storage medium. Technical Field
[0001] This application relates to the field of online game technology, and in particular to a method for laying out virtual objects, a computer device, and a storage medium. Background Technology
[0002] In multiplayer online games, users control virtual objects to distribute and move. These virtual objects can be virtual characters, items, buildings, etc., which players can control. This allows different virtual objects to cooperate or fight against each other. The distribution and movement of virtual objects is an important part of enhancing the gaming experience.
[0003] Traditional techniques divide a region into smaller areas based on its shape and then place virtual objects into these smaller areas using different random methods. Most existing layout solutions only focus on the final layout result and cannot demonstrate the dynamic layout process of virtual objects from their initial state to their final state. Summary of the Invention
[0004] Therefore, it is necessary to provide a layout method for virtual objects, a computer device, and a storage medium to address the aforementioned technical problems.
[0005] Firstly, this application provides a method for displaying virtual objects. The method includes:
[0006] Display a collection of virtual objects in the current video frame of the virtual scene;
[0007] Based on the initial position of each virtual object in the virtual object set and the shape of the corresponding display area, at least one virtual object combination is determined, and the mutual repulsion between the virtual objects in the virtual object combination is determined; wherein, the display area of the virtual object in the virtual object combination overlaps with the display area of at least one other virtual object;
[0008] Based on the mutual repulsion, the update position of each virtual object in the virtual object combination is determined in the next video frame of the current video frame;
[0009] In the next video frame, the virtual object combination and other virtual objects in the virtual object set besides the virtual object combination are displayed based on the updated position, while the other virtual objects remain in their initial positions.
[0010] In one embodiment, the calculation process of the mutual repulsion force includes:
[0011] Based on the initial positions of each pair of different virtual objects in the virtual object combination, the centroid in the opposite direction vector and distance between the pairs of different virtual objects are obtained;
[0012] Based on the distance between each pair of different virtual objects and the shape of the display area of each pair of different virtual objects, the repulsive force intensity between each pair of different virtual objects is obtained.
[0013] Based on the repulsive force intensity and the centroid in the opposite direction vector, the mutual repulsive force between the two different virtual objects is obtained.
[0014] In one embodiment, before displaying the collection of virtual objects in the current video frame of the virtual scene, the method further includes:
[0015] At least one virtual object is randomly generated in a virtual scene. Based on the center point of the virtual object, a random displacement operation is performed within a preset range to obtain a virtual object after random displacement.
[0016] In one embodiment, the method further includes:
[0017] The receiving page operation sets up repulsive wells and / or attractive wells in the virtual scene;
[0018] Based on the repulsive well and / or gravitational well, virtual objects within the repulsive range and / or gravitational range are determined, so that the virtual objects within the repulsive range and / or gravitational range form a layout of a preset shape based on the repulsive force of the repulsive well and / or the gravitational force of the gravitational well.
[0019] In one embodiment, the method further includes:
[0020] A repulsive boundary is set based on a preset shape, which is used to ensure that the virtual object is displayed within the area of the preset shape.
[0021] In one embodiment, the method further includes:
[0022] In the case of overlapping virtual objects, the overlapping virtual objects are laid out according to a preset layout rule. The virtual objects include a first virtual object, a second virtual object, a third virtual object, and a fourth virtual object.
[0023] The preset layout rules include a first layout rule and a second layout rule, wherein the first layout rule has a higher priority than the second layout rule;
[0024] The first layout rule includes, when the third virtual object overlaps with the fourth virtual object, displaying the overlapping portion of the third virtual object above the overlapping portion of the fourth virtual object;
[0025] The second layout rule includes that, when the first virtual object and the second virtual object overlap, the overlapping portion of the first virtual object is displayed on top of the overlapping portion of the second virtual object.
[0026] In one embodiment, the preset size of the first virtual object is larger than the preset size of the second virtual object, and the preset size of the second virtual object is determined based on the interactive operation of the second virtual object in the virtual scene.
[0027] In one embodiment, the second virtual object is displayed through the following steps:
[0028] The second virtual object is gradually increased from its initial size to the preset size based on the preset display speed.
[0029] In one embodiment, the second virtual object is switched to the first virtual object through the following steps:
[0030] The second virtual object is gradually increased to the target size, so that the second virtual object that reaches the target size switches to the first virtual object;
[0031] The first virtual object of the target size is gradually reduced to the preset size of the first virtual object to obtain the switched first virtual object.
[0032] In one embodiment, the interactive operation includes:
[0033] An interactive area is set, and the interaction frequency is determined based on the distance between the virtual object and the interactive area;
[0034] After each interaction, the interaction result of the virtual object is calculated;
[0035] Virtual objects are displayed in the interaction area based on the interaction results.
[0036] Secondly, this disclosure also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of a method for displaying virtual objects.
[0037] Thirdly, this disclosure also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of a method for displaying virtual objects.
[0038] Fourthly, this disclosure also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of a method for displaying virtual objects.
[0039] The above-mentioned methods for displaying virtual objects have at least the following beneficial effects:
[0040] The embodiments provided in this disclosure employ a frame-based computation method, which decomposes complex computational tasks into multiple frames for processing, reducing the instantaneous computational load. In each frame, the mutual repulsion force is calculated to maintain an appropriate distance between virtual objects, demonstrating the dynamic change process of virtual objects gradually dispersing from an initial crowded state to a uniform distribution.
[0041] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments or conventional technologies of this disclosure, the accompanying drawings used in the description of the embodiments or conventional technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 is an application environment diagram of a virtual object display method in one embodiment;
[0044] Figure 2 is a flowchart illustrating a method for displaying virtual objects in one embodiment;
[0045] Figure 3 is a schematic diagram of a virtual object collection in one embodiment;
[0046] Figure 4 is a schematic diagram of a random displacement operation in one embodiment;
[0047] Figure 5 is a schematic diagram of the virtual object display process in one embodiment;
[0048] Figure 6 is a schematic diagram of different types of virtual objects in one embodiment;
[0049] Figure 7 is a magnified schematic diagram of the second virtual object in one embodiment;
[0050] Figure 8 is a schematic diagram of the second virtual object switching to the first virtual object in one embodiment;
[0051] Figure 9 is a schematic diagram of the interactive area in one embodiment;
[0052] Figure 10 is a schematic diagram of the collision intensity of virtual objects in one embodiment;
[0053] Figure 11 is a schematic diagram of switching perspectives in one embodiment;
[0054] Figure 12 is an internal structure diagram of a computer device in one embodiment;
[0055] Figure 13 is an internal structure diagram of a server in one embodiment. Detailed Implementation
[0056] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0057] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims. The terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitation, the presence of other identical or equivalent elements in a process, method, product, or apparatus that includes said elements is not excluded. For example, the use of terms such as "first," "second," etc., is to denote names and does not indicate any specific order.
[0058] This disclosure provides a method for displaying virtual objects, applicable to the application environment shown in Figure 1. The terminal 102 communicates with the server 104 via a network. A data storage system stores the data that the server 104 needs to process. The data storage system can be integrated onto the server 104 or located on a cloud or other network server. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0059] As shown in FIG2, in some embodiments of this disclosure, a method for displaying virtual objects is provided. In one specific embodiment, the method may include the following steps:
[0060] S202: Display a collection of virtual objects in the current video frame of the virtual scene.
[0061] A virtual scene can be a game world, a virtual reality application, or any other form of digital space, and can contain various virtual elements such as terrain, virtual objects, and items. The transformation of a virtual scene is a dynamic process; for example, a virtual object may move from one location to another. This dynamic change can be composed of multiple video frames. A video frame is the basic unit of video, referring to a single static image in a video sequence. Videos produce dynamic effects by rapidly playing these frames in succession. Each video frame represents the state of the virtual scene at a specific point in time, and the display of consecutive video frames achieves continuous dynamic effects. Virtual objects can be virtual characters, props, buildings, etc., that are operated by the player. A collection of virtual objects can include multiple different virtual objects; in this embodiment, it can be multiple different character avatars.
[0062] S204: Based on the initial position of each virtual object in the virtual object set and the shape of the corresponding display area, determine at least one virtual object combination, and determine the mutual repulsion between each virtual object in the virtual object combination; wherein, the display area of the virtual object in the virtual object combination overlaps with the display area of at least one other virtual object.
[0063] The display area of a virtual object can be circular, rectangular, hexagonal, etc. Figure 3 is a schematic diagram of a virtual object set in one embodiment, wherein the shape, color, and size of the display areas of different virtual objects can be different. Based on the initial position of the virtual object and the shape of its display area, overlap is checked. In a virtual object combination, if the display area of one virtual object overlaps with the display area of at least one other virtual object, then this virtual object and all other overlapping virtual objects can constitute a virtual object combination. Other virtual objects are within the range of the virtual object combination. In a virtual object combination, at least one virtual object's display area overlaps with the display area of at least one other virtual object. For example, suppose there are three virtual objects A, B, and C. The display area of object A overlaps with the display area of object B, and the display area of object B overlaps with the display area of object C. The overlap between the display areas of A and B, and B and C is detected. Therefore, A, B, and C can be classified as a virtual object combination. The repulsive forces between A and B, and B and C are calculated, causing their display areas to gradually separate and reducing overlap. Calculate the mutual repulsion between virtual objects in the virtual object combination. The mutual repulsion can be determined based on the distance between virtual objects and the size of the display area. For example, it can be set that the closer the distance, the greater the repulsion, and the larger the display area, the greater the repulsion.
[0064] S206: Based on the mutual repulsion, determine the update position of each virtual object in the virtual object combination in the next video frame of the current video frame.
[0065] Based on the calculated mutual repulsion, adjusting the positions of each virtual object in the virtual object combination can reduce or eliminate overlap, thus obtaining the updated positions of each virtual object in the virtual object combination, which can then be used as the updated positions of each virtual object in the next video frame.
[0066] S208: In the next video frame, based on the updated position, the virtual object combination and other virtual objects in the virtual object set besides the virtual object combination are displayed, and the other virtual objects besides the virtual object combination remain in their initial positions.
[0067] The virtual object set includes a virtual object set and other virtual objects besides the virtual object combination. The virtual object combination is displayed in the next video frame based on the updated position, and other virtual objects besides the virtual object combination are displayed in the next video frame. The other virtual objects besides the virtual object combination remain in their initial positions.
[0068] In the above-mentioned method of displaying virtual objects, a frame-by-frame operation is used to decompose the complex calculation task into multiple frames for processing, which reduces the instantaneous amount of calculation. In each frame, the mutual repulsion force is calculated to keep the virtual objects at an appropriate distance, showing the dynamic change process of the virtual objects gradually dispersing from the initial crowded state to a uniform distribution.
[0069] In some embodiments of this disclosure, the calculation process of the mutual repulsion force includes:
[0070] Based on the initial positions of each pair of different virtual objects in the virtual object combination, the centroid in the opposite direction vector and distance between the pairs of different virtual objects are obtained;
[0071] Based on the distance between each pair of different virtual objects and the shape of the display area of each pair of different virtual objects, the repulsive force intensity between each pair of different virtual objects is obtained.
[0072] Based on the repulsive force intensity and the centroid in the opposite direction vector, the mutual repulsive force between the two different virtual objects is obtained.
[0073] Each repulsive force occurs between two virtual objects. If multiple overlapping virtual objects exist, they can be separated into individual pairs of virtual objects, and their repulsive forces can be considered separately. For each pair of different virtual objects, calculate the centroid-opposite direction vector between them. This centroid-opposite direction vector represents the direction from one virtual object to another, but it needs to be reversed when calculating the repulsive force. The distance can be the Euclidean distance between the pairs of different virtual objects. Based on the distance between the pairs of different virtual objects and the shape of their display areas, the repulsive force strength between the pairs of different virtual objects is obtained. Then, based on the repulsive force strength and the centroid-opposite direction vector, the mutual repulsive force between the pairs of different virtual objects is obtained, which can be expressed as: mutual repulsive force = centroid-opposite direction vector * repulsive force strength.
[0074] In some embodiments of this disclosure, before displaying the collection of virtual objects in the current video frame of the virtual scene, the method further includes:
[0075] At least one virtual object is randomly generated in a virtual scene. Based on the center point of the virtual object, a random displacement operation is performed within a preset range to obtain a virtual object after random displacement.
[0076] At least one virtual object is randomly generated in the virtual scene, and its initial position and display area are set. A preset range is defined, and the center point of the virtual object is randomly displaced within this range to obtain a virtual object after random displacement. For example, if the center point of a randomly generated virtual object is (0, 0), it can be randomly displaced within the range of (2, 2)(-2, 2)(2, -2)(-2, -2), and a virtual object is generated at any of these positions, creating a random displacement effect and achieving a uniform yet random staggered distribution. Figure 4 is a schematic diagram of the random displacement operation in one embodiment, where 4-1 represents the virtual object that can be generated within the preset range, and 4-2 represents the virtual object after random displacement.
[0077] In some embodiments of this disclosure, the method further includes:
[0078] The receiving page operation sets up repulsive wells and / or attractive wells in the virtual scene;
[0079] Based on the repulsive well and / or gravitational well, virtual objects within the repulsive range and / or gravitational range are determined, so that the virtual objects within the repulsive range and / or gravitational range form a layout of a preset shape based on the repulsive force of the repulsive well and / or the gravitational force of the gravitational well.
[0080] Page operations can include mouse clicks, dragging, keyboard input, touch operations, etc. Repulsion wells and / or attraction wells, including their repulsion and / or attraction ranges, can be set in a virtual scene according to preset shapes. A repulsion well is a virtual force field implemented by tools included in the game development engine. Those skilled in the art can master the methods for setting up repulsion and attraction wells within mainstream game development engines. When an object enters this area, it experiences a repulsive force, causing it to move away from a central point or other object. The repulsive force increases as the object approaches the central point or other object. Repulsion wells can be used to prevent collisions between objects. A attraction well is a virtual force field; when an object enters this area, it experiences an attractive force, causing it to move towards a central point or other object. The attraction increases as the object moves away from the central point or other object. Attraction wells can be used to guide objects towards a target. By selecting repulsion wells and / or attraction wells according to preset shapes and setting the coordinates of the well's center point, repulsion range, and / or attraction range, repulsion wells and / or attraction wells can apply repulsive and / or attraction forces to virtual objects, resulting in a layout of the preset shape. For each virtual object within the repulsive force range, calculate the repulsive force it experiences and adjust its position. For each virtual object within the gravitational force range, calculate the gravitational force it experiences and adjust its position to ensure that the virtual objects ultimately form a layout of the preset shape. The repulsive force of a repulsive well is calculated as: (square of the distance from the virtual object to other virtual objects within the repulsive force range) × (attenuation coefficient) × (repulsive force intensity). The gravitational force of a gravitational well is calculated as: (square of the distance from the virtual object to other virtual objects within the gravitational force range) × (enhancement coefficient) × (gravitational force intensity). For example, to achieve a distribution within a circle, a gravity well can be placed at the center. To achieve a distribution within an empty area like a donut, a repulsive well can be placed at the center. Both gravity and repulsive wells exert attractive or repulsive forces on virtual objects within their respective radii.
[0081] In some embodiments of this disclosure, the method further includes:
[0082] A repulsive boundary is set based on a preset shape, which is used to ensure that the virtual object is displayed within the area of the preset shape.
[0083] A repulsive boundary is set. If a virtual object approaches or exceeds the boundary, a repulsive force is calculated and applied to return it to the area of the preset shape. For example, to distribute virtual objects within a fan-shaped area, a gravity well can be set at the center of the circle to form the distribution within the circle. Then, a repulsive boundary is set, specifying the two sides of the fan. The repulsive force of the repulsive boundary = the direction vector from the center of the fan to the virtual object × the repulsive force intensity. The perpendicular vector of the direction vector from the center of the fan to the virtual object is taken as the repulsive force direction. That is, the repulsive force intensity is a scalar value that can be used to adjust the magnitude of the repulsive force. The direction vector from the center of the fan to the virtual object can be used to calculate the distance between the virtual object and the center of the circle. The perpendicular vector can be used to define the direction of the repulsive force. The repulsive force of the repulsive boundary is obtained by multiplying the direction vector from the center of the fan to the virtual object and the repulsive force intensity.
[0084] Figure 5 is a schematic diagram of the virtual object display process in one embodiment.
[0085] In some embodiments of this disclosure, the method further includes:
[0086] In the case of overlapping virtual objects, the overlapping virtual objects are laid out according to a preset layout rule. The virtual objects include a first virtual object, a second virtual object, a third virtual object, and a fourth virtual object.
[0087] The preset layout rules include a first layout rule and a second layout rule, wherein the first layout rule has a higher priority than the second layout rule;
[0088] The first layout rule includes, when the third virtual object overlaps with the fourth virtual object, displaying the overlapping portion of the third virtual object above the overlapping portion of the fourth virtual object;
[0089] The second layout rule includes that, when the first virtual object and the second virtual object overlap, the overlapping portion of the first virtual object is displayed on top of the overlapping portion of the second virtual object.
[0090] A virtual scene can include multiple factions, and different factions can include different virtual objects.
[0091] The virtual objects in different factions have different colors to distinguish them. These virtual objects can be categorized into first, second, third, and fourth virtual objects. In an embodiment of this disclosure, Figure 6 is a schematic diagram of different types of virtual objects. The dotted lines represent overlapping virtual objects displayed below. The first virtual object can be a vanguard, i.e., the hexagonal avatar in Figure 6. The second virtual object can be a soldier, i.e., the circular avatar in Figure 6. In the game settings, a vanguard can be a virtual object with higher combat power than a soldier, or a virtual object that is deployed first. When the first and second virtual objects overlap, the overlapping part of the first virtual object is displayed above the overlapping part of the second virtual object, ensuring that important virtual objects can be clearly observed in complex virtual scenes. The third virtual object can be the player's own avatar, i.e., the avatar with a specific identifier in Figure 6, such as an arrow pointing to oneself, used to indicate the player's position. The fourth virtual object can be the avatar of another player. When the third and fourth virtual objects overlap, the overlapping part of the third virtual object is displayed above the overlapping part of the fourth virtual object, ensuring that important characters or player avatars are always visible and not obscured by secondary objects. The hierarchy can be dynamically adjusted according to different scenario requirements, and the transparency, shape, and other properties of virtual objects can also be adjusted.
[0092] In some embodiments of this disclosure, the preset size of the first virtual object is larger than the preset size of the second virtual object, and the preset size of the second virtual object is determined based on the interactive operation of the second virtual object in the virtual scene.
[0093] The size of the second virtual object can be adjusted to reflect the differences between different second virtual objects. For example, the scaling ratio can be calculated based on each player's combat power value. Players with different combat power values have different avatar sizes. Taking the soldier with the lowest combat power as a reference, if the diameter of the soldier with the lowest combat power is 10 pixels, then the diameter of the soldier with the highest combat power is 15 pixels. However, the preset size of the first virtual object is larger than the preset size of the second virtual object.
[0094] In some embodiments of this disclosure, the second virtual object is displayed through the following steps:
[0095] The second virtual object is gradually increased from its initial size to the preset size based on the preset display speed.
[0096] Figure 7 is a schematic diagram of the enlarged second virtual object in one embodiment. The first virtual object appears in the virtual scene earlier than the second virtual object, and the second virtual object is gradually enlarged from its initial size to a preset size based on a preset display speed. For example, vanguard avatars appear one by one at 0.2-second intervals. When the vanguard avatar lands, the soldier avatar appears next, appearing in a scaled-down form, as shown in Figure 7. The size can change from 0.2 times to 1 times. The enlarged second virtual object needs to be set within the preset size range of the second virtual object.
[0097] In some embodiments of this disclosure, the second virtual object is switched to the first virtual object through the following steps:
[0098] The second virtual object is gradually increased to the target size, so that the second virtual object that reaches the target size switches to the first virtual object;
[0099] The first virtual object of the target size is gradually reduced to the preset size of the first virtual object to obtain the switched first virtual object.
[0100] Figure 8 is a schematic diagram of the second virtual object switching to the first virtual object in one embodiment. The second virtual object is gradually increased to a target size so that the second virtual object that reaches the target size switches to the first virtual object; the first virtual object of the target size is gradually decreased to a preset size of the first virtual object to obtain the switched first virtual object, thus achieving a dynamic transformation effect.
[0101] In some embodiments of this disclosure, the interactive operations include:
[0102] An interactive area is set, and the interaction frequency is determined based on the distance between the virtual object and the interactive area;
[0103] After each interaction, the interaction result of the virtual object is calculated;
[0104] Virtual objects are displayed in the interaction area based on the interaction results.
[0105] Interactive operations can be categorized into Vanguard Battle, Team Battle, and Free-for-All, etc. An interactive area is set up; Figure 9 shows a schematic diagram of the interactive area in one embodiment, which can be set as a donut-shaped interactive area. Virtual objects are distributed between the inner and outer circles. The interaction frequency is determined based on the distance between the virtual object and the interactive area; that is, the closer the virtual object is to the center, the more intense the collision. Figure 10 shows a schematic diagram of the collision intensity of virtual objects in one embodiment. The numbers 1-3 represent the interaction frequency of virtual objects changing from strong to weak. Ball 1 has the largest collision amplitude, ball 2 has a collision action, but the amplitude is smaller than ball 1, and ball 3 can be set to have a small cyclical change operation. Users can switch perspectives to observe the interactive operations. In a high-angle view, players can see more tiles, which appear smaller. A low-angle view magnifies the camera, showing more tile details. Figure 11 shows a schematic diagram of switching perspectives in one embodiment; 11-1 is a high-angle view, which can display more virtual scenes, while 11-2 is a low-angle view, where the virtual scene is magnified but observed less than in the high-angle view. In Vanguard Battle, Vanguard avatars fight each other towards the center, generating points during the battle. The winning Vanguard will jump to the center and play a victory animation. The interaction process in Development Battle and Team Battle is the same as in Vanguard Battle, but there are more virtual objects involved and the interaction frequency is higher.
[0106] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0107] In one embodiment, a computer device, which may be a server, is provided, and its internal structure diagram is shown in Figure 12. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores virtual objects. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for displaying virtual objects.
[0108] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in Figure 13. The computer device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. Wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for displaying virtual objects. The display screen of the computer device may be an LCD screen or an e-ink screen. The input device of the computer device may be a touch layer covering the display screen, or buttons, a trackball, or a touchpad located on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0109] Those skilled in the art will understand that the structures shown in Figures 12 and 13 are merely block diagrams of some structures related to the present disclosure and do not constitute a limitation on the computer device to which the present disclosure is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.
[0110] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the methods described in any embodiment of this disclosure.
[0111] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods described in any embodiment of this disclosure.
[0112] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, databases, or other media used in the embodiments provided in this disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this disclosure may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this disclosure may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0113] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0114] The embodiments described above are merely illustrative of several implementations of this disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this disclosure, and these all fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the appended claims.
Claims
1. A method for displaying virtual objects, characterized in that, The method comprises: displaying a set of virtual objects in a current video frame of a virtual scene; determining at least one virtual object combination based on initial positions of virtual objects in the set of virtual objects and shapes of corresponding display areas, and determining repulsive forces between virtual objects in the virtual object combination, wherein a display area of a virtual object in the virtual object combination overlaps with a display area of at least one other virtual object; determining updated positions of virtual objects in the virtual object combination in a next video frame of the current video frame based on the repulsive forces; displaying the virtual object combination and other virtual objects in the set of virtual objects except the virtual object combination in the next video frame based on the updated positions, and keeping the other virtual objects at initial positions.
2. The method of claim 1, wherein, The calculation process of the repulsive forces comprises: obtaining a gravity center anti-direction vector and a distance between two different virtual objects in the virtual object combination based on initial positions of the two different virtual objects; obtaining a repulsive force strength between the two different virtual objects based on the distance between the two different virtual objects and shapes of display areas of the two different virtual objects; obtaining a repulsive force between the two different virtual objects based on the repulsive force strength and the gravity center anti-direction vector.
3. The method of claim 1, wherein, Before the displaying of the set of virtual objects in the current video frame of the virtual scene, the method further comprises: randomly generating at least one virtual object in the virtual scene, and performing a random displacement operation on a center point of the virtual object to obtain a virtual object after random displacement.
4. The method of claim 1, wherein, The method further comprises: receiving a page operation to set a repulsive well and / or an attractive well in the virtual scene; determining virtual objects in a repulsive range and / or an attractive range based on the repulsive well and / or the attractive well, so that the virtual objects in the repulsive range and / or the attractive range form a layout of a preset shape based on repulsive forces of the repulsive well and / or attractive forces of the attractive well.
5. The method according to claims 1-4, characterized in that, The method further comprises: setting a repulsive boundary based on a preset shape, the repulsive boundary being used to ensure that a virtual object is displayed in a region of the preset shape.
6. The method of claim 1, wherein, The method further comprises: in the case of overlapping of the virtual objects, arranging the overlapping virtual objects based on a preset layout rule, the virtual objects including a first virtual object and a second virtual object, and a third virtual object and a fourth virtual object; the preset layout rule comprises a first layout rule and a second layout rule, wherein a priority of the first layout rule is higher than that of the second layout rule; the first layout rule comprises, in the case of overlapping of the third virtual object and the fourth virtual object, displaying an overlapping part of the third virtual object above an overlapping part of the fourth virtual object; the second layout rule comprises, in the case of overlapping of the first virtual object and the second virtual object, displaying an overlapping part of the first virtual object above an overlapping part of the second virtual object.
7. The method of claim 6, wherein, The preset size of the first virtual object is greater than the preset size of the second virtual object, and the preset size of the second virtual object is determined based on an interactive operation of the second virtual object in a virtual scene.
8. The method of claim 7, wherein, The second virtual object is displayed by the following steps: The second virtual object is gradually increased from an initial size to a preset size based on a preset display speed.
9. The method of claim 7, wherein, The second virtual object is switched to the first virtual object by the following steps: The second virtual object is gradually increased to a target size, so that the second virtual object reaching the target size is switched to the first virtual object; The first virtual object of the target size is gradually reduced to the preset size of the first virtual object, to obtain the switched first virtual object.
10. The method of claim 7, wherein, The interactive operation includes: An interactive region is set, and an interaction frequency is determined based on a distance between the virtual object and the interactive region; After each interaction ends, an interaction result of the virtual object is calculated; The virtual object is displayed in the interactive region based on the interaction result. 11.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-10. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 10.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 10.
13. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 10.