Ray display method and device based on virtual scene, equipment and storage medium
By displaying a virtual ray emitter on the virtual prop emitter to assist aiming, the problem of high aiming difficulty of virtual prop emitters in complex game scenes is solved, improving human-computer interaction efficiency and game realism.
Patent Information
- Application Number
- CN202511221381.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2025-12-12
AI Technical Summary
In complex game scenarios, the crosshair of virtual item launchers in existing technologies is difficult to find accurately, resulting in high aiming difficulty and low human-computer interaction efficiency.
A virtual ray emitter is displayed on the virtual prop launcher. With ray-assisted aiming, users can choose the attachment position and the ray points to the aiming position, reducing the difficulty of aiming.
It improves the realism of the game and the efficiency of human-computer interaction, allowing users to flexibly choose the mounting position of the ray emitter, reducing the difficulty of aiming and improving the accuracy of aiming.
Smart Images

Figure CN121102894A_ABST
Abstract
Description
[0001] This application is a divisional application of the patent application No. 202210110548.6, with the title of "Ray display method and device based on virtual scene, equipment and storage medium", and filed on January 29, 2022. TECHNICAL FIELD
[0002] The present application relates to the technical field of computer, in particular to a ray display method and device based on virtual scene, equipment and storage medium. BACKGROUND
[0003] With the development of multimedia technology and the diversification of terminal functions, the types of games that can be played on the terminal are increasing. The shooting game is a kind of popular game. In the shooting game, the user can manipulate the virtual object to use different virtual prop launchers, and through the virtual prop launcher, the user can fight with other virtual objects controlled by other users.
[0004] In the related art, a crosshair is usually displayed on the game screen to prompt the user to the aiming position of the virtual prop launcher. However, the area of the crosshair is usually small, and the color is light, so it is not easy to find the position of the crosshair when encountering some game scenes with complex display content, the aiming difficulty is high, and the efficiency of human-computer interaction is low. SUMMARY
[0005] The embodiments of the present application provide a ray display method and device based on virtual scene, equipment and storage medium, which can improve the efficiency of human-computer interaction. The technical solutions are as follows:
[0006] In one aspect, a ray display method based on virtual scene is provided, the method comprising:
[0007] displaying a virtual scene, the virtual scene displaying a target virtual object and a virtual prop launcher held by the target virtual object;
[0008] in response to an assembly operation on the virtual prop launcher in the virtual scene, displaying an assembled virtual ray launcher based on a target assembly position determined by the assembly operation, the virtual ray launcher being used to assist the virtual prop launcher in aiming;
[0009] based on the target virtual object, the virtual prop launcher and the target assembly position, displaying a ray emitted by the virtual ray launcher in the virtual scene, the ray pointing to an aiming position of the virtual prop launcher.
[0010] In one aspect, a ray display device based on virtual scene is provided, the device comprising:
[0011] A virtual scene display module is used to display a virtual scene, wherein the virtual scene displays a target virtual object and a virtual prop dispenser held by the target virtual object;
[0012] A virtual ray emitter display module is used to respond to an assembly operation of the virtual prop emitter in the virtual scene, and to display the assembled virtual ray emitter based on the target assembly position determined by the assembly operation. The virtual ray emitter is used to assist the virtual prop emitter in aiming.
[0013] A ray display module is used to display, in the virtual scene, a ray emitted by the virtual ray emitter, based on the target virtual object, the virtual prop emitter, and the target assembly position, with the ray pointing towards the aiming position of the virtual prop emitter.
[0014] In one possible implementation, the virtual ray emitter display module is configured to, in response to a first operation in the virtual scene, display an assembly page for the virtual prop emitter in the virtual scene, the assembly page displaying a plurality of candidate assembly positions for the virtual prop emitter; in response to a second operation on the assembly page, determine the selected candidate assembly position from the plurality of candidate assembly positions as the target assembly position; and display the virtual ray emitter at the target assembly position of the virtual prop emitter.
[0015] In one possible implementation, the virtual ray emitter display module is configured to perform any of the following:
[0016] In response to a pickup operation of the virtual ray emitter in the virtual scene, an assembly page for the virtual prop emitter is displayed in the virtual scene;
[0017] In response to a click operation on the assembly controls displayed in the virtual scene, the assembly page of the virtual prop launcher is displayed in the virtual scene.
[0018] In one possible implementation, the virtual ray emitter display module is configured to perform any of the following:
[0019] In response to a click operation on any of the plurality of candidate assembly positions on the assembly page, the candidate assembly position is determined as the target assembly position;
[0020] In response to dragging the virtual ray emitter to any of the plurality of candidate assembly positions on the assembly page, the candidate assembly position is determined as the target assembly position.
[0021] In one possible implementation, the ray display module is used to determine the ray emission direction 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 to control the virtual ray emitter to emit the ray in the emission direction.
[0022] In one possible implementation, the ray display module is configured to determine the target position of the virtual ray emitter based on first positioning information of the target virtual object in the virtual scene and the target assembly position, wherein the first positioning information includes the position and direction of the hand of the target virtual object in the virtual scene; and to determine the emission direction of the ray based on the first positioning information, second positioning information of the target virtual object, the type of the virtual prop emitter, the position of the hand, and the target position, wherein the second positioning information includes the position and orientation of the virtual camera of the target virtual object in the virtual scene.
[0023] In one possible implementation, 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; and fuse the position of the hand and the reference position of the virtual ray emitter to obtain a target position of the virtual ray emitter, wherein the target position is the relative position between the virtual ray emitter and the target virtual object.
[0024] In one possible implementation, the ray display module is configured to: determine the target firing distance of the virtual prop launcher based on the type of the virtual prop launcher; determine the reference aiming position of the virtual prop launcher based on the second positioning information of the target virtual object and the target firing distance; and determine the firing direction vector of the ray based on the target position, the reference aiming position of the virtual prop launcher, and the first positioning information.
[0025] In one possible implementation, the ray display module is used 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, the reference emission direction vector being a vector in space established based on the target virtual object; and to obtain the emission direction vector of the ray by rotating the reference emission direction based on the direction of the hand, the emission direction vector being a vector in space established based on the virtual prop launcher.
[0026] In one possible implementation, the device further includes:
[0027] A light spot display module is used to display light spots on virtual obstacles when the aiming position of the virtual prop emitter is a virtual obstacle in the virtual scene. The light spots are the intersection points of the rays emitted by the virtual ray emitter and the virtual obstacles.
[0028] In one possible implementation, the ray display module is further configured to not display the ray emitted by the virtual ray emitter when the target virtual object adjusts its posture of holding the virtual prop emitter from the first posture to the second posture.
[0029] On one hand, a computer device is provided, the computer device including one or more processors and one or more memories, the one or more memories storing at least one computer program, the computer program being loaded and executed by the one or more processors to implement the virtual scene-based ray display method.
[0030] On one hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the virtual scene-based ray display method.
[0031] On the one hand, a computer program product or computer program is provided, which includes program code stored in a computer-readable storage medium. The processor of a computer device reads the program code from the computer-readable storage medium and executes the program code, causing the computer device to perform the above-described ray display method based on a virtual scene.
[0032] The technical solution provided in this application provides the function of assembling a virtual ray emitter in a virtual scene, and the user can choose the assembly position during assembly. During aiming, the ray is displayed based on the target virtual object, the virtual prop emitter, and the assembly position of the virtual ray emitter, allowing the ray to point to the aiming position of the virtual prop emitter. The ray assists the user's aiming, thereby reducing aiming difficulty and improving the efficiency of human-computer interaction. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1This is a schematic diagram of the implementation environment of a ray display method based on a virtual scene provided in an embodiment of this application;
[0035] Figure 2 This is a schematic diagram illustrating a perspective for observing a virtual scene, as provided in an embodiment of this application.
[0036] Figure 3 This is a schematic diagram of a virtual scene provided in an embodiment of this application;
[0037] Figure 4 This is a flowchart of a ray display method based on a virtual scene provided in an embodiment of this application;
[0038] Figure 5 This is a flowchart of a ray display method based on a virtual scene provided in an embodiment of this application;
[0039] Figure 6 This is a schematic diagram of another virtual scene provided in an embodiment of this application;
[0040] Figure 7 This is a schematic diagram of yet another virtual scene provided in the embodiments of this application;
[0041] Figure 8 This is a schematic diagram of yet another virtual scene provided in the embodiments of this application;
[0042] Figure 9 This is a schematic diagram of yet another virtual scene provided in the embodiments of this application;
[0043] Figure 10 This is a schematic diagram of yet another virtual scene provided in the embodiments of this application;
[0044] Figure 11 This is a schematic diagram of a target launch distance provided in an embodiment of this application;
[0045] Figure 12 This is a flowchart of the ray-based display method for virtual scenes provided in the embodiments of this application;
[0046] Figure 13 This is a schematic diagram of the structure of a ray display device based on a virtual scene provided in an embodiment of this application;
[0047] Figure 14 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0049] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "n," nor are they limited in quantity or execution order.
[0050] In this application, the term "at least one" means one or more, and "multiple" means two or more.
[0051] In related technologies, a crosshair is often displayed on the game screen to indicate the aiming position of the virtual item launcher. The game screen is used to simulate a real-world scenario, but a crosshair doesn't exist in a real-world scenario. Displaying a crosshair on the game screen would reduce the game's realism. If the crosshair isn't displayed on the game screen, aiming can be done using a fixed-position aiming device. While this would increase the game's realism, it would reduce aiming accuracy. Furthermore, because the aiming device's position is fixed, its configuration is less flexible.
[0052] Virtual scene: A virtual scene is a scene displayed (or provided) by an application when it runs on a terminal. This virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. A virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within this virtual scene.
[0053] Virtual objects: These are movable objects within a virtual scene. These movable objects can be virtual characters, animals, cartoon characters, etc., such as people, animals, plants, oil drums, walls, and stones displayed in a virtual scene. A virtual object can be a virtual avatar representing the user within that scene. A virtual scene can include multiple virtual objects, each with its own shape and volume, occupying a portion of the virtual scene's space.
[0054] Optionally, the virtual object can be a user character controlled through client-side operations, or an artificial intelligence (AI) trained and set up for virtual scene battles, or a non-user character (NPC) set up in the virtual scene. Optionally, the virtual object can be a virtual character competing in the virtual scene. Optionally, the number of virtual objects participating in the interaction in the virtual scene can be preset or dynamically determined based on the number of clients joining the interaction.
[0055] Taking shooting games as an example, users can control virtual objects to freely fall, glide, or deploy parachutes in the sky within the virtual scene, run, jump, crawl, and bend forward on land, and swim, float, or dive in the ocean. Users can also control virtual objects to move within the virtual scene using virtual vehicles, such as virtual cars, virtual aircraft, or virtual yachts. These examples are merely illustrations and are not specifically limited in this application. Users can also control virtual objects to interact with other virtual objects through interactive props, such as grenades, cluster grenades, sticky grenades (referred to as "sticky grenades"), or shooting props like machine guns, pistols, and rifles. This application does not specifically limit the type of interactive props. It should be noted that the shooting props such as machine guns, pistols, and rifles described above are all in-game items.
[0056] Figure 1 This is a schematic diagram illustrating the implementation environment of a ray-based display method for virtual scenes provided in this application embodiment. See also... Figure 1 The implementation environment includes: terminal 120 and server 140.
[0057] Terminal 120 is equipped with and runs an application that supports the display of virtual scenes. Optionally, this application can be any of a first-person shooter (FPS) game, a third-person shooter game, a virtual reality application, a 3D mapping application, or a multiplayer survival game. Terminal 120 is a user-operated terminal that allows the user to manipulate a target virtual object located in the virtual scene. These activities include, but are not limited to, adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up items, shooting, attacking, and throwing at least one of these actions. Illustratively, the target virtual object is a virtual character, such as a realistic or anime character.
[0058] Server 140 is an independent physical server, 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 communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This application embodiment does not limit the number of servers or the type of equipment. Server 140 provides background services for applications running on terminal 120, which is connected to server 140 via a wireless network or wired network.
[0059] After introducing the implementation environment of the embodiments of this application, the application scenarios of the embodiments of this application will be described below. In the following description, the terminal is the terminal 120 in the above implementation environment, and the server is the server 140.
[0060] The technical solution provided in this application can be applied to 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 within the virtual scene. In some embodiments, the target virtual object holds a virtual item launcher, which allows it to attack other virtual objects in the virtual scene. During gameplay, the user can control the target virtual object to aim at the desired virtual object using the virtual item launcher, thus launching an attack. In some embodiments, the terminal displays a crosshair for the virtual item launcher in the virtual scene. This crosshair indicates the aiming position of the virtual item launcher in the virtual scene, and the user can control the virtual item launcher to aim by adjusting the position of the crosshair. In some cases, because the virtual scene may be complex and the displayed content may be complex, the user may not be able to accurately see the position of the crosshair, resulting in high aiming difficulty for the virtual item launcher and low efficiency of human-computer interaction. By adopting the technical solution provided in this application, users can add a virtual ray emitter to the virtual item dispenser. This virtual ray emitter assists in aiming the virtual item dispenser, reducing the aiming difficulty and improving the efficiency of human-computer interaction. Furthermore, users can choose the mounting position of the virtual ray emitter on the virtual item dispenser. Regardless of its mounting position, the virtual ray emitter can always send a ray to the aiming position of the virtual item dispenser, enhancing game realism, enriching user game choices, and improving the efficiency of human-computer interaction.
[0061] It should be noted that the above is an example of applying the technical solution provided in the embodiments of this application to a shooting game scenario. In other possible implementations, the technical solution provided in the embodiments of this application can also be applied to other types of games that require aiming, and the embodiments of this application do not limit this.
[0062] It should be noted that the above description is based on the example of the ray display method based on virtual scene provided in the embodiments of this application being executed by the terminal. In the case of the above shooting game being a cloud game, the ray display method based on virtual scene provided in the embodiments of this application can also be executed by the server. That is, the server executes the background processing to generate a video stream, pushes the video stream to the terminal, and the terminal displays it. The embodiments of this application do not limit this.
[0063] To more clearly illustrate the technical solutions provided in the embodiments of this application, the virtual scene in this application is described below. (See attached image.) Figure 2 To make shooting games more realistic, game designers reference how humans observe the real world when designing the display of virtual scenes. The first virtual object 201 can observe the virtual scene in area 202; the view of area 202 from the perspective of the first virtual object 201 is the displayed virtual scene. Users can adjust the orientation of the first virtual object 201 to change its position in observing the virtual scene.
[0064] In some embodiments, the virtual scene includes controls for controlling a target virtual object to perform different actions. See also Figure 3 The virtual scene 301 displays a virtual joystick 302, a posture adjustment control 303, and a shooting control 304. The virtual joystick 302 controls the movement direction of the target virtual object. The posture adjustment control 303 adjusts the posture of the target virtual object, such as controlling it to crouch or crawl. The shooting control 304 controls the virtual item launcher held by the target virtual object to fire virtual items. In some embodiments, the virtual item launcher is a shooting-type interactive item in the game, and the virtual item is virtual ammunition. 305 is a minimap, or virtual map, allowing the user to observe the positions of teammates and enemies in the virtual scene.
[0065] After introducing the implementation environment and application scenarios of the embodiments of this application, the following will describe the ray display method based on virtual scenes provided by the embodiments of this application. See [link to documentation]. Figure 4 The methods include:
[0066] 401. The terminal displays a virtual scene, which shows a target virtual object and a virtual prop dispenser held by the target virtual object.
[0067] In this context, a virtual scene is an activity environment for virtual objects, a simulation of the real world, and in some embodiments, it is also referred to as a game scene. The target virtual object is a virtual object controlled by a terminal, which the user can control to interact with within the virtual scene. A virtual item launcher is a type of game item provided by the game, capable of launching virtual items within the virtual scene to attack virtual objects. The virtual item launcher is essentially a shooting-type interactive item in the game, and the virtual items launched by the virtual item launcher are equivalent to virtual ammunition in the game.
[0068] 402. In response to the assembly operation of 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.
[0069] The assembly operation of the virtual prop emitter refers to the operation of selecting the assembly position of the virtual ray emitter on the virtual prop emitter. The virtual ray emitter can emit rays in the virtual scene, and these rays can assist the virtual prop emitter in aiming. In this embodiment, the assembly position of the virtual ray emitter on the virtual prop emitter is determined by the user. That is to say, this embodiment provides multiple assembly forms between the virtual ray emitter and the virtual prop emitter, providing users with a wide range of assembly options.
[0070] 403. Based on the target virtual object, the virtual prop transmitter, and the target assembly position, the terminal displays the ray emitted by the virtual ray transmitter in the virtual scene, and the ray points to the aiming position of the virtual prop transmitter.
[0071] The virtual ray emitter emits a ray that points to the aiming position of the virtual prop emitter. This means that users can know the aiming position of the virtual prop emitter by looking at the direction of the ray, making it convenient for users to control the virtual prop emitter for aiming. This results in a high efficiency of human-computer interaction.
[0072] The technical solution provided in this application provides the function of assembling a virtual ray emitter in a virtual scene, and the user can choose the assembly position during assembly. During aiming, the ray is displayed based on the target virtual object, the virtual prop emitter, and the assembly position of the virtual ray emitter, allowing the ray to point to the aiming position of the virtual prop emitter. The ray assists the user's aiming, thereby reducing aiming difficulty and improving the efficiency of human-computer interaction.
[0073] Steps 401-403 above are a brief introduction to the ray-based display method for virtual scenes provided in the embodiments of this application. The technical solutions provided in the embodiments of this application will be described in more detail below with some examples. See [link to relevant documentation]. Figure 5 The methods include:
[0074] 501. The terminal displays a virtual scene, which shows a target virtual object and a virtual prop dispenser held by the target virtual object.
[0075] In some embodiments, the virtual scene is a game scene of a shooting game, and the target virtual object is a terminal-controlled virtual object. The user can control the target virtual object to move, use items, drive virtual vehicles, and perform other activities within the virtual scene via the terminal. A virtual item launcher is a game item provided in the shooting game. This launcher can fire virtual items into the virtual scene, which can attack virtual objects within the scene. When a virtual object is hit by a virtual item, its attribute value decreases. The amount of decrease in the virtual item's attribute value is related to at least one of the virtual item's type, the location where it is hit, and equipped virtual armor. When the virtual object's attribute value drops to a target value, the virtual object is defeated. In some embodiments, this attribute value is referred to as the virtual object's health, and the target value is 0; that is, when the virtual object's health value drops to 0, the virtual object is defeated.
[0076] In one possible implementation, in response to a user starting a competitive match, the terminal displays a virtual scene corresponding to that match, and displays a target virtual object within the virtual scene. A competitive match is essentially a shooting game, and the virtual scene displayed on the terminal is a part of the virtual scene. The target virtual object is displayed in the center of the virtual scene displayed on the terminal, and the virtual scene moves as the target virtual object moves. The target virtual object holds a virtual item launcher. In some embodiments, the target virtual object can hold the virtual item launcher in at least two postures: a first posture where the virtual item launcher is placed at the target virtual object's waist, also known as "hip-fire"; and a second posture where the virtual item launcher is placed at the target virtual object's shoulder, also known as "ADS (Aiming Down Sight)," which is the posture of aiming using the virtual item launcher's scope. Changing from the "hip-fire" posture to the "ADS" posture is also known as aiming down sights. In some embodiments, the virtual scene displayed on the terminal is also referred to as the target virtual object's field of view. In this scenario, if other virtual objects enter the target virtual object's field of view, the terminal can display those other virtual objects.
[0077] The above implementation method is illustrated below with two examples.
[0078] Example 1: In response to a click on the target icon, the terminal launches the target application. The target icon is the icon corresponding to the target application, which is the application for the competitive game. The terminal loads the relevant resources of the target application and displays its main interface. In response to an operation on the main interface, i.e., starting a competitive game, the terminal loads the rendering resources of the virtual scene and displays the virtual scene corresponding to the competitive game. The virtual scene displays the target virtual object and the virtual item dispenser held by the target virtual object. In some embodiments, the user can manually switch the virtual item dispenser held by the target virtual object during the game, and can also manually switch the posture of the target virtual object holding the virtual item dispenser. In this case, the rendering and display of the virtual scene are both performed by the terminal.
[0079] Example 2: In response to a click on a target icon, the terminal sends an application launch request to the server. The target icon is the icon corresponding to the target application, which is the application for this competitive game. The application launch request carries the identifier of the target application. Upon receiving the application launch request, the server retrieves the identifier of the target application from the request and launches the target application based on that identifier. The server continuously pushes the video stream of the target application to the terminal, which displays the video stream. In response to an operation based on the video stream, the terminal sends a competitive game start request to the server. The server receives this request, loads the rendering resources of the virtual scene based on the request, and generates the virtual scene corresponding to the competitive game. The server pushes the video stream corresponding to the competitive game to the terminal, which displays the virtual scene of the competitive game. This virtual scene displays the target virtual object and the virtual item dispenser held by the target virtual object. In this case, the rendering of the virtual scene is performed by the server, while the display is performed by the terminal. This shooting game is essentially a cloud game.
[0080] 502. In response to the assembly operation of 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.
[0081] The virtual ray emitter is a game item provided for shooting games. In shooting games, it is also called a laser pointer or simply a "laser pointer." In some embodiments, virtual ray emitters include multiple types, each with different performance parameters. For example, different types of virtual ray emitters may have different shapes or emit rays of different colors. The virtual ray emitter can be attached to a virtual item launcher to assist the virtual item by emitting rays. That is, after being attached to a virtual item launcher, the virtual ray emitter emits a ray in the virtual scene that points towards the aiming position of the virtual item launcher. Users can determine the current aiming position of the virtual item launcher by observing the ray, thus facilitating aiming. In some embodiments, the ray emitted by the virtual ray emitter is achieved through particle effects. The target attachment position is determined based on the attachment operation, meaning that users can choose the attachment position of the virtual ray emitter on the virtual item launcher, thereby achieving personalized attachment of the virtual item launcher and providing users with richer gameplay. In some embodiments, shooting games provide various accessories for the virtual item launcher. Different types of accessories provide different functions for the virtual item launcher, and the virtual ray launcher is one such accessory. The installation positions of the multiple accessories of the virtual item launcher are freely determined by the user, and the installation positions of each accessory can be adjusted. In other words, the user can adjust the installation position of the virtual ray launcher on the virtual item launcher at any time during the game.
[0082] For example, see Figure 6 The terminal displays a virtual scene 600, which displays a virtual prop emitter 601. The virtual prop emitter 601 is equipped with a virtual ray emitter 602, which emits a ray 603 in the virtual scene.
[0083] In one possible implementation, in response to a first operation in the virtual scene, the terminal displays an assembly page for the virtual prop launcher, which shows multiple candidate assembly positions for the virtual prop launcher. In response to a second operation on the assembly page, the terminal determines the selected candidate assembly position from the multiple candidate assembly positions as the target assembly position. The terminal then displays the virtual ray emitter at the target assembly position of the virtual prop launcher.
[0084] The virtual item launcher's assembly page is used to equip the virtual item launcher with accessories. The assembly page provides multiple candidate assembly positions, which are available locations on the virtual item launcher for accessory assembly. The assembly page allows users to select assembly positions. In some embodiments, the assembly page also includes an accessory selection area, which includes multiple accessories possessed by the target virtual object. Users can select the accessories they wish to equip on the virtual item launcher from this accessory selection area, which is also referred to as the target virtual object's virtual backpack.
[0085] This implementation offers several advantages. First, it provides a method for aiming via a virtual ray emitter, which enhances the game's realism compared to aiming with a crosshair in related technologies. Second, it offers multiple candidate mounting positions for the virtual ray emitter on the virtual item dispenser, allowing users to select the target mounting position from these options, thus increasing the flexibility of assembling the virtual ray emitter.
[0086] Selecting the target assembly location from multiple candidate assembly locations can at least bring the following effects:
[0087] First, it adapts to users' usage habits. For example, some users are used to equipping the virtual ray emitter on the right side of the virtual prop emitter, while others are used to equipping it on the left side. Providing multiple candidate equipping positions can simultaneously adapt to different user habits.
[0088] Secondly, since different virtual prop emitters and virtual ray emitters may vary in size and shape, when a virtual ray emitter is mounted in a certain position on a virtual prop emitter, it may obstruct the user's view. By providing multiple alternative mounting positions, users can adjust the mounting position of the virtual ray emitter in a timely manner when their view is obstructed, thus resolving the obstruction issue.
[0089] To provide a clearer explanation of the above embodiments, the following description will be divided into three parts.
[0090] Part 1: 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.
[0091] in, Figure 7 A diagram of the assembly page for this virtual item dispenser is provided; see [link / reference]. Figure 7The assembly page 700 includes multiple candidate assembly positions, each corresponding to a different part of the virtual prop emitter. In some embodiments, the assembly page also displays the virtual prop emitter so that the user knows which virtual prop emitter is currently being assembled with the virtual ray emitter.
[0092] In one possible implementation, in response to a pickup operation of the virtual ray emitter in the virtual scene, the terminal displays an assembly page for the virtual prop emitter in the virtual scene. In this case, the first operation in the virtual scene is a pickup operation of the virtual ray emitter in the virtual scene.
[0093] The picking operation in this virtual scene refers to the operation of controlling the target virtual object to pick up the virtual ray emitter in the virtual scene. In some embodiments, the virtual ray emitter in the virtual scene is a virtual ray emitter that falls randomly in the virtual scene, or a virtual ray emitter that falls after a virtual object in the virtual scene is defeated. This application embodiment does not limit this.
[0094] In this implementation, when the target virtual object picks up a virtual ray emitter in the virtual scene, the terminal can display the assembly page of the virtual prop emitter. The assembly page provides the user with the option to select the assembly position of the picked-up virtual ray emitter, which is highly efficient.
[0095] For example, in response to a target virtual object approaching the location of a virtual ray emitter in a virtual scene, the terminal displays a pick-up control on the virtual ray emitter. The position of the target virtual object in the virtual scene is controlled by the user; that is, when the user sees the virtual ray emitter in the virtual scene, they can control the target virtual object to move towards the location of the virtual ray emitter, thereby controlling the target virtual object to pick up the virtual ray emitter. In response to clicking the pick-up control, the target virtual object picks up the virtual ray emitter, and the virtual item emitter's assembly page is displayed. Picking up the virtual ray emitter means storing it in the target virtual object's virtual inventory. Alternatively, in response to a target virtual object approaching the location of the virtual ray emitter in a virtual scene, the terminal controls the target virtual object to pick up the virtual ray emitter. That is, when the user controls the target virtual object to approach the virtual ray emitter, the terminal can automatically control the target virtual object to pick up the virtual ray emitter without manual control from the user, resulting in high efficiency in human-computer interaction. In response to the target virtual object picking up the virtual ray emitter, the terminal displays the assembly page for the virtual prop emitter, through which the user can select the assembly position for the picked-up virtual ray emitter.
[0096] In one possible implementation, in response to a click operation on the assembly controls displayed in the virtual scene, the terminal displays the assembly page of the virtual prop launcher in the virtual scene.
[0097] The assembly control is a functional control that triggers 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 this embodiment does not limit this. In this case, the first operation in the virtual scene is a click operation on the assembly control within the virtual scene.
[0098] In this implementation, when a user wants to view the assembly page of the virtual item launcher, they can simply click on the assembly control, resulting in high efficiency in human-computer interaction.
[0099] For example, see Figure 6 and Figure 7 The virtual scene 600 displays an assembly control 604. In response to a click on the assembly control 604, the terminal displays the assembly page 700 of the virtual prop launcher in the virtual scene.
[0100] In response to a second operation on the assembly page, the terminal determines the selected candidate assembly position from the plurality of candidate assembly positions as the target assembly position.
[0101] The target assembly position is also the assembly position of the virtual ray emitter on the virtual prop emitter.
[0102] In one possible implementation, in response to a click operation on any of the plurality of candidate assembly locations on the assembly page, the terminal determines the candidate assembly location as the target assembly location.
[0103] In this case, the second operation in the virtual scene is a click operation on any one of the multiple candidate assembly positions.
[0104] In this implementation, users can quickly select the target assembly location by clicking, resulting in high efficiency of human-computer interaction.
[0105] For example, see Figure 7 In response to a click operation on any candidate assembly position 701 among the plurality of candidate assembly positions on the assembly page 700, the terminal determines the candidate assembly position 701 as the target assembly position.
[0106] In one possible implementation, in response to dragging the virtual ray emitter to any of the plurality of candidate assembly locations on the assembly page, the terminal determines the candidate assembly location as the target assembly location.
[0107] In this implementation, users can select the installation position of the virtual ray emitter by dragging. At the same time, the dragging operation can also indicate the virtual ray emitter currently selecting the installation position, reducing the probability of selection error.
[0108] For example, see Figure 7 In response to the virtual ray emitter being dragged to any of the candidate assembly positions 701 among the plurality of candidate assembly positions, the terminal determines the candidate assembly position 701 as the target assembly position.
[0109] Part Three: The terminal displays the virtual ray emitter at the target assembly location of the virtual prop emitter.
[0110] In one possible implementation, the terminal renders the model of the virtual ray emitter onto the target assembly location based on the target assembly location and the model of the virtual prop emitter.
[0111] It should be noted that step 502 above is an example of the terminal executing corresponding steps based on an operation. In the cloud gaming scenario, the terminal can also send corresponding instructions to the server based on an operation, and the server will execute the steps corresponding to the instructions, send the rendered video stream to the terminal, and the terminal will display the video stream.
[0112] 503. The terminal determines the emission direction of the ray based on the location information of the target virtual object in the virtual scene, the type of the virtual prop launcher, and the assembly position of the target, wherein the emission direction of the ray is relative to the emission direction of the virtual prop launcher.
[0113] In one possible implementation, the terminal determines the target position of the virtual ray emitter based on 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 target virtual object's hand in the virtual scene. Based on the first positioning information, 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 terminal determines the emission direction of the ray. The second positioning information includes the position and orientation of the target virtual object's virtual camera in the virtual scene.
[0114] Since the virtual ray emitter has multiple candidate mounting positions, the direction of the emitted ray may differ depending on the position. The terminal can determine the ray's direction based on multiple pieces of information to ensure it targets the virtual prop emitter's aiming position. The virtual camera acts as the user's "eye" in the virtual scene, and the virtual scene displayed on the terminal is the view captured by this camera. In first-person shooter games, the virtual camera's position within the virtual scene corresponds to the target virtual object's head position, simulating the target virtual object's perspective. Alternatively, the virtual camera's position may correspond to the target virtual object's eye position. In third-person shooter games, the virtual camera's position is above the target virtual object.
[0115] To provide a clearer explanation of the above embodiments, the following description will be divided into two parts.
[0116] The first part involves the terminal determining the target location 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.
[0117] 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 target virtual object's model. Correspondingly, the direction of the hand in the virtual scene is the relative direction between the hand and the origin of the target virtual object's model. 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 target virtual object's model. In some embodiments, the origin of the target virtual object's model is also referred to as the root skeleton, and the coordinate system established by the root skeleton is also referred to as the character space. In some embodiments, the terminal uses coordinates to represent the position of the hand in the virtual scene and vectors to represent the direction of the hand in the virtual scene. In some embodiments, the coordinate system established by the origin of the virtual prop emitter is also referred to as the prop space. Through the processing in the first part described above, the target position between the virtual ray and the root skeleton can be determined, and the coordinate system transformation can be realized, facilitating subsequent processing.
[0118] In one possible implementation, the terminal generates a first rotation matrix based on the hand's orientation. The terminal uses this first rotation matrix to process the target assembly position to obtain a reference position for the virtual ray emitter. The terminal then fuses the hand's position and the virtual ray emitter's reference position to obtain the target position of the virtual ray emitter, which is the relative position between the virtual ray emitter and the target virtual object.
[0119] The relative position between the virtual ray emitter and the target virtual object is also the relative position between the origin of the virtual ray emitter and the model of the target virtual object. When the target virtual object holds the virtual prop emitter, the orientation of the target virtual object's hand is the orientation of the virtual prop emitter in the virtual scene.
[0120] For example, the terminal acquires an image of a target virtual object holding the virtual prop emitter. Based on this holding image, the terminal acquires the first positioning information of the target virtual object in the virtual scene, namely the coordinates and direction vector of the target virtual object's hand. 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, which represent the target position.
[0121] For example, the terminal obtains the holding screen of the virtual prop launcher 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 launcher through the following formula (2), obtains the direction of the hand of the target virtual object based on the holding screen of the virtual prop launcher through the following formula (3), and the position and direction of the hand of the target virtual object are represented by the following formula (4).
[0122] GripAnim=GetGripAnim(CurrentWeapon)(1)
[0123] HandLoc=GripAnim.GetBoneLoc("Hand")(2)
[0124] HandRot=GripAnim.GetBoneRot("Hand")(3)
[0125] ("Hand", Loc=(X=28.7, Y=15.6, Z=133.0), Rot=(Roll=0, Yaw=2, Pitch=0)) (4)
[0126] Wherein, 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 the hand is pointing, 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.
[0127] The terminal obtains the target coordinates of the virtual ray emitter using the following formula (5).
[0128] LaserLoc = HandLoc + HandRot InverseTransformVector (LaserLoc_WeaponSpace)(5)
[0129] Where LaserLoc is the target coordinate of the virtual ray emitter, HandLoc is the position of the hand in the virtual scene, and HandRot is the target coordinate of the virtual ray emitter. InverseTransformVector The first rotation matrix is LaserLoc_WeaponSpace, which represents the target assembly coordinates. WeaponSpace indicates the space where the virtual item dispenser is located. HandRot InverseTransformVector The result of (LaserLoc_WeaponSpace) is the reference coordinate of the virtual ray emitter.
[0130] The following example illustrates the application of formula (5) above. See the calculation process below:
[0131] 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) and (68.4, 12.3, 143.6) are the three-dimensional coordinates of the target assembly position in the root skeleton coordinate system, in centimeters; InverseTransformVecto rotates the vector (39.6, -3.3, 10.6) by -2 degrees around the Yaw direction, and (39.6, -3.3, 10.6) are the relative coordinates between the target assembly position and the virtual prop launcher.
[0132] The second part states that 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 transmitter, the position of the hand, and the position of the target.
[0133] In one possible implementation, the terminal determines the target launch distance of the virtual prop launcher based on its type. The terminal determines a reference aiming position of the virtual prop launcher based on second positioning information of the target virtual object and the target launch distance. The terminal determines the emission direction vector of the ray based on the target position, the reference aiming position of the virtual prop launcher, and the first positioning information.
[0134] To provide a clearer explanation of the above implementation methods, the concept of relative target launch distance will be explained below.
[0135] In some embodiments, the target emission distance, also referred to as the zeroing distance, is the distance at which the ray spot and the crosshair just coincide. The ray spot is the point displayed when the ray makes contact with a virtual obstacle in the virtual scene. For a zeroing distance of 10 meters, see [link to documentation]. Figure 8 When the distance between the crosshair and the virtual camera is 10 meters, the light spot 801 will coincide exactly with the crosshair 802; see [link / reference]. Figure 9 When the distance between the crosshair and the virtual camera is less than the zeroing distance, the light spot 901 will be located to the lower right of the crosshair 902; see [link / reference]. Figure 10 When the distance between the crosshair and the virtual camera is greater than the zeroing distance, spot 1001 will be located to the upper left of crosshair 1002. See also Figure 11 This is because the angle between ray 1101 and the virtual ray emitter 1102 is fixed and does not change due to the distance between the crosshair and the camera; otherwise, the ray emitted by the virtual ray emitter would not be realistic enough. In some embodiments, the zeroing distance is often the optimal combat distance for the virtual prop emitter. The zeroing distance is related to the type of virtual prop emitter. 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. 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 in the embodiments of this application, in the above... Figure 9 and Figure 10 In the case shown, the ray emitted by the virtual ray emitter will also coincide with the crosshair, thereby assisting in aiming the virtual prop emitter. In some embodiments, the crosshair is a point in the center of the screen. When hip-firing, the virtual prop will fall near the crosshair. The direction of the crosshair is a point on a straight line extending forward from the center of the virtual camera.
[0136] In this implementation, since different types of virtual item launchers have different target firing distances, meaning they have different optimal combat distances, the firing direction of the ray determined using the above implementation method can always point to the crosshair of the virtual item launcher, i.e., to the aiming position, thereby improving the aiming accuracy of the virtual item launcher. Furthermore, since the virtual ray launcher has multiple mounting positions on the virtual item launcher, and the firing direction determination process incorporates these mounting positions, the determined firing direction of the ray will always point to the crosshair of the virtual item launcher regardless of where the virtual ray launcher is mounted.
[0137] After introducing the example of target launch, the above implementation method will be described below.
[0138] For example, the terminal queries the type of the virtual prop launcher to obtain the target launch distance of the virtual prop launcher. Based on the image of the target virtual object holding the virtual prop launcher, the terminal obtains the second positioning information of the target virtual object in the virtual scene. This second positioning information includes the position and orientation of the virtual camera in the virtual scene. Based on the orientation of the virtual camera in the virtual scene, the terminal generates a second rotation matrix. 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 where the ray points in the virtual scene. Based on the target position and the reference aiming position of the virtual prop launcher, the terminal determines the reference launch direction vector of the ray, which is a vector in the space established based on the target virtual object. The terminal rotates the reference launch direction based on the direction of the hand to obtain the launch direction vector of the ray, which is also a vector in the space established based on the virtual prop launcher.
[0139] For example, the terminal queries 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. The target launch distance list stores the correspondence between the types of virtual prop launchers and the target launch distances. Based on the holding image of the virtual prop launcher by the target virtual object, the terminal obtains the coordinates of the virtual camera in the virtual scene using the following formula (6), and obtains the orientation of the virtual camera in the virtual scene using the following formula (7). Based on the orientation of the virtual camera in the virtual scene, the terminal generates a second rotation matrix. The terminal processes the target launch distance using the second rotation matrix and the position of the virtual camera in the virtual scene using the following formula (8) to obtain the reference aiming position of the virtual prop launcher. Based on the target position and the reference aiming position of the virtual prop launcher, the terminal determines the reference launch direction vector of the ray using the following formula (9). The reference launch 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 direction of the hand using the following formula (10) to obtain the emission direction vector of the ray, which is a vector in the space established based on the virtual prop launcher.
[0140] CameraLoc=GripAnim.GetBoneLoc("Camera")(6)
[0141] CameraRot=GripAnim.GetBoneRot("Camera")(7)
[0142] ZeroingPoint=CameraLoc+CameraRot GetForwardVector *ZeroingDistance(8)
[0143] BeamDirection=(ZeroingPoint–LaserLoc).GetNormal(9)
[0144] BeamDirection_WeaponSpace=HandRot TransformVector (BeamDirection)(10)
[0145] Where 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 firing distance, and CameraRot... GetForwardVectorThe second rotation matrix is defined by BeamDirection, the reference emission direction vector, LaserLoc, the target position of the virtual ray emitter, GetNormal, and BeamDirection_WeaponSpace, which is the emission direction vector of the ray. HandRot... TransformVector The third rotation matrix is generated based on the hand's direction. In some embodiments, the first rotation matrix and the third rotation matrix are inverses of each other.
[0146] The following will combine Figure 12 The above-mentioned optional implementation methods will be used to describe step 503.
[0147] See Figure 12 The terminal acquires the GripAnim image of the target virtual object holding the virtual prop launcher. Based on the GripAnim image, the terminal acquires the HandLoc position and HandRot orientation of the target virtual object's hand. Based on the GripAnim image, the terminal acquires the CameraLoc position and CameraRot orientation of the virtual camera. Based on the type of the virtual prop launcher, the terminal acquires the ZeroingDistance of the virtual prop launcher, which is also the target firing distance of the virtual prop launcher. The terminal acquires the target assembly position LaserLoc_WeaponSpace of the virtual ray launcher and determines the target position LaserLoc of the virtual ray launcher based on the target assembly position. Based on the target position and the reference aiming position of the virtual prop launcher, the terminal determines the reference firing direction vector BeamDirection of the ray. The terminal rotates the reference firing direction vector BeamDirection based on the direction of the hand to obtain the firing direction vector BeamDirection_WeaponSpace of the ray.
[0148] It should be noted that the above steps 501-503 are described using the example of real-time execution on the terminal. In other possible implementations, the terminal can also execute the above steps 501-503 in advance before the game starts, store the processing results, and call them directly when the game runs. This application embodiment does not limit the execution timing.
[0149] 504. The terminal controls the virtual ray emitter to emit the ray in the emission direction.
[0150] In one possible implementation, the terminal renders and displays the ray in the virtual scene based on the location of the virtual ray emitter and the direction of emission.
[0151] Optionally, after step 504, the terminal may also perform any of the following steps.
[0152] In one possible implementation, when the aiming position of the virtual prop emitter is a virtual obstacle in the virtual scene, the terminal displays a light spot on the virtual obstacle, which is the intersection of the ray emitted by the virtual ray emitter and the virtual obstacle.
[0153] Virtual obstacles include virtual walls, virtual stones, virtual trees, and other obstacles. 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.
[0154] In this implementation, the terminal can indicate the aiming position of the virtual item launcher by displaying a light dot, which assists the user in aiming the virtual item launcher.
[0155] For example, see Figure 8 When the aiming position of the virtual prop launcher is the virtual obstacle 803 in the virtual scene, the terminal displays a light spot 801 on the virtual obstacle 803.
[0156] In one possible implementation, the target virtual object holds the virtual prop emitter in a first posture. When the target virtual object adjusts the posture of holding the virtual prop emitter from the first posture to a second posture, the terminal does not display the ray emitted by the virtual ray emitter.
[0157] The first posture is "hip-fire" and the second posture is "aiming and firing".
[0158] In this implementation, when the pose of the target virtual object changes, the terminal may no longer display the ray, allowing the user to focus on aiming and shooting, thus improving the hit rate of virtual prop shooting.
[0159] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0160] The technical solution provided in this application provides the function of assembling a virtual ray emitter in a virtual scene, and the user can choose the assembly position during assembly. During aiming, the ray is displayed based on the target virtual object, the virtual prop emitter, and the assembly position of the virtual ray emitter, allowing the ray to point to the aiming position of the virtual prop emitter. The ray assists the user's aiming, thereby reducing aiming difficulty and improving the efficiency of human-computer interaction.
[0161] In related technologies, the ray is directed to a point in front of the virtual prop launcher, regardless of the hip-fire posture. If, to optimize the visual effect, the angle of the hand holding the launcher is tilted upwards, the corresponding light spot will move upwards; if tilted to the left, the light spot will move to the left, and so on. This often results in the light spot being far from the crosshair, making it impossible for the user to aim using the virtual ray launcher. With the technical solution provided in this application, the angle of the ray can be adjusted according to the actual situation, ensuring that the ray coincides with the crosshair at the zero-distance point. Even if the distance between the crosshair and the virtual camera is zero, the crosshair will be located on the extension line of the ray; even if the distance between the crosshair and the camera is greater than the zero-distance point, the crosshair will be located on the edge of the ray. In short, it facilitates aiming for the user in various situations. Of course, when there are multiple candidate mounting positions for the virtual ray launcher, the technical solution provided in this application can ensure that the ray always points to the crosshair. That is, regardless of where the virtual ray launcher is mounted on the virtual item launcher, a relatively accurate aiming effect can be achieved. Furthermore, multiple candidate mounting positions enhance the flexibility of the virtual ray launcher and enrich user choices. Additionally, in some shooting games without a crosshair, the technical solution provided in this application can also directly achieve assisted aiming when using the virtual item launcher.
[0162] Figure 13 This is a schematic diagram of the structure of a ray display device based on a virtual scene provided in an embodiment of this application. See also... Figure 13 The device includes: a virtual scene display module 1301, a virtual ray emitter display module 1302, and a ray display module 1303.
[0163] The virtual scene display module 1301 is used to display a virtual scene, which displays a target virtual object and a virtual prop dispenser held by the target virtual object.
[0164] The virtual ray emitter display module 1302 is used to respond to the assembly operation of the virtual prop emitter in the virtual scene, and to display the assembled virtual ray emitter based on the target assembly position determined by the assembly operation. The virtual ray emitter is used to assist the virtual prop emitter in aiming.
[0165] The ray display module 1303 is used to display, in the virtual scene, a ray emitted by the virtual ray emitter, which points to the aiming position of the virtual ray emitter, based on the target virtual object, the virtual prop emitter, and the target assembly position.
[0166] In one 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 for the virtual prop emitter in the virtual scene, the assembly page displaying multiple candidate assembly positions for the virtual prop emitter. In response to a second operation on the assembly page, the selected candidate assembly position from the multiple candidate assembly positions is determined as the target assembly position. The virtual ray emitter is then displayed at the target assembly position of the virtual prop emitter.
[0167] In one possible implementation, the virtual ray emitter display module 1302 is configured to perform any of the following:
[0168] In response to a pick-up operation of the virtual ray emitter in the virtual scene, the assembly page for the virtual prop emitter is displayed in the virtual scene.
[0169] In response to a click on the assembly controls displayed in the virtual scene, the assembly page for the virtual prop launcher is displayed in the virtual scene.
[0170] In one possible implementation, the virtual ray emitter display module 1302 is configured to perform any of the following:
[0171] In response to a click operation on any of the multiple candidate assembly locations on the assembly page, that candidate assembly location is determined as the target assembly location.
[0172] In response to dragging the virtual ray emitter to any of the multiple candidate assembly locations on the assembly page, the candidate assembly location is determined as the target assembly location.
[0173] In one possible implementation, the ray display module 1303 is used to determine the ray emission direction 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, wherein the ray emission direction is relative to the emission direction of the virtual prop emitter. The virtual ray emitter is then controlled to emit the ray in that emission direction.
[0174] In one possible implementation, the ray display module 1303 is used to determine the target position of the virtual ray emitter based on 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 target virtual object's hand in the virtual scene. Based on the first positioning information, 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 ray emission direction is determined. The second positioning information includes the position and orientation of the target virtual object's virtual camera in the virtual scene.
[0175] In one possible implementation, the ray display module 1303 is used to generate a first rotation matrix based on the direction of the hand. The first rotation matrix is used to process the target assembly position to obtain a reference position for the virtual ray emitter. The position of the hand and the reference position of the virtual ray emitter are then fused to obtain the target position of the virtual ray emitter, which is the relative position between the virtual ray emitter and the target virtual object.
[0176] In one possible implementation, the ray display module 1303 is used to determine the target firing distance of the virtual prop launcher based on the type of the virtual prop launcher. Based on the second positioning information of the target virtual object and the target firing distance, a reference aiming position of the virtual prop launcher is determined. Based on the target position, the reference aiming position of the virtual prop launcher, and the first positioning information, the firing direction vector of the ray is determined.
[0177] In one possible implementation, the ray display module 1303 is used to determine a reference emission direction vector for the ray based on the target position and the reference aiming position of the virtual prop launcher. This reference emission direction vector is a vector in space established based on the target virtual object. The ray emission direction vector is obtained by rotating the reference emission direction based on the direction of the hand, and this emission direction vector is also a vector in space established based on the virtual prop launcher.
[0178] In one possible implementation, the device further includes:
[0179] The light spot display module is used to display a light spot on the virtual obstacle when the aiming position of the virtual prop emitter is a virtual obstacle in the virtual scene. The light spot is the intersection point of the ray emitted by the virtual ray emitter and the virtual obstacle.
[0180] In one 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 its posture of holding the virtual prop emitter from the first posture to the second posture.
[0181] It should be noted that the above embodiments of the virtual scene-based ray display device are only illustrated by the division of the above functional modules when displaying rays. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the virtual scene-based ray display device and the virtual scene-based ray display method embodiments are based on the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0182] The technical solution provided in this application provides the function of assembling a virtual ray emitter in a virtual scene, and the user can choose the assembly position during assembly. During aiming, the ray is displayed based on the target virtual object, the virtual prop emitter, and the assembly position of the virtual ray emitter, allowing the ray to point to the aiming position of the virtual prop emitter. The ray assists the user's aiming, thereby reducing aiming difficulty and improving the efficiency of human-computer interaction.
[0183] This application provides a computer device for performing the above-described method. This computer device can be implemented as a terminal. The structure of the terminal is described below:
[0184] Figure 14 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. The terminal 1400 can be a smartphone, tablet computer, laptop computer, or desktop computer. The terminal 1400 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0185] Typically, terminal 1400 includes one or more processors 1401 and one or more memories 1402.
[0186] Processor 1401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0187] The memory 1402 may include one or more computer-readable storage media, which may be non-transitory. The memory 1402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 are used to store at least one computer program, which is executed by the processor 1401 to implement the virtual scene-based ray-casting method provided in the method embodiments of this application.
[0188] Those skilled in the art will understand that Figure 14 The structure shown does not constitute a limitation on terminal 1400 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0189] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including a computer program that can be executed by a processor to perform the virtual scene-based ray-viewing method in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, or optical data storage device, etc.
[0190] In an exemplary embodiment, a computer program product or computer program is also provided, which includes program code stored in a computer-readable storage medium. The processor of a computer device reads the program code from the computer-readable storage medium and executes the program code, causing the computer device to perform the above-described ray display method based on a virtual scene.
[0191] In some embodiments, the computer program involved in the present application embodiments may be deployed and executed on a computer device, or executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network may constitute a blockchain system.
[0192] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0193] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A ray-based display method for virtual scenes, characterized in that, The method includes: A virtual scene is displayed, in which a target virtual object and a virtual prop dispenser held by the target virtual object are displayed; In response to a first operation in the virtual scene, an assembly page for the virtual prop launcher is displayed in the virtual scene, the assembly page displaying multiple candidate assembly positions for the virtual prop launcher; In response to a second operation on the assembly page, the selected candidate assembly position among the plurality of candidate assembly positions is determined as the target assembly position; The virtual ray emitter is displayed at the target mounting position of the virtual prop emitter, and the virtual ray emitter is used to assist the virtual prop emitter in aiming; Based on the target virtual object, the virtual prop launcher, and the target assembly position, a ray emitted by the virtual ray launcher is displayed in the virtual scene, and the ray points to the aiming position of the virtual prop launcher.
2. The method according to claim 1, characterized in that, The response to a first operation in the virtual scene, displaying the assembly page for the virtual prop dispenser in the virtual scene, includes any of the following: In response to a pickup operation of the virtual ray emitter in the virtual scene, an assembly page for the virtual prop emitter is displayed in the virtual scene; In response to a click operation on the assembly controls displayed in the virtual scene, the assembly page of the virtual prop launcher is displayed in the virtual scene.
3. The method according to claim 1, characterized in that, The step of determining the selected candidate assembly position from the plurality of candidate assembly positions as the target assembly position in response to the second operation on the assembly page includes any of the following: In response to a click operation on any of the plurality of candidate assembly positions on the assembly page, the candidate assembly position is determined as the target assembly position; In response to dragging the virtual ray emitter to any of the plurality of candidate assembly positions on the assembly page, the candidate assembly position is determined as the target assembly position.
4. The method according to claim 1, characterized in that, The method of 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 includes: Based on the location information of the target virtual object in the virtual scene, the type of the virtual prop launcher, and the target assembly position, the emission direction of the ray is determined; Control the virtual ray emitter to emit the ray in the emission direction.
5. The method according to claim 4, characterized in that, Determining the emission direction of the ray based on the location information of the target virtual object in the virtual scene, the type of the virtual prop emitter, and the target assembly position includes: Based on the first positioning information of the target virtual object in the virtual scene and the target assembly position, the target position of the virtual ray emitter is determined. The first positioning information includes the position and direction of the target virtual object's hand 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, the emission direction of the ray is determined. The second positioning information includes the position and orientation of the virtual camera of the target virtual object in the virtual scene.
6. The method according to claim 5, characterized in that, 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: Based on the direction of the hand, a first rotation matrix is generated; The target assembly position is processed using the first rotation matrix to obtain the reference position of the virtual ray emitter; The position of the hand and the reference position of the virtual ray emitter are fused to obtain the target position of the virtual ray emitter, which is the relative position between the virtual ray emitter and the target virtual object.
7. The method according to claim 5, characterized in that, Determining 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 includes: Based on the type of the virtual item launcher, determine the target launch distance of the virtual item launcher; Based on the second positioning information of the target virtual object and the target launch distance, the reference aiming position of the virtual prop launcher is determined; Based on the target location, the reference aiming position of the virtual prop launcher, and the first positioning information, the emission direction vector of the ray is determined.
8. The method according to claim 7, characterized in that, Determining the emission direction vector of the ray based on the target location, the reference aiming position of the virtual prop launcher, and the first positioning information includes: Based on the target location and the reference aiming position of the virtual prop launcher, the reference emission direction vector of the ray is determined. The reference emission direction vector is a vector in space established based on the target virtual object. The reference emission direction is rotated based on the direction of the hand to obtain the emission direction vector of the ray, which is a vector in space established based on the virtual prop launcher.
9. 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, a light spot is displayed on the virtual obstacle. The light spot is the intersection of the ray emitted by the virtual ray emitter and the virtual obstacle.
10. The method according to claim 1, characterized in that, 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 its posture of holding the virtual prop emitter from the first posture to the second posture, the ray emitted by the virtual ray emitter is not displayed.
11. A ray display device based on a virtual scene, characterized in that, The device includes: A virtual scene display module is used to display a virtual scene, wherein the virtual scene displays a target virtual object and a virtual prop dispenser held by the target virtual object; A virtual ray emitter display module is configured to, in response to a first operation in the virtual scene, display an assembly page for the virtual prop emitter in the virtual scene, the assembly page displaying multiple candidate assembly positions for the virtual prop emitter; in response to a second operation on the assembly page, determine the selected candidate assembly position from the multiple candidate assembly positions as the target assembly position; and display the assembled virtual ray emitter at the target assembly position of the virtual prop emitter, the virtual ray emitter being used to assist the virtual prop emitter in aiming; A ray display module is used to display, in the virtual scene, a ray emitted by the virtual ray emitter, based on the target virtual object, the virtual prop emitter, and the target assembly position, with the ray pointing towards the aiming position of the virtual prop emitter.
12. A computer device, characterized in that, The computer device includes one or more processors and one or more memories, wherein 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-based display method for virtual scenes as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the ray-based display method for virtual scenes as described in any one of claims 1 to 10.
14. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the ray-based display method for virtual scenes as described in any one of claims 1 to 10.