Ray Display Method, Device, Equipment and Storage Medium Based on Virtual Scenario
By adding virtual ray emitters to virtual prop launchers in shooting games, users can customize the assembly position and ray assisted aiming, solving problems that are difficult to find in sight, and improving the authenticity of the game and human-computer interaction efficiency.
Patent Information
- Application Number
- CN202210110548.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-01-29
AI Technical Summary
In shooting games, due to the small footprint area and light color, it is difficult to find the aiming position in complex game scenes, resulting in high aiming difficulty and low human-computer interaction efficiency.
The virtual ray emitter is assembled on the virtual prop emitter. With ray assisted aiming, the user can choose the assembly position by himself, and the ray points to the aiming position to reduce the difficulty of aiming.
Improves the authenticity of the game and human-computer interaction efficiency, and users can customize the assembly position of the virtual ray emitter to simplify the aiming process.
Smart Images

Figure CN114432701B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and particularly to a ray display method, apparatus, device, and storage medium based on a virtual scene. Background Art
[0002] With the development of multimedia technologies and the diversification of terminal functions, the types of games that can be played on terminals are increasing. Shooting games are a relatively popular type of game. In shooting games, users can manipulate virtual objects to use different virtual prop launchers, and through the virtual prop launchers, they can fight against virtual objects controlled by other users.
[0003] In related technologies, a sight is usually displayed on the game screen to prompt the aiming position of the virtual prop launcher. However, the area of the sight is often small and the color is light, making it difficult to find the position of the sight in some game scenes with complex display contents, resulting in a high aiming difficulty and low efficiency of human-computer interaction. Summary of the Invention
[0004] Embodiments of the present application provide a ray display method, apparatus, device, and storage medium based on a virtual scene, which can improve the efficiency of human-computer interaction. The technical solutions are as follows:
[0005] On the one hand, a ray display method based on a virtual scene is provided. The method includes:
[0006] Display a virtual scene, where the virtual scene displays a target virtual object and a virtual prop launcher held by the target virtual object;
[0007] In response to an assembly operation on the virtual prop launcher in the virtual scene, display an assembled virtual ray launcher based on a target assembly position determined by the assembly operation, where the virtual ray launcher is used to assist the virtual prop launcher in aiming;
[0008] Based on the target virtual object, the virtual prop launcher, and the target assembly position, display a ray emitted by the virtual ray launcher in the virtual scene, where the ray points to the aiming position of the virtual prop launcher.
[0009] On the one hand, a ray display apparatus based on a virtual scene is provided. The apparatus includes:
[0010] A virtual scene display module, configured to display a virtual scene, where the virtual scene displays a target virtual object and a virtual prop launcher held by the target virtual object;
[0011] A virtual ray emitter display module, configured to, in response to an assembly operation on the virtual prop emitter in the virtual scene, display the assembled virtual ray emitter based on the target assembly position determined by the assembly operation, where the virtual ray emitter is used to assist the virtual prop emitter in aiming;
[0012] A ray display module, configured to display a ray emitted by the virtual ray emitter in the virtual scene based on the target virtual object, the virtual prop emitter, and the target assembly position, where the ray points to the aiming position of the virtual prop emitter.
[0013] In a possible implementation manner, the virtual ray emitter display module is configured to, in response to a first operation in the virtual scene, display an assembly page of the virtual prop emitter in the virtual scene, where the assembly page displays multiple candidate assembly positions of the virtual prop emitter; in response to a second operation in the assembly page, determine the selected candidate assembly position among the multiple candidate assembly positions as the target assembly position; and display the virtual ray emitter at the target assembly position of the virtual prop emitter.
[0014] In a possible implementation manner, the virtual ray emitter display module is configured to perform any one of the following:
[0015] In response to a pick-up operation on the virtual ray emitter in the virtual scene, display the assembly page of the virtual prop emitter in the virtual scene;
[0016] In response to a click operation on an assembly control displayed in the virtual scene, display the assembly page of the virtual prop emitter in the virtual scene.
[0017] In a possible implementation manner, the virtual ray emitter display module is configured to perform any one of the following:
[0018] In response to a click operation on any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position;
[0019] In response to dragging the virtual ray emitter to any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position.
[0020] In a possible implementation, the ray display module is configured to determine the emission direction of the ray based on the positioning information of the target virtual object in the virtual scene, the type of the virtual prop emitter, and the target assembly position; and control the virtual ray emitter to emit the ray in the emission direction.
[0021] In a possible implementation, the ray display module is configured to determine the target position of the virtual ray emitter based on the first positioning information of the target virtual object in the virtual scene and the target assembly position, where the first positioning information includes the position and pointing of the hand of the target virtual object in the virtual scene; and determine the emission direction of the ray based on the first positioning information, the second positioning information of the target virtual object, the type of the virtual prop emitter, the position of the hand, and the target position, where the second positioning information includes the position and orientation of the virtual camera of the target virtual object in the virtual scene.
[0022] In a possible implementation, the ray display module is configured to generate a first rotation matrix based on the pointing of the hand; process the target assembly position using the first rotation matrix to obtain the reference position of the virtual ray emitter; and fuse the position of the hand and the reference position of the virtual ray emitter to obtain the target position of the virtual ray emitter, where the target position is the relative position between the virtual ray emitter and the target virtual object.
[0023] In a possible implementation, the ray display module is configured to determine the target emission distance of the virtual prop emitter based on the type of the virtual prop emitter; determine the reference aiming position of the virtual prop emitter based on the second positioning information of the target virtual object and the target emission distance; and determine the emission direction vector of the ray based on the target position, the reference aiming position of the virtual prop emitter, and the first positioning information.
[0024] In a possible implementation, the ray display module is configured to determine the reference emission direction vector of the ray based on the target position and the reference aiming position of the virtual prop emitter, where the reference emission direction vector is a vector in the space established based on the target virtual object; and rotate the reference emission direction based on the pointing of the hand to obtain the emission direction vector of the ray, where the emission direction vector is a vector in the space established based on the virtual prop emitter.
[0025] In a possible implementation, the device further includes:
[0026] A light point display module is configured to display a light point on the virtual obstacle when the aiming position of the virtual prop launcher is the virtual obstacle in the virtual scene, where the light point is the intersection point of the ray emitted by the virtual ray launcher and the virtual obstacle.
[0027] In a possible implementation manner, the ray display module is further configured to not display the ray emitted by the virtual ray launcher when the target virtual object adjusts the posture of holding the virtual prop launcher from the first posture to the second posture.
[0028] On the one hand, a computer device is provided, which includes one or more processors and one or more memories. At least one computer program is stored in the one or more memories, and the computer program is loaded and executed by the one or more processors to implement the ray display method based on the virtual scene.
[0029] On the one hand, a computer-readable storage medium is provided, in which at least one computer program is stored, and the computer program is loaded and executed by a processor to implement the ray display method based on the virtual scene.
[0030] On the one hand, a computer program product or a computer program is provided. The computer program product or the computer program includes program code, the program code is stored in a computer-readable storage medium, a processor of a computer device reads the program code from the computer-readable storage medium, and the processor executes the program code, so that the computer device executes the above-mentioned ray display method based on the virtual scene.
[0031] Through the technical solution provided by the embodiments of the present application, a function of assembling a virtual ray launcher is provided in the virtual scene, and the assembling position can be selected by itself during assembly. During the aiming process, the ray is displayed according to the target virtual object, the virtual prop launcher, and the assembling position of the virtual ray launcher, so that the ray can point to the aiming position of the virtual prop launcher, and the ray can assist the user's aiming, thereby reducing the aiming difficulty and improving the efficiency of human-computer interaction. Description of the Drawings
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0033] Figure 1It is a schematic diagram of the implementation environment of a ray display method based on a virtual scene provided by an embodiment of the present application;
[0034] Figure 2 It is a schematic diagram of a viewing angle for observing a virtual scene provided by an embodiment of the present application;
[0035] Figure 3 It is a schematic diagram of a virtual scene provided by an embodiment of the present application;
[0036] Figure 4 It is a flowchart of a ray display method based on a virtual scene provided by an embodiment of the present application;
[0037] Figure 5 It is a flowchart of a ray display method based on a virtual scene provided by an embodiment of the present application;
[0038] Figure 6 It is a schematic diagram of another virtual scene provided by an embodiment of the present application;
[0039] Figure 7 It is a schematic diagram of yet another virtual scene provided by an embodiment of the present application;
[0040] Figure 8 It is a schematic diagram of yet another virtual scene provided by an embodiment of the present application;
[0041] Figure 9 It is a schematic diagram of yet another virtual scene provided by an embodiment of the present application;
[0042] Figure 10 It is a schematic diagram of yet another virtual scene provided by an embodiment of the present application;
[0043] Figure 11 It is a schematic diagram of a target emission distance provided by an embodiment of the present application;
[0044] Figure 12 It is a flowchart of a ray display method based on a virtual scene provided by an embodiment of the present application;
[0045] Figure 13 It is a schematic diagram of the structure of a ray display device based on a virtual scene provided by an embodiment of the present application;
[0046] Figure 14 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present application. Detailed implementation manners
[0047] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the implementation manners of the present application in detail with reference to the accompanying drawings.
[0048] In this application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects. It should be understood that there is no logical or chronological dependence between "first", "second", and "nth", nor are the quantity and execution order limited.
[0049] In this application, the term "at least one" means one or more, and the meaning of "multiple" means two or more.
[0050] In related technologies, a sight is often displayed on the game screen. The sight is used to indicate the aiming position of the virtual prop launcher, and the game screen is used to simulate a real scene. However, there is no sight in the real scene, and displaying the sight on the game screen will reduce the authenticity of the game. If the sight is not displayed on the game screen, then aiming can be performed through a fixed-position aiming device. Although this can improve the authenticity of the game, it will reduce the aiming accuracy. In addition, due to the fixed position of the aiming device, the configuration of the aiming device is not flexible enough.
[0051] Virtual scene: It is a virtual scene displayed (or provided) when the application program runs on the terminal. The virtual scene can be a simulation environment of the real world, a semi-simulated and semi-fictional virtual environment, or a purely fictional virtual environment. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5D virtual scene, or a three-dimensional virtual scene. The embodiments of this application do not limit the dimension of the virtual scene. For example, the virtual scene can include the sky, land, ocean, etc. The land can include environmental elements such as deserts and cities, and users can control virtual objects to move in the virtual scene.
[0052] Virtual object: It refers to an active object in the virtual scene. The active object can be a virtual character, a virtual animal, an anime character, etc. For example, the characters, animals, plants, oil drums, walls, stones, etc. displayed in the virtual scene. The virtual object can be a virtual image in the virtual scene that represents the user. The virtual scene can include multiple virtual objects, and each virtual object has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene.
[0053] Optionally, the virtual object is a user role controlled by operations on the client, or an artificial intelligence (AI) set in the virtual scene battle through training, or a non-player character (NPC) set in the virtual scene. Optionally, the virtual object is a virtual character competing in the virtual scene. Optionally, the number of virtual objects participating in the interaction in the virtual scene is preset or dynamically determined according to the number of clients joining the interaction.
[0054] Taking a shooting game as an example, the user can control the virtual object to freely fall, glide or open a parachute to fall in the sky of the virtual scene, run, jump, crawl, bend forward, etc. on land, and can also control the virtual object to swim, float or dive in the ocean. Of course, the user can also control the virtual object to move in the virtual scene by taking a virtual vehicle. For example, the virtual vehicle can be a virtual car, a virtual aircraft, a virtual yacht, etc. Only the above scenarios are used for illustration here, and the embodiments of the present application do not make specific limitations thereto. The user can also control the virtual object to interact with other virtual objects through interactive props, such as fighting. For example, the interactive prop can be a throwing interactive prop such as a grenade, a cluster mine, a sticky grenade (abbreviation: "sticky mine"), or a shooting interactive prop such as a machine gun, a pistol, a rifle, etc. The present application does not make specific limitations on the type of interactive props. It should be noted that the above-introduced shooting interactive props such as machine guns, pistols, and rifles are all props in the game.
[0055] Figure 1 It is a schematic diagram of the implementation environment of a ray display method based on a virtual scene provided by an embodiment of the present application. Refer to Figure 1 , and the implementation environment includes: a terminal 120 and a server 140.
[0056] The terminal 120 is equipped with and runs an application program that supports virtual scene display. Optionally, the application program is any one of a First-Person Shooting Game (FPS), a third-person shooting game, a virtual reality application program, a three-dimensional map program, or a multiplayer survival game with equipment. The terminal 120 is the terminal used by the user. The user uses the terminal 120 to operate the target virtual object located in the virtual scene for activities, and the activities include but are not limited to: adjusting the body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing, etc. Schematically, the target virtual object is a virtual character, such as a simulated character or an anime character.
[0057] The server 140 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The embodiments of the present application do not limit the number and device type of the servers. The server 140 provides background services for the application program running on the terminal 120, and the terminal 120 is connected to the server 140 through a wireless network or a wired network.
[0058] After introducing the implementation environment of the embodiments of the present application, the application scenarios of the embodiments of the present application will be introduced below. In the following description process, the terminal is the terminal 120 in the above implementation environment, and the server is the server 140 above.
[0059] The technical solution provided by the embodiments of the present application can be applied to the scenario of shooting games. In shooting games, the terminal displays a virtual scene, which includes a target virtual object. The user can control the target virtual object to move and attack in the virtual scene through the terminal. In some embodiments, the target virtual object holds a virtual prop launcher, and through this virtual prop launcher, it is possible to attack other virtual objects in the virtual scene. During the game, the user can control the virtual prop launcher held by the target virtual object to aim at the virtual object to be attacked, so as to launch an attack on this virtual object. In some embodiments, the terminal will display the sight of the virtual prop launcher in the virtual scene, and this sight is used to indicate the aiming position of the virtual prop launcher in the virtual scene. By adjusting the position of this sight, the user can achieve the purpose of controlling the virtual prop launcher to aim. In some cases, due to the possible complexity of the virtual scene and the complexity of the displayed content, the user may not be able to accurately view the position of the sight, resulting in a higher aiming difficulty for the virtual prop launcher and a lower efficiency of human-computer interaction. After adopting the technical solution provided by the embodiments of the present application, the user can add a virtual ray emitter to the virtual prop launcher, and use this virtual ray emitter to assist in aiming the virtual prop launcher, reducing the aiming difficulty of the virtual prop launcher and improving the efficiency of human-computer interaction. In addition, the user can also independently select the installation position of the virtual ray emitter on the virtual prop launcher, and no matter which position the virtual ray emitter is installed on the virtual prop launcher, the virtual ray emitter can send a ray to the aiming position of the virtual prop launcher, enriching the user's game choices while improving the authenticity of the game and the efficiency of human-computer interaction.
[0060] It should be noted that the above is an example of applying the technical solution provided by the embodiments of the present application to the scenario of shooting games. In other possible implementation manners, the technical solution provided by the embodiments of the present application can also be applied to other types of games that require aiming. The embodiments of the present application do not make any limitations in this regard.
[0061] It should be noted that the above description is given by taking the terminal executing the ray display method based on the virtual scene provided in the embodiments of the present application as an example. In the case where the above shooting game is a cloud game, the ray display method based on the virtual scene provided in the embodiments of the present application can also be executed by the server, that is, the server executes the background processing process to generate a video stream, pushes the video stream to the terminal, and the terminal can perform the display. The embodiments of the present application do not make any limitations in this regard.
[0062] To more clearly illustrate the technical solutions provided in the embodiments of the present application, the virtual scene in the present application will be introduced below. Refer to Figure 2 , in order to make the shooting game more realistic, game designers will design the display mode of the virtual scene by referring to the way humans observe the real world. The first virtual object 201 can observe the virtual scene in the area 202, and the picture obtained by observing the area 202 from the perspective of the first virtual object 201 is also the displayed virtual scene. The user can adjust the position of the first virtual object 201 observing the virtual scene by adjusting the orientation of the first virtual object 201.
[0063] In some embodiments, the virtual scene includes controls for controlling the target virtual object to perform different actions. Refer to Figure 3 , a virtual joystick 302, a posture adjustment control 303, and a shooting control 304 are displayed on the virtual scene 301. Among them, the virtual joystick 302 is used to control the moving direction of the target virtual object. The posture adjustment control 303 is used to adjust the posture of the target virtual object, such as controlling the virtual object to perform actions such as squatting or crawling. The shooting control 304 is used to control the virtual prop launcher held by the target virtual object to launch virtual props. In some embodiments, the virtual prop launcher is a virtual firearm in the game, and the virtual prop is virtual ammunition in the game. 305 is a mini-map, or a virtual map, and the user can observe the positions of teammates and enemies in the virtual scene through the mini-map 305.
[0064] After introducing the implementation environment and application scenarios of the embodiments of the present application, the ray display method based on the virtual scene provided in the embodiments of the present application will be described below. Refer to Figure 4 , the method includes:
[0065] 401. The terminal displays a virtual scene, and the virtual scene displays a target virtual object and a virtual prop launcher held by the target virtual object.
[0066] Among them, the virtual scene is the activity scene of the virtual object. The virtual scene is a simulation of the real world. In some embodiments, the virtual scene is also referred to as the game scene. The target virtual object is the virtual object controlled by the terminal. The user can control the target virtual object to interact in the virtual scene through the terminal. The virtual prop launcher is a type of game prop provided by the game. The virtual prop launcher can launch virtual props in the virtual scene to achieve an attack on the virtual object. Among them, the virtual prop launcher is the virtual firearm in the game, and the virtual prop launched by the virtual prop launcher is the virtual ammunition in the game.
[0067] 402. In response to the assembly operation on the virtual prop launcher in the virtual scene, the terminal displays the assembled virtual ray launcher based on the target assembly position determined by the assembly operation. The virtual ray launcher is used to assist the virtual prop launcher in aiming.
[0068] Among them, the assembly operation on the virtual prop launcher refers to the operation of selecting the assembly position on the virtual prop launcher for the virtual ray launcher. The virtual ray launcher can emit rays in the virtual scene, and the rays can play a role in assisting the virtual prop launcher in aiming. In the embodiments of the present application, the assembly position of the virtual ray launcher on the virtual prop launcher is determined by the user. That is to say, in the embodiments of the present application, multiple assembly forms between the virtual ray launcher and the virtual prop launcher are provided, providing a very rich assembly method for the user.
[0069] 403. The terminal displays the ray emitted by the virtual ray launcher in the virtual scene based on the target virtual object, the virtual prop launcher, and the target assembly position. The ray points to the aiming position of the virtual prop launcher.
[0070] Among them, the ray emitted by the virtual ray launcher points to the aiming position of the virtual prop launcher, which means that the user can know the aiming position of the virtual prop launcher by viewing the direction of the ray, thereby facilitating the user to control the virtual prop launcher to aim, and the efficiency of human-computer interaction is relatively high.
[0071] Through the technical solution provided by the embodiments of the present application, the function of assembling the virtual ray launcher is provided in the virtual scene, and the assembly position can be selected by itself during assembly. During the aiming process, the ray is displayed according to the target virtual object, the virtual prop launcher, and the assembly position of the virtual ray launcher, so that the ray can point to the aiming position of the virtual prop launcher, and the ray can assist the user's aiming, thereby reducing the aiming difficulty and improving the efficiency of human-computer interaction.
[0072] The above steps 401-403 are a brief introduction to the ray display method based on a virtual scene provided by an embodiment of the present application. Below, some examples will be combined to provide a more detailed description of the technical solution provided by the embodiment of the present application. See Figure 5 , the method includes:
[0073] 501. The terminal displays a virtual scene, and the virtual scene displays a target virtual object and a virtual prop launcher held by the target virtual object.
[0074] In some embodiments, the virtual scene is a game scene of a shooting game, the target virtual object is a virtual object controlled by the terminal, and the user can control the target virtual object to move, use props, drive a virtual vehicle, and perform other activities in the virtual scene through the terminal. The virtual prop launcher is a game prop provided in the shooting game, and the virtual prop launcher can launch virtual props in the virtual scene. The virtual props launched by the virtual prop launcher can attack the virtual objects in the virtual scene. When a virtual object in the virtual scene is hit by a virtual prop, the attribute value of the virtual object will decrease. Among them, the amount of decrease in the attribute value of the virtual prop is related to at least one of the type of the virtual prop, the position hit by the virtual prop, and the equipped virtual armor. When the attribute value of the virtual object drops to a target value, the virtual object is defeated. In some embodiments, the attribute value is referred to as the health value of the virtual object, and the target value is 0. That is, when the health value of the virtual object drops to 0, the virtual object is defeated.
[0075] In a possible implementation, in response to the user starting a competitive battle, the terminal displays the virtual scene corresponding to the competitive battle, and a target virtual object is displayed in the virtual scene. Here, a competitive battle is a shooting game, and the virtual scene displayed by the terminal is a part of the virtual scene. The target virtual object is displayed in the center of the virtual scene displayed by the terminal, and the virtual scene displayed by the terminal moves with the movement of the target virtual object. The target virtual object holds a virtual prop launcher. In some embodiments, the target virtual object can hold the virtual prop launcher in at least two postures. The first posture is to place the virtual prop launcher at the waist of the target virtual object, and this posture is also called "hip fire"; the second posture is to place the virtual prop launcher on the shoulder of the target virtual object, and this posture is also called "ADS (Aiming Down Sight)", that is, the posture of aiming with the sight of the virtual prop launcher. The transition from the "hip fire" posture to the "ADS" posture is also called aiming. In some embodiments, the virtual scene displayed by the terminal is also called the field of view of the target virtual object. In this case, when other virtual objects enter the field of view of the target virtual object, the terminal can display the other virtual objects.
[0076] The above implementation is described below through two examples.
[0077] Example 1: In response to a click operation on a target icon, the terminal starts a target application program, where the target icon is the icon corresponding to the target application program, and the target application program is the application program for the competitive battle. The terminal loads the relevant resources of the target application program and displays the main interface of the target application program. In response to an operation on the main interface, that is, starting a competitive battle, the terminal loads the rendering resources of the virtual scene and displays the virtual scene corresponding to the competitive battle. The virtual scene displays the target virtual object and the virtual prop launcher held by the target virtual object. In some embodiments, the user can independently switch the virtual prop launcher held by the target virtual object during the game process and can also independently switch the posture of the target virtual object holding the virtual prop launcher. In this case, both the rendering and display of the virtual scene are performed by the terminal.
[0078] Example 2: In response to a click operation on a target icon, the terminal sends an application start request to the server. The target icon is the icon corresponding to the target application, and the target application is the application for the competitive battle. The application start request carries the identifier of the target application. In response to receiving the application start request, the server obtains the identifier of the target application from the application start request and starts the target application based on the identifier of the target application. The server continuously pushes the video stream of the target application to the terminal, and the terminal displays the video stream. In response to an operation based on the video stream, the terminal sends a competitive battle start request to the server. The server receives the competitive battle start request and loads the rendering resources of the virtual scene based on the competitive battle start request to generate the virtual scene corresponding to this round of competitive battle. The server pushes the video stream corresponding to this round of competitive battle to the terminal, and the terminal displays the virtual scene corresponding to this round of competitive battle. The virtual scene displays a target virtual object and a virtual prop launcher held by the target virtual object. In this case, the rendering of the virtual scene is performed by the server, and the display of the virtual scene is performed by the terminal. This shooting game is also a cloud game.
[0079] 502. In response to an assembly operation on the virtual prop launcher in the virtual scene, the terminal displays the assembled virtual ray launcher at the target assembly position determined based on the assembly operation. The virtual ray launcher is used to assist the virtual prop launcher in aiming.
[0080] Among them, the virtual ray emitter is a game item provided for shooting games. In shooting games, the virtual ray emitter is also known as a laser pointer or simply "ray pointer". In some embodiments, the virtual ray emitter includes multiple types, and different types of virtual ray emitters have different performance parameters. For example, different types of virtual ray emitters have different shapes, or different types of virtual ray emitters can emit rays of different colors, etc. The virtual ray emitter can be assembled on the virtual item emitter and assist the virtual item by emitting rays. That is to say, after the virtual ray emitter is assembled on the virtual item emitter, it can emit a ray pointing to the aiming position of the virtual item emitter in the virtual scene, and the user can determine the current aiming position of the virtual item emitter by viewing the ray, thus facilitating the user to aim. In some embodiments, the ray emitted by the virtual ray emitter is implemented through particle effects. The target assembly position is determined based on the assembly operation, that is, the user can freely choose the assembly position of the virtual ray emitter on the virtual item emitter, so as to achieve personalized assembly of the virtual item emitter and provide the user with richer gameplay. In addition, in some embodiments, multiple accessories are provided for the virtual item emitter in shooting games, and different types of accessories can provide different functions for the virtual item emitter. The virtual ray emitter is also an accessory of the virtual item emitter. The assembly positions of multiple accessories of the virtual item emitter are freely determined by the user, and the assembly positions of each accessory can be adjusted. That is to say, the user can adjust the assembly position of the virtual ray emitter on the virtual item emitter at any time during the game process.
[0081] For example, referring to Figure 6 , the terminal displays the virtual scene 600, which shows the virtual item emitter 601, and the virtual ray emitter 602 is assembled on the virtual item emitter 601, and the virtual ray emitter 602 emits a ray 603 in the virtual scene.
[0082] In a possible implementation manner, in response to a first operation in the virtual scene, the terminal displays an assembly page of the virtual item emitter in the virtual scene, and the assembly page shows multiple candidate assembly positions of the virtual item emitter. In response to a second operation in the assembly page, the terminal determines the selected candidate assembly position among the multiple candidate assembly positions as the target assembly position. The terminal displays the virtual ray emitter at the target assembly position of the virtual item emitter.
[0083] Among them, the assembly page of the virtual prop launcher is used to assemble accessories for the virtual prop launcher. The multiple candidate assembly positions provided on the assembly page are the positions where the virtual prop launcher can be assembled with accessories, and the assembly page provides the function of allowing users to select assembly positions. In some embodiments, the assembly page further includes an accessory selection area, which includes multiple accessories owned by the target virtual object. The user can select the accessories they want to assemble on the virtual prop launcher from the accessory selection area, and this accessory selection area is also referred to as the virtual backpack of the target virtual object.
[0084] In this implementation manner, on the one hand, a method of aiming through a virtual ray emitter is provided. Compared with the method of aiming through a sight in the related art, it can improve the authenticity of the game. On the other hand, multiple candidate assembly positions are provided for the virtual ray emitter on the virtual prop launcher, and the user can independently select the target assembly position from these multiple candidate assembly positions, improving the flexibility of assembling the virtual ray emitter.
[0085] Selecting the target assembly position independently from multiple candidate assembly positions can at least bring the following effects:
[0086] First, it adapts to the user's usage habits. For example, some users are accustomed to assembling the virtual ray emitter on the right side of the virtual prop launcher, while some users are accustomed to assembling the virtual ray emitter on the left side of the virtual prop launcher. The multiple candidate assembly positions provided can thus adapt to different user usage habits simultaneously.
[0087] Second, since the sizes and shapes of different virtual prop launchers may be different, and the sizes and shapes of different virtual ray emitters may also be different, when the virtual ray emitter is assembled at a certain position on the virtual prop launcher, there may be a situation of blocking the field of view. In the case of providing multiple candidate assembly positions, the user can timely adjust the assembly position of the virtual ray emitter when the field of view is blocked, thus solving the problem of blocked field of view.
[0088] To illustrate the above implementation manner more clearly, the above implementation manner will be described in three parts below.
[0089] The first part: In response to a first operation in the virtual scene, the terminal displays the assembly page of the virtual prop launcher in the virtual scene.
[0090] Among them, Figure 7 A schematic diagram of the assembly page of the virtual prop launcher is provided. See Figure 7, the assembly page 700 includes a plurality of candidate assembly positions corresponding to different parts of the virtual prop launcher. In some embodiments, the virtual prop launcher is also displayed on the assembly page so that the user can know which virtual prop launcher the virtual ray launcher is being assembled for currently.
[0091] In a possible implementation manner, in response to a pick-up operation on the virtual ray launcher in the virtual scene, the terminal displays the assembly page of the virtual prop launcher in the virtual scene. In this case, the first operation in the virtual scene is the pick-up operation on the virtual ray launcher in the virtual scene.
[0092] Among them, the pick-up operation in the virtual scene refers to an operation of controlling a target virtual object to pick up the virtual ray launcher in the virtual scene. In some embodiments, the virtual ray launcher in the virtual scene is a virtual ray launcher randomly dropped in the virtual scene, or a virtual ray launcher dropped after a virtual object in the virtual scene is defeated. The embodiments of the present application do not make limitations on this.
[0093] In this implementation manner, when the target virtual object picks up the virtual ray launcher in the virtual scene, the terminal can display the assembly page of the virtual prop launcher, and provide the user with the selection of assembly positions for the picked-up virtual ray launcher through this assembly page, with relatively high efficiency.
[0094] For example, in response to the target virtual object approaching the position where the virtual ray launcher is located in the virtual scene, the terminal displays a pick-up control on the virtual ray launcher. Among them, the position of the target virtual object in the virtual scene is controlled by the user. That is to say, when the user sees the virtual ray launcher in the virtual scene, the user can control the target virtual object to move towards the position where the virtual ray launcher is located, so as to control the target virtual object to pick up the virtual ray launcher. In response to a click operation on the pick-up control, the target virtual object picks up the virtual ray launcher, and the assembly page of the virtual prop launcher is displayed. Among them, the target virtual object picking up the virtual ray launcher means storing the virtual ray launcher in the virtual backpack of the target virtual object. Or, in response to the target virtual object approaching the position where the virtual ray launcher is located in the virtual scene, the terminal controls the target virtual object to pick up the virtual ray launcher. That is to say, when the user controls the target virtual object to approach the virtual ray launcher, the terminal can automatically control the target virtual object to pick up the virtual ray launcher without manual control by the user, and the efficiency of human-computer interaction is relatively high. In response to the target virtual object picking up the virtual ray launcher, the terminal displays the assembly page of the virtual prop launcher, and the user can select an assembly position for the picked-up virtual ray launcher through this assembly page.
[0095] In a possible implementation manner, in response to a click operation on the assembly control displayed in the virtual scene, the terminal displays an assembly page of the virtual prop launcher in the virtual scene.
[0096] Among them, the assembly control is a function control for triggering the display of the assembly page. The form and display position of the assembly control are set by technicians according to the actual situation, and the embodiments of the present application do not limit this. In this case, the first operation in the virtual scene is a click operation on the assembly control in the virtual scene.
[0097] In this implementation manner, when the user wants to view the assembly page of the virtual prop launcher, they can directly click the assembly control, and the efficiency of human-computer interaction is relatively high.
[0098] For example, referring to Figure 6 and Figure 7 , the virtual scene 600 displays an assembly control 604. In response to a click operation on the assembly control 604, the terminal displays an assembly page 700 of the virtual prop launcher in the virtual scene.
[0099] Second part: In response to a second operation in the assembly page, the terminal determines the selected candidate assembly position among the multiple candidate assembly positions as the target assembly position.
[0100] Among them, the target assembly position is also the assembly position of the virtual ray emitter on the virtual prop launcher.
[0101] In a possible implementation manner, in response to a click operation on any one of the multiple candidate assembly positions in the assembly page, the terminal determines the candidate assembly position as the target assembly position.
[0102] Among them, in this case, the second operation in the virtual scene is a click operation on any one of the multiple candidate assembly positions.
[0103] In this implementation manner, the user can quickly select the target assembly position by clicking, and the efficiency of human-computer interaction is relatively high.
[0104] For example, referring to Figure 7 , in response to a click operation on any one of the multiple candidate assembly positions 701 in the assembly page 700, the terminal determines the candidate assembly position 701 as the target assembly position.
[0105] In a possible implementation manner, in response to dragging the virtual ray emitter to any one of the multiple candidate assembly positions in the assembly page, the terminal determines the candidate assembly position as the target assembly position.
[0106] In this implementation, the user can select an assembly position for the virtual ray emitter by dragging. At the same time, the dragging operation can also indicate the virtual ray emitter that is currently selecting the assembly position, reducing the probability of selection errors.
[0107] For example, referring to Figure 7 , in response to the virtual ray emitter being dragged to any one of the multiple candidate assembly positions 701, the terminal determines the candidate assembly position 701 as the target assembly position.
[0108] Part Three: The terminal displays the virtual ray emitter at the target assembly position of the virtual prop emitter.
[0109] In a possible implementation, the terminal renders the model of the virtual ray emitter to the target assembly position based on the target assembly position and the model of the virtual prop emitter.
[0110] It should be noted that the above step 502 is described by taking the terminal as an example to execute the corresponding steps based on operations. In the cloud game scenario, the terminal can also send corresponding instructions to the server based on operations, and the server executes the steps corresponding to the instructions, sends the rendered video stream to the terminal, and the terminal displays the video stream.
[0111] 503. The terminal determines the emission direction of the ray based on the positioning information of the target virtual object in the virtual scene, the type of the virtual prop emitter, and the target assembly position, where the emission direction of the ray is relative to the emission direction of the virtual prop emitter.
[0112] In a possible implementation, the terminal determines the target position of the virtual ray emitter based on the first positioning information of the target virtual object in the virtual scene and the target assembly position. The first positioning information includes the position and direction of the hand of the target virtual object in the virtual scene. The terminal determines the emission direction of the ray based on the first positioning information, the second positioning information of the target virtual object, the type of the virtual prop emitter, the position of the hand, and the target position. The second positioning information includes the position and orientation of the virtual camera of the target virtual object in the virtual scene.
[0113] Among them, since the virtual ray emitter includes multiple candidate assembly positions, when the virtual ray emitter is assembled at different candidate positions, the direction in which the virtual ray emitter emits rays may be different. The terminal can determine the emission direction of the ray based on multiple pieces of information to ensure that the ray can point to the aiming position of the virtual prop emitter. The virtual camera is the "eye" for the user to observe the virtual scene, and the virtual scene displayed by the terminal is the picture captured by the virtual camera. In a first-person shooting game, the position of the virtual camera in the virtual scene is the position of the head of the target virtual object in the virtual scene to simulate the angle at which the target virtual object observes the virtual scene. Alternatively, the position of the virtual camera in the virtual scene is the position of the eyes of the target virtual object in the virtual scene. In a third-person shooting game, the position of the virtual camera in the virtual scene is above the target virtual object.
[0114] To more clearly illustrate the above embodiments, the above embodiments will be described in two parts below.
[0115] First part: The terminal determines the target position of the virtual ray emitter based on the first positioning information of the target virtual object in the virtual scene and the target assembly position.
[0116] Among them, the first positioning information includes the position and direction of the hand of the target virtual object in the virtual scene. The position of the hand in the virtual scene is the relative position between the hand and the origin of the model of the target virtual object. Correspondingly, the direction of the hand in the virtual scene is the relative direction between the hand and the origin of the model of the target virtual object. The target assembly position is the relative position between the virtual ray emitter and the virtual prop emitter, and the target position is the relative position between the virtual ray emitter and the origin of the model of the target virtual object. In some embodiments, the origin of the model of the target virtual object is also referred to as the root bone, and the coordinate system established with the root bone is also referred to as the character space. In some embodiments, the terminal represents the position of the hand in the virtual scene in the form of coordinates and represents the direction of the hand in the virtual scene in the form of a vector. In some embodiments, the coordinate system established with the origin of the virtual prop emitter is also referred to as the weapon space. Through the processing process of the above first part, the target position between the virtual ray and the root bone can be determined, realizing the transformation of the coordinate system, which is convenient for subsequent processing.
[0117] In a possible implementation manner, the terminal generates a first rotation matrix based on the direction of the hand. The terminal processes the target assembly position using the first rotation matrix to obtain the reference position of the virtual ray emitter. The terminal fuses the position of the hand and the reference position of the virtual ray emitter to obtain the target position of the virtual ray emitter, and the target position is the relative position between the virtual ray emitter and the target virtual object.
[0118] Among them, the relative position between the virtual ray emitter and the target virtual object is also the relative position between the virtual ray emitter and the origin of the model of the target virtual object. When the target virtual object holds the virtual prop emitter, the orientation of the hand of the target virtual object is also the orientation of the virtual prop emitter in the virtual scene.
[0119] For example, the terminal obtains the holding screen of the target virtual object for the virtual prop emitter. Based on the holding screen, the terminal obtains the first positioning information of the target virtual object in the virtual scene, which is also the coordinates and direction vector of the hand of the target virtual object. Based on the direction vector of the hand, the terminal generates a first rotation matrix. The terminal processes the target assembly coordinates using the first rotation matrix to obtain the reference coordinates of the virtual ray emitter, where the target assembly coordinates represent the target assembly position and the reference coordinates represent the reference position. The terminal adds the coordinates of the hand and the reference coordinates of the virtual ray emitter to obtain the target coordinates of the virtual ray emitter, and the target coordinates represent the target position.
[0120] For example, the terminal obtains the holding screen of the virtual prop emitter through the following formula (1), obtains the position of the hand of the target virtual object based on the holding screen of the virtual prop emitter through the following formula (2), obtains the pointing direction of the hand of the target virtual object based on the holding screen of the virtual prop emitter through the following formula (3), and the position and pointing direction of the hand of the target virtual object are represented by the following formula (4).
[0121] GripAnim = GetGripAnim(CurrentWeapon) (1)
[0122] HandLoc = GripAnim.GetBoneLoc(“Hand”) (2)
[0123] HandRot = GripAnim.GetBoneRot(“Hand”) (3)
[0124] (“Hand”, Loc = (X = 28.7, Y = 15.6, Z = 133.0), Rot = (Roll = 0, Yaw = 2, Pitch = 0)) (4)
[0125] Among them, GripAnim is the holding screen of the virtual prop launcher, CurrentWeapon is the virtual prop launcher, Hand is the hand of the target virtual object, Loc = () is the coordinate of the hand, Rot is the direction of the hand, Roll is the roll angle, indicating the angle of rotation around the Z axis; Yaw is the yaw angle, indicating the angle of rotation around the Y axis, and Pitch is the pitch angle, indicating the angle of rotation around the X axis.
[0126] The terminal obtains the target coordinates of the virtual ray launcher through the following formula (5).
[0127] LaserLoc = HandLoc + HandRot InverseTransformVector (LaserLoc_WeaponSpace)(5)
[0128] Among them, LaserLoc is the target coordinate of the virtual ray launcher, HandLoc is the position of the hand in the virtual scene, and HandRot InverseTransformVector is the first rotation matrix, LaserLoc_WeaponSpace is the target assembly coordinate, WeaponSpace represents the space where the virtual prop launcher is located, and HandRot InverseTransformVector The result of (LaserLoc_WeaponSpace) is the reference coordinate of the virtual ray launcher.
[0129] The following uses an example to illustrate the application method of the above formula (5). See the following calculation process:
[0130] LaserLoc(68.4, 12.3, 143.6) = (28.7, 15.6, 133.0) + (Roll = 0, Yaw = 2, Pitch = 0) InverseTransformVector (39.6, -3.3, 10.6), (68.4, 12.3, 143.6) are the three-dimensional coordinates of the target assembly position in the root bone coordinate system, with the unit of centimeter; the function of InverseTransformVecto is to rotate the vector (39.6, -3.3, 10.6) by -2 degrees in the Yaw direction, and (39.6, -3.3, 10.6) is the relative coordinate between the target assembly position and the virtual prop launcher.
[0131] Second, the terminal determines the emission direction of the ray based on the first positioning information, the second positioning information of the target virtual object, the type of the virtual prop launcher, the position of the hand, and the target position.
[0132] In a possible implementation, the terminal determines the target launch distance of the virtual prop launcher based on the type of the virtual prop launcher. The terminal determines the reference aiming position of the virtual prop launcher based on the second positioning information of the target virtual object and the target launch distance. The terminal determines the launch direction vector of the ray based on the target position, the reference aiming position of the virtual prop launcher, and the first positioning information.
[0133] To illustrate the above implementation more clearly, the concept of the target launch distance is described below.
[0134] In some embodiments, the target launch distance is also referred to as the zeroing distance, which refers to the distance at which the light spot and the aiming crosshair coincide exactly. The light spot refers to the point displayed when the ray contacts a virtual obstacle in the virtual scene. When the zeroing distance is 10 meters, refer to Figure 8 , when the distance between the aiming crosshair and the virtual camera is 10 meters, the light spot 801 will coincide exactly with the aiming crosshair 802; refer to Figure 9 , when the distance between the aiming crosshair and the virtual camera is less than the zeroing distance, the light spot 901 will be at the lower right of the aiming crosshair 902; refer to Figure 10 , when the distance between the aiming crosshair and the virtual camera is greater than the zeroing distance, the light spot 1001 will be at the upper left of the aiming crosshair 1002. Refer to Figure 11 , this is because the angle formed by the ray 1101 and the virtual ray launcher 1102 is fixed and will not change due to the distance between the aiming crosshair and the camera. Otherwise, the ray emitted by the virtual ray launcher will not be realistic enough. In some embodiments, the zeroing distance is often the optimal combat distance of the virtual prop launcher. The zeroing distance is related to the type of the virtual prop launcher. For example, the zeroing distance of the MP5 submachine gun is 30 meters, and the zeroing distance of the AKM assault rifle is 80 meters. Among them, both the MP5 submachine gun and the AKM assault rifle are game props in the game. It should be noted that after adopting the technical solution provided by the embodiments of the present application, in the situations shown in the above Figure 9 and Figure 10 , the ray emitted by the virtual ray launcher will also coincide with the aiming crosshair, thereby realizing the assistance for aiming the virtual prop launcher. In some embodiments, the aiming crosshair is a point in the middle of the screen. When firing from the hip, the virtual prop will land near the aiming crosshair. The direction of the aiming crosshair is a point on the straight line extending forward from the midpoint of the virtual camera.
[0135] In this embodiment, since different types of virtual prop launchers have different target launch distances, that is, different types of virtual prop launchers have different optimal combat distances. For different types of virtual prop launchers, the launch directions of the rays determined by the above embodiment can all point to the sight of the virtual prop launcher, that is, point to the aiming position of the virtual prop launcher, thereby improving the aiming accuracy of the virtual prop launcher. In addition, since the virtual ray launcher has multiple mounting positions on the virtual prop launcher, and in the process of determining the launch direction of the ray above, the mounting position of the virtual ray launcher is combined, so no matter which position the virtual ray launcher is mounted on the virtual prop launcher, the determined launch direction of the ray can point to the sight of the virtual prop launcher.
[0136] After introducing the target launch example, the above embodiment will be described below.
[0137] For example, the terminal queries based on the type of the virtual prop launcher to obtain the target launch distance of the virtual prop launcher. The terminal obtains the second positioning information of the target virtual object in the virtual scene based on the holding screen of the virtual prop launcher by the target virtual object. The second positioning information includes the position and orientation of the virtual camera in the virtual scene. The terminal generates a second rotation matrix based on the orientation of the virtual camera in the virtual scene. The terminal processes the target launch distance using the second rotation matrix and the position of the virtual camera in the virtual scene to obtain the reference aiming position of the virtual prop launcher, where the reference aiming position is also the position pointed to by the ray in the virtual scene. The terminal determines the reference launch direction vector of the ray based on the target position and the reference aiming position of the virtual prop launcher, and the reference launch direction vector is a vector in the space established based on the target virtual object. The terminal rotates the reference launch direction based on the pointing of the hand to obtain the launch direction vector of the ray, and the launch direction vector is a vector in the space established based on the virtual prop launcher.
[0138] For example, the terminal queries in the target launch distance list based on the type of the virtual prop launcher to obtain the target launch distance of the virtual prop launcher, where the target launch distance list stores the correspondence between the type of the virtual prop launcher and the target launch distance. Based on the holding screen of the virtual prop launcher by the target virtual object, the terminal obtains the coordinates of the virtual camera in the virtual scene through the following formula (6), and obtains the orientation of the virtual camera in the virtual scene through the following formula (7). The terminal generates a second rotation matrix based on the orientation of the virtual camera in the virtual scene. The terminal processes the target launch distance by using the second rotation matrix and the position of the virtual camera in the virtual scene through the following formula (8) to obtain the reference aiming position of the virtual prop launcher. The terminal determines the reference emission direction vector of the ray based on the target position and the reference aiming position of the virtual prop launcher through the following formula (9), and the reference emission direction vector is a vector in the space established based on the target virtual object. The terminal rotates the reference emission direction vector based on the pointing of the hand through the following formula (10) to obtain the emission direction vector of the ray, and the emission direction vector is a vector in the space established based on the virtual prop launcher.
[0139] CameraLoc = GripAnim.GetBoneLoc(“Camera”) (6)
[0140] CameraRot = GripAnim.GetBoneRot(“Camera”) (7)
[0141] ZeroingPoint = CameraLoc + CameraRot GetForwardVector *ZeroingDistance (8)
[0142] BeamDirection = (ZeroingPoint – LaserLoc).GetNormal (9)
[0143] BeamDirection_WeaponSpace = HandRot TransformVector (BeamDirection) (10)
[0144] Wherein, CameraLoc is the position of the virtual camera in the virtual scene, CameraRot is the orientation of the virtual camera in the virtual scene, ZeroingPoint is the reference aiming position, ZeroingDistance is the target launch distance, CameraRot GetForwardVectoris the second rotation matrix, BeamDirection is the reference emission direction vector, LaserLoc is the target position of the virtual ray emitter, GetNormal is used to obtain the unit vector of the vector, BeamDirection_WeaponSpace is the emission direction vector of the ray, and HandRot TransformVector is the third rotation matrix generated based on the hand pointing. In some embodiments, the first rotation matrix and the third rotation matrix are inverse matrices of each other.
[0145] Next, in combination with Figure 12 and each of the above optional implementation manners, step 503 above will be introduced.
[0146] Refer to Figure 12 , the terminal obtains the holding screen GripAnim of the target virtual object for the virtual prop emitter. Based on the holding screen GripAnim, the terminal obtains the position HandLoc and orientation HandRot of the hand of the target virtual object. Based on the holding screen GripAnim, the terminal obtains the position CameraLoc and orientation CameraRot of the virtual camera. Based on the type of the virtual prop emitter, the terminal obtains the zeroing distance ZeroingDistance of the virtual prop emitter, that is, obtains the target emission distance of the virtual prop emitter. The terminal obtains the target assembly position LaserLoc_WeaponSpace of the virtual ray emitter, and determines the target position LaserLoc of the virtual ray emitter based on the target assembly position. Based on the target position and the reference aiming position of the virtual prop emitter, the terminal determines the reference emission direction vector BeamDirection of the ray. The terminal rotates the reference emission direction vector BeamDirection based on the hand pointing to obtain the emission direction vector BeamDirection_WeaponSpace of the ray.
[0147] It should be noted that the above steps 501-503 are described by taking the terminal executing in real time as an example. In other possible implementation manners, the terminal can also execute the above steps 501-503 in advance before the game starts, store the processing results, and directly call them when the game is running. The embodiments of the present application do not limit the execution timing.
[0148] 504. The terminal controls the virtual ray emitter to emit the ray in the emission direction.
[0149] In a possible implementation manner, the terminal renders in the virtual scene based on the position of the virtual ray emitter and the emission direction, and displays the ray.
[0150] After step 504, optionally, the terminal can also perform any of the following steps.
[0151] In a possible implementation, when the aiming position of the virtual prop launcher is a virtual obstacle in the virtual scene, the terminal displays a light spot on the virtual obstacle, and the light spot is the intersection point of the ray emitted by the virtual ray launcher and the virtual obstacle.
[0152] Among them, the virtual obstacles include obstacles such as virtual walls, virtual stones, and virtual trees. In some embodiments, when the aiming position of the virtual prop launcher is any virtual object in the virtual scene, the terminal displays the light spot on the virtual object.
[0153] In this implementation, the terminal can indicate the aiming position of the virtual prop launcher by displaying the light spot, which helps the user control the aiming of the virtual prop launcher.
[0154] For example, referring to Figure 8 , when the aiming position of the virtual prop launcher is the virtual obstacle 803 in the virtual scene, the terminal displays the light spot 801 on the virtual obstacle 803.
[0155] In a possible implementation, the target virtual object holds the virtual prop launcher in a first posture. When the posture of the target virtual object holding the virtual prop launcher is adjusted from the first posture to the second posture, the terminal does not display the ray emitted by the virtual ray launcher.
[0156] Among them, the first posture is "hip fire", and the second posture is "aiming and shooting".
[0157] In this implementation, when the posture of the target virtual object changes, the terminal can no longer display the ray, enabling the user to focus on aiming in the "aiming and shooting" manner and improving the hit rate of virtual prop shooting.
[0158] All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present application, which will not be elaborated one by one here.
[0159] Through the technical solution provided by the embodiments of the present application, a function of assembling a virtual ray launcher is provided in the virtual scene, and the assembling position can be selected by itself during assembly. During the aiming process, the ray is displayed according to the target virtual object, the virtual prop launcher, and the assembling position of the virtual ray launcher, so that the ray can point to the aiming position of the virtual prop launcher, and the ray can assist the user's aiming, thereby reducing the aiming difficulty and improving the efficiency of human-computer interaction.
[0160] In the related art, the ray points to a point in front of the virtual prop launcher, regardless of the hip-fire posture. If, for optimizing the artistic effect, the angle of the hand held during hip-fire is tilted upward a bit, the light spot corresponding to the ray will move upward; if tilted leftward, the light spot will move leftward, and so on. This makes the position of the light spot often far from the aiming reticle, and users cannot use the virtual ray launcher for aiming. After adopting the technical solution provided by the embodiment of the present application, the angle of the ray can be adjusted according to the actual situation, so that the ray will coincide with the aiming reticle at the zeroing distance. Even when the distance between the aiming reticle and the virtual camera returns to the zeroing distance, the aiming reticle will be on the extension line of the ray; even when the distance between the aiming reticle and the camera is greater than the zeroing distance, the aiming reticle will be on the edge of the ray. All in all, it will be convenient for users to aim in various situations. Of course, when there are multiple candidate mounting positions for the virtual prop launcher to mount the virtual ray launcher, adopting the technical solution provided by the embodiment of the present application can also make the ray always point to the position where the aiming reticle is located, that is, no matter which mounting position on the virtual prop launcher the virtual ray launcher is mounted, using the virtual ray launcher can achieve a relatively accurate aiming effect. At the same time, the multiple candidate mounting positions also improve the flexibility of the virtual ray launcher and enrich the user's choices. In addition, in some shooting games without an aiming reticle, the technical solution provided by the embodiment of the present application can directly achieve assisted aiming when using the virtual prop launcher.
[0161] Figure 13 is a schematic structural diagram of a ray display device based on a virtual scene provided by an embodiment of the present application. Refer to Figure 13 The device includes: a virtual scene display module 1301, a virtual ray launcher display module 1302, and a ray display module 1303.
[0162] The virtual scene display module 1301 is configured to display a virtual scene, where the virtual scene displays a target virtual object and a virtual prop launcher held by the target virtual object.
[0163] The virtual ray launcher display module 1302 is configured to, in response to an assembly operation on the virtual prop launcher in the virtual scene, display the assembled virtual ray launcher based on the target assembly position determined by the assembly operation, where the virtual ray launcher is used to assist the virtual prop launcher in aiming.
[0164] The ray display module 1303 is configured to display a ray emitted by the virtual ray launcher in the virtual scene based on the target virtual object, the virtual prop launcher, and the target assembly position, where the ray points to the aiming position of the virtual prop launcher.
[0165] In a possible implementation, the virtual ray emitter display module 1302 is configured to, in response to a first operation in the virtual scene, display an assembly page of the virtual prop emitter in the virtual scene, where the assembly page shows multiple candidate assembly positions of the virtual prop emitter. In response to a second operation in the assembly page, determine the selected candidate assembly position among the multiple candidate assembly positions as the target assembly position. Display the virtual ray emitter at the target assembly position of the virtual prop emitter.
[0166] In a possible implementation, the virtual ray emitter display module 1302 is configured to perform any one of the following:
[0167] In response to a pick-up operation on the virtual ray emitter in the virtual scene, display an assembly page of the virtual prop emitter in the virtual scene.
[0168] In response to a click operation on an assembly control displayed in the virtual scene, display an assembly page of the virtual prop emitter in the virtual scene.
[0169] In a possible implementation, the virtual ray emitter display module 1302 is configured to perform any one of the following:
[0170] In response to a click operation on any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position.
[0171] In response to dragging the virtual ray emitter to any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position.
[0172] In a possible implementation, the ray display module 1303 is configured to determine the emission direction of the ray based on the positioning information of the target virtual object in the virtual scene, the type of the virtual prop emitter, and the target assembly position, where the emission direction of the ray is relative to the emission direction of the virtual prop emitter. Control the virtual ray emitter to emit the ray in the emission direction.
[0173] In a possible implementation, the ray display module 1303 is configured to determine the target position of the virtual ray emitter based on the first positioning information of the target virtual object in the virtual scene and the target assembly position, where the first positioning information includes the position and direction of the hand of the target virtual object in the virtual scene. Based on the first positioning information, the second positioning information of the target virtual object, the type of the virtual prop emitter, the position of the hand, and the target position, determine the emission direction of the ray, where the second positioning information includes the position and orientation of the virtual camera of the target virtual object in the virtual scene.
[0174] In a possible implementation, the ray display module 1303 is configured to generate a first rotation matrix based on the direction of the hand. Process the target assembly position using the first rotation matrix to obtain the reference position of the virtual ray emitter. Fuse the position of the hand and the reference position of the virtual ray emitter to obtain the target position of the virtual ray emitter, where the target position is the relative position between the virtual ray emitter and the target virtual object.
[0175] In a possible implementation, the ray display module 1303 is configured to determine the target emission distance of the virtual prop emitter based on the type of the virtual prop emitter. Determine the reference aiming position of the virtual prop emitter based on the second positioning information of the target virtual object and the target emission distance. Determine the emission direction vector of the ray based on the target position, the reference aiming position of the virtual prop emitter, and the first positioning information.
[0176] In a possible implementation, the ray display module 1303 is configured to determine the reference emission direction vector of the ray based on the target position and the reference aiming position of the virtual prop emitter, where the reference emission direction vector is a vector in the space established based on the target virtual object. Rotate the reference emission direction based on the direction of the hand to obtain the emission direction vector of the ray, where the emission direction vector is a vector in the space established based on the virtual prop emitter.
[0177] In a possible implementation, the device further includes:
[0178] A light point display module, configured to display a light point on the virtual obstacle when the aiming position of the virtual prop emitter is a virtual obstacle in the virtual scene, where the light point is the intersection point of the ray emitted by the virtual ray emitter and the virtual obstacle.
[0179] In a possible implementation, the ray display module 1303 is further configured to not display the ray emitted by the virtual ray emitter when the target virtual object adjusts the posture of holding the virtual prop emitter from the first posture to the second posture.
[0180] It should be noted that when the ray display device based on the virtual scene provided in the above embodiments displays rays, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be assigned to different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the ray display device based on the virtual scene provided in the above embodiments and the embodiments of the ray display method based on the virtual scene belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.
[0181] Through the technical solution provided by the embodiments of the present application, a function of assembling a virtual ray emitter is provided in the virtual scene, and the assembly position can be selected automatically during assembly. During the aiming process, the ray is displayed according to the assembly positions of the target virtual object, the virtual prop emitter, and the virtual ray emitter, so that the ray can point to the aiming position of the virtual prop emitter, and the ray can assist the user's aiming, thereby reducing the aiming difficulty and improving the efficiency of human-computer interaction.
[0182] The embodiments of the present application provide a computer device for executing the above method. The computer device can be implemented as a terminal. The structure of the terminal will be introduced below:
[0183] Figure 14 It is a schematic structural diagram of a terminal provided by the embodiments of the present application. The terminal 1400 can be: a smart phone, a tablet computer, a notebook computer, or a desktop computer. The terminal 1400 may also be referred to by other names such as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, etc.
[0184] Generally, the terminal 1400 includes: one or more processors 1401 and one or more memories 1402.
[0185] The processor 1401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 1401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1401 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 1401 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1401 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0186] The memory 1402 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 1402 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 is used to store at least one computer program, and the at least one computer program is used to be executed by the processor 1401 to implement the ray display method based on a virtual scene provided in the method embodiments of the present application.
[0187] Those skilled in the art can understand that Figure 14 the structure shown in
[0188] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including a computer program, and the computer program can be executed by a processor to complete the ray display method based on a virtual scene in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0189] In an exemplary embodiment, a computer program product or a computer program is also provided. The computer program product or the computer program includes program code, and the program code is stored in a computer-readable storage medium. A processor of a computer device reads the program code from the computer-readable storage medium, and the processor executes the program code, so that the computer device executes the ray display method based on a virtual scene described above.
[0190] In some embodiments, the computer program involved in the embodiments of the present application can be deployed to be executed on a single computer device, or on multiple computer devices located at one place. Or, it can be executed on multiple computer devices distributed at multiple places and interconnected through a communication network. The multiple computer devices distributed at multiple places and interconnected through a communication network can form a blockchain system.
[0191] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk, or an optical disc, etc.
[0192] The above are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A ray display method based on a virtual scene, characterized in that The method includes: Displaying a virtual scene, where the virtual scene displays a target virtual object and a virtual prop launcher held by the target virtual object; In response to an assembly operation on the virtual prop launcher in the virtual scene, based on a target assembly position determined by the assembly operation, displaying an assembled virtual ray launcher. The virtual prop launcher has multiple candidate assembly positions, and the virtual ray launcher is used to assist the virtual prop launcher in aiming; Based on first positioning information of the target virtual object and the target assembly position, determining a target position of the virtual ray launcher. The first positioning information includes the position and direction of the hand of the target virtual object in the virtual scene, and the target position is the relative position between the virtual ray launcher and the target virtual object; Based on second positioning information of the target virtual object and a target launch distance of the virtual prop launcher, determining a reference aiming position of the virtual prop launcher. The second positioning information includes the position and orientation of a virtual camera of the target virtual object in the virtual scene, and the target launch distance is the distance corresponding to the type of the virtual prop launcher at which a light point and a sight coincide. The light point is the intersection point of a ray emitted by the virtual ray launcher and a virtual obstacle, and the sight is used to prompt the aiming position of the virtual prop launcher; Based on the target position, the reference aiming position, and the first positioning information, determining a launch direction vector of the ray to display the ray emitted by the virtual ray launcher in the virtual scene, where the ray points to the aiming position of the virtual prop launcher.
2. The method according to claim 1, characterized in that The step of, in response to an assembly operation on the virtual prop launcher in the virtual scene, based on a target assembly position determined by the assembly operation, displaying an assembled virtual ray launcher includes: In response to a first operation in the virtual scene, displaying an assembly page of the virtual prop launcher in the virtual scene, where the assembly page displays multiple candidate assembly positions of the virtual prop launcher; In response to a second operation in the assembly page, determining the selected candidate assembly position among the multiple candidate assembly positions as the target assembly position; Displaying the virtual ray launcher at the target assembly position of the virtual prop launcher.
3. The method according to claim 2, wherein The step of, in response to a first operation in the virtual scene, displaying an assembly page of the virtual prop launcher in the virtual scene includes any one of the following: In response to a pick-up operation on the virtual ray launcher in the virtual scene, displaying an assembly page of the virtual prop launcher in the virtual scene; In response to a click operation on an assembly control displayed in the virtual scene, displaying an assembly page of the virtual prop launcher in the virtual scene.
4. The method according to claim 2, characterized in that, The step of, in response to a second operation in the assembly page, determining the selected candidate assembly position among the multiple candidate assembly positions as the target assembly position includes any one of the following: In response to a click operation on any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position; In response to dragging the virtual ray emitter to any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position.
5. The method according to claim 1, characterized in that The determining the target position of the virtual ray emitter based on the first positioning information of the target virtual object in the virtual scene and the target assembly position includes: Generate a first rotation matrix based on the pointing direction of the hand; Process the target assembly position using the first rotation matrix to obtain the reference position of the virtual ray emitter; Fuse the position of the hand and the reference position of the virtual ray emitter to obtain the target position of the virtual ray emitter.
6. The method according to claim 1, characterized in that, The determining the emission direction vector of the ray based on the target position, the reference aiming position of the virtual prop emitter, and the first positioning information includes: Determine a reference emission direction vector of the ray based on the target position and the reference aiming position of the virtual prop emitter, where the reference emission direction vector is a vector in the space established based on the target virtual object; Rotate the reference emission direction based on the pointing direction of the hand to obtain the emission direction vector of the ray, where the emission direction vector is a vector in the space established based on the virtual prop emitter.
7. The method according to claim 1, characterized in that After displaying the ray emitted by the virtual ray emitter in the virtual scene based on the target virtual object, the virtual prop emitter, and the target assembly position, the method further includes: When the aiming position of the virtual prop emitter is a virtual obstacle in the virtual scene, display a light point on the virtual obstacle, where the light point is the intersection point of the ray emitted by the virtual ray emitter and the virtual obstacle.
8. The method according to claim 1, wherein When the target virtual object holds the virtual prop emitter in a first posture, after displaying the ray emitted by the virtual ray emitter in the virtual scene based on the target virtual object, the virtual prop emitter, and the target assembly position, the method further includes: When the target virtual object adjusts the posture of holding the virtual prop emitter from the first posture to a second posture, do not display the ray emitted by the virtual ray emitter.
9. A ray display device based on a virtual scene, characterized in that, The device includes: A virtual scene display module for displaying a virtual scene, where the virtual scene displays a target virtual object and a virtual prop emitter held by the target virtual object; A virtual ray emitter display module for, in response to an assembly operation on the virtual prop emitter in the virtual scene, displaying the assembled virtual ray emitter based on the target assembly position determined by the assembly operation, where the virtual prop emitter has multiple candidate assembly positions, and the virtual ray emitter is used to assist the virtual prop emitter in aiming; A ray display module, configured to determine a target position of the virtual ray emitter based on the first positioning information of the target virtual object and the target assembly position, where the first positioning information includes the position and direction of the hand of the target virtual object in the virtual scene, and the target position is the relative position between the virtual ray emitter and the target virtual object; Determine a reference aiming position of the virtual prop emitter based on the second positioning information of the target virtual object and the target emission distance of the virtual prop emitter, where the second positioning information includes the position and orientation of the virtual camera of the target virtual object in the virtual scene, and the target emission distance is the distance corresponding to the type of the virtual prop emitter at which the light point and the sight coincide, the light point is the intersection point of the ray emitted by the virtual ray emitter and the virtual obstacle, and the sight is used to indicate the aiming position of the virtual prop emitter; Determine the emission direction vector of the ray based on the target position, the reference aiming position, and the first positioning information to display the ray emitted by the virtual ray emitter in the virtual scene, where the ray points to the aiming position of the virtual prop emitter.
10. The device according to claim 9, wherein The virtual ray emitter display module is configured to: In response to a first operation in the virtual scene, display an assembly page of the virtual prop emitter in the virtual scene, where the assembly page displays multiple candidate assembly positions of the virtual prop emitter; In response to a second operation in the assembly page, determine the selected candidate assembly position among the multiple candidate assembly positions as the target assembly position; Display the virtual ray emitter at the target assembly position of the virtual prop emitter.
11. The device according to claim 10, characterized in that, The virtual ray emitter display module is used for any one of the following: In response to a pick-up operation on the virtual ray emitter in the virtual scene, display the assembly page of the virtual prop emitter in the virtual scene; In response to a click operation on the assembly control displayed in the virtual scene, display the assembly page of the virtual prop emitter in the virtual scene.
12. The device according to claim 10, characterized in that, The virtual ray emitter display module is used for any one of the following: In response to a click operation on any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position; In response to dragging the virtual ray emitter to any one of the multiple candidate assembly positions in the assembly page, determine the candidate assembly position as the target assembly position.
13. The device according to claim 9, wherein The ray display module is configured to: Generate a first rotation matrix based on the direction of the hand; Process the target assembly position using the first rotation matrix to obtain a reference position of the virtual ray emitter; Fuse the position of the hand and the reference position of the virtual ray emitter to obtain the target position of the virtual ray emitter.
14. The device according to claim 9, characterized in that, The ray display module is configured to: Determine a reference emission direction vector of the ray based on the target position and the reference aiming position of the virtual prop launcher, where the reference emission direction vector is a vector in the space established based on the target virtual object; Rotate the reference emission direction based on the pointing of the hand to obtain an emission direction vector of the ray, where the emission direction vector is a vector in the space established based on the virtual prop launcher.
15. The device according to claim 9, characterized in that, The device further includes: A light point display module, configured to display a light point on the virtual obstacle when the aiming position of the virtual prop launcher is the virtual obstacle in the virtual scene.
16. The device according to claim 9, wherein The ray display module is further configured to: Not display the ray emitted by the virtual ray launcher when the target virtual object adjusts the posture of holding the virtual prop launcher from the first posture to the second posture.
17. A computer device, characterized in that, The computer device includes one or more processors and one or more memories, and at least one computer program is stored in the one or more memories. The computer program is loaded and executed by the one or more processors to implement the ray display method based on a virtual scene according to any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that, At least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the ray display method based on a virtual scene according to any one of claims 1 to 8.
19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the ray display method based on a virtual scene according to any one of claims 1 to 8.
Citation Information
Patent Citations
Laser sighting device
CN108844406A
Operation control method and device, storage medium and electronic device
CN111111171A