Virtual object display method, computer equipment and storage medium
By displaying the collection of virtual objects in a virtual scene and calculating mutual repulsion, the problem of difficulty in displaying the dynamic layout of virtual objects in the prior art is solved, and the dynamic change process of virtual objects from the initial state to the final state is realized.
Patent Information
- Application Number
- CN202510175375.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art is difficult to demonstrate the dynamic layout process of virtual objects from the initial state to the final state, focusing only on the final layout results.
By displaying the virtual object collection in the current video frame of the virtual scene, and determining the virtual object combination and its mutual repulsion based on the initial position of the virtual object and the shape of the display area, the update position is calculated to show the dynamic layout process.
The dynamic change process of virtual objects gradually dispersing from the initial crowded state to uniform distribution is realized, reducing the amount of instantaneous calculations and ensuring that the appropriate distance between virtual objects is maintained.
Smart Images

Figure CN119838213A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of online games, and in particular to a layout method of virtual objects, a computer device, and a storage medium. Background Art
[0002] In multiplayer online games, users manipulate the distribution and movement of virtual objects. Virtual objects can be virtual characters, props, buildings, etc. operated by players, enabling different virtual objects to team up or compete with each other. The distribution and movement of virtual objects is an important part of enhancing the gaming experience.
[0003] In traditional technology, the area is divided into several small areas based on the shape of the distribution area, and virtual objects are placed into the small areas in different random ways. Most existing layout solutions only focus on the final layout results and cannot show the dynamic layout process of virtual objects from the initial state to the final state. Summary of the invention
[0004] Based on this, it is necessary to provide a virtual object layout method, computer device, and storage medium to address the above technical issues.
[0005] In a first aspect, the present application provides a method for displaying a virtual object. The method comprises:
[0006] Displaying a collection of virtual objects in a current video frame of a virtual scene;
[0007] Based on the initial positions of the virtual objects in the virtual object set and the shapes of the corresponding display areas, 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, determining an update position of each virtual object of the virtual object combination in a video frame next to the current video frame;
[0009] In the next video frame, the virtual object combination and other virtual objects in the virtual object set except the virtual object combination are displayed based on the updated position, and the other virtual objects except the virtual object combination remain at the initial position.
[0010] In one embodiment, the calculation process of the mutual repulsion includes:
[0011] Based on the initial positions of two different virtual objects in the virtual object combination, obtain the center of gravity reverse direction vector and the distance between the two different virtual objects;
[0012] Based on the distance between the two different virtual objects and the shape of the display area of the two different virtual objects, obtaining the repulsive force strength between the two different virtual objects;
[0013] The mutual repulsion between the two different virtual objects is obtained based on the repulsive force strength and the gravity center reverse direction vector.
[0014] In one embodiment, before presenting the set 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, and a random displacement operation is performed within a preset range based on a center point of the virtual object to obtain a virtual object after random displacement.
[0016] In one embodiment, the method further comprises:
[0017] Receiving a page operation to set a repulsion well and / or an attraction well in the virtual scene;
[0018] Based on the repulsive well and / or attractive well, virtual objects within the repulsive range and / or attractive range are determined so that the virtual objects within the repulsive range and / or attractive range form a layout of a preset shape based on the repulsive force of the repulsive well and / or the attractive force of the attractive well.
[0019] In one embodiment, the method further comprises:
[0020] A repulsive boundary is set based on a preset shape, and the repulsive boundary is used to ensure that the virtual object is displayed within an area of the preset shape.
[0021] In one embodiment, the method further comprises:
[0022] In the case where the virtual objects overlap, laying out the overlapping virtual objects based on a preset layout rule, the virtual objects including a first virtual object, a second virtual object, a third virtual object, and a fourth virtual object;
[0023] The preset layout rule includes a first layout rule and a second layout rule, wherein the priority of the first layout rule is higher than that of the second layout rule;
[0024] The first layout rule includes that when the third virtual object overlaps with the fourth virtual object, the overlapping portion of the third virtual object is displayed above the overlapping portion of the fourth virtual object;
[0025] The second layout rule includes that, when the first virtual object overlaps with the second virtual object, an overlapping portion of the first virtual object is displayed above an overlapping portion of the second virtual object.
[0026] In one of the embodiments, 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.
[0027] In one embodiment, the second virtual object is displayed by the following steps:
[0028] The second virtual object is gradually increased from an initial size to a preset size based on a preset display speed.
[0029] In one embodiment, the second virtual object is switched to the first virtual object by the following steps:
[0030] gradually increasing the second virtual object to a target size, so that the second virtual object reaching the target size switches to the first virtual object;
[0031] The first virtual object of the target size is gradually reduced to a preset size of the first virtual object to obtain the switched first virtual object.
[0032] In one embodiment, the interaction operation includes:
[0033] Setting an interaction area, wherein the interaction frequency is determined based on the distance between the virtual object and the interaction area;
[0034] After each interaction, calculating the interaction result of the virtual object;
[0035] A virtual object is displayed in the interaction area based on the interaction result.
[0036] In a second aspect, the present disclosure further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the virtual object display method when executing the computer program.
[0037] In a third aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method for displaying a virtual object when the computer program is executed by a processor.
[0038] In a fourth aspect, the present disclosure further provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method for displaying a virtual object are implemented.
[0039] The above virtual object display method has at least the following beneficial effects:
[0040] The embodiment scheme provided by the present disclosure adopts a frame operation method to decompose complex computing tasks into multiple frames for processing, thereby reducing the instantaneous amount of calculation, and in each frame, the appropriate distance between virtual objects is maintained by calculating the mutual repulsion, showing the dynamic change process of virtual objects gradually dispersing from an initial crowded state to a uniform distribution.
[0041] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A diagram of an application environment of a method for displaying a virtual object in an embodiment;
[0044] Figure 2 is a schematic diagram of a flow chart of a method for displaying a virtual object in one embodiment;
[0045] Figure 3 is a schematic diagram of a virtual object set in one embodiment;
[0046] Figure 4 is a schematic diagram of a random shift operation in one embodiment;
[0047] Figure 5 A schematic diagram of a display process of a virtual object in one embodiment;
[0048] Figure 6 is a schematic diagram of different types of virtual objects in one embodiment;
[0049] Figure 7 is a schematic diagram of an enlarged second virtual object in one embodiment;
[0050] Figure 8 is a schematic diagram of switching from a second virtual object to a first virtual object in one embodiment;
[0051] Fig. 9 is a schematic diagram of an interaction area in one embodiment;
[0052] Fig.10 is a schematic diagram of the collision strength of a virtual object in one embodiment;
[0053] Fig.11is a schematic diagram of switching viewing angles in one embodiment;
[0054] Fig.12 is an internal structure diagram of a computer device in one embodiment;
[0055] Fig.13 The figure is a diagram of the internal structure of a server in one embodiment. DETAILED DESCRIPTION
[0056] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0058] The present disclosure provides a method for displaying a virtual object, which can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0059] In some embodiments of the present disclosure, Figure 2 As shown, a method for displaying a virtual object is provided. In a specific embodiment, the method may include the following steps:
[0060] S202: Displaying a set of virtual objects in a current video frame of a 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, items, etc. The transformation of a virtual scene is a dynamic process. For example, a virtual object may move from one location to another. The dynamic change process can be composed of multiple video frames. A video frame is the basic component unit of a video, which refers to a single static image in a video sequence. The video produces dynamic effects by playing these frames in rapid succession. Each video frame represents the state of the virtual scene at a specific point in time, and the display of continuous video frames can achieve continuous dynamic effects. Virtual objects can be virtual characters, props, buildings, etc. operated by players. A virtual object set can include multiple different virtual objects. In the embodiment of this solution, it can be multiple different character avatars.
[0062] S204: Determine at least one virtual object combination based on the initial position of each virtual object in the virtual object set and the shape of the corresponding display area, and determine the mutual repulsion between the virtual objects 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 the virtual object can be in the shape of a circle, rectangle, hexagon, etc. Figure 3Schematic diagram of a virtual object set in an embodiment, wherein the display areas of different virtual objects may have different shapes, colors, and sizes. According to the initial position of the virtual object and the shape of the display area, check whether there is overlap. In a virtual object combination, as long as the display area of a virtual object overlaps with the display area of at least one other virtual object, then this virtual object and all other virtual objects overlapping with it can constitute a virtual object combination. The other virtual objects are within the range of the virtual object combination. In a virtual object combination, the display area of at least one virtual object 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. It is detected that the display areas of A and B, and B and C overlap. Therefore, A, B, and C can be divided into a virtual object combination, and the repulsion between A and B, and B and C is calculated so that their display areas are gradually separated to reduce overlap. The mutual repulsion between each virtual object in the virtual object combination is calculated. The mutual repulsion can be determined according to the distance between the 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: Determine, based on the mutual repulsion, an update position of each virtual object of the virtual object combination in a video frame next to the current video frame.
[0065] Based on the calculated mutual repulsion, the positions of the virtual objects in the virtual object combination are adjusted to reduce or eliminate the overlap, and the updated positions of the virtual objects in the virtual object combination are obtained as the updated positions of the virtual objects in the next video frame.
[0066] S208: Displaying the virtual object combination and other virtual objects in the virtual object set except the virtual object combination based on the updated position in the next video frame, and the other virtual objects except the virtual object combination remain at the initial position.
[0067] The virtual object set includes a virtual object set and other virtual objects except the virtual object set. The virtual object set is displayed in a next video frame based on the updated position, and the other virtual objects except the virtual object set are displayed in a next video frame, and the other virtual objects except the virtual object set are still at their initial positions.
[0068] In the above-mentioned method for displaying virtual objects, a frame-based operation method is adopted to decompose complex computing tasks into multiple frames for processing, thereby reducing the instantaneous amount of calculation. In each frame, the mutual repulsion is calculated to maintain an appropriate distance between virtual objects, showing the dynamic change process of virtual objects gradually dispersing from an initial crowded state to a uniform distribution.
[0069] In some embodiments of the present disclosure, the calculation process of the mutual repulsion includes:
[0070] Based on the initial positions of two different virtual objects in the virtual object combination, obtain the center of gravity reverse direction vector and the distance between the two different virtual objects;
[0071] Based on the distance between the two different virtual objects and the shape of the display area of the two different virtual objects, obtaining the repulsive force strength between the two different virtual objects;
[0072] The mutual repulsion between the two different virtual objects is obtained based on the repulsive force strength and the gravity center reverse direction vector.
[0073] Each mutual repulsion occurs between two virtual objects. If there are multiple overlapping virtual objects, the multiple overlapping virtual objects can be split into different pairs of virtual objects to consider mutual repulsion separately. For two different virtual objects, calculate the center of gravity reverse vector between them. The center of gravity reverse vector indicates the direction from one virtual object to another virtual object, but it needs to be in the opposite direction when used to calculate repulsion. The distance can be the Euclidean distance between two different virtual objects. Based on the distance between two different virtual objects and the shape of the display area of two different virtual objects, the repulsion strength between two different virtual objects is obtained, and then based on the repulsion strength and the center of gravity reverse vector, the mutual repulsion between two different virtual objects is obtained, which can be expressed as mutual repulsion = center of gravity reverse vector * repulsion strength.
[0074] In some embodiments of the present disclosure, before presenting the set 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, and a random displacement operation is performed within a preset range based on a center point of the virtual object to obtain a virtual object after random displacement.
[0076] At least one virtual object is randomly generated in the virtual scene, and the initial position and display area of the virtual object are set, a preset range is defined, and the center point of the virtual object is randomly displaced within the preset range to obtain a virtual object after the corresponding random displacement. For example, if the center point of a randomly generated virtual object is (0, 0), the center point can be randomly displaced within the range of (2, 2) (-2, 2) (2, -2) (-2, -2), and a virtual object is generated at any position, producing a random displacement effect, and achieving a uniform and random patchwork distribution. Figure 4 4-1 is a schematic diagram of a random displacement operation in an embodiment, wherein 4-1 is a virtual object that can be generated within a preset range, and 4-2 is a virtual object after a corresponding random displacement.
[0077] In some embodiments of the present disclosure, the method further includes:
[0078] Receiving a page operation to set a repulsion well and / or an attraction well in the virtual scene;
[0079] Based on the repulsive well and / or attractive well, virtual objects within the repulsive range and / or attractive range are determined so that the virtual objects within the repulsive range and / or attractive range form a layout of a preset shape based on the repulsive force of the repulsive well and / or the attractive force of the attractive well.
[0080] Page operations can be mouse clicks, drags, keyboard inputs, touch operations, etc., and repulsion wells and / or gravitational wells can be set in the virtual scene according to the preset shape, including repulsion ranges and / or gravitational ranges. Repulsion wells are a virtual force field, which is implemented by the tools that come with the game development engine. Those skilled in the art can master the setting methods of relevant repulsion wells and gravitational wells in mainstream game development engines. When an object enters the area, it will be subject to a repulsive force that moves it away from a certain center point or other objects. The repulsive force increases as the object approaches the center point or other objects. The repulsive well can be used to prevent collisions between objects. The gravitational well is a virtual force field. When an object enters the area, it will be subject to an attractive force that moves it toward a certain center point or other objects. The gravitational well increases as the object moves away from the center point or other objects. The gravitational well can be used to guide the object to move toward the target. Select the repulsion well and / or gravitational well according to the preset shape, and set the center point coordinates, repulsion range and / or gravitational range of the well. The repulsion well and / or gravitational well can apply repulsion and / or gravitational force to the virtual object to obtain a layout of the preset shape. For each virtual object within the repulsive range, calculate the repulsive force it receives and adjust its position. For each virtual object within the gravitational range, calculate the gravitational force it receives and adjust its position, so that the virtual objects finally form a layout of a preset shape. Among them, the repulsive force of the repulsive well = the square of the distance from the virtual object to other virtual objects within the repulsive range × attenuation coefficient × repulsive force strength, and the gravitational force of the gravitational well = the square of the distance from the virtual object to other virtual objects within the gravitational range × enhancement coefficient × gravitational strength. For example, to achieve distribution within a circle, a gravity well can be set at the center of the circle. If you want to achieve distribution in an area with an empty center like a donut, you can set a repulsive well at the center of the circle. The gravity well and the repulsive well will exert suction or repulsion on the virtual objects within their own radius of action.
[0081] In some embodiments of the present disclosure, the method further includes:
[0082] A repulsive boundary is set based on a preset shape, and the repulsive boundary is used to ensure that the virtual object is displayed within an area of the preset shape.
[0083] Set a repulsive boundary. If the 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 achieve the distribution of virtual objects in a sector area, you can set a gravity well at the center of the circle to form a distribution within the circle, and then set the repulsive boundary to specify the two sides of the sector. The repulsive force of the repulsive boundary = the direction vector pointing to the virtual object from the center of the sector × the repulsive force strength. The direction vector pointing to the virtual object from the center of the sector is the vertical vector, and the vertical direction is the repulsive direction, that is, the repulsive force strength is a scalar value that can be used to adjust the size of the repulsive force. The direction vector pointing to the virtual object from the center of the sector can calculate the distance between the virtual object and the center of the circle. The use of the vertical vector can be used to define the direction of the repulsive force. The repulsive force of the repulsive boundary can be obtained by multiplying the direction vector pointing to the virtual object from the center of the sector and the repulsive force strength.
[0084] Figure 5 Schematic diagram of a display process of a virtual object in an embodiment.
[0085] In some embodiments of the present disclosure, the method further includes:
[0086] In the case where the virtual objects overlap, laying out the overlapping virtual objects based on a preset layout rule, the virtual objects including a first virtual object, a second virtual object, a third virtual object, and a fourth virtual object;
[0087] The preset layout rule includes a first layout rule and a second layout rule, wherein the priority of the first layout rule is higher than that of the second layout rule;
[0088] The first layout rule includes that when the third virtual object overlaps with the fourth virtual object, the overlapping portion of the third virtual object is displayed above the overlapping portion of the fourth virtual object;
[0089] The second layout rule includes that, when the first virtual object overlaps with the second virtual object, an overlapping portion of the first virtual object is displayed above an overlapping portion of the second virtual object.
[0090] Multiple camps can be included in a virtual scene, and different camps can include different virtual objects.
[0091] The colors of virtual objects in different camps are different, which can be used to distinguish different camps. Virtual objects can be classified into first virtual objects, second virtual objects, third virtual objects, and fourth virtual objects. In the embodiment of the present disclosure, Figure 6 is a schematic diagram of different types of virtual objects in one embodiment. The dotted line pattern is a virtual object displayed below after overlapping. The first virtual object may be a pioneer, that is, Figure 6The second virtual object can be a soldier, that is, Figure 6 In the game setting, the vanguard can be a virtual object with higher combat power than the soldier, or a virtual object that has priority in battle. When the first virtual object overlaps with the second virtual object, 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 observed intuitively in complex virtual scenes. The third virtual object can be the player's own avatar, that is, Figure 6 The avatar with a specific mark in the game can be an arrow pointing to the player, which is used to indicate the player's own position. The fourth virtual object can be the avatar of another player. When the third virtual object overlaps with the fourth virtual object, the overlapping part of the third virtual object is displayed above the overlapping part of the fourth virtual object, which can ensure that the avatars of important characters or players are always visible and avoid being blocked by secondary objects. The level can be dynamically adjusted according to different scene requirements, and the transparency, shape, etc. of the virtual objects can also be adjusted.
[0092] In some embodiments of the present disclosure, 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.
[0093] The size of the second virtual object can be adjusted to reflect the difference between different second virtual objects. For example, the corresponding scaling ratio can be calculated according to the combat power value of each player. Players with different combat powers 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 the present disclosure, the second virtual object is displayed through the following steps:
[0095] The second virtual object is gradually increased from an initial size to a preset size based on a preset display speed.
[0096] Figure 7 Schematic diagram of the second virtual object being enlarged in one embodiment. The first virtual object appears earlier than the second virtual object in the virtual scene, and the second virtual object is gradually enlarged from an initial size to a preset size based on a preset display speed. For example, at intervals of 0.2 seconds, the pioneer avatars appear one by one, and when the pioneer avatar lands, the soldier avatar appears again, and the soldier avatar appears in a reduced and enlarged form, such as Figure 7 As shown, the size can be changed from 0.2 times to 1 times, and the enlarged second virtual object needs to be set within the preset size range of the second virtual object.
[0097] In some embodiments of the present disclosure, the second virtual object is switched to the first virtual object through the following steps:
[0098] gradually increasing the second virtual object to a target size, so that the second virtual object reaching the target size switches to the first virtual object;
[0099] The first virtual object of the target size is gradually reduced to a preset size of the first virtual object to obtain the switched first virtual object.
[0100] Figure 8 The schematic diagram of switching from the second virtual object to the first virtual object in one embodiment is as follows. The second virtual object is gradually enlarged 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 a preset size of the first virtual object to obtain the switched first virtual object, thereby achieving a dynamic transformation effect.
[0101] In some embodiments of the present disclosure, the interaction operation includes:
[0102] Setting an interaction area, wherein the interaction frequency is determined based on the distance between the virtual object and the interaction area;
[0103] After each interaction, calculating the interaction result of the virtual object;
[0104] A virtual object is displayed in the interaction area based on the interaction result.
[0105] Interactive operations can be divided into vanguard battles, group battles, melee battles, etc., and interactive areas are set. Fig. 9 FIG. 1 is a schematic diagram of an interaction area in an embodiment. The interaction area may be set to a donut-shaped interaction area, wherein virtual objects are distributed between the inner circle and the outer circle, and the interaction frequency is determined based on the distance between the virtual objects and the interaction area. That is, the closer the virtual objects are to the center, the more intense the collision. Fig.10 This is a schematic diagram of the virtual object collision intensity in an embodiment. The numbers 1-3 represent the interaction frequency of virtual objects, which changes 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 a small cyclic change operation. Among them, the user can switch the perspective to observe the interaction operation. In the high perspective, the player can view more plots, and the plots will be smaller. The low perspective diagram will zoom in the lens to show more plot details. Fig.1111-1 is a schematic diagram of switching perspectives in an embodiment, 11-2 is a schematic diagram of a high perspective, which can display more virtual scenes, and 11-2 is a schematic diagram of a low perspective, in which the virtual scene is enlarged but the observed virtual scene is smaller than the high perspective. In the vanguard battle, the vanguard avatars fight towards the middle, and points will be generated during the fight. The vanguard who wins in the end will jump to the middle and play the victory animation. The interactive process of the development station and team battle is the same as that of the vanguard battle, but there are more virtual objects involved than in the vanguard battle, and the interaction frequency is higher than that of the vanguard battle.
[0106] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0107] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store virtual objects. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for displaying a virtual object is implemented.
[0108] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.13As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for displaying a virtual object is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0109] Those skilled in the art will understand that Fig.12 , Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0110] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present disclosure is implemented.
[0111] In one embodiment, a computer program product is provided, including a computer program, which implements the method described in any embodiment of the present disclosure when executed by a processor.
[0112] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
[0113] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, 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 above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A method for displaying a virtual object, characterized in that: The method comprises: Displaying a collection of virtual objects in a current video frame of a virtual scene; Based on the initial positions of the virtual objects in the virtual object set and the shapes of the corresponding display areas, 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; Based on the mutual repulsion, determining an update position of each virtual object of the virtual object combination in a video frame next to the current video frame; In the next video frame, the virtual object combination and other virtual objects in the virtual object set except the virtual object combination are displayed based on the updated position, and the other virtual objects except the virtual object combination remain at the initial position.
2. The method according to claim 1, characterized in that The calculation process of the mutual repulsion includes: Based on the initial positions of two different virtual objects in the virtual object combination, obtain the center of gravity reverse direction vector and the distance between the two different virtual objects; Based on the distance between the two different virtual objects and the shape of the display area of the two different virtual objects, obtaining the repulsive force strength between the two different virtual objects; The mutual repulsion between the two different virtual objects is obtained based on the repulsive force strength and the gravity center reverse direction vector.
3. The method according to claim 1, characterized in that Before presenting the set of virtual objects in the current video frame of the virtual scene, the method further includes: At least one virtual object is randomly generated in a virtual scene, and a random displacement operation is performed within a preset range based on a center point of the virtual object to obtain a virtual object after random displacement.
4. The method according to claim 1, characterized in that: The method further comprises: Receiving a page operation to set a repulsion well and / or an attraction well in the virtual scene; Based on the repulsive well and / or attractive well, virtual objects within the repulsive range and / or attractive range are determined so that the virtual objects within the repulsive range and / or attractive range form a layout of a preset shape based on the repulsive force of the repulsive well and / or the attractive force of the attractive well.
5. The method according to claims 1-4, characterized in that: The method further comprises: A repulsive boundary is set based on a preset shape, and the repulsive boundary is used to ensure that the virtual object is displayed within an area of the preset shape.
6. The method according to claim 1, characterized in that The method further comprises: In the case where the virtual objects overlap, laying out the overlapping virtual objects based on a preset layout rule, the virtual objects including a first virtual object, a second virtual object, a third virtual object, and a fourth virtual object; The preset layout rule includes a first layout rule and a second layout rule, wherein the priority of the first layout rule is higher than that of the second layout rule; The first layout rule includes that when the third virtual object overlaps with the fourth virtual object, the overlapping portion of the third virtual object is displayed above the overlapping portion of the fourth virtual object; The second layout rule includes that, when the first virtual object overlaps with the second virtual object, an overlapping portion of the first virtual object is displayed above an overlapping portion of the second virtual object.
7. The method according to claim 6, characterized in that 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 according to claim 7, characterized in that 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 according to claim 7, characterized in that: The second virtual object is switched to the first virtual object by the following steps: gradually increasing the second virtual object to a target size, so that the second virtual object reaching the target size switches to the first virtual object; The first virtual object of the target size is gradually reduced to a preset size of the first virtual object to obtain the switched first virtual object.
10. The method according to claim 7, characterized in that The interactive operation includes: Setting an interaction area, wherein the interaction frequency is determined based on the distance between the virtual object and the interaction area; After each interaction, calculating the interaction result of the virtual object; A virtual object is displayed in the interaction area based on the interaction result.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Cited By
Virtual object display method, computer device, and storage medium
WO2026170632A1