CN112221131B - Visual angle switching method and device and computer readable storage medium - Google Patents

Visual angle switching method and device and computer readable storage medium Download PDF

Info

Publication number
CN112221131B
CN112221131B CN202011094226.4A CN202011094226A CN112221131B CN 112221131 B CN112221131 B CN 112221131B CN 202011094226 A CN202011094226 A CN 202011094226A CN 112221131 B CN112221131 B CN 112221131B
Authority
CN
China
Prior art keywords
view
value
angle
visual angle
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011094226.4A
Other languages
Chinese (zh)
Other versions
CN112221131A (en
Inventor
董君楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011094226.4A priority Critical patent/CN112221131B/en
Publication of CN112221131A publication Critical patent/CN112221131A/en
Application granted granted Critical
Publication of CN112221131B publication Critical patent/CN112221131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention discloses a method and a device for switching visual angles and a computer readable storage medium; after a game picture under a current visual angle is displayed, the current visual angle comprises an object visual angle and a scene visual angle, the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle, visual angle parameters of the current visual angle are acquired in response to visual angle switching operation aiming at the visual angle switching control, switching types of visual angle switching operation are determined according to the visual angle parameters, the object visual angle and the scene visual angle are adjusted based on the switching types, a target visual angle is obtained, and a target game picture under the target visual angle is switched and displayed.

Description

Visual angle switching method and device and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for switching a view angle, and a computer-readable storage medium.
Background
In a shooting-type game, a player needs to adjust the field of view of the game to obtain a better shooting experience. For example, the adjustment of the game view by opening or closing the sighting telescope and switching the mechanical sighting can be regarded as switching the angle of view of the camera for capturing the game screen. The conventional view angle switching method is to directly adjust the view angle of the camera to switch the view angle.
In the process of research and practice of the prior art, the inventor of the present invention finds that, because the virtual object and the virtual scene are included under the view angle of the camera and the virtual object and the virtual scene are in the same view angle, the display ranges of the virtual scene and the virtual object in the switched view angle are not flexible enough, and therefore, the display effect of the picture after the view angle is switched is reduced.
Disclosure of Invention
The embodiment of the invention provides a method and a device for switching visual angles and a computer readable storage medium, which can improve the image display effect after the visual angles are switched.
A method of view switching, comprising:
displaying a game picture under a current visual angle, wherein the current visual angle comprises an object visual angle and a scene visual angle, and the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle;
responding to the visual angle switching operation aiming at the visual angle switching control, and acquiring the visual angle parameter of the current visual angle;
determining the switching type of the visual angle switching operation according to the visual angle parameters;
based on the switching type, the object visual angle and the scene visual angle are adjusted to obtain a target visual angle;
and switching and displaying the target game picture under the target visual angle.
Accordingly, an embodiment of the present invention provides a device for switching viewing angles, including:
the game device comprises a display unit, a processing unit and a processing unit, wherein the display unit is used for displaying a game picture under a current visual angle, the current visual angle comprises an object visual angle and a scene visual angle, and the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle;
the acquisition unit is used for responding to the visual angle switching operation aiming at the visual angle switching control and acquiring the visual angle parameter of the current visual angle;
the determining unit is used for determining the switching type of the visual angle switching operation according to the visual angle parameter;
the adjusting unit is used for adjusting the object visual angle and the scene visual angle based on the switching type to obtain a target visual angle;
and the switching unit is used for switching and displaying the target game picture under the target visual angle.
Optionally, in some embodiments, the adjusting unit may be specifically configured to screen out, from the view parameter, a first view value of the object view and a second view value of the scene view; and adjusting the first view angle value and the second view angle value based on the switching type to obtain a target view angle.
Optionally, in some embodiments, the adjusting unit may be specifically configured to determine, based on the switching type, an adjustment type and a target view value for adjusting the first view value and the second view value; and adjusting the first view angle value and the second view angle value to the target view angle value according to the adjustment type to obtain the target view angle.
Optionally, in some embodiments, the adjusting unit may be specifically configured to add the first view value and the second view value to the target view value to obtain the target view when the adjustment type is view increase adjustment; and when the adjustment type is view reduction adjustment, reducing the first view value and the second view value to the target view value to obtain the target view.
Optionally, in some embodiments, the adjusting unit may be specifically configured to compare the first viewing angle value with the second viewing angle value; when the first visual angle value and the second visual angle value are the same, adding the first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle; when the first perspective value and the second perspective value are different, calculating a first perspective difference value between the first perspective value and the second perspective value, and adding the first perspective value and the second perspective value to the target perspective value based on the first perspective difference value to obtain the target perspective.
Optionally, in some embodiments, the adjusting unit may be specifically configured to, when the first angle of view value exceeds a second angle of view value, adjust the second angle of view value to be the same as the first angle of view value based on the first angle of view difference value, and add the adjusted second angle of view value and the first angle of view value to the target angle of view value to obtain the target angle of view; when the first visual angle value does not exceed a second visual angle value, based on the first visual angle difference value, adjusting the first visual angle value to be the same as the second visual angle value, and adding the adjusted first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle.
Optionally, in some embodiments, the adjusting unit may be specifically configured to determine, according to the first viewing angle difference, an adjusting speed for adjusting the second viewing angle value; adjusting the second view angle value based on the adjustment speed, so that the adjusted second view angle value is the same as the first view angle value; and adding the adjusted second visual angle value and the adjusted first visual angle value to the target visual angle value to obtain the target visual angle.
Optionally, in some embodiments, the adjusting unit may be specifically configured to calculate a second viewing angle difference value between the first viewing angle value and the target viewing angle value; determining an increasing speed of increasing the adjusted second view angle value and the first view angle value to the target view angle value according to the second view angle difference value; and adding the adjusted second visual angle value and the first visual angle value to the target visual angle value based on the increasing speed to obtain the target visual angle.
Optionally, in some embodiments, the adjusting unit may be specifically configured to compare the first viewing angle value with the second viewing angle value; when the first visual angle value and the second visual angle value are the same, reducing the first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle; and when the first view angle value is different from the second view angle value, calculating a third view angle difference value between the first view angle value and the second view angle value, and reducing the first view angle value and the second view angle value to the target view angle value based on the third view angle difference value to obtain the target view angle.
Optionally, in some embodiments, the switching unit may be specifically configured to collect a virtual object and a virtual scene at the target view angle to obtain a target game picture; and switching the game picture into the target game picture.
Optionally, in some embodiments, the determining unit may be specifically configured to acquire a preset view parameter threshold for determining a switching type; comparing the view angle parameter with the preset view angle parameter threshold value; when the view angle parameter exceeds the preset view angle parameter threshold value, determining that the switching type of the view angle switching operation is reduced view angle switching, and switching the reduced view angle to a view angle smaller than the current view angle; and when the view angle parameter does not exceed the preset view angle parameter threshold value, determining that the switching type of the view angle switching operation is increased view angle switching, and switching the current view angle to a view angle larger than the current view angle by the increased view angle switching.
Optionally, in some embodiments, the obtaining unit may be specifically configured to obtain an initial perspective parameter of the current perspective and a game engine type corresponding to the game screen; when the game engine type is the same as a preset game engine type, taking the initial view angle parameter as the view angle parameter of the current view angle; and when the game engine type is different from the preset game engine type, converting the initial view angle parameter into a target view angle parameter corresponding to the preset game engine type, and taking the target view angle parameter as the view angle parameter of the current view angle.
In addition, an electronic device is further provided in an embodiment of the present invention, and includes a processor and a memory, where the memory stores an application program, and the processor is configured to run the application program in the memory to implement the method for switching views provided in the embodiment of the present invention.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where multiple instructions are stored in the computer-readable storage medium, and the instructions are suitable for being loaded by a processor to perform any one of the steps in the method for switching a view angle provided in the embodiment of the present invention.
After the game picture under the current visual angle is displayed, the current visual angle comprises an object visual angle and a scene visual angle, the game picture comprises a visual angle switching control, a virtual object collected under the object visual angle and a virtual scene collected under the scene visual angle, the visual angle parameter of the current visual angle is obtained in response to the visual angle switching operation aiming at the visual angle switching control, the switching type of the visual angle switching operation is determined according to the visual angle parameter, the object visual angle and the scene visual angle are adjusted based on the switching type to obtain a target visual angle, and the target game picture under the target visual angle is switched and displayed, because the scheme collects the virtual object and the virtual scene through the object visual angle and the scene visual angle provided by different cameras, the virtual object and the virtual scene are in pictures corresponding to different visual angles, and the object visual angle and the scene are respectively adjusted when the visual angle is switched, therefore, the flexibility of the display range of the virtual scene and the virtual object after the visual angle is switched is greatly improved, and the display effect of the picture after the visual angle is switched can be greatly improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
Fig. 1 is a scene schematic diagram of a view switching method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for switching a viewing angle according to an embodiment of the present invention;
FIG. 3 is a schematic view of a current viewing angle in a game screen according to an embodiment of the present invention;
FIG. 4 is a diagram of a game screen provided by an embodiment of the invention;
fig. 5 is another schematic flow chart of a method for switching a viewing angle according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of opening or closing the mirror according to the embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating a game screen change corresponding to a mirror-off operation according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a viewing angle switching apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a method and a device for switching visual angles and a computer readable storage medium. The viewing angle switching device may be integrated in an electronic device, and the electronic device may be a server or a terminal.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Network acceleration service (CDN), big data and an artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
For example, referring to fig. 1, taking an example that the viewing angle switching device is integrated in the electronic device, the electronic device displays a game picture at a current viewing angle, where the current viewing angle includes an object viewing angle and a scene viewing angle, the game picture includes a viewing angle switching control, a virtual object acquired at the object viewing angle and a virtual scene acquired at the scene viewing angle, and in response to a viewing angle switching operation for the viewing angle switching control, a viewing angle parameter of the current viewing angle is acquired, then a switching type of the viewing angle switching operation is determined according to the viewing angle parameter, and then the object viewing angle and the scene viewing angle are adjusted based on the switching type, so as to obtain a target viewing angle, and a target game picture at the target viewing angle is switched and displayed.
The game screen may be a game screen corresponding to a shooting game, and the shooting game may include all games that use hot weapons to perform remote attacks, such as a First-person shooting game (FPS) and a third-person shooting game.
The field of view (FOV) is also commonly referred to as an angular field of view (anglioview), and mainly refers to an angular range in which a camera can receive images in a general environment. In an optical instrument, a lens of the optical instrument is used as a vertex, an included angle is formed by two edges of the maximum range through which an object image of a measured object can pass through the lens, and the visual angle can be called as a visual angle. The size of the field angle determines the field range of the optical instrument, and the larger the field angle, the larger the field of view, and the smaller the optical magnification. In colloquial terms, the object is not captured in the lens beyond this angle, meaning that the object is not present in the field of view.
The visual angle switching can be understood as changing the visual angle, for example, in a shooting game, the sighting telescope is opened and closed, when the sighting telescope is opened, the visual angle needs to be changed from large to small, so that the sighting telescope can be more clearly focused on other players needing to be attacked, after the attacking is completed, the sighting telescope needs to be closed, at the moment, the visual angle needs to be changed from small to large, so that the surrounding environment can be more accurately seen, and the sighting telescope is used for defending or avoiding the attack of other players and the like.
Wherein, in response to the condition or state indicating that the executed operation depends on, when the dependent condition or state is satisfied, the executed operation or operations may be in real time or may have a set delay; there is no restriction on the order of execution of the operations performed unless otherwise specified.
The following are detailed descriptions. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
In this embodiment, a description will be given of a perspective switching device, which may be specifically integrated in an electronic device, where the electronic device may be a server or a terminal; the terminal may include a tablet Computer, a notebook Computer, a Personal Computer (PC), a wearable device, a virtual reality device, or other smart devices capable of switching viewing angles.
A method of view switching, comprising:
displaying a game picture under a current visual angle, wherein the current visual angle comprises an object visual angle and a scene visual angle, the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle, responding to the visual angle switching operation aiming at the visual angle switching control, acquiring the visual angle parameter of the current visual angle, determining the switching type of the visual angle switching operation according to the visual angle parameter, adjusting the object visual angle and the scene visual angle based on the switching type, obtaining a target visual angle, and switching and displaying the target game picture under the target visual angle.
As shown in fig. 2, the specific flow of the method for switching the viewing angle is as follows:
101. and displaying the game picture at the current visual angle.
The current view angle may include an object view angle and a scene view angle, and therefore, a game picture at the current view angle is mainly formed by acquiring a virtual object and a virtual scene through the object view angle and the scene view angle by using two different cameras, as shown in fig. 3.
The game screen includes a view switching control, a virtual object collected from an object view, and a virtual scene collected from a scene view, for example, taking a game as a shooting game as an example, the game screen may be as shown in fig. 4, and includes a virtual object 41, a virtual scene 42, and a view switching control 43.
The object view angle may be a view angle for capturing a virtual object by a first camera mounted behind a single character object of a player, the object view angle is mainly used for capturing a virtual object in a game picture, and after the first camera captures the virtual object through the object view angle, an image of the captured virtual object may be displayed in the game picture, wherein, as shown in fig. 4, the virtual object 41 may be a partial or whole object of the character object of the player and a selected gun. The scene view angle may be a view angle used for capturing a virtual scene by a second camera mounted behind a single character of a player, and the scene view angle is mainly used for capturing the virtual scene in a game picture, and when the second camera completes capturing the virtual scene through the scene view angle, an image of the captured virtual scene may be displayed in the game picture, where, as shown in fig. 4, the virtual scene 42 may be a scene other than a player character object and a selected firearm in the game picture, and the virtual scene may include an external environment, a building, a vehicle, other player objects, and the like.
For example, the player may operate a user operation page of the game client to trigger the game client to display the game screen at the current viewing angle, for example, the player may trigger the game screen at the current viewing angle to display by operating a login page of the game client. Where the login page may include entry controls for the player's account number and password, and login controls. A player inputs an account and a password through an input control, then a login control is triggered, at the moment, a player setting page can be displayed at a game client side, the player setting page can comprise a player character selection control, a firearm selection control, a game map selection control and a game starting control, each game map corresponds to a game virtual scene, and after the player selects a player character, a firearm and a game map, the game starting control is triggered, and a game picture at the current view angle can be displayed at the game client side.
102. And responding to the visual angle switching operation aiming at the visual angle switching control, and acquiring the visual angle parameter of the current visual angle.
The view angle parameter may include view angle values of an object view and a scene view angle in the game picture at the current view angle, and may also be understood as a FOV value of the object view and the scene view angle in the game picture at the current time, that is, a value of the field angle.
For example, when a player needs to open or close a sighting telescope or switch a mechanical sighting telescope during a game, at this time, a current viewing angle in a game picture needs to be switched, and at this time, the player can perform a viewing angle switching operation on the current viewing angle by triggering a viewing angle switching control. And responding to the switching operation aiming at the visual angle switching control, acquiring the visual angle values of the object visual angle and the scene visual angle in the game picture under the current visual angle and the game engine type corresponding to the game picture, and taking the visual angle values of the object visual angle and the scene visual angle as the initial visual angle parameters of the current visual angle. The game engine refers to a core component of some written editable computer game systems or some interactive real-time image application programs. These systems provide game designers with the various tools required to compose games, with the goal of allowing game designers to easily and quickly program games without starting from zero. Most support various operating platforms, such as Linux, Mac OS X, microsoft Windows. The game engine comprises the following systems: rendering engines (i.e., "renderers," including two-dimensional and three-dimensional graphics engines), physics engines, collision detection systems, sound effects, scripting engines, computer animation, artificial intelligence, network engines, and scene management.
Comparing the game engine type corresponding to the obtained game page with a preset engine type, and when the game engine type is the same as the preset game engine type, taking the initial view angle parameter as the view angle parameter of the current view angle, for example, taking the type of the preset game engine as a nonreal (a game engine) as an example, and when the type of the game engine corresponding to the game picture is also nonreal, at this time, the initial view angle parameter can be directly taken as the view angle parameter of the current view angle. When the game engine type is different from the preset game engine type, the initial view angle parameter is converted into a target view angle parameter corresponding to the preset game engine type, for example, also taking the preset game engine type as unity, when the game engine type corresponding to the game picture is unity (another game engine), at this time, the game engine type corresponding to the game picture is different from the preset game engine type, the initial view angle parameter under unity needs to be converted into the target view angle parameter under unity, and the converted target view angle parameter can be used as the view angle parameter of the current view angle. The specific conversion formula can be shown as formula (1), and specifically can be as follows:
Figure BDA0002723146810000091
wherein x is an initial view parameter in unity, and y is a target view parameter in unity.
103. And determining the switching type of the visual angle switching operation according to the visual angle parameters.
Here, the switching type may be understood as a type of changing the current view, for example, the view parameter of the current view may be changed from small to large or from small to large, and thus, the switching type may include increasing view switching and decreasing view switching. The increasing of the view angle switching may be to switch the current view angle to a view angle larger than the current view angle, and the decreasing of the view angle switching may be to switch the current view angle to a view angle smaller than the current view angle, for example, taking switching of the view angle as turning on or turning off the scope, the switching type corresponding to the change of the view angle parameter of the current view angle from small to large may be to turn off the scope, and conversely, the switching type corresponding to the change of the view angle parameter of the current view angle from large to small may be to turn on the scope.
For example, a preset view parameter threshold for determining the switching type may be obtained, for example, the preset view parameter threshold may include a preset object view threshold and a preset scene view threshold. The view angle parameter of the current view angle is compared with a preset view angle parameter threshold, for example, an object view angle value and a scene view angle value can be extracted from the view angle parameter, the object view angle value is compared with the preset object view angle threshold, and the scene view angle value is compared with the preset scene view angle threshold.
When the view angle parameter exceeds the preset view angle parameter threshold, determining that the switching type of the view angle switching operation is reduced view angle switching, for example, when any one of the object view angle value and the scene view angle value exceeds the corresponding preset view angle parameter threshold, for example, when the object view angle value exceeds the preset object view angle threshold and the scene view angle value also exceeds the preset scene view angle threshold, determining reduced view angle switching of the switching type of the view angle switching operation; or, when the object view value exceeds the preset object view value and the scene view value does not exceed the preset scene view threshold, the switching type of the view switching operation may be determined to be reduced view switching; alternatively, when the object view value does not exceed the preset object view value and the scene view value exceeds the preset scene view threshold, the switching type of the view switching operation may also be determined to be reduced view switching.
When the view angle parameter does not exceed the preset view angle parameter threshold, it is determined that the switching type of the view angle switching operation is switching of the increased view angle, for example, when the object view angle value does not exceed the preset object view angle threshold and the scene view angle value does not exceed the preset scene view angle threshold, at this time, it may be determined that the switching type of the view angle switching operation is switching of the increased view angle.
104. And adjusting the object visual angle and the scene visual angle based on the switching type to obtain the target visual angle.
The adjustment of the object view angle and the scene view angle may be understood as changing view angle values of the object view angle and the scene view angle, that is, changing FOV values of the object view angle and the scene view angle.
For example, a first view value of an object view and a second view value of a scene view may be screened from the view parameters, and the first view value and the second view value may be adjusted based on the switching type to obtain a target view, which may specifically be as follows:
and S1, screening out a first view angle value of the object view angle and a second view angle value of the scene view angle from the view angle parameters.
For example, a first view angle value of the object view angle and a second view angle value of the scene view angle are screened out from the view angle parameters, for example, the object view angle value of the object view angle and the scene view angle value of the scene view angle may be screened out from the view angle parameters, and the object view angle value and the scene view angle value may be respectively used as the first view angle value and the second view angle value.
And S2, adjusting the first visual angle value and the second visual angle value based on the switching type to obtain a target visual angle value.
For example, an adjustment type for adjusting the first view value and the second view value and the target view value may be determined based on the switching type, wherein the adjustment type may be a view increasing adjustment and a view decreasing adjustment. For example, when the switching type is switching to increase the angle of view, it may be determined that the adjustment type for adjusting the first angle of view value and the second angle of view value is adjustment to increase the angle of view, and conversely, when the switching type is switching to decrease the angle of view, it may be determined that the adjustment type for adjusting the first angle of view value and the second angle of view value is adjustment to decrease the angle of view. And screening out a target view angle value which needs to be adjusted according to the first view angle value and the second view angle value from the game view angle data set according to the switching type, wherein the target view angle value can comprise a target view angle value of an object view angle and a target view angle value of a scene view angle, and the target view angle value of the object view angle and the target view angle value of the scene view angle can be the same or different.
And adjusting the first view angle value and the second view angle value to a target view angle value according to the adjustment type to obtain a target view angle. The adjustment types may include a viewing angle increase adjustment and a viewing angle decrease adjustment, which are specifically described below:
and C1, when the adjustment type is the visual angle increasing adjustment, adding the first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle.
For example, when the adjustment type is view increase adjustment, the first view value and the second view value are compared, when the first view value and the second view value are the same, the first view value and the second view value can be directly added to the target view value to obtain the target view value, the view corresponding to the target view value is used as the target view, for example, when the target view value is 90, the first view value and the second view value are 35, the first view value and the second view value can be increased from 35 to 90 by using a constant speed or a non-constant speed to obtain the target view.
When the first view angle value and the second view angle value are different, a first view angle difference value between the first view angle value and the second view angle value is calculated, then, based on the first view angle difference value, the first view angle value and the second view angle value are added to a target view angle value, for example, when the first view angle value exceeds the second view angle value, based on the first view angle value, the first view angle value is adjusted to be the same as the first view angle value, and the adjusted second view angle value and the first view angle value are added to the target view angle value. Adding the adjusted second view angle value and the adjusted first view angle value to the target view angle value to obtain the target view angle, for example, calculating a second view angle difference between the first view angle value and the target view angle value, determining an increase speed of adding the adjusted second view angle value and the adjusted first view angle value to the target view angle value according to the second view angle value, and adding the adjusted second view angle value and the adjusted first view angle value to the target view angle value based on the increase speed to obtain the target view angle.
Optionally, when the first viewing angle value does not exceed the second viewing angle value, at this time, the first viewing angle value is adjusted to be equal to the second viewing angle value only by using the same method, and then the adjusted first viewing angle value and second viewing angle value are added to the target viewing angle value together, so that the target viewing angle can be obtained. The adjustment speed and the increase speed are also determined by using the difference between the first viewing angle value and the second viewing angle and the difference between the second viewing angle value and the target viewing angle value, in the same manner as the above method.
Wherein, in case that the first and second viewing angle values are different, the first and second viewing angle values are added to the target viewing angle, to illustrate a specific example, for example, taking the first viewing angle value 35, the second viewing angle value 45, and the target viewing angle value 75 as examples, the difference between the first viewing angle value and the second viewing angle value is first calculated to be 10, then, based on the difference 10, an adjustment speed for adjusting the first viewing angle value to 45, which may be a constant speed or a variable speed, then, the first viewing angle value is adjusted to 45 according to the adjustment speed, then, the difference value between the second viewing angle value and the target viewing angle value is calculated to be 30, and it is determined that the adjusted first viewing angle value 45 and the first viewing angle value 45 are simultaneously increased to 75 according to the difference value 30, at this time, the viewing angle corresponding to the first viewing angle value and the second viewing angle value, which are both 75, may be taken as the target viewing angle.
And C2, when the adjustment type is view angle reduction adjustment, reducing the first view angle value and the second view angle value to the target view angle value to obtain the target view angle.
For example, when the adjustment type is viewing angle reduction adjustment, the first viewing angle value and the second viewing angle value are compared, and when the first viewing angle value and the second viewing angle value are the same, the first viewing angle value and the second viewing angle value are reduced to the target viewing angle value, for example, when the first viewing angle value and the second viewing angle value are both 75 and the target viewing angle value is 35, the first viewing angle value and the second viewing angle value are directly reduced to 35 at a constant speed or a variable speed, and the viewing angle corresponding to the first viewing angle value and the second viewing angle value with the viewing angle value of 35 is taken as the target viewing angle. The speed of change for reducing the first and second view angle values to 35 may be determined from the difference between the first or second view angle value and the target view angle value.
Alternatively, when the first view angle value and the second view angle value are different, a third view angle difference value between the first view angle value and the second view angle value may be calculated, and then, the first view angle value and the second view angle value may be reduced to the target view angle value based on the third view angle difference value, for example, when the first view angle value exceeds the second view angle value, a first reduction speed at which the first view angle value is reduced to the second view angle value may be determined according to the third view angle difference value, and then, the first view angle value may be reduced to the second view angle value at the first reduction speed. And continuously calculating a fourth visual angle difference value of the first visual angle value and the target visual angle value, determining a second reduction speed for reducing the first visual angle value and the reduced second visual angle value to the target visual angle value according to the fourth visual angle difference value, then continuously adopting the second reduction speed, reducing the first visual angle value and the reduced second visual angle value to the target visual angle value, and taking the visual angle corresponding to the first visual angle value and the second visual angle value reduced to the target visual angle value as the target visual angle, thereby obtaining the target visual angle.
When the first view angle value does not exceed the second view angle value, the method may be adopted to reduce the second view angle value to the first view angle value, and then reduce the first view angle value and the reduced second view angle value together to the target view angle value, and the reduction speeds of the two times may be determined based on the third view angle difference and the fourth view angle difference, respectively.
The first reduction speed and the second reduction speed may be the same or different, and the first reduction speed and the second reduction speed may be constant or variable.
105. And switching and displaying the target game picture under the target visual angle.
For example, the virtual object and the virtual scene at the target view angle may be collected to obtain the target game picture, for example, the target virtual object at the object view angle adjusted to the target view angle value may be collected by the first camera, the target virtual scene at the scene object view angle adjusted to the target view angle value may be collected by the second camera, the virtual object in the game picture may be replaced by the target virtual object, and the virtual scene in the game picture may be replaced by the target virtual object, so that the target game picture at the target view angle may be obtained. And switching the game picture to a target game picture, for example, switching the game picture displayed on the game client under the current visual angle to the target game picture under the target visual angle, thereby completing the visual angle switching in the game picture.
As can be seen from the above, in the embodiments of the present invention, after a game picture at a current viewing angle is displayed, the current viewing angle includes an object viewing angle and a scene viewing angle, the game picture includes a viewing angle switching control, a virtual object collected at the object viewing angle, and a virtual scene collected at the scene viewing angle, a viewing angle parameter of the current viewing angle is obtained in response to a viewing angle switching operation for the viewing angle switching control, a switching type of the viewing angle switching operation is determined according to the viewing angle parameter, the object viewing angle and the scene viewing angle are adjusted based on the switching type to obtain a target viewing angle, and a target game picture at the target viewing angle is switched and displayed, because the scheme collects the virtual object and the virtual scene through the object viewing angle and the scene viewing angle provided by different cameras, the virtual object viewing angle and the virtual scene are in pictures corresponding to different viewing angles, and when the viewing angle is switched, the object viewing angle and the scene are respectively adjusted, therefore, the flexibility of the display range of the virtual scene and the virtual object after the visual angle is switched is greatly improved, and the display effect of the picture after the visual angle is switched can be greatly improved.
The method described in the above examples is further illustrated in detail below by way of example.
In this embodiment, the visual angle switching device is specifically integrated in an electronic device, the electronic device is a terminal, a game corresponding to a game screen is an FPS game, a visual angle switching control is an aiming control, and switching types are closing of an aiming lens (hereinafter, referred to as closing of a lens) and opening of the aiming lens (hereinafter, referred to as opening of a lens) for example.
As shown in fig. 5, a method for switching a viewing angle specifically includes the following steps:
201. and the terminal displays the game picture at the current visual angle.
For example, a player may operate a login page of a game client to trigger the terminal to display a game screen at a current viewing angle, for example, the player inputs an account and a password through an input control, and then triggers the login control, the terminal may display a player setting page at the game client, the player may select a player character, a gun, and a game map on the player setting page, and then trigger a start game control, and the terminal may display the game screen at the current viewing angle.
202. And the terminal responds to the visual angle switching operation aiming at the aiming control to acquire the visual angle parameter of the current visual angle.
For example, when a player needs to perform an operation of opening or closing the mirror during a game, the player can perform a switching operation on the current viewing angle by triggering the aiming control. The terminal responds to the switching operation aiming at the aiming control, can acquire the visual angle values of the object visual angle and the scene visual angle in the game picture under the current visual angle and the game engine type corresponding to the game picture, and takes the visual angle values of the object visual angle and the scene visual angle as the initial visual angle parameters of the current visual angle. Comparing the game engine type corresponding to the acquired game page with a preset engine type, taking the preset game engine type as nonreal as an example, when the game engine type corresponding to the game picture is nonreal, at this time, the initial view angle parameter can be directly used as the view angle parameter of the current view angle; when the game engine type corresponding to the game screen is unity, the initial perspective parameter in unity needs to be converted into the target perspective parameter in unity, and the converted target perspective parameter can be used as the perspective parameter of the current perspective, and the specific conversion formula can be referred to as formula (1).
203. And the terminal determines the switching type of the visual angle switching operation according to the visual angle parameters.
For example, the terminal may obtain a preset view parameter threshold for determining the switching type, where the preset parameter threshold may include a preset object view threshold and a preset scene view threshold, extract an object view value and a scene view value from the view parameter, compare the object view value with the preset object view threshold, and compare the scene view value with the preset scene view threshold.
When any one of the object view angle value and the scene view angle value exceeds a corresponding preset view angle parameter threshold, for example, when the object view angle value exceeds a preset object view angle threshold and the scene view angle value also exceeds a preset scene view angle threshold, a switching type of the view angle switching operation can be determined to be turned off; or, when the object view value exceeds the preset object view value and the scene view value does not exceed the preset scene view threshold, the switching type of the view switching operation may also be determined to be off; or, when the object view value does not exceed the preset object view value and the scene view value exceeds the preset scene view threshold, the switching type of the view switching operation may also be determined to be off.
When the object view angle value does not exceed the preset object view angle threshold value and the scene view angle value does not exceed the preset scene view angle threshold value, the switching type of the view angle switching operation can be determined to be open mirror.
204. And the terminal screens out a first view angle value of the object view angle and a second view angle value of the scene view angle from the view angle parameters.
For example, the terminal may screen an object view value of the object view and a scene view value of the scene view from the view parameters, and use the object view value as a first view value and the scene view value as a second view value, respectively.
205. The terminal determines an adjustment type and a target view value for adjusting the first view value and the second view value based on the switching type.
For example, when the switching type is on-mirror, the terminal may determine that the adjustment type for adjusting the first view angle value and the second view angle value is view angle increase adjustment, and conversely, when the switching type is off-mirror, the terminal may determine that the adjustment type for adjusting the first view angle value and the second view angle value is view angle decrease adjustment. And screening out a target view angle value which needs to be adjusted according to the first view angle value and the second view angle value from the game view angle data set according to the switching type, wherein the target view angle value can comprise a target view angle value of an object view angle and a target view angle value of a scene view angle, and the target view angle value of the object view angle and the target view angle value of the scene view angle can be the same or different.
206. And when the adjustment type is visual angle increasing adjustment, the terminal increases the first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle.
For example, when the adjustment type is view increase adjustment, the terminal needs to compare the first view value with the second view value, and increase the first view value and the second view value to the target view value according to the comparison result, so as to obtain the target view, which may specifically be as follows:
(1) the first viewing angle and the second viewing angle have the same value.
For example, when the first angle of view and the second angle of view are the same, the terminal may directly add the first angle of view and the second angle of view to the target angle of view, so as to obtain a target angle of view, take the angle of view corresponding to the target angle of view as the target angle of view, for example, take the first angle of view and the second angle of view as 35 and the target angle of view as 75, directly add the first angle of view and the second angle of view to 75 at a constant speed or at a variable speed, and take the angle of view corresponding to the first angle of view and the second angle of view as the target angle of view, where the angle of view is 75.
(2) The first viewing angle is different from the second viewing angle.
For example, when the first view angle value and the second view angle value are different, a first view angle difference value between the first view angle value and the second view angle value is calculated, when the first view angle value exceeds the second view angle value, an adjustment speed for adjusting the second view angle value is determined according to the first view angle difference value, and the second view angle value is adjusted based on the adjustment speed so that the adjusted second view angle value is the same as the first view angle value. And calculating a second visual angle difference value between the first visual angle value and the target visual angle value, determining the increasing speed of increasing the adjusted second visual angle value and the adjusted first visual angle value to the target visual angle value according to the second visual angle value, and increasing the adjusted second visual angle value and the adjusted first visual angle value to the target visual angle value based on the increasing speed to obtain the target visual angle.
Optionally, when the first viewing angle value does not exceed the second viewing angle value, at this time, the first viewing angle value is adjusted to be equal to the second viewing angle value only by using the same method, and then the adjusted first viewing angle value and second viewing angle value are added to the target viewing angle value together, so that the target viewing angle can be obtained. The adjustment speed and the increase speed are also determined by the difference between the first viewing angle value and the second viewing angle and the difference between the second viewing angle value and the target viewing angle value.
207. And when the adjustment type is visual angle reduction adjustment, the terminal reduces the first visual angle value and the second visual angle value to a target visual angle value to obtain a target visual angle.
For example, when the adjustment type is view reduction adjustment, the terminal needs to compare the first view value with the second view value, and reduce the first view value and the second view value to the target view value according to the comparison result, so as to obtain the target view, which may specifically be as follows:
(1) the first viewing angle value and the second viewing angle value are the same.
For example, when the first view angle value and the second view angle value are the same, the terminal may reduce the first view angle value and the second view angle value to the target view angle value, and take the view angle corresponding to the target view angle value as the target view angle, for example, taking the first view angle value and the second view angle value as 75 and the target view angle value as 35 as an example, directly reduce the first view angle value and the second view angle value to 35 at a constant speed or at a variable speed, and take the view angle corresponding to the first view angle value and the second view angle value with the view angle value of 35 as the target view angle.
(2) The first view value and the second view value are different.
For example, when the first viewing angle value and the second viewing angle are different and the first viewing angle value exceeds the second viewing angle value, the terminal may calculate a third viewing angle difference value between the first viewing angle value and the second viewing angle value, determine a first reduction speed at which the first viewing angle value is reduced to the second viewing angle value based on the third viewing angle difference value, and then reduce the first viewing angle value to the second viewing angle value using the first reduction speed. And continuously calculating a fourth visual angle difference value of the first visual angle value and the target visual angle value, determining a second reduction speed for reducing the first visual angle value and the reduced second visual angle value to the target visual angle value according to the fourth visual angle difference value, then continuously adopting the second reduction speed, reducing the first visual angle value and the reduced second visual angle value to the target visual angle value, and taking the visual angles corresponding to the first visual angle value and the second visual angle value reduced to the target visual angle value as target visual angles so as to obtain the target visual angles.
Optionally, when the first view angle value and the second view angle value are different and the first view angle value does not exceed the second view angle value, the terminal may also reduce the second view angle value to the first view angle value by using the above method, and then reduce the first view angle value and the reduced second view angle value together to the target view angle value, where the reduction speeds of the two times may be determined based on the third view angle difference value and the fourth view angle difference value, respectively.
208. And the terminal switches and displays the target game picture under the target visual angle.
For example, the terminal may acquire, by the first camera, a target virtual object at an object viewing angle adjusted to a target viewing angle value, acquire, by the second camera, a target virtual scene at a scene object viewing angle adjusted to the target viewing angle value, replace the virtual object in the game screen with the target virtual object, and replace the virtual scene in the game screen with the target virtual object, thereby obtaining a target game screen at the target viewing angle. And switching the game picture displayed on the terminal at the current visual angle into a target game picture at the target visual angle, thereby completing the process of single mirror opening or closing operation of the player.
The process of completing the single mirror opening or closing by the player may be as shown in fig. 6, and the specific process may also be understood as that after the player triggers the aiming control, it needs to determine whether the view angle switching is in the change from mirror opening to mirror closing or in the change from mirror closing to mirror opening, that is, the mirror opening or mirror closing in the switching type, and the mirror opening is in the change from mirror closing to mirror opening, and similarly, the mirror closing is in the change from mirror opening to mirror closing. And then, acquiring two cameras according to a blueprint and a scene blueprint configured on the virtual object and the firearm, wherein the first camera corresponds to the virtual object and the firearm, and the second camera corresponds to the virtual scene, and judging whether the view angle values of the two cameras are consistent at the current moment according to the current FOV values of the two cameras, namely the first view angle value and the second view angle value.
For example, taking fig. 7 as an example of a mirror closing operation, the viewing angle parameter of the current viewing angle of the image (a) in fig. 7 may be that the first viewing angle value is 91.5, the second viewing angle value is 80, and the target viewing angle value of the target viewing angle of the image (b) in fig. 7 is 75, at this time, the first viewing angle value is changed at a constant speed or at a variable speed by using a certain speed (which may be determined or preset according to a difference between the first viewing angle value and the second viewing angle value), and when the first viewing angle value changes to a time equal to 80, the first viewing angle value and the second viewing angle value change to 75. When the two cameras finish moving, the process of opening or closing the mirror once can be finished, and at the moment, the game picture displays the virtual object and the virtual scene which are acquired by the two cameras under the target view angle value.
As can be seen from the above, after the terminal of this embodiment displays a game picture at a current viewing angle, where the current viewing angle includes an object viewing angle and a scene viewing angle, the game picture includes a viewing angle switching control, a virtual object collected at the object viewing angle, and a virtual scene collected at the scene viewing angle, acquires a viewing angle parameter of the current viewing angle in response to a viewing angle switching operation for the viewing angle switching control, determines a switching type of the viewing angle switching operation according to the viewing angle parameter, adjusts the object viewing angle and the scene viewing angle based on the switching type to obtain a target viewing angle, and switches and displays a target game picture at the target viewing angle, because the scheme collects the virtual object and the virtual scene through the object viewing angle and the scene viewing angle provided by different cameras, the virtual object and the virtual scene are in pictures corresponding to different viewing angles, and when the viewing angle is switched, the object viewing angle and the scene are respectively adjusted, therefore, the flexibility of the display range of the virtual scene and the virtual object after the visual angle is switched is greatly improved, and the display effect of the picture after the visual angle is switched can be greatly improved.
In order to better implement the above method, an embodiment of the present invention further provides a viewing angle switching apparatus, which may be integrated in an electronic device, such as a server or a terminal, and the terminal may include a tablet computer, a notebook computer, and/or a personal computer.
For example, as shown in fig. 8, the viewing angle switching apparatus may include a display unit 301, an acquisition unit 302, a determination unit 303, an adjustment unit 304, and a switching unit 306, as follows:
(1) a display unit 301;
the display unit 301 is configured to display a game screen at a current view angle, where the current view angle includes an object view angle and a scene view angle, and the game screen includes a view angle switching control, a virtual object acquired at the object view angle, and a virtual scene acquired at the scene view angle.
For example, the display unit 301 may be specifically configured to enable a player to trigger and display a game screen at a current viewing angle by operating a login page of a game client, where the player inputs an account and a password through an input control, and then triggers the login control, at this time, a player setting page may be displayed at the game client, and after the player selects a player character, a firearm, and a game map, a game control is triggered to start, so that the game screen at the current viewing angle may be displayed at the game client.
(2) An acquisition unit 302;
an obtaining unit 302, configured to obtain a view parameter of a current view in response to a view switching operation for the view switching control.
For example, the obtaining unit 302 may be specifically configured to obtain an initial view parameter of a current view and a game engine type corresponding to a game picture, and when the game engine type is the same as a preset game engine type, use the initial view parameter as the view parameter of the current view; and when the game engine type is different from the preset game engine type, converting the initial view angle parameter into a target view angle parameter corresponding to the preset game engine type, and taking the target view angle parameter as the view angle parameter of the current view angle.
(3) A determination unit 303;
a determining unit 303, configured to determine a switching type of the view switching operation according to the view parameter.
For example, the determining unit 303 may be specifically configured to acquire a preset view parameter threshold used for determining a switching type, compare the view parameter with the preset view parameter threshold, determine that the switching type of the view switching operation is reduced view switching when the view parameter exceeds the preset view parameter threshold, and reduce the view to switch the current view to a view smaller than the current view; and when the visual angle parameter does not exceed the preset visual angle parameter threshold value, determining that the switching type of the visual angle switching operation is the increased visual angle switching, and switching the increased visual angle into the visual angle larger than the current visual angle.
(4) An adjustment unit 304;
an adjusting unit 304, configured to adjust the object view and the scene view based on the switching type, so as to obtain a target view.
For example, the adjusting unit 304 may be specifically configured to screen a first view value of an object view and a second view value of a scene view from the view parameters, determine an adjustment type and a target view value for adjusting the first view value and the second view value based on the switching type, and adjust the first view value and the second view value to the target view value according to the adjustment type to obtain the target view.
(5) A switching unit 305;
a switching unit 305 for switching and displaying the target game screen at the target viewing angle.
For example, the switching unit 305 may be specifically configured to acquire a virtual object and a virtual scene at a target viewing angle, obtain a target game screen, and switch the game screen to the target game screen.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, in this embodiment, after the display unit 301 displays a game picture at a current viewing angle, the current viewing angle includes an object viewing angle and a scene viewing angle, the game picture includes a viewing angle switching control, a virtual object collected at the object viewing angle, and a virtual scene collected at the scene viewing angle, the obtaining unit 302 obtains a viewing angle parameter of the current viewing angle in response to a viewing angle switching operation for the viewing angle switching control, the determining unit 303 determines a switching type of the viewing angle switching operation according to the viewing angle parameter, the adjusting unit 304 adjusts the object viewing angle and the scene viewing angle based on the switching type to obtain a target viewing angle, the switching unit 305 switches and displays a target game picture at the target viewing angle, because the scheme collects the virtual object and the virtual scene through the object viewing angle and the scene viewing angle provided by different cameras, so that the virtual object and the virtual scene are in pictures corresponding to different viewing angles, and when the visual angle is switched, the visual angle of the object and the scene are respectively adjusted, so that the flexibility of the display range of the virtual scene and the virtual object after the visual angle is switched is greatly improved, and the display effect of the picture after the visual angle is switched can be greatly improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, which shows a schematic structural diagram of the electronic device according to the embodiment of the present invention, specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 9 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating 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, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, 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, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
displaying a game picture under a current visual angle, wherein the current visual angle comprises an object visual angle and a scene visual angle, the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle, responding to the visual angle switching operation aiming at the visual angle switching control, acquiring the visual angle parameter of the current visual angle, determining the switching type of the visual angle switching operation according to the visual angle parameter, adjusting the object visual angle and the scene visual angle based on the switching type, obtaining a target visual angle, and switching and displaying the target game picture under the target visual angle.
For example, a player may trigger and display a game screen at a current view angle by operating a login page of a game client, the player inputs an account and a password by inputting a control, and then triggers the login control, at this time, the electronic device may display a player setting page at the game client, and when the player selects a player character, a gun, and a game map, the electronic device triggers a start game control, and may display the game screen at the current view angle at the game client. Acquiring an initial view angle parameter of a current view angle and a game engine type corresponding to a game picture, and taking the initial view angle parameter as the view angle parameter of the current view angle when the game engine type is the same as a preset game engine type; and when the game engine type is different from the preset game engine type, converting the initial view angle parameter into a target view angle parameter corresponding to the preset game engine type, and taking the target view angle parameter as the view angle parameter of the current view angle. Acquiring a preset visual angle parameter threshold value used for determining a switching type, comparing the visual angle parameter with the preset visual angle parameter threshold value, determining that the switching type of visual angle switching operation is reduced visual angle switching when the visual angle parameter exceeds the preset visual angle parameter threshold value, and switching the reduced visual angle to a visual angle smaller than the current visual angle; and when the visual angle parameter does not exceed the preset visual angle parameter threshold value, determining that the switching type of the visual angle switching operation is the increased visual angle switching, and switching the increased visual angle into the visual angle larger than the current visual angle. And screening a first view angle value of the object view angle and a second view angle value of the scene view angle from the view angle parameters, determining an adjustment type and a target view angle value for adjusting the first view angle value and the second view angle value based on the switching type, and adjusting the first view angle value and the second view angle value to the target view angle value according to the adjustment type to obtain the target view angle. And acquiring the virtual object and the virtual scene under the target visual angle to obtain a target game picture, and switching the game picture into the target game picture.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
As can be seen from the above, in the embodiments of the present invention, after a game picture at a current viewing angle is displayed, the current viewing angle includes an object viewing angle and a scene viewing angle, the game picture includes a viewing angle switching control, a virtual object collected at the object viewing angle, and a virtual scene collected at the scene viewing angle, a viewing angle parameter of the current viewing angle is obtained in response to a viewing angle switching operation for the viewing angle switching control, a switching type of the viewing angle switching operation is determined according to the viewing angle parameter, the object viewing angle and the scene viewing angle are adjusted based on the switching type to obtain a target viewing angle, and a target game picture at the target viewing angle is switched and displayed, because the scheme collects the virtual object and the virtual scene through the object viewing angle and the scene viewing angle provided by different cameras, the virtual object viewing angle and the virtual scene are in pictures corresponding to different viewing angles, and when the viewing angle is switched, the object viewing angle and the scene are respectively adjusted, therefore, the flexibility of the display range of the virtual scene and the virtual object after the visual angle is switched is greatly improved, and the display effect of the picture after the visual angle is switched can be greatly improved.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the embodiment of the present invention provides a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the view switching methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
displaying a game picture under a current visual angle, wherein the current visual angle comprises an object visual angle and a scene visual angle, the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle, responding to the visual angle switching operation aiming at the visual angle switching control, acquiring the visual angle parameter of the current visual angle, determining the switching type of the visual angle switching operation according to the visual angle parameter, adjusting the object visual angle and the scene visual angle based on the switching type, obtaining a target visual angle, and switching and displaying the target game picture under the target visual angle.
For example, a player may trigger and display a game screen at a current view angle by operating a login page of a game client, the player inputs an account and a password by inputting a control, and then triggers the login control, at this time, the electronic device may display a player setting page at the game client, and when the player selects a player character, a gun, and a game map, the electronic device triggers a start game control, and may display the game screen at the current view angle at the game client. Obtaining an initial view angle parameter of a current view angle and a game engine type corresponding to a game picture, and taking the initial view angle parameter as the view angle parameter of the current view angle when the game engine type is the same as a preset game engine type; and when the game engine type is different from the preset game engine type, converting the initial view angle parameter into a target view angle parameter corresponding to the preset game engine type, and taking the target view angle parameter as the view angle parameter of the current view angle. Acquiring a preset visual angle parameter threshold value used for determining a switching type, comparing the visual angle parameter with the preset visual angle parameter threshold value, and when the visual angle parameter exceeds the preset visual angle parameter threshold value, determining that the switching type of visual angle switching operation is reduced visual angle switching, and reducing the visual angle switching to switch the current visual angle into a visual angle smaller than the current visual angle; and when the visual angle parameter does not exceed the preset visual angle parameter threshold value, determining that the switching type of the visual angle switching operation is the increased visual angle switching, and switching the increased visual angle into the visual angle larger than the current visual angle. And screening a first view angle value of the object view angle and a second view angle value of the scene view angle from the view angle parameters, determining an adjustment type and a target view angle value for adjusting the first view angle value and the second view angle value based on the switching type, and adjusting the first view angle value and the second view angle value to the target view angle value according to the adjustment type to obtain the target view angle. And acquiring the virtual object and the virtual scene under the target visual angle to obtain a target game picture, and switching the game picture into the target game picture.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any of the perspective switching methods provided in the embodiments of the present invention, the beneficial effects that can be achieved by any of the perspective switching methods provided in the embodiments of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described again here.
According to an aspect of the application, there is provided, among other things, a computer program product or computer program comprising 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 to cause the computer device to perform the methods provided in the various alternative implementations of the perspective switching aspect described above.
The foregoing detailed description is directed to a method, an apparatus, and a computer-readable storage medium for switching a view angle provided by an embodiment of the present invention, and a specific example is applied in the detailed description to explain the principles and embodiments of the present invention, and the description of the foregoing embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (14)

1. A method for switching a viewing angle, comprising:
displaying a game picture under a current visual angle, wherein the current visual angle comprises an object visual angle and a scene visual angle, and the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle;
responding to the visual angle switching operation aiming at the visual angle switching control, and acquiring the initial visual angle parameter of the current visual angle and the game engine type corresponding to the game picture;
when the game engine type is the same as a preset game engine type, taking the initial view angle parameter as the view angle parameter of the current view angle;
when the game engine type is different from the preset game engine type, converting the initial view angle parameter into a target view angle parameter corresponding to the preset game engine type, and taking the target view angle parameter as the view angle parameter of the current view angle;
determining the switching type of the visual angle switching operation according to the visual angle parameters;
based on the switching type, adjusting the object visual angle and the scene visual angle to obtain a target visual angle;
and switching and displaying the target game picture under the target visual angle.
2. The method of claim 1, wherein the adjusting the object view and the scene view based on the switching type to obtain a target view comprises:
screening out a first view angle value of the object view angle and a second view angle value of the scene view angle from the view angle parameters;
and adjusting the first view angle value and the second view angle value based on the switching type to obtain a target view angle.
3. The method according to claim 2, wherein the adjusting the first view value and the second view value based on the switching type to obtain the target view comprises:
determining an adjustment type and a target view value for adjusting the first view value and the second view value based on the switching type;
and adjusting the first view angle value and the second view angle value to the target view angle value according to the adjustment type to obtain the target view angle.
4. The method according to claim 3, wherein the adjusting the first view value and the second view value to the target view value according to the adjustment type to obtain the target view comprises:
when the adjustment type is view increasing adjustment, adding the first view value and the second view value to the target view value to obtain the target view;
and when the adjustment type is view reduction adjustment, reducing the first view value and the second view value to the target view value to obtain the target view.
5. The method according to claim 4, wherein the adding the first and second view values to the target view value to obtain the target view comprises:
comparing the first and second perspective values;
when the first visual angle value and the second visual angle value are the same, adding the first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle;
when the first perspective value and the second perspective value are different, calculating a first perspective difference value between the first perspective value and the second perspective value, and adding the first perspective value and the second perspective value to the target perspective value based on the first perspective difference value to obtain the target perspective.
6. The method according to claim 5, wherein the adding the first view value and the second view value to the target view value based on the first view difference value to obtain the target view comprises:
when the first visual angle value exceeds a second visual angle value, based on the first visual angle difference value, adjusting the second visual angle value to be the same as the first visual angle value, and adding the adjusted second visual angle value and the first visual angle value to the target visual angle value to obtain the target visual angle;
when the first visual angle value does not exceed a second visual angle value, based on the first visual angle difference value, adjusting the first visual angle value to be the same as the second visual angle value, and adding the adjusted first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle.
7. The method of claim 6, wherein the adjusting the second view value to be the same as the first view value based on the first view difference value and adding the adjusted second view value and the first view value to the target view value to obtain the target view comprises:
determining an adjusting speed for adjusting the second visual angle value according to the first visual angle difference value;
adjusting the second view angle value based on the adjustment speed, so that the adjusted second view angle value is the same as the first view angle value;
and adding the adjusted second visual angle value and the adjusted first visual angle value to the target visual angle value to obtain the target visual angle.
8. The method for switching a viewing angle according to claim 7, wherein the adding the adjusted second viewing angle value and the adjusted first viewing angle value to the target viewing angle value to obtain the target viewing angle comprises:
calculating a second view difference value between the first view value and the target view value;
determining an increasing speed of increasing the adjusted second view angle value and the first view angle value to the target view angle value according to the second view angle difference value;
and adding the adjusted second visual angle value and the first visual angle value to the target visual angle value based on the increasing speed to obtain the target visual angle.
9. The method according to claim 4, wherein the reducing the first view value and the second view value to the target view value to obtain the target view comprises:
comparing the first and second perspective values;
when the first visual angle value and the second visual angle value are the same, reducing the first visual angle value and the second visual angle value to the target visual angle value to obtain the target visual angle;
and when the first view angle value is different from the second view angle value, calculating a third view angle difference value between the first view angle value and the second view angle value, and reducing the first view angle value and the second view angle value to the target view angle value based on the third view angle difference value to obtain the target view angle.
10. The method according to any one of claims 1 to 9, wherein the switching and displaying of the target game screen at the target viewing angle includes:
acquiring a virtual object and a virtual scene under the target visual angle to obtain a target game picture;
and switching the game picture into the target game picture.
11. The method according to any one of claims 1 to 9, wherein the determining a switching type of the view switching operation according to the view parameter comprises:
acquiring a preset visual angle parameter threshold value for determining a switching type;
comparing the view angle parameter with the preset view angle parameter threshold value;
when the view angle parameter exceeds the preset view angle parameter threshold value, determining that the switching type of the view angle switching operation is reduced view angle switching, and switching the reduced view angle to a view angle smaller than the current view angle;
and when the view angle parameter does not exceed the preset view angle parameter threshold value, determining that the switching type of the view angle switching operation is increased view angle switching, and switching the current view angle to a view angle larger than the current view angle by the increased view angle switching.
12. A viewing angle switching apparatus, comprising:
the game device comprises a display unit, a processing unit and a processing unit, wherein the display unit is used for displaying a game picture under a current visual angle, the current visual angle comprises an object visual angle and a scene visual angle, and the game picture comprises a visual angle switching control, a virtual object acquired under the object visual angle and a virtual scene acquired under the scene visual angle;
the obtaining unit is used for responding to the visual angle switching operation aiming at the visual angle switching control and obtaining the initial visual angle parameter of the current visual angle and the game engine type corresponding to the game picture; when the game engine type is the same as a preset game engine type, taking the initial view angle parameter as the view angle parameter of the current view angle; when the game engine type is different from the preset game engine type, converting the initial view angle parameter into a target view angle parameter corresponding to the preset game engine type, and taking the target view angle parameter as the view angle parameter of the current view angle;
the determining unit is used for determining the switching type of the visual angle switching operation according to the visual angle parameter;
the adjusting unit is used for adjusting the object visual angle and the scene visual angle based on the switching type to obtain a target visual angle;
and the switching unit is used for switching and displaying the target game picture under the target visual angle.
13. An electronic device comprising a processor and a memory, the memory storing an application program, the processor being configured to execute the application program in the memory to implement the steps in the method for switching the viewing angle according to any one of claims 1 to 11.
14. A computer-readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the method of switching views according to any one of claims 1 to 11.
CN202011094226.4A 2020-10-14 2020-10-14 Visual angle switching method and device and computer readable storage medium Active CN112221131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011094226.4A CN112221131B (en) 2020-10-14 2020-10-14 Visual angle switching method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011094226.4A CN112221131B (en) 2020-10-14 2020-10-14 Visual angle switching method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112221131A CN112221131A (en) 2021-01-15
CN112221131B true CN112221131B (en) 2022-05-06

Family

ID=74112561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011094226.4A Active CN112221131B (en) 2020-10-14 2020-10-14 Visual angle switching method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112221131B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113318447B (en) * 2021-05-25 2022-07-29 网易(杭州)网络有限公司 Game scene processing method and device, storage medium and electronic equipment
JP7416980B2 (en) * 2021-05-25 2024-01-17 ネットイーズ (ハンチョウ) ネットワーク カンパニー リミテッド Game scene processing methods, devices, storage media and electronic devices

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6389208B2 (en) * 2016-06-07 2018-09-12 株式会社カプコン GAME PROGRAM AND GAME DEVICE
CN106975219B (en) * 2017-03-27 2019-02-12 网易(杭州)网络有限公司 Display control method and device, storage medium, the electronic equipment of game picture
CN108704307A (en) * 2018-05-17 2018-10-26 Oppo广东移动通信有限公司 Processing method, device, storage medium and the electronic device of touch information
CN110141855A (en) * 2019-05-24 2019-08-20 网易(杭州)网络有限公司 Method of controlling viewing angle, device, storage medium and electronic equipment
CN111420402B (en) * 2020-03-18 2021-05-14 腾讯科技(深圳)有限公司 Virtual environment picture display method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN112221131A (en) 2021-01-15

Similar Documents

Publication Publication Date Title
CN106383587B (en) Augmented reality scene generation method, device and equipment
US9479709B2 (en) Method and apparatus for long term image exposure with image stabilization on a mobile device
CN112221131B (en) Visual angle switching method and device and computer readable storage medium
WO2022063177A1 (en) Control method and apparatus for virtual camera, and device
CN111589128A (en) Operation control display method and device based on virtual scene
CN107623819B (en) A kind of method taken pictures and mobile terminal and related media production
CN114745598B (en) Video data display method and device, electronic equipment and storage medium
CN112891943B (en) Lens processing method and device and readable storage medium
WO2021031765A1 (en) Application method and related apparatus of sighting telescope in virtual environment
CN113058264A (en) Virtual scene display method, virtual scene processing method, device and equipment
CN110858409A (en) Animation generation method and device
CN112784081A (en) Image display method and device and electronic equipment
WO2023130809A1 (en) Picture display method and apparatus, terminal, storage medium, and program product
US20230048826A1 (en) Virtual scene display method and apparatus, device, storage medium, and program product
CN111625101B (en) Display control method and device
CN112584110B (en) White balance adjusting method and device, electronic equipment and storage medium
CN113946221A (en) Eye driving control method and device, storage medium and electronic equipment
CN113181635B (en) Virtual prop assembling method, device, terminal and storage medium
CN113813607B (en) Game view angle switching method and device, storage medium and electronic equipment
TWI733245B (en) System for switching between augmented reality and virtual reality based on interaction process and method thereof
WO2024032176A1 (en) Virtual item processing method and apparatus, electronic device, storage medium, and program product
CN112274917B (en) Game display control method, game display control device, electronic equipment and storage medium
CN113398564B (en) Virtual character control method, device, storage medium and computer equipment
CN108771859B (en) Virtual scene display method and device, electronic device and storage medium
CN113546407A (en) Game picture processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant