Direction indication method, device, electronic device and storage medium
By generating and rotating the cone model in a first-person shooter, the problem that players cannot judge the direction of the hit at certain angles is solved, and the direction indication is easier to distinguish and the game operation experience is improved.
Patent Information
- Application Number
- CN202111211996.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-10-18
AI Technical Summary
In existing first-person shooting games, if the damage source is near the front or rear of the game character controlled by the player, the pyramid model will be presented in a shape similar to the plane figure, which will make it impossible for the player to easily judge the direction of the attack.
Provide a graphical user interface through the terminal device to generate a cone model when the game character is attacked by a source of damage, and calculate the angle between the vertices of the cone model and the field of view of the game character. If the angle is less than the critical angle, the cone model is rotated in a direction perpendicular to the horizontal plane of the field of view until the angle between the central axis and the horizontal plane of the field of view is equal to the critical angle to adjust the direction indication.
It improves the problem that players cannot easily judge the direction of hit at certain angles. By rotating the cone model, it makes its presentation on the graphical user interface easier to distinguish, and improves the player's operating experience.
Smart Images

Figure CN113952719B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and particularly to a direction indication method, device, electronic device, and storage medium. Background Art
[0002] In existing first-person shooting games (FPS for short), when the game character controlled by a player is attacked, the indication of the hit direction is usually achieved by means of a pyramid model displayed on the screen. The pointed end of the pyramid points to the direction from which the attack comes, and the planar part opposite to the pointed end points to the game character controlled by the player.
[0003] However, during the actual display process, if the source of damage is near the front or rear of the game character controlled by the player, the pyramid model will be presented to the player in the shape of an approximate planar figure, making it difficult for the player to easily determine the hit direction. Summary of the Invention
[0004] Embodiments of this application provide a direction indication method, device, electronic device, and storage medium, which can improve the problem that players cannot easily determine the hit direction at certain angles in the prior art.
[0005] Embodiments of this application provide a direction indication method. The method includes: providing a graphical user interface through a terminal device, where the content displayed in the graphical user interface at least includes a game character controlled by the terminal device. The method includes: in response to the game character being attacked by a damage source, generating a cone model, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character; obtaining a first connection line between the vertex of the cone model and the corresponding position of the game character; calculating a visual field angle between the first connection line and the visual field horizontal plane of the game character; if the visual field angle is less than the angle value of a critical angle, then with the vertex of the cone model as the center, rotate the cone model in a direction perpendicular to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model and display the rotated cone model on the graphical user interface.
[0006] An embodiment of the present application further provides a direction indication device. A graphical user interface is provided through a terminal device. The content displayed in the graphical user interface at least includes a game character controlled by the terminal device. The device includes: a cone generation unit, configured to generate a cone model in response to the game character being attacked by a damage source, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character; a connection line acquisition unit, configured to acquire a first connection line between the vertex of the cone model and the corresponding position of the game character; a field of view angle calculation unit, configured to calculate the field of view angle between the first connection line and the horizontal plane of the game character's field of view; a model rotation unit, configured to, if the field of view angle is less than the angle value of the critical angle, rotate the cone model around the vertex of the cone model in a direction perpendicular to the horizontal plane of the field of view until the angle value of the angle between the central axis and the horizontal plane of the field of view is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model; a model display unit, configured to display the cone model that has completed the rotation action on the graphical user interface.
[0007] In some embodiments, the corresponding position of the game character includes: a preset part on the game character, the corresponding position of the virtual weapon held by the game character, the current position of the virtual camera bound to the game character, or a position at a preset distance from the above positions.
[0008] In some embodiments, the device further includes:
[0009] A second display unit, configured to display the cone model on the graphical user interface when the field of view angle exceeds the angle value of the critical angle.
[0010] In some embodiments, the model rotation unit includes:
[0011] A positive critical angle comparison sub-unit, configured to compare the field of view angle with the positive critical angle when the first connection line is above the horizontal plane of the field of view;
[0012] A first rotation sub-unit, configured to rotate the cone model around the vertex of the cone model in a direction close to the horizontal plane of the field of view until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the positive critical angle when the field of view angle is less than the positive critical angle.
[0013] In some embodiments, the positive critical angle comparison sub-unit is specifically configured to compare the field of view angle with the forward positive critical angle when the first connection line is above the horizontal plane of the field of view and in front of the game character;
[0014] The first rotation sub-unit is specifically configured to rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the forward positive critical angle when the field of view angle is less than the forward positive critical angle.
[0015] In some embodiments, the positive critical angle comparison sub-unit is specifically configured to compare the field of view angle with the backward positive critical angle when the first connection line is above the horizontal plane of the field of view and behind the game character;
[0016] The first rotation sub-unit is specifically configured to rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the backward positive critical angle when the field of view angle is less than the backward positive critical angle.
[0017] In some embodiments, the model rotation unit further includes:
[0018] The negative critical angle comparison sub-unit is configured to compare the field of view angle with the negative critical angle when the first connection line is below the horizontal plane of the field of view;
[0019] The second rotation sub-unit is configured to rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the negative critical angle when the field of view angle is less than the negative critical angle.
[0020] In some embodiments, the negative critical angle comparison sub-unit is specifically configured to compare the field of view angle with the forward negative critical angle when the first connection line is below the horizontal plane of the field of view and in front of the game character;
[0021] The second rotation sub-unit is specifically configured to rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the forward negative critical angle when the field of view angle is less than the forward negative critical angle.
[0022] In some embodiments, the negative critical angle comparison sub-unit is specifically configured to compare the field of view angle with the backward negative critical angle when the first connection line is below the horizontal plane of the field of view and behind the game character;
[0023] The second rotation sub-unit is specifically configured to rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the backward negative critical angle when the field of view angle is less than the backward negative critical angle.
[0024] In some embodiments, the device further includes:
[0025] The brightness setting unit is configured to set the vertex of the cone model to a first brightness value and set the bottom surface of the cone model to a second brightness value, where the first brightness value is greater than the second brightness value.
[0026] An embodiment of the present application further provides a computer-readable storage medium storing multiple instructions suitable for a processor to load and execute the steps in any of the direction indication methods provided by the embodiments of the present application.
[0027] In the direction indication method provided by the embodiments of the present application, a first connection line between a cone model indicating the direction of the damage source and a game character can be obtained, and the field of view angle between the first connection line and the above game character can be calculated. If the field of view angle is less than the angle value of the critical angle, the vertex of the cone model remains unchanged, and the cone model is rotated in a direction perpendicular to the horizontal plane of the field of view until the angle value of the angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the angle value of the critical angle. Then, the cone model that has completed the rotation action is displayed above, so that the user can determine the direction of the damage source according to the cone model.
[0028] In the present application, the critical angle is a preset angle. The cone model at this critical angle enables the user to still distinguish the hit direction relatively accurately and quickly. If the field of view angle between the first connection line and the horizontal plane of the field of view is less than the critical angle, the presentation of the cone model on the display screen will be almost a planar graph, which is not conducive to the user to easily distinguish the hit direction. At this time, the vertex of the cone model can be maintained unchanged, and the entire cone model is rotated with this vertex as the center until the angle value of the angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the angle value of the critical angle. At this time, while the vertex still indicates the hit direction, the presentation of the cone model on the display screen becomes easier to distinguish, thus improving the problem that players in the prior art cannot easily judge the hit direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] 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 drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0030] Figure 1a It is a schematic diagram of the scenario of the direction indication method provided by the embodiment of the present application;
[0031] Figure 1b It is a schematic flowchart of the direction indication method provided by an embodiment of the present application;
[0032] Figure 1c It shows an application scenario diagram of the direction indication method;
[0033] Figure 1d In (1) shows a schematic diagram of the cone model before rotation;
[0034] Figure 1d In (2) shows a schematic diagram of the cone model after rotation;
[0035] Figure 1e It shows a detailed schematic diagram of the critical angle;
[0036] Figure 1f In (1) shows a schematic diagram of the cone model presented on the display screen under the forward positive critical angle;
[0037] Figure 1f In (2) shows a schematic diagram of the cone model presented on the display screen under the backward positive critical angle;
[0038] Figure 1f In (3) shows a schematic diagram of the cone model presented on the display screen under the forward negative critical angle;
[0039] Figure 1f In (4) shows a schematic diagram of the cone model presented on the display screen under the backward negative critical angle;
[0040] Figure 1g It shows a schematic diagram of the relative position of the light source and the cone model;
[0041] Figure 2 It is a schematic flowchart of the direction indication method provided by another embodiment of the present application;
[0042] Figure 3 It is a schematic structural diagram of a direction indication device provided by an embodiment of the present application;
[0043] Figure 4 It is a schematic structural diagram of an electronic device provided by the embodiment of the present application. Specific Embodiments
[0044] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0045] The embodiments of the present application provide a direction indication method, device, electronic device, and storage medium.
[0046] Among them, the direction indication device can be specifically integrated in an electronic device, and the electronic device can be a device such as a terminal or a server. Among them, the terminal can be a device such as a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a personal computer (PC); the server can be a single server or a server cluster composed of multiple servers.
[0047] In some embodiments, the direction indication device can also be integrated in multiple electronic devices. For example, the direction indication device can be integrated in multiple servers, and multiple servers are used to implement the direction indication method of the present application.
[0048] In some embodiments, the server can also be implemented in the form of a terminal.
[0049] For example, referring to Figure 1a , the above-mentioned electronic device can execute the following method: in response to the game character being attacked by a damage source, generate a cone model, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character; obtain the first connection line between the vertex of the cone model and the corresponding position of the game character; calculate the viewing angle between the first connection line and the viewing horizontal plane of the game character; if the viewing angle is less than the angle value of the critical angle, then with the vertex of the cone model as the center, rotate the cone model in a direction perpendicular to the viewing horizontal plane until the angle value of the angle between the central axis and the viewing horizontal plane is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model and display the rotated cone model on the graphical user interface.
[0050] The following will be described in detail respectively. It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0051] In this embodiment, a direction indication method is provided, asFigure 1b As shown, this direction indication method is applied to a terminal. The specific process of this method can be as follows, from step 110 to step 150:
[0052] 110. In response to the game character being attacked by a damage source, generate a cone model.
[0053] Wherein, the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character.
[0054] The cone model is a model for showing the direction of the damage source (i.e., the hit direction). The vertex of the cone model can be made to indicate the damage source, and the bottom surface of the cone model can indicate the game character, so as to use the cone model to represent the relative position relationship between the game character and the damage source.
[0055] The cone model can be a cone or a pyramid; for the pyramid cone model, the cone model includes multiple planes as the sides and one plane as the bottom surface. The vertex mentioned in the text refers to the vertex opposite to the bottom surface. To better help the user distinguish the direction, the cone model can be set as a cone model with an odd number of edges. For example, the cone model can be a triangular pyramid model. For details, please refer to Figure 1c .
[0056] In the above embodiment, if the cone model is a cone, the above central axis is the extension line of the rotation axis of the cone; if the cone model is a pyramid, the above central axis is the extension line of the perpendicular line drawn from the vertex to the bottom surface of the pyramid.
[0057] Optionally, in a specific embodiment, the cone model generated in step 110 may not be displayed on the display screen first. After the processing process of the cone model in steps 120 to 140 is executed, the processed cone model can be displayed on the graphical user interface again; in another specific embodiment, the cone model generated in step 110 can be displayed on the graphical user interface when it is generated, and the processing process of steps 120 to 140 is executed in the display state. Among them, the specific processing process of steps 120 to 140 will be described in detail below.
[0058] 120. Obtain the first connection line between the vertex of the cone model and the corresponding position of the game character.
[0059] Optionally, the corresponding position of the game character includes: a preset part on the game character, the corresponding position of the virtual weapon held by the game character, the current position of the virtual camera bound to the game character, or a position at a preset distance from the above positions.
[0060] Optionally, the preset part on the above-mentioned game character can be the eye part of the game character, the corresponding position of the virtual weapon can be the position of the sight of the virtual weapon, and the virtual camera is a virtual camera that sets a viewpoint simulating the human eye when rendering the game scene. Objects within the viewing angle range of this virtual camera are presented according to the perspective relationship. In addition to the above positions, the corresponding position of the game character can also be at a position with a preset distance from the above position. For example, it can be at a position N pixel points above the above position, where N is a positive integer, and the specific value of N should not be construed as a limitation of this application.
[0061] 130. Calculate the viewing angle between the first connection line and the horizontal plane of the game character's field of view.
[0062] The horizontal plane of the field of view is a horizontal plane flush with the height of the above-mentioned viewpoint. On the premise that both the first connection line and the horizontal plane of the field of view are clear, the viewing angle formed by the two can be calculated, and this viewing angle is the angle between the line (i.e., the first connection line) and the plane (i.e., the horizontal plane of the field of view).
[0063] 140. If the viewing angle is less than the angle value of the critical angle, rotate the cone model around the vertex of the cone model in a direction perpendicular to the horizontal plane of the field of view until the angle value of the angle between the central axis and the horizontal plane of the field of view is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model.
[0064] Among them, the critical angle is a preset angle. The cone model under this critical angle allows the user playing the game to still be able to distinguish the direction of being hit more accurately and quickly. If the viewing angle is less than the critical angle, the presentation of the cone model on the display screen will be almost a planar graph, which is not conducive to the user easily distinguishing the direction of being hit.
[0065] For the case where the viewing angle is less than the critical angle, the position of the vertex of the cone model can be maintained unchanged, and the entire cone model is rotated around the vertex until the angle value of the angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the angle value of the critical angle. At this time, while the vertex still indicates the direction of being hit, the presentation of the cone model on the display screen becomes easier to distinguish.
[0066] For details, please refer to Figure 1d (1) and (2) in Figure 1dIn (1), the comparison between the cone model before rotation and the cone model corresponding to the critical angle is shown. It can be seen that the cone model corresponding to the critical angle enables the user playing the game to still accurately and quickly distinguish the direction of being hit. For the cone model before rotation, since the corresponding viewing angle is smaller than the critical angle, the presentation of the cone model before rotation on the display screen is closer to a planar graph. When the user sees the cone model before rotation, it is not easy to quickly distinguish the direction it indicates.
[0067] Figure 1d In (2), the comparison between the rotated cone model and the cone model corresponding to the critical angle is shown. It can be seen that the vertex position of the rotated cone model remains unchanged, and the angle between the entire cone model and the viewing horizontal plane is the same as the critical angle. Thus, while the vertex still indicates the direction of being hit, the presentation of the cone model on the display screen becomes easier to distinguish, thereby improving the problem in the prior art that players cannot easily judge the direction of being hit.
[0068] Optionally, the critical angle includes a positive critical angle and a negative critical angle; the positive critical angle is the angle between the critical line above the viewing horizontal plane and the viewing horizontal plane, and the negative critical angle is the angle between the critical line below the viewing horizontal plane and the viewing horizontal plane.
[0069] Step 140 may specifically include the following steps 141 to 144:
[0070] 141. If the first connection line is above the viewing horizontal plane, compare the viewing angle with the positive critical angle.
[0071] 142. If the viewing angle is smaller than the positive critical angle, rotate the cone model in the direction close to the viewing horizontal plane with the vertex of the cone model as the center until the angle value of the angle between the central axis and the viewing horizontal plane becomes the angle value of the positive critical angle.
[0072] For the direction of being hit from above the viewing horizontal plane, the first connection line between the vertex of the cone model pointing to the source of damage and the viewpoint can be obtained, and the viewing angle between the first connection line and the viewing horizontal plane can be calculated, and then the viewing angle is compared with the positive critical angle.
[0073] The cone model under the positive critical angle is a critical cone model. This critical cone model enables the user to accurately and quickly distinguish the direction of being hit when being attacked from above the viewing horizontal plane.
[0074] If there is a certain cone model whose angle with the visual field horizontal plane is less than the angle of the critical cone model with the visual field horizontal plane, the presentation of the cone model on the display screen will be nearly a planar graph, which is not conducive to users easily distinguishing the hitting direction;
[0075] If there is another cone model whose angle with the visual field horizontal plane is greater than or equal to the angle of the critical cone model with the visual field horizontal plane, the presentation of the cone model on the display screen enables users to accurately and quickly distinguish the hitting direction.
[0076] In a specific embodiment, the positive critical angle may include a forward positive critical angle, which is used to compare with the visual field angle when the source of damage is located above the front of the game character. For details, please refer to Figure 1e , Figure 1e The ∠a in Figure 1f is the forward positive critical angle;
[0077] Step 141 may specifically include: If the first connection line is above the visual field horizontal plane and in front of the game character, compare the visual field angle with the forward positive critical angle.
[0078] Step 142 may specifically include: If the visual field angle is less than the forward positive critical angle, rotate the cone model around the vertex of the cone model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the forward positive critical angle.
[0079] The cone model under the forward positive critical angle is a critical cone model. This critical cone model enables users to accurately and quickly distinguish the hitting direction when being attacked from above the visual field horizontal plane and in front of the game character.
[0080] If there is a certain cone model whose angle with the visual field horizontal plane is less than the angle of the critical cone model with the visual field horizontal plane, the presentation of the cone model on the display screen will be nearly a planar graph, which is not conducive to users easily distinguishing the hitting direction; If there is another cone model whose angle with the visual field horizontal plane is greater than or equal to the angle of the critical cone model with the visual field horizontal plane, the presentation of the cone model on the display screen enables users to accurately and quickly distinguish the hitting direction.
[0081] In another specific embodiment, the positive critical angle may further include a backward positive critical angle, which is used to compare with the visual field angle when the source of damage is located above the back of the game character. For details, please refer to Figure 1e , Figure 1eThe ∠b therein is the positive backward critical angle; Figure 1f (2) therein shows a schematic diagram of the cone model presented on the display screen at the positive backward critical angle.
[0082] Step 141 may specifically further include: If the first connection line is above the visual field horizontal plane and behind the game character, then compare the visual field angle with the positive backward critical angle.
[0083] Step 142 may specifically further include: If the visual field angle is less than the positive backward critical angle, then rotate the cone model around the vertex of the cone model in a direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the positive backward critical angle.
[0084] The cone model at the positive backward critical angle is a critical cone model. This critical cone model enables the user to accurately and quickly distinguish the hit direction when being attacked from above the visual field horizontal plane and behind the game character.
[0085] If there is a certain cone model whose angle with the visual field horizontal plane is less than the angle of this critical cone model with the visual field horizontal plane, then the presentation of this cone model on the display screen will be nearly a planar graph, which is not conducive to the user easily distinguishing the hit direction; if there is another cone model whose angle with the visual field horizontal plane is greater than or equal to the angle of this critical cone model with the visual field horizontal plane, then the presentation of this cone model on the display screen enables the user to accurately and quickly distinguish the hit direction.
[0086] It can be understood that on the premise that the user is attacked from above the visual field horizontal plane, the ability to accurately and quickly distinguish the hit direction when being attacked in front of the game character and when being attacked behind the game character is different. Therefore, the angle value of the positive forward critical angle and the angle value of the positive backward critical angle can be different.
[0087] 143. If the first connection line is below the visual field horizontal plane, then compare the visual field angle with the negative critical angle.
[0088] 144. If the visual field angle is less than the negative critical angle, then rotate the cone model around the vertex of the cone model in a direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the negative critical angle.
[0089] For the hit direction from below the visual field horizontal plane, the first connection line between the vertex of the cone model pointing to the damage source and the viewpoint can be obtained, and the visual field angle between the first connection line and the visual field horizontal plane can be calculated, and then this visual field angle is compared with the negative critical angle.
[0090] The cone model under the negative critical angle is a critical cone model, which enables the user to accurately and quickly distinguish the direction of the attack when being attacked from below the visual horizontal plane.
[0091] It can be understood that the user's ability to accurately and quickly distinguish the direction of the attack is different when being attacked from above the visual horizontal plane and when being attacked from below the visual horizontal plane. Therefore, the angle value of the negative critical angle and the angle value of the positive critical angle can be different.
[0092] If there is a cone model whose angle with the visual horizontal plane is smaller than the angle of the critical cone model with the visual horizontal plane, the presentation of this cone model on the display screen will be almost a planar graph, which is not conducive to the user to easily distinguish the direction of the attack;
[0093] If there is another cone model whose angle with the visual horizontal plane is greater than or equal to the angle of the critical cone model with the visual horizontal plane, the presentation of this cone model on the display screen enables the user to accurately and quickly distinguish the direction of the attack.
[0094] In a specific embodiment, the negative critical angle may include a forward negative critical angle, which is used to compare with the visual angle when the source of the damage is located below the front of the game character. For details, please refer to Figure 1e , Figure 1e ∠-a in it is the forward negative critical angle; Figure 1f (3) in it shows a schematic diagram of the cone model presented on the display screen under the forward negative critical angle.
[0095] Step 143 may specifically include: if the first connection line is below the visual horizontal plane and in front of the game character, then compare the visual angle with the forward negative critical angle.
[0096] Step 144 may specifically include: if the visual angle is smaller than the forward negative critical angle, then rotate the cone model around the vertex of the cone model in the direction close to the visual horizontal plane until the angle value of the angle between the central axis and the visual horizontal plane becomes the angle value of the forward negative critical angle.
[0097] The cone model under the forward negative critical angle is a critical cone model, which enables the user to accurately and quickly distinguish the direction of the attack when being attacked from below the visual horizontal plane and in front of the game character.
[0098] If there is a certain cone model whose angle with the visual field horizontal plane is less than the angle of the critical cone model with the visual field horizontal plane, the presentation of this cone model on the display screen will be almost a planar graph, which is not conducive to users easily distinguishing the hit direction; if there is another cone model whose angle with the visual field horizontal plane is greater than or equal to the angle of the critical cone model with the visual field horizontal plane, the presentation of this cone model on the display screen enables users to accurately and quickly distinguish the hit direction.
[0099] In another specific embodiment, the negative critical angle can include a backward negative critical angle, which is used to compare with the visual field angle when the source of damage is located below and behind the game character. For details, please refer to Figure 1e , Figure 1e ∠-b in Figure 1f is the backward negative critical angle;
[0100] Step 143 can specifically further include: if the first connection line is below the visual field horizontal plane and behind the game character, then compare the visual field angle with the backward negative critical angle.
[0101] Step 144 can specifically further include: if the visual field angle is less than the backward negative critical angle, then rotate the cone model around the vertex of the cone model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the backward negative critical angle.
[0102] The cone model under the backward negative critical angle is a critical cone model. This critical cone model enables users to accurately and quickly distinguish the hit direction when being attacked from below the visual field horizontal plane and behind the game character.
[0103] If there is a certain cone model whose angle with the visual field horizontal plane is less than the angle of the critical cone model with the visual field horizontal plane, the presentation of this cone model on the display screen will be almost a planar graph, which is not conducive to users easily distinguishing the hit direction; if there is another cone model whose angle with the visual field horizontal plane is greater than or equal to the angle of the critical cone model with the visual field horizontal plane, the presentation of this cone model on the display screen enables users to accurately and quickly distinguish the hit direction.
[0104] It can be understood that on the premise that the user is attacked from below the visual field horizontal plane, the ability to accurately and quickly distinguish the hit direction when being attacked in front of the game character is different from that when being attacked behind the game character. Therefore, the angle value of the forward negative critical angle and the angle value of the backward negative critical angle can be different.
[0105] 150. Display a cone model that has completed a rotation action on the graphical user interface.
[0106] In the above embodiment, the critical angle can be specifically divided into a forward positive critical angle a, a backward positive critical angle b, a forward negative critical angle -a, and a backward negative critical angle -b. For the above four critical angles, they can all be compared with the field of view angle. If the angle value of the field of view angle is less than the angle value of the critical angle, the presentation of the cone model on the display screen will be almost a planar graph, which is not conducive to users easily distinguishing the direction of being hit. At this time, the vertex of the cone model can be maintained unchanged, and the entire cone model can be rotated around this vertex until the angle value of the angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the angle value of the critical angle. At this time, while the vertex still indicates the direction of being hit, the presentation of the cone model on the display screen becomes easier to distinguish, thus improving the problem that players in the prior art cannot easily judge the direction of being hit.
[0107] It can be understood that the angle values of the forward positive critical angle a, the backward positive critical angle b, the forward negative critical angle -a, and the backward negative critical angle -b can be different from each other, and the specific numerical values of their corresponding angle values should not be construed as a limitation to this application.
[0108] Optionally, in a specific embodiment, after step 140, the method provided by the embodiments of this application may further include: If the field of view angle exceeds the angle value of the critical angle, display the cone model on the graphical user interface.
[0109] The cone model under the critical angle enables users to distinguish the direction of being hit more accurately and quickly. Then, the cone model in the case where the angle value exceeds the critical angle can enable users to distinguish the direction of being hit more accurately and quickly. Therefore, for the case where the field of view angle exceeds the angle value of the critical angle, the cone model can be directly displayed.
[0110] Optionally, a and -a can be used as the numerical values of two limit angles. If the numerical value of the field of view angle is greater than or equal to a, it is determined that the source of the damage comes from above the horizontal plane of the field of view and in front of the game character. At this time, the cone model can be normally displayed.
[0111] If the numerical value of the field of view angle is less than or equal to -a, it is determined that the source of the damage comes from below the horizontal plane of the field of view and in front of the game character. At this time, the cone model can be normally displayed.
[0112] If the value of the field of view angle is between -a and a, it means that the source of damage is in front of the game character, and if the cone model is displayed directly at this time, it will present a shape similar to a plane figure. Therefore, the adjacent value between the cone model and -a or a can be determined, and then the vertex position of the cone model is kept unchanged, and the cone model is rotated until the angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the determined adjacent value.
[0113] It should be understood that the numerical value of the field of view angle is greater than or equal to a, which means that the actual angle value of the field of view angle is greater than or equal to the actual angle value of the forward positive critical angle a; the numerical value of the field of view angle is less than or equal to -a, which means that the actual angle value of the field of view angle is greater than or equal to the actual angle value of the forward negative critical angle -a; the numerical value of the field of view angle is between -a and a, which means that the actual angle value of the field of view angle is less than the actual angle value of the forward positive critical angle a, or the actual angle value of the field of view angle is less than the actual angle value of the forward negative critical angle -a.
[0114] Optionally, b and -b can be used as the values of the two extreme angles. If the value of the field of view angle is greater than or equal to b, it is determined that the source of damage comes from above the field of view horizontal plane and is located behind the game character. At this time, the cone model can be displayed normally.
[0115] If the value of the field of view angle is less than or equal to -b, the damage source is determined to be from below the field of view horizontal plane and behind the game character. At this time, the cone model can be displayed normally.
[0116] If the value of the field of view angle is between -b and b, it means that the source of damage is behind the game character, and if the cone model is displayed directly at this time, it will appear to be a shape similar to a plane figure. Therefore, the adjacent value between the cone model and -b or b can be determined, and then the vertex position of the cone model is kept unchanged, and the cone model is rotated until the angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the determined adjacent value.
[0117] It should be understood that the numerical value of the field of view angle is greater than or equal to b, which means that the actual angle value of the field of view angle is greater than or equal to the actual angle value of the forward positive critical angle b; the numerical value of the field of view angle is less than or equal to -b, which means that the actual angle value of the field of view angle is greater than or equal to the actual angle value of the forward negative critical angle -b; the numerical value of the field of view angle is between -b and b, which means that the actual angle value of the field of view angle is less than the actual angle value of the forward positive critical angle b, or the actual angle value of the field of view angle is less than the actual angle value of the forward negative critical angle -b.
[0118] Optionally, in a specific embodiment, the method provided by the embodiments of the present application may further include: setting the vertex of the cone model to a first brightness value and setting the bottom surface of the cone model to a second brightness value, where the first brightness value is greater than the second brightness value.
[0119] Optionally, the first brightness value can render the vertex of the cone model in a highlighted state, and the second brightness value can set the bottom surface of the cone model to a dull state.
[0120] For details, please refer to Figure 1g , in a specific embodiment, by setting the light source at a position close to the vertex of the cone model and far from the bottom surface of the cone model, and keeping the relative position of the light source and the cone model fixed, the vertex of the cone model can be set to the first brightness value and the bottom surface of the cone model can be set to the second brightness value.
[0121] In another specific embodiment, the vertex of the cone model can also be set to the first brightness value and the bottom surface of the cone model can be set to the second brightness value by setting different brightness value textures for the vertex and the bottom surface of the cone model. It should be understood that the specific method of setting different brightness values for the vertex and the bottom surface of the cone model should not be construed as a limitation of the present application.
[0122] In the above embodiments, by setting the brightness of the vertex and the bottom surface of the cone model, it is easier for the user to distinguish the vertex and the bottom surface of the cone model, and further reduces the difficulty for the user to distinguish the direction pointed by the cone.
[0123] In the direction indication method provided by the embodiments of the present application, a first connection line between a cone model indicating the direction of the damage source and the game character can be obtained, and the included angle between the first connection line and the field of view of the game character can be calculated. If the included angle is less than the angle value of the critical included angle, the vertex of the cone model remains unchanged, and the cone model is rotated along the direction perpendicular to the horizontal plane of the field of view until the angle value of the included angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the angle value of the critical included angle. Then, the cone model that has completed the rotation action is displayed, so that the user can determine the direction of the damage source based on the cone model.
[0124] In this application, the critical angle is a preset angle. At this critical angle, the cone model enables the user to still relatively accurately and quickly distinguish the direction of the hit. However, if the viewing angle between the first connection line and the viewing horizontal plane is less than the critical angle, the presentation of the cone model on the display screen will be almost a planar figure, which is not conducive to the user easily distinguishing the direction of the hit. At this time, the vertex of the cone model can be maintained unchanged, and the entire cone model can be rotated around this vertex until the angle value of the angle between the central axis of the cone model and the viewing horizontal plane is equal to the angle value of the critical angle. At this time, while the vertex still indicates the direction of the hit, the presentation of the cone model on the display screen becomes easier to distinguish, thus improving the problem in the prior art that players cannot easily judge the direction of the hit.
[0125] The method described in the above embodiment will be further described in detail below.
[0126] In this embodiment, taking the cone model as a triangular pyramid model as an example, the method of the embodiment of this application will be described in detail.
[0127] As Figure 2 shown, the specific process of a direction indication method is as follows:
[0128] 201. In response to the game character being attacked by a damage source, generate a triangular pyramid model.
[0129] 202. Obtain the first connection line between the vertex of the triangular pyramid model and the corresponding position of the game character.
[0130] 203. Calculate the viewing angle between the first connection line and the viewing horizontal plane of the game character.
[0131] 204. If the first connection line is above the viewing horizontal plane and in front of the game character, compare the viewing angle with the forward positive critical angle a.
[0132] 205. If the viewing angle is less than the forward positive critical angle a, rotate the triangular pyramid model around the vertex of the triangular pyramid model in the direction close to the viewing horizontal plane until the angle value of the angle between the central axis of the triangular pyramid model and the viewing horizontal plane becomes the angle value of the forward positive critical angle a.
[0133] 206. If the first connection line is above the viewing horizontal plane and behind the game character, compare the viewing angle with the backward positive critical angle b.
[0134] 207. If the viewing angle is less than the backward positive critical angle b, rotate the triangular pyramid model around the vertex of the triangular pyramid model in the direction close to the viewing horizontal plane until the angle value of the angle between the central axis of the triangular pyramid model and the viewing horizontal plane becomes the angle value of the backward positive critical angle b.
[0135] 208. If the first connection line is below the visual field horizontal plane and in front of the game character, compare the visual field angle with the forward negative critical angle -a.
[0136] 209. If the visual field angle is less than the forward negative critical angle -a, rotate the triangular pyramid model centered on the vertex of the triangular pyramid model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis of the triangular pyramid model and the visual field horizontal plane becomes the angle value of the forward negative critical angle -a.
[0137] 210. If the first connection line is below the visual field horizontal plane and behind the game character, compare the visual field angle with the backward negative critical angle -b.
[0138] 211. If the visual field angle is less than the backward negative critical angle -b, rotate the triangular pyramid model centered on the vertex of the triangular pyramid model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis of the triangular pyramid model and the visual field horizontal plane becomes the angle value of the backward negative critical angle -b.
[0139] 212. Display the triangular pyramid model that has completed the rotation action.
[0140] 213. If the visual field angle exceeds the angle value of the critical angle, display the triangular pyramid model.
[0141] As can be seen from the above, the cone model under the critical angle enables the user to still distinguish the hit direction relatively accurately and quickly. If the visual field angle between the first connection line and the visual field horizontal plane is less than the critical angle, the presentation of the cone model on the display screen will be almost a planar graph, which is not conducive to the user easily distinguishing the hit direction. At this time, the vertex of the cone model can be kept unchanged, and the entire cone model can be rotated centered on this vertex until the angle value of the angle between the central axis of the cone model and the visual field horizontal plane is equal to the angle value of the critical angle. At this time, while the vertex still indicates the hit direction, the presentation of the cone model on the display screen becomes easier to distinguish, thus improving the problem that players in the prior art cannot easily judge the hit direction.
[0142] To better implement the above method, the embodiment of the present application also provides a direction indication device. The direction indication device can be specifically integrated in an electronic device, and the electronic device can be a terminal. Among them, the terminal can be a device such as a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer, etc.
[0143] For example, in this embodiment, taking the direction indication device being specifically integrated in the terminal as an example, the method of the embodiment of the present application will be described in detail.
[0144] For example, as Figure 3 shown, the direction indication device may include:
[0145] A cone generation unit 301, configured to generate a cone model in response to an attack on the game character from a damage source, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character;
[0146] A connection line acquisition unit 302, configured to acquire a first connection line between the vertex of the cone model and the corresponding position of the game character;
[0147] A field of view angle calculation unit 303, configured to calculate a field of view angle between the first connection line and the horizontal plane of the game character's field of view;
[0148] A model rotation unit 304, configured to, if the field of view angle is less than the angle value of a critical angle, rotate the cone model around the vertex of the cone model in a direction perpendicular to the horizontal plane of the field of view until the angle value of the angle between the central axis and the horizontal plane of the field of view is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model;
[0149] A model display unit 305, configured to display the rotated cone model on the graphical user interface.
[0150] In some embodiments, the corresponding position of the game character includes: a preset part on the game character, the corresponding position of the virtual weapon held by the game character, the current position of the virtual camera bound to the game character, or a position at a preset distance from the above positions.
[0151] In some embodiments, the apparatus further includes:
[0152] A second display unit, configured to display the cone model on the graphical user interface when the field of view angle exceeds the angle value of the critical angle.
[0153] In some embodiments, the model rotation unit 304 includes:
[0154] A positive critical angle comparison sub-unit, configured to compare the field of view angle with the positive critical angle when the first connection line is above the horizontal plane of the field of view;
[0155] A first rotation sub-unit, configured to rotate the cone model around the vertex of the cone model in a direction close to the horizontal plane of the field of view until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the positive critical angle when the field of view angle is less than the positive critical angle.
[0156] In some embodiments, the positive critical angle comparison sub-unit is specifically configured to compare the field of view angle with the forward positive critical angle when the first connection line is above the horizontal plane of the field of view and in front of the game character;
[0157] The first rotation sub-unit is specifically configured to, when the field of view angle is less than the forward positive critical angle, rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the forward positive critical angle.
[0158] In some embodiments, the positive critical angle comparison sub-unit is specifically configured to compare the field of view angle with the backward positive critical angle when the first connection line is above the horizontal plane of the field of view and behind the game character;
[0159] The first rotation sub-unit is specifically configured to, when the field of view angle is less than the backward positive critical angle, rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the backward positive critical angle.
[0160] In some embodiments, the model rotation unit 304 further includes:
[0161] The negative critical angle comparison sub-unit is configured to compare the field of view angle with the negative critical angle when the first connection line is below the horizontal plane of the field of view;
[0162] The second rotation sub-unit is configured to, when the field of view angle is less than the negative critical angle, rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the negative critical angle.
[0163] In some embodiments, the negative critical angle comparison sub-unit is specifically configured to compare the field of view angle with the forward negative critical angle when the first connection line is below the horizontal plane of the field of view and in front of the game character;
[0164] The second rotation sub-unit is specifically configured to, when the field of view angle is less than the forward negative critical angle, rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the forward negative critical angle.
[0165] In some embodiments, the negative critical angle comparison subunit is specifically configured to compare the field of view angle with the backward negative critical angle when the first connection line is below the horizontal plane of the field of view and behind the game character;
[0166] The second rotation subunit is specifically configured to rotate the cone model in a direction close to the horizontal plane of the field of view with the vertex of the cone model as the center until the angle value of the angle between the central axis and the horizontal plane of the field of view becomes the angle value of the backward negative critical angle when the field of view angle is less than the backward negative critical angle.
[0167] In some embodiments, the device further includes:
[0168] The brightness setting unit is configured to set the vertex of the cone model to a first brightness value and set the bottom surface of the cone model to a second brightness value, where the first brightness value is greater than the second brightness value.
[0169] In specific implementation, each of the above units can be implemented as an independent entity, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of each of the above units, reference can be made to the foregoing method embodiments, which will not be elaborated herein.
[0170] As can be seen from the above, the critical angle is a preset angle. The cone model at this critical angle enables the user to still distinguish the hit direction relatively accurately and quickly. If the field of view angle between the first connection line and the horizontal plane of the field of view is less than the critical angle, the presentation of the cone model on the display screen will be almost a planar graph, which is not conducive to the user to easily distinguish the hit direction. At this time, the vertex of the cone model can be maintained unchanged, and the entire cone model can be rotated with this vertex as the center until the angle value of the angle between the central axis of the cone model and the horizontal plane of the field of view is equal to the angle value of the critical angle. At this time, while the vertex still indicates the hit direction, the presentation of the cone model on the display screen becomes easier to distinguish, thus improving the problem that players in the prior art cannot easily judge the hit direction.
[0171] The embodiment of the present application further provides an electronic device, which can be a device such as a terminal or a server. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers, etc.
[0172] In some embodiments, the direction indication device can also be integrated in multiple electronic devices. For example, the direction indication device can be integrated in multiple servers, and multiple servers are used to implement the direction indication method of the present application.
[0173] In this embodiment, the electronic device in this embodiment will be taken as an example for detailed description. For example, as Figure 4 shown, it shows a schematic structural diagram of the electronic device involved in the embodiment of the present application. Specifically:
[0174] The electronic device may include a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input module 404, a communication module 405, and other components. Those skilled in the art can understand that Figure 4 the structure of the electronic device shown in
[0175] does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Among them:
[0176] The processor 401 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 401.
[0176] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.); the data storage area can store data created according to the use of the electronic device. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0177] The electronic device further includes a power source 403 for supplying power to each component. In some embodiments, the power source 403 may be logically connected to the processor 401 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power source 403 may further include any components such as one or more DC or AC power sources, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0178] The electronic device may further include an input module 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0179] The electronic device may further include a communication module 405. In some embodiments, the communication module 405 may include a wireless module. The electronic device can perform short-range wireless transmission through the wireless module of the communication module 405, thereby providing users with wireless broadband Internet access. For example, the communication module 405 can be used to help users send and receive emails, browse web pages, and access streaming media, etc.
[0180] Although not shown, the electronic device may further include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:
[0181] In response to the game character being attacked by a damage source, generate a cone model, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character; obtain the first connection line between the vertex of the cone model and the corresponding position of the game character; calculate the viewing angle between the first connection line and the viewing horizontal plane of the game character; if the viewing angle is less than the angle value of the critical angle, then with the vertex of the cone model as the center, rotate the cone model in a direction perpendicular to the viewing horizontal plane until the angle value of the angle between the central axis and the viewing horizontal plane is equal to the angle value of the critical angle, so as to adjust the direction of the cone model and display the rotated cone model on the graphical user interface. The specific implementation of each of the above operations can refer to the previous embodiments and will not be elaborated here.
[0182] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0183] For this reason, an embodiment of the present application provides a computer-readable storage medium, in which multiple instructions are stored. The instructions can be loaded by a processor to execute the steps in any of the direction indication methods provided by the embodiments of the present application. For example, the instructions can execute the following steps:
[0184] In response to the game character being attacked by a damage source, generate a cone model, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character; obtain a first connection line between the vertex of the cone model and the corresponding position of the game character; calculate the viewing angle between the first connection line and the viewing horizontal plane of the game character; if the viewing angle is less than the angle value of the critical angle, then with the vertex of the cone model as the center, rotate the cone model in a direction perpendicular to the viewing horizontal plane until the angle value of the angle between the central axis and the viewing horizontal plane is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model and display the rotated cone model on the graphical user interface.
[0185] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0186] According to one aspect of the present application, there is provided a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementation manners provided in the above embodiments.
[0187] Since the instructions stored in the storage medium can execute the steps in any of the direction indication methods provided by the embodiments of the present application, the beneficial effects that can be achieved by any of the direction indication methods provided by the embodiments of the present application can be realized. For details, please refer to the previous embodiments and will not be elaborated here.
[0188] The above has introduced in detail a direction indication method, device, electronic device, and computer-readable storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A direction indication method, characterized in that, Provide a graphical user interface through a terminal device, where the content displayed in the graphical user interface at least includes a game character controlled and operated through the terminal device. The method includes: In response to the game character being attacked by a damage source, generate a cone model, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex of the cone model and the bottom surface of the cone model is the same as the direction from the position where the damage source is located to the corresponding position of the game character; the central axis is the perpendicular line from the vertex of the cone model to the bottom surface of the cone model; Obtain the first connection line between the vertex of the cone model and the corresponding position of the game character; Calculate the viewing angle between the first connection line and the viewing horizontal plane of the game character; the viewing horizontal plane is a horizontal plane at the same height as the viewpoint, and the viewpoint is set during the rendering of the game scene; If the viewing angle is less than the angle value of the critical angle, rotate the cone model around the vertex of the cone model in a direction perpendicular to the viewing horizontal plane until the angle value of the angle between the central axis and the viewing horizontal plane is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model; Display the rotated cone model on the graphical user interface.
2. The method according to claim 1, characterized in that, The corresponding position of the game character includes: a preset part on the game character, the corresponding position of the virtual weapon held by the game character, the current position of the virtual camera bound to the game character, or a position at a preset distance from the preset part, the corresponding position of the virtual weapon, or the current position of the virtual camera.
3. The method according to claim 1, characterized in that, After calculating the viewing angle between the first connection line and the viewing horizontal plane of the game character, the method further includes: If the viewing angle exceeds the angle value of the critical angle, display the cone model on the graphical user interface.
4. The method according to claim 1, characterized in that, The critical angle includes a positive critical angle, and the positive critical angle is the angle between the critical line above the viewing horizontal plane and the viewing horizontal plane; The step of if the viewing angle is less than the angle value of the critical angle, then rotate the cone model around the vertex of the cone model in a direction perpendicular to the viewing horizontal plane until the angle value of the angle between the central axis and the viewing horizontal plane is equal to the angle value of the critical angle includes: If the first connection line is above the viewing horizontal plane, compare the viewing angle with the positive critical angle; If the viewing angle is less than the positive critical angle, rotate the cone model around the vertex of the cone model in a direction close to the viewing horizontal plane until the angle value of the angle between the central axis and the viewing horizontal plane becomes the angle value of the positive critical angle.
5. The method according to claim 4, characterized in that The positive critical angle includes a forward positive critical angle, and the forward positive critical angle is used to compare with the viewing angle when the damage source is in the upper front of the game character; The step of if the first connection line is above the viewing horizontal plane, then compare the viewing angle with the positive critical angle includes: If the first connection line is above the visual field horizontal plane and in front of the game character, compare the visual field angle with the forward positive critical angle; If the visual field angle is less than the positive critical angle, with the vertex of the cone model as the center, rotate the cone model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the forward positive critical angle, including: If the visual field angle is less than the forward positive critical angle, with the vertex of the cone model as the center, rotate the cone model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the forward positive critical angle.
6. The method according to claim 4, wherein The positive critical angle includes a backward positive critical angle, which is used to compare with the visual field angle when the source of damage is above and behind the game character; If the first connection line is above the visual field horizontal plane, comparing the visual field angle with the positive critical angle includes: If the first connection line is above the visual field horizontal plane and behind the game character, compare the visual field angle with the backward positive critical angle; If the visual field angle is less than the positive critical angle, with the vertex of the cone model as the center, rotate the cone model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the positive critical angle, including: If the visual field angle is less than the backward positive critical angle, with the vertex of the cone model as the center, rotate the cone model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the backward positive critical angle.
7. The method according to claim 1, wherein The critical angle includes a negative critical angle, which is the angle between the critical line below the visual field horizontal plane and the visual field horizontal plane; If the visual field angle is less than the angle value of the critical angle, with the vertex of the cone model as the center, rotate the cone model in the direction perpendicular to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane is equal to the angle value of the critical angle, and also includes: If the first connection line is below the visual field horizontal plane, compare the visual field angle with the negative critical angle; If the visual field angle is less than the negative critical angle, with the vertex of the cone model as the center, rotate the cone model in the direction close to the visual field horizontal plane until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the negative critical angle.
8. The method according to claim 7, wherein The negative critical angle includes a forward negative critical angle, which is used to compare with the visual field angle when the source of damage is below and in front of the game character; If the first connection line is below the visual field horizontal plane, comparing the visual field angle with the negative critical angle includes: If the first connection line is below the visual field horizontal plane and in front of the game character, compare the visual field angle with the forward negative critical angle; If the visual field angle is less than the negative critical angle, rotate the cone model in a direction close to the visual field horizontal plane with the vertex of the cone model as the center until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the negative critical angle, including: If the visual field angle is less than the forward negative critical angle, rotate the cone model in a direction close to the visual field horizontal plane with the vertex of the cone model as the center until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the forward negative critical angle.
9. The method according to claim 7, characterized in that The negative critical angle includes a backward negative critical angle, which is used to compare with the visual field angle when the source of damage is at the lower rear of the game character; If the first connection line is below the visual field horizontal plane, compare the visual field angle with the negative critical angle, including: If the first connection line is below the visual field horizontal plane and behind the game character, compare the visual field angle with the backward negative critical angle; If the visual field angle is less than the negative critical angle, rotate the cone model in a direction close to the visual field horizontal plane with the vertex of the cone model as the center until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the negative critical angle, including: If the visual field angle is less than the backward negative critical angle, rotate the cone model in a direction close to the visual field horizontal plane with the vertex of the cone model as the center until the angle value of the angle between the central axis and the visual field horizontal plane becomes the angle value of the backward negative critical angle.
10. The method according to claim 1, wherein, The method further includes: Set the vertex of the cone model to a first brightness value and the bottom surface of the cone model to a second brightness value, where the first brightness value is greater than the second brightness value.
11. A direction indicating device, characterized in that, Provide a graphical user interface through a terminal device, and the content displayed in the graphical user interface at least includes a game character controlled by the terminal device. The device includes: A cone generation unit, configured to generate a cone model in response to the game character being attacked by a damage source, where the cone model is used to indicate the direction of the damage source, and the direction of the central axis between the vertex and the bottom surface of the cone model is the same as the direction from the position of the damage source to the corresponding position of the game character; the central axis is the perpendicular line from the vertex of the cone model to the bottom surface of the cone model; A connection line acquisition unit, configured to acquire a first connection line between the vertex of the cone model and the corresponding position of the game character; A visual field angle calculation unit, configured to calculate the visual field angle between the first connection line and the visual field horizontal plane of the game character; the visual field horizontal plane is a horizontal plane at the same height as the viewpoint, and the viewpoint is set during the rendering of the game scene. A model rotation unit, configured to rotate the cone model around the vertex of the cone model in a direction perpendicular to the visual field horizontal plane until the angle value between the central axis and the visual field horizontal plane is equal to the angle value of the critical angle, so as to adjust the direction indication of the cone model, if the angle value of the visual field angle is less than the angle value of the critical angle. A model display unit, configured to display the cone model that has completed the rotation action on the graphical user interface.
12. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores multiple instructions; the processor loads the instructions from the memory to execute the steps in the direction indication method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by the processor to execute the steps in the direction indication method according to any one of claims 1 to 10.
Citation Information
Patent Citations
automatic envelope making machine
FR1130910A
Game machine, program for realizing game machine, and method of displaying objects in game
US20100267451A1