Virtual camera control method, device, equipment and storage medium

By detecting the movement status of the controlled virtual object in 3D games and using incremental time to correct the viewing parameters of the virtual lens, the problem of cumbersome dragging and dropping lenses is solved and the player's operation experience is improved.

CN116139482BActive Publication Date: 2025-07-29NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111397050.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2025-07-29
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

In existing 3D games, it is complicated to adjust the perspective by dragging the lens, resulting in a decline in player game experience.

Method used

By detecting the moving state of the controlled virtual object in the game scene, the perspective parameters of the virtual lens are corrected using incremental time, and adaptive logic is implemented to adjust the perspective of the virtual lens.

Benefits of technology

It reduces the difficulty of players' operation, improves the gaming experience, ensures that the perspective of the virtual lens matches the movement of the controlled virtual object, and avoids the problems of jamming and poor viewing angles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116139482B_ABST
    Figure CN116139482B_ABST
Patent Text Reader

Abstract

The present application provides a virtual camera control method, device, equipment and storage medium. Among them, the method includes: if it is detected that a controlled virtual object in a game scene is in a moving state, then according to the incremental time of the first frame, the viewing angle parameters of the virtual camera when displaying the first frame are corrected to obtain the target viewing angle parameters of the virtual camera when displaying the second frame, and according to the target viewing angle parameters, the viewing angle of the virtual camera is adjusted to display the second frame with the virtual camera whose viewing angle has been adjusted. By adding an adaptive logic to the virtual camera, the viewing angle of the virtual camera is associated with the movement of the controlled virtual object, greatly reducing the operation difficulty of players. At the same time, the viewing angle of the virtual camera can be corrected to the best angle, improving the operation experience of players.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game technologies, and in particular, to a virtual camera control method, apparatus, device, and storage medium. Background Art

[0002] A 3D game refers to a game in which the basic models (game characters, scenes, and basic terrains) are implemented using three-dimensional solid models. 3D games have won the favor of more and more players due to their strong visual impact.

[0003] Currently, in a 3D game scene, while a player manipulates a virtual object, they also need to manually drag the camera to achieve roaming operations in the 3D scene. However, this method is relatively cumbersome in operation, resulting in a decline in the player's gaming experience. Summary of the Invention

[0004] The purpose of this application is to provide a virtual camera control method, apparatus, device, and storage medium to solve the problem in the prior art that adjusting the camera perspective by dragging the camera leads to cumbersome operations and a decline in the gaming experience.

[0005] To achieve the above objective, the technical solutions adopted in the embodiments of this application are as follows:

[0006] In a first aspect, an embodiment of this application provides a virtual camera control method, which includes:

[0007] If it is detected that the controlled virtual object in the game scene is in a moving state, then according to the incremental time of the first frame, the perspective parameters of the virtual camera when displaying the first frame are corrected to obtain the target perspective parameters of the virtual camera when displaying the second frame;

[0008] According to the target perspective parameters, the perspective of the virtual camera is adjusted to display the second frame with the adjusted perspective of the virtual camera.

[0009] In an optional implementation, before correcting the perspective parameters of the virtual camera when displaying the first frame according to the incremental time of the first frame to obtain the target perspective parameters of the virtual camera when displaying the second frame, the method further includes:

[0010] Obtain the movement parameters of the controlled virtual object in the game scene;

[0011] Determine whether the movement parameters meet the preset perspective adjustment conditions of the virtual camera;

[0012] Modifying the perspective parameter of the virtual camera when displaying the first video frame according to the incremental time of the first video frame to obtain the target perspective parameter of the virtual camera when displaying the second video frame, includes:

[0013] If the movement parameter meets the perspective adjustment condition, modifying the perspective parameter of the virtual camera when displaying the first video frame according to the incremental time to obtain the target perspective parameter.

[0014] In an alternative embodiment, the movement parameter includes: the movement duration of the controlled virtual object moving continuously, and determining whether the movement parameter meets the preset perspective adjustment condition of the virtual camera includes:

[0015] If the movement duration reaches the preset duration, determining that the movement parameter meets the perspective adjustment condition.

[0016] In an alternative embodiment, the movement parameter includes: the movement speed of the controlled virtual object in a direction perpendicular to the preset horizontal direction, and determining whether the movement parameter meets the preset perspective adjustment condition of the virtual camera includes:

[0017] If the movement speed is not equal to the preset speed, determining that the movement parameter meets the perspective adjustment condition.

[0018] In an alternative embodiment, modifying the perspective parameter of the virtual camera when displaying the first video frame according to the incremental time of the first video frame to obtain the target perspective parameter of the virtual camera when displaying the second video frame, includes:

[0019] Obtaining a correction speed according to the incremental time of the first video frame and a preset correction coefficient;

[0020] Modifying the perspective parameter of the virtual camera when displaying the first video frame according to the correction speed to obtain the target perspective parameter of the virtual camera when displaying the second video frame.

[0021] In an alternative embodiment, modifying the perspective parameter of the virtual camera when displaying the first video frame according to the correction speed to obtain the target perspective parameter of the virtual camera when displaying the second video frame, includes:

[0022] Obtaining the set perspective parameter of the virtual camera when displaying the first video frame;

[0023] Modifying the perspective parameter of the virtual camera when displaying the first video frame according to the correction speed and the set perspective parameter to obtain the target perspective parameter of the virtual camera when displaying the second video frame.

[0024] In an optional implementation manner, before obtaining the correction speed based on the incremental time and the preset correction coefficient of the first picture frame, the method further includes:

[0025] Acquiring the relative orientation of the controlled virtual object and the virtual lens when displaying the first picture frame;

[0026] The obtaining of the correction speed according to the incremental time of the first picture frame and the preset correction coefficient includes:

[0027] The correction speed is obtained according to the relative orientation, the incremental time of the first picture frame, and the preset correction coefficient.

[0028] In a second aspect, another embodiment of the present application provides a virtual lens control device, the device comprising:

[0029] a correction module configured to, if detecting that the controlled virtual object in the game scene is in a moving state, correct the viewing angle parameters of the virtual lens when displaying the first frame according to the incremental time of the first frame to obtain the target viewing angle parameters of the virtual lens when displaying the second frame;

[0030] The adjustment module is configured to adjust the viewing angle of the virtual lens according to the target viewing angle parameter, so as to display the second picture frame using the virtual lens after the viewing angle adjustment.

[0031] In an optional embodiment, the invention further comprises:

[0032] An acquisition module, configured to acquire movement parameters of the controlled virtual object in the game scene;

[0033] A judging module, configured to judge whether the movement parameters satisfy a preset viewing angle adjustment condition of the virtual lens;

[0034] The correction module is specifically used to:

[0035] If the movement parameter satisfies the viewing angle adjustment condition, the viewing angle parameter of the virtual lens when displaying the first picture frame is modified according to the incremental time to obtain the target viewing angle parameter.

[0036] In an optional embodiment, the movement parameter includes: a movement duration of the controlled virtual object's continuous movement, and the judgment module is specifically configured to:

[0037] If the movement duration reaches a preset duration, it is determined that the movement parameter meets the viewing angle adjustment condition.

[0038] In an optional embodiment, the movement parameter includes: a movement speed of the controlled virtual object in a direction perpendicular to a preset horizontal direction, and the judgment module is specifically configured to:

[0039] If the moving speed is not equal to the preset speed, it is determined that the moving parameter meets the viewing angle adjustment condition.

[0040] In an optional implementation manner, the correction module is specifically configured to:

[0041] Obtaining a correction speed according to the incremental time of the first picture frame and a preset correction coefficient;

[0042] According to the correction speed, the viewing angle parameters of the virtual lens when displaying the first picture frame are corrected to obtain the target viewing angle parameters of the virtual lens when displaying the second picture frame.

[0043] In an optional implementation manner, the correction module is specifically configured to:

[0044] Acquiring setting viewing angle parameters of the virtual lens when displaying the first picture frame;

[0045] The viewing angle parameters of the virtual lens when displaying the first picture frame are modified according to the correction speed and the set viewing angle parameters to obtain the target viewing angle parameters of the virtual lens when displaying the second picture frame.

[0046] In an optional implementation manner, the acquisition module is further configured to:

[0047] Acquiring the relative orientation of the controlled virtual object and the virtual lens when displaying the first picture frame;

[0048] The acquisition module is specifically configured to acquire the correction speed according to the relative orientation, the incremental time of the first picture frame, and the preset correction coefficient.

[0049] In a third aspect, another embodiment of the present application provides a virtual lens control device, comprising: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the virtual lens control device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform any method described in the first aspect.

[0050] In a fourth aspect, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in any one of the first aspects is executed.

[0051] The beneficial effects of this application are:

[0052] The virtual camera control method, device, equipment and storage medium provided by this application. Among them, the method includes: if it is detected that the controlled virtual object in the game scene is in a moving state, then according to the incremental time of the first frame, the viewing angle parameters of the virtual camera when displaying the first frame are corrected to obtain the target viewing angle parameters of the virtual camera when displaying the second frame. According to the target viewing angle parameters, the viewing angle of the virtual camera is adjusted to display the second frame with the adjusted viewing angle of the virtual camera. By adding adaptive logic to the virtual camera, the viewing angle of the virtual camera is associated with the movement of the controlled virtual object, greatly reducing the operation difficulty of the player. At the same time, the viewing angle of the virtual camera can be corrected to the best angle, improving the player's operation experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions of the embodiments of this application, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of this application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0054] Figure 1 Shows a schematic diagram of the roll angle and pitch angle provided by the embodiments of this application;

[0055] Figure 2 Shows the flow diagram of the virtual camera control method provided by the embodiments of this application Figure 1 ;

[0056] Figure 3 Shows the flow diagram of the virtual camera control method provided by the embodiments of this application Figure 2 ;

[0057] Figure 4 Shows the flow diagram of the virtual camera control method provided by the embodiments of this application Figure 3 ;

[0058] Figure 5 Shows a schematic diagram of the second frame before and after adjusting the roll angle provided by the embodiments of this application;

[0059] Figure 6 Shows a schematic diagram of the second frame before and after adjusting the pitch angle provided by the embodiments of this application;

[0060] Figure 7 Shows a schematic diagram of the second frame before and after adjusting the pitch angle when the controlled virtual object is on a slope provided by the embodiments of this application;

[0061] Figure 8 Shows the flow diagram of the virtual camera control method provided by the embodiments of this applicationFigure 4 ;

[0062] Figure 9 It shows a schematic structural diagram of the virtual lens control device provided by an embodiment of the present application;

[0063] Figure 10 It shows a schematic structural diagram of the virtual lens control device provided by an embodiment of the present application. Detailed implementation manners

[0064] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be understood that the accompanying drawings in the present application are only for the purposes of illustration and description, and are not used to limit the protection scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to actual scale. The flowcharts used in the present application show the operations implemented according to some embodiments of the present application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical context relationships may be reversed or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of the present application.

[0065] In addition, the described embodiments are only some embodiments of the present application, rather than all embodiments. The components of the embodiments of the present application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application to be protected, but only represents the selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts fall within the protection scope of the present application.

[0066] It should be noted that the term "including" will be used in the embodiments of the present application to indicate the existence of the features stated thereafter, but does not exclude adding other features.

[0067] In the prior art, the roaming operation of the 3D scene is usually achieved by manually dragging the lens. Its defects are as follows: players cannot achieve the roaming operation of the 3D scene through a single joystick, the user experience is not good, and the operation is cumbersome; when there is no auxiliary function, players are likely to get the controlled virtual object stuck in some areas of the 3D scene; for the case where the height difference of going up and down stairs is relatively large, there is a lack of an auxiliary correction lens, and the narrow viewing angle affects the player's perception.

[0068] Based on this, the present application provides a virtual lens control method. By adding adaptive logic to the virtual lens, the perspective of the virtual lens is associated with the movement of the controlled virtual object, that is, roaming operations of the 3D scene can be achieved through a single joystick, which greatly reduces the player's operating difficulty. At the same time, the perspective of the virtual lens can be corrected to the optimal angle, improving the player's operating experience. Therefore, for situations where the height difference between up and down stairs is relatively large, the virtual lens will be assisted in correction, which will not affect the player's viewing experience and will not cause the controlled virtual object to be stuck in certain areas of the 3D scene.

[0069] Before introducing the technical solution of this application, the professional terms involved in this application are first explained.

[0070] Figure 1 Schematic diagram of the roll angle and pitch angle provided by the embodiment of the present application is shown in FIG. Figure 1 As shown, a three-dimensional coordinate system is established with the controlled virtual object as the coordinate origin, the orientation of the controlled virtual object is the z-axis, and the directions perpendicular to the orientation of the controlled virtual object are the x-axis and y-axis, respectively. The x-axis and z-axis are located in the same horizontal plane, and the plane where the y-axis is located is perpendicular to the planes where the x-axis and z-axis are located.

[0071] See also Figure 1 The pan angle of the virtual lens is the angle rotated with the y-axis as the rotation axis, and the pitch angle of the virtual lens is the angle rotated with the x-axis as the rotation axis.

[0072] Figure 2 The following is a flow chart of the virtual lens control method provided by the embodiment of the present application: Figure 1 The execution subject of this embodiment is a virtual lens control device, for example, a mobile phone, a tablet computer or other device capable of data processing.

[0073] like Figure 2 As shown, the method may include:

[0074] S101. If it is detected that the controlled virtual object in the game scene is in a moving state, the viewing angle parameters of the virtual lens when displaying the first frame are corrected according to the incremental time of the first frame to obtain the target viewing angle parameters of the virtual lens when displaying the second frame.

[0075] By executing the game application, a graphical user interface can be displayed, on which a game scene is displayed. The game scene can be a game scene of any 3D game. Players can download and install the 3D game on the virtual lens control device, such as a football mobile game.

[0076] The game scene includes controlled virtual objects, which may be controlled virtual animals, controlled virtual characters, etc., which are controlled by the players in the game. For football mobile games, the controlled virtual objects may be controlled virtual characters.

[0077] The delta time (Time.deltaTime) is the time it takes for a game screen frame to be drawn onto the computer screen within the unit time defined by the game engine. It is equal to the ratio of 1 second to the number of rendered frames per screen frame. The delta time can ensure that the correction speed remains relatively constant when the number of rendered frames fluctuates.

[0078] It should be noted that the number of rendered frames per screen frame is dynamically variable and can be obtained in real time from the interfaces provided by the game engine. Generally, for complex screen frames, the number of rendered frames that can be rendered in 1 second is less, so the delta time is longer. For example, if the first screen frame is more complex than the second screen frame, the number of rendered frames of the first screen frame can be 10 frames, and the delta time is 1 / 10 second. The number of rendered frames of the second screen frame can be 11, and the delta time is 1 / 11 second. For the specific description of the delta time, reference can be made to the prior art, which will not be elaborated here.

[0079] The virtual camera is used to show game scenes with different views to players. The game scenes with different views are mainly determined by the perspective parameters of the virtual camera. The perspective parameters can include, for example, the yaw angle parameter and the pitch angle parameter.

[0080] In some embodiments, if it is detected that the controlled virtual object in the game scene is in a moving state, then according to the delta time of the first screen frame, the perspective parameters of the virtual camera when displaying the first screen frame are corrected to obtain the target perspective parameters of the virtual camera when displaying the second screen frame. Here, the first screen frame can be the currently displayed screen frame, and the second screen frame can be the next screen frame of the first screen frame. In this way, the movement situation of the controlled virtual object can be associated with the perspective of the virtual camera. When the controlled virtual object is in a moving state, the perspective parameters of the virtual camera when displaying the first screen frame can be corrected so that the perspective parameters of the virtual camera when displaying the second screen frame match the movement situation of the controlled virtual object, and then the perspective of the virtual camera can be corrected to the best angle.

[0081] S102. Adjust the perspective of the virtual camera according to the target perspective parameters, so as to display the second screen frame with the virtual camera whose perspective has been adjusted.

[0082] Adjust the perspective of the virtual camera according to the target perspective parameters, so as to display the second screen frame with the virtual camera whose perspective has been adjusted. In this way, the second screen frame can be displayed with the best perspective, and the display perspective of the second screen frame matches the movement situation of the controlled virtual object.

[0083] It should be noted that in football games, the left joystick is generally used to control the movement of the controlled virtual object, and the perspective of the virtual camera is fixed. The player needs to slide the screen with his right hand in real time to modify the display perspective of the virtual camera. With the adaptive logic provided by this embodiment, the player only needs to use the left joystick to control the displacement of the controlled virtual object, and the perspective of the virtual camera can be automatically corrected during the displacement process.

[0084] The virtual camera control method of this embodiment, if a controlled virtual object in a game scene is detected to be in motion, modifies the viewing angle parameters of the virtual camera when displaying the first frame based on the incremental time of the first frame, obtains the target viewing angle parameters of the virtual camera when displaying the second frame, and then adjusts the viewing angle of the virtual camera based on the target viewing angle parameters to display the second frame using the adjusted virtual camera. By adding adaptive logic to the virtual camera, the viewing angle of the virtual camera is linked to the movement of the controlled virtual object, significantly reducing the difficulty of player operation and allowing the virtual camera's viewing angle to be adjusted to the optimal angle, enhancing the player's operational experience.

[0085] Figure 3 The following is a flow chart of the virtual lens control method provided by the embodiment of the present application: Figure 2 ,like Figure 3 As shown, in step S101, before modifying the viewing angle parameters of the virtual lens when displaying the first frame according to the incremental time of the first frame to obtain the target viewing angle parameters of the virtual lens when displaying the second frame, the method may further include:

[0086] S201: Obtain movement parameters of a controlled virtual object in a game scene.

[0087] S202: Determine whether the movement parameters meet the preset viewing angle adjustment conditions of the virtual lens.

[0088] The movement parameters of the controlled virtual object are used to reflect the movement of the controlled virtual object in the game scene, and may include, for example, movement speed, movement duration, movement position, etc.

[0089] In order to determine whether to correct the viewing angle parameters of the virtual lens when displaying the first frame, the movement parameters of the controlled virtual object in the game scene can be obtained in real time, and then it can be determined whether the movement parameters meet the preset viewing angle adjustment conditions of the virtual lens. This is because, in some cases, for example, the movement speed of the controlled virtual object is small and can be ignored, then there is no need to correct the viewing angle parameters of the virtual lens when displaying the first frame, because according to the movement speed of the controlled virtual object, the viewing angle parameters of the virtual lens when displaying the first frame are used to display the second frame, and there will be no mismatch between the movement and the viewing angle of the virtual lens.

[0090] Accordingly, step S101 may include:

[0091] S203. If the movement parameter meets the perspective adjustment condition, then according to the incremental time, correct the perspective parameter of the virtual camera when displaying the first frame of the picture to obtain the target perspective parameter.

[0092] When the movement parameter meets the perspective adjustment condition, then according to the incremental time of the first frame of the picture, correct the perspective parameter of the virtual camera when displaying the first frame of the picture to obtain the target perspective parameter of the virtual camera when displaying the second frame of the picture. If the movement parameter does not meet the perspective adjustment condition, there is no need to correct the perspective parameter of the virtual camera, that is, the perspective parameter of the virtual camera when displaying the first frame of the picture is used to display the second frame of the picture.

[0093] In an alternative embodiment, the movement parameter includes: the movement duration of the controlled virtual object moving continuously. Determining whether the movement parameter meets the preset perspective adjustment condition of the virtual camera includes:

[0094] If the movement duration reaches the preset duration, it is determined that the movement parameter meets the perspective adjustment condition.

[0095] When the movement duration of the controlled virtual object moving continuously reaches the preset duration, that is, the duration of the player operating the joystick reaches the preset duration. In this case, it is determined that the movement parameter meets the perspective adjustment condition. The preset duration can be selected according to the actual situation and is not particularly limited in this embodiment.

[0096] If the movement duration reaches the preset duration, it is determined that the movement parameter meets the perspective adjustment condition. Furthermore, the pan angle and tilt angle of the virtual camera can be adjusted so that the pan angle is adjusted to make the orientation of the virtual camera the same as the orientation of the controlled virtual object, and the tilt angle is adjusted so that the pitch perspective of the controlled virtual object is at the best angle.

[0097] In an alternative embodiment, the movement parameter includes: the movement speed of the controlled virtual object in the direction perpendicular to the preset horizontal direction. Determining whether the movement parameter meets the preset perspective adjustment condition of the virtual camera includes:

[0098] If the movement speed is not equal to the preset speed, it is determined that the movement parameter meets the perspective adjustment condition.

[0099] The preset horizontal direction may be Figure 1 the direction indicated by the x-axis and z-axis in Figure 1 and the direction perpendicular to the preset horizontal direction may be

[0100] The moving speed of the controlled virtual object in the direction perpendicular to the preset horizontal direction can be the moving speed of the controlled virtual object in the direction indicated by the y-axis. The preset speed can be zero. If the moving speed is not equal to the preset speed, it indicates that the controlled virtual object has a speed in the direction indicated by the y-axis, that is, the controlled virtual object is on a slope. If the moving speed is positive, it means going uphill, and if the moving speed is negative, it means going downhill.

[0101] If the moving speed is not equal to the preset speed, it indicates that the controlled virtual object is going uphill or downhill. In order to keep the perspective of the controlled virtual object the same as that of the real uphill or downhill when it is going uphill or downhill, the perspective parameters of the virtual camera need to be adjusted, that is, to determine that the movement parameters meet the perspective adjustment conditions.

[0102] If the moving speed is not equal to the preset speed, then determine that the movement parameters meet the perspective adjustment conditions, and then the pitch angle of the virtual camera can be adjusted to adjust the pitch angle to be the same as the perspective of the controlled virtual object in the real uphill and downhill.

[0103] The virtual camera control method of this embodiment obtains the movement parameters of the controlled virtual object in the game scene, determines whether the movement parameters meet the perspective adjustment conditions of the preset virtual camera. If the movement parameters meet the perspective adjustment conditions, then according to the incremental time, the perspective parameters of the virtual camera when displaying the first frame of the picture are corrected to obtain the target perspective parameters. It improves the effectiveness of the perspective parameter correction.

[0104] Figure 4 shows the flow diagram of the virtual camera control method provided by the embodiment of the present application Figure 3 , as Figure 4 shown, step S101, according to the incremental time of the first frame of the picture, correct the perspective parameters of the virtual camera when displaying the first frame of the picture to obtain the target perspective parameters of the virtual camera when displaying the second frame of the picture, including:

[0105] S301. Obtain the correction speed according to the incremental time of the first frame of the picture and the preset correction coefficient.

[0106] S302. According to the correction speed, correct the perspective parameters of the virtual camera when displaying the first frame of the picture to obtain the target perspective parameters of the virtual camera when displaying the second frame of the picture.

[0107] The preset correction coefficient can be determined by the game engine, and this embodiment does not make special limitations on this.

[0108] According to the product of the incremental time of the first frame of the picture and the preset correction coefficient, the correction speed can be calculated, and then according to the correction speed, the perspective parameters of the virtual camera when displaying the first frame of the picture are corrected to obtain the target perspective parameters of the virtual camera when displaying the second frame of the picture.

[0109] In an optional embodiment, step S302, correcting the viewing angle parameters of the virtual lens when displaying the first picture frame according to the correction speed to obtain the target viewing angle parameters of the virtual lens when displaying the second picture frame, includes:

[0110] Get the setting viewing angle parameters of the virtual lens when displaying the first picture frame.

[0111] According to the correction speed and the set viewing angle parameters, the viewing angle parameters of the virtual lens when displaying the first picture frame are corrected to obtain the target viewing angle parameters of the virtual lens when displaying the second picture frame.

[0112] Among them, the set viewing angle parameters of the virtual lens when displaying the first frame can be the pre-set viewing angle parameters of the virtual lens corresponding to the first frame, and the viewing angle parameters of the virtual lens when displaying the first frame are the viewing angle parameters corresponding to the first frame obtained in real time from the interface provided by the game engine.

[0113] Taking the correction speed and the set viewing angle parameters as considerations, the viewing angle parameters of the virtual lens when displaying the first picture frame are corrected to obtain the target viewing angle parameters of the virtual lens when displaying the second picture frame, thereby improving the accuracy of the target viewing angle parameters.

[0114] As an example, if the controlled virtual object is in a moving state and the moving time reaches a preset time, the viewing angle parameters include: a roll angle parameter, a preset correction coefficient is smooth1, and the incremental time of the first frame is Time.deltaTime. The product of the incremental time of the first frame and the preset correction coefficient is calculated as: smooth1×Time.deltaTime, and the correction speed is smooth1×Time.deltaTime÷6. The correction process of the viewing angle parameters of the virtual lens when displaying the first frame is: yaw2=yaw1×(1-correction speed)+yaw 设定1 × correction speed, where yaw2 is the pan angle of the virtual lens when displaying the second frame, yaw1 is the pan angle of the virtual lens when displaying the first frame, and yaw 设定1 The pan angle of the virtual lens when displaying the first frame, smooth1, can be determined according to the game engine, and is not particularly limited in this embodiment.

[0115] See also Figure 5 , Figure 5 FIG. 1 shows a schematic diagram of the second picture frame before and after adjusting the pan angle provided by an embodiment of the present application, as shown in FIG. Figure 5 As shown in (a) in the figure, in a typical football game, when the left joystick is moved, the perspective of the virtual camera does not move. The player needs to use his right hand to slide in the blank area in real time to modify the pan angle of the virtual camera. Figure 5As shown in (b) of the figure, if a 180° rotation is required, the player needs to drag the camera multiple times to reach the desired viewing angle, which is too cumbersome. However, with the auxiliary logic of this embodiment, the player only needs to control the displacement with the left joystick, and the virtual camera's orientation is automatically corrected to match the orientation of the controlled virtual object during the displacement process.

[0116] It should be noted that the correction can be stopped when the pan angle is changed until the direction of the virtual camera is the same as that of the character, or when the controlled virtual object stops moving.

[0117] This virtual camera pan correction logic allows players to pan the camera using only the joystick. This means they can single-handedly move their character's position while simultaneously rotating the camera. This allows the camera to align with the direction the character is facing while the controlled virtual object moves. This correction logic reduces the operational complexity for new players and simplifies the operation for experienced players, eliminating the need to control character movement with one hand and rotate the camera with the other.

[0118] As another example, if the controlled virtual object is in a moving state and the moving duration reaches a preset duration, the viewing angle parameters include: a pitch angle parameter, a preset correction coefficient is smooth2, and the incremental time of the first frame is Time.deltaTime. The product of the incremental time of the first frame and the preset correction coefficient is calculated as: smooth2×Time.deltaTime, and the correction speed is smooth2×Time.deltaTime÷6. The correction process of the viewing angle parameters of the virtual lens when displaying the first frame is: pitch2=pitch1×(1-correction speed)+pitch 设定1 × correction speed, where pitch2 is the pitch angle of the virtual lens when displaying the second frame, pitch1 is the pitch angle of the virtual lens when displaying the first frame, and pitch 设定1 The pitch angle of the virtual lens when displaying the first picture frame can be determined by smooth2 according to the game engine and is not particularly limited in this embodiment.

[0119] See also Figure 6 , Figure 6 FIG. 1 shows a schematic diagram of the second picture frame before and after adjusting the pitch angle provided by an embodiment of the present application, as shown in FIG. Figure 6 As shown in (a) in FIG, in a general football game, when the player moves horizontally, the perspective is in a downward or upward viewing situation.

[0120] like Figure 6 As shown in (b) in FIG, the lens needs to be manually adjusted to gradually correct the pitch angle of the virtual lens to the optimal angle, which is a cumbersome operation.

[0121] likeFigure 6 As shown in (c) of , through the auxiliary logic of this embodiment, the player only needs to control the displacement through the left joystick, and the pitch angle of the virtual camera can be automatically corrected to the optimal state during the displacement process. Specifically, when the controlled virtual object is in the looking-up state, the pitch angle of the virtual camera is corrected downward, and when the controlled virtual object is in the looking-down state, the pitch angle of the virtual camera is corrected upward, so as to correct the pitch angle of the virtual camera to the normal angle and avoid affecting the visual experience during the movement when the player's perspective is too high or too low.

[0122] It should be noted that when the pitch angle of the virtual camera reaches the above calculated value when the second frame is displayed, or when the controlled virtual object stops moving, the correction can be stopped.

[0123] In this way, under horizontal movement, the correction logic of the pitch angle enables the player to only use the direction joystick to return the pitch angle of the virtual camera to the proper position. That is, while moving the character's position with one hand, the player can correct the current looking-down or looking-up perspective, so that the pitch angle of the virtual camera is at the optimal angle. Through this correction logic, the player does not need to slide the screen in real time to correct the pitch angle of the virtual camera, and only the displacement joystick on the left hand can be used to correct the pitch angle.

[0124] As another example, if the controlled virtual object is in a moving state and the moving speed in the direction perpendicular to the preset horizontal direction is not equal to the preset speed, that is, the controlled virtual object is on a slope, then the pitch angle of the virtual camera can be gradually corrected to the optimal angle when going uphill or downhill. The preset correction coefficient is smooth3, the incremental time of the first frame is Time.deltaTime, and the correction speed is smooth1×Time.deltaTime÷6. The correction process of the viewing angle parameter of the virtual camera when the first frame is displayed is: pitch2 = pitch1×(1 - correction speed) + pitch 设定1 ×correction speed, where pitch2 is the pitch angle of the virtual camera when the second frame is displayed, pitch1 is the pitch angle of the virtual camera when the first frame is displayed, and pitch 设定1 is the set pitch angle of the virtual camera when the first frame is displayed, denoted as: actor.velocity.y×slopeCorrection, where actor.velocity.y is the moving speed of the controlled virtual object in the y-axis indicated direction, and slopeCorrection is the adjustable parameter of the correction angle. smooth3 can be determined according to the game engine, and this embodiment does not make special limitations on this.

[0125] It should be noted that when the pitch angle of the virtual camera reaches the above calculated value when the second frame is displayed, or when the controlled virtual object stops moving, the correction can be stopped.

[0126] See Figure 7 , Figure 7 which shows a schematic diagram of the second screen frame before and after adjusting the pitch angle when the controlled virtual object provided in the embodiment of the present application is on a slope. As shown in (a) of Figure 7 , when the player goes upstairs or downstairs, if the pitch angle of the virtual camera is not adjusted, the camera view will be parallel to the horizontal plane, resulting in the line of sight being blocked when going upstairs and the stairs not being visible when going downstairs.

[0127] As shown in (b) of Figure 7 , when the player goes upstairs, the player needs to manually adjust the view angle (pitch angle) of the virtual camera to an upward view. Similarly, when the player goes downstairs, the player also needs to manually adjust the view angle (pitch angle) of the virtual camera to a downward view, and the operation is relatively cumbersome.

[0128] As shown in (c) of Figure 7 , through the auxiliary logic of this embodiment, the player only needs to control the displacement through the left joystick, and the pitch angle of the camera can be automatically corrected to the best state during the displacement process.

[0129] It should be noted that when the controlled virtual object stops moving, the correction can stop.

[0130] In this way, when moving on a slope, the correction logic of the camera pitch value can enable the player to keep their view the same as the real uphill and downhill views when going uphill or downhill. On the one hand, it improves the immersion of the game, and on the other hand, it enables the player to have a better view when going uphill and downhill, enhancing the player's gaming experience.

[0131] The virtual camera control method of this embodiment obtains the correction speed according to the incremental time of the first screen frame and the preset correction coefficient, and corrects the view angle parameter of the virtual camera when displaying the first screen frame according to the correction speed to obtain the target view angle parameter of the virtual camera when displaying the second screen frame. Through the adaptive correction logic, the view angle of the virtual camera is associated with the movement of the controlled virtual object, greatly reducing the operation difficulty of the player, and at the same time, the view angle of the virtual camera can be corrected to the best angle, enhancing the player's operation experience.

[0132] Figure 8 shows the flow diagram of the virtual camera control method provided in the embodiment of the present application Figure 4 , as shown in Figure 8 , before step S301, obtaining the correction speed according to the incremental time of the first screen frame and the preset correction coefficient, the method further includes:

[0133] S401. Obtain the relative orientation of the controlled virtual object and the virtual camera when displaying the first screen frame.

[0134] Accordingly, step S301 of obtaining a correction speed according to the incremental time of the first video frame and a preset correction coefficient includes:

[0135] S402. Obtain a correction speed according to the relative orientation, the incremental time of the first video frame, and the preset correction coefficient.

[0136] In some cases, when the orientation of the controlled virtual object during movement has a large difference from the orientation of the virtual camera, if the above correction logic is adopted, the correction speed is too fast, resulting in a large difference between the viewing angle parameters of the virtual camera when displaying the first video frame and when displaying the second video frame, which may cause a large transition in the displayed video frames. To prevent this situation, the relative orientation between the controlled virtual object and the virtual camera when displaying the first video frame can be obtained, and the relative orientation can be used as a consideration factor to obtain the correction speed.

[0137] In some embodiments, the orientations of the controlled virtual object and the virtual camera when displaying the first video frame can both be represented in the form of roll angles. Then, the relative orientation between the controlled virtual object and the virtual camera when displaying the first video frame is the absolute value of the difference between these two roll angles, denoted as AngleD = |actor.yaw - camera.yaw|, where actor.yaw is the roll angle of the orientation of the controlled virtual object when displaying the first video frame, and camera.yaw is the roll angle of the orientation of the virtual camera when displaying the first video frame.

[0138] After that, a correction speed can be obtained according to the relative orientation, the incremental time of the first video frame, and the preset correction coefficient. As an example, if the controlled virtual object is in a moving state and the moving duration reaches a preset duration, and the viewing angle parameters include roll angle parameters, the correction speed can be smooth1 × msmooth is in a moving state, and moving (6 + 10th is in a moving state).

[0139] The virtual camera control method of this embodiment obtains the relative orientation between the controlled virtual object and the virtual camera when displaying the first video frame, and obtains a correction speed according to the relative orientation, the incremental time of the first video frame, and the preset correction coefficient. Thereby, it is possible to avoid excessive correction, ensure the uniform display of video frames, and improve the gaming experience of players.

[0140] Figure 9 FIG. shows a schematic structural diagram of a virtual camera control device provided by an embodiment of the present application. The virtual camera control device 50 is integrated in a virtual camera control device. As Figure 9 shown, the virtual camera control device 50 includes:

[0141] The correction module 501 is configured to correct the viewing angle parameters of the virtual lens when displaying the first frame according to the incremental time of the first frame if it is detected that the controlled virtual object in the game scene is in a moving state, so as to obtain the target viewing angle parameters of the virtual lens when displaying the second frame;

[0142] The adjustment module 502 is configured to adjust the viewing angle of the virtual lens according to the target viewing angle parameter, so as to display the second picture frame using the virtual lens after the viewing angle adjustment.

[0143] In an optional embodiment, the invention further comprises:

[0144] An acquisition module 503 is configured to acquire movement parameters of the controlled virtual object in the game scene;

[0145] A judging module 504 is configured to judge whether the movement parameters satisfy a preset viewing angle adjustment condition of the virtual lens;

[0146] The correction module 501 is specifically used to:

[0147] If the movement parameter satisfies the viewing angle adjustment condition, the viewing angle parameter of the virtual lens when displaying the first picture frame is modified according to the incremental time to obtain the target viewing angle parameter.

[0148] In an optional implementation, the movement parameter includes: a movement duration of the controlled virtual object's continuous movement, and the judgment module 504 is specifically configured to:

[0149] If the movement duration reaches a preset duration, it is determined that the movement parameter meets the viewing angle adjustment condition.

[0150] In an optional embodiment, the movement parameter includes: a movement speed of the controlled virtual object in a direction perpendicular to a preset horizontal direction, and the judgment module 504 is specifically configured to:

[0151] If the moving speed is not equal to the preset speed, it is determined that the moving parameter meets the viewing angle adjustment condition.

[0152] In an optional implementation manner, the correction module 501 is specifically configured to:

[0153] Obtaining a correction speed according to the incremental time of the first picture frame and a preset correction coefficient;

[0154] According to the correction speed, the viewing angle parameters of the virtual lens when displaying the first picture frame are corrected to obtain the target viewing angle parameters of the virtual lens when displaying the second picture frame.

[0155] In an optional implementation manner, the correction module 501 is specifically configured to:

[0156] Acquiring setting viewing angle parameters of the virtual lens when displaying the first picture frame;

[0157] The viewing angle parameters of the virtual lens when displaying the first picture frame are modified according to the correction speed and the set viewing angle parameters to obtain the target viewing angle parameters of the virtual lens when displaying the second picture frame.

[0158] In an optional implementation manner, the acquisition module 503 is further configured to:

[0159] Acquiring the relative orientation of the controlled virtual object and the virtual lens when displaying the first picture frame;

[0160] The acquisition module 503 is specifically configured to acquire the correction speed according to the relative orientation, the incremental time of the first picture frame, and the preset correction coefficient.

[0161] The implementation process and principles of the virtual lens control device of this embodiment can be found in the relevant description of the above method embodiment, and will not be repeated here.

[0162] Figure 10 FIG. 1 shows a schematic diagram of the structure of a virtual lens control device provided in an embodiment of the present application. Figure 10 As shown, the virtual lens control device 60 includes: a processor 601, a memory 602 and a bus 603. The memory 602 stores machine-readable instructions executable by the processor 601. When the virtual lens control device 60 is running, the processor 601 communicates with the memory 602 via the bus 603, and the processor 601 executes the machine-readable instructions to perform the above method embodiment.

[0163] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above method embodiment is executed.

[0164] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the method embodiments, and will not be elaborated herein. In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some communication interfaces. The indirect coupling or communication connection of the devices or modules can be in electrical, mechanical, or other forms.

[0165] In addition, each functional unit in the various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, etc., which can store program codes.

[0166] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application.

Claims

1. A virtual lens control method, characterized in that, Including: If it is detected that the controlled virtual object in the game scene is in a moving state, then according to the incremental time of the first frame, the perspective parameter of the virtual camera when displaying the first frame is corrected to obtain the target perspective parameter of the virtual camera when displaying the second frame, where the incremental time is the ratio of 1 second to the number of rendered frames of the first frame; According to the target perspective parameter, adjust the perspective of the virtual camera to display the second frame with the virtual camera after perspective adjustment; The step of correcting the perspective parameter of the virtual camera when displaying the first frame according to the incremental time of the first frame to obtain the target perspective parameter of the virtual camera when displaying the second frame includes: Obtain a correction speed according to the incremental time of the first frame and a preset correction coefficient; According to the correction speed, correct the perspective parameter of the virtual camera when displaying the first frame to obtain the target perspective parameter of the virtual camera when displaying the second frame.

2. The method according to claim 1, wherein Before the step of correcting the perspective parameter of the virtual camera when displaying the first frame according to the incremental time of the first frame to obtain the target perspective parameter of the virtual camera when displaying the second frame, the method further includes: Obtain the movement parameter of the controlled virtual object in the game scene; Determine whether the movement parameter meets the preset perspective adjustment condition of the virtual camera; The step of correcting the perspective parameter of the virtual camera when displaying the first frame according to the incremental time of the first frame to obtain the target perspective parameter of the virtual camera when displaying the second frame includes: If the movement parameter meets the perspective adjustment condition, then correct the perspective parameter of the virtual camera when displaying the first frame according to the incremental time to obtain the target perspective parameter.

3. The method according to claim 2, wherein The movement parameter includes: the movement duration of the continuous movement of the controlled virtual object. The step of determining whether the movement parameter meets the preset perspective adjustment condition of the virtual camera includes: If the movement duration reaches the preset duration, it is determined that the movement parameter meets the perspective adjustment condition.

4. The method according to claim 2, wherein The movement parameter includes: the movement speed of the controlled virtual object in the direction perpendicular to the preset horizontal direction. The step of determining whether the movement parameter meets the preset perspective adjustment condition of the virtual camera includes: If the movement speed is not equal to the preset speed, it is determined that the movement parameter meets the perspective adjustment condition.

5. The method according to claim 1, characterized in that, The step of correcting the perspective parameter of the virtual camera when displaying the first frame according to the correction speed to obtain the target perspective parameter of the virtual camera when displaying the second frame includes: Obtain the set perspective parameter of the virtual camera when displaying the first frame; According to the correction speed and the set perspective parameter, correct the perspective parameter of the virtual camera when displaying the first frame to obtain the target perspective parameter of the virtual camera when displaying the second frame.

6. The method according to claim 1 or 5, characterized in that, Before the step of obtaining the correction speed according to the incremental time of the first frame and the preset correction coefficient, the method further includes: Obtain the relative orientation of the controlled virtual object and the virtual camera when the first frame is displayed; The obtaining of the correction speed according to the incremental time of the first frame and the preset correction coefficient includes: Obtain the correction speed according to the relative orientation, the incremental time of the first frame, and the preset correction coefficient.

7. A virtual lens control device, characterized in that, Includes: A correction module, configured to, if it is detected that the controlled virtual object in the game scene is in a moving state, correct the viewing angle parameters of the virtual camera when the first frame is displayed according to the incremental time of the first frame, to obtain the target viewing angle parameters of the virtual camera when the second frame is displayed, where the incremental time is the ratio of 1 second to the number of rendered frames of the first frame; An adjustment module, configured to adjust the viewing angle of the virtual camera according to the target viewing angle parameters, so as to display the second frame using the virtual camera with the adjusted viewing angle; The correction module, specifically configured to: Obtain the correction speed according to the incremental time of the first frame and the preset correction coefficient; Correct the viewing angle parameters of the virtual camera when the first frame is displayed according to the correction speed, to obtain the target viewing angle parameters of the virtual camera when the second frame is displayed.

8. A virtual lens control device, characterized in that, Includes: A processor, a memory, and a bus, where the memory stores machine-readable instructions executable by the processor. When the virtual camera control device runs, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the method according to any one of claims 1 to 6 is executed.

Citation Information

Patent Citations

  • View angle control method and device and VR system

    CN106843470A

  • Virtual camera state control method and device, electronic equipment and storage medium

    CN108170295A