Object control method and device and electronic equipment
By dynamically adjusting the rotation angle of the virtual camera in the game on an electronic device, combining the speed and sensitivity coefficient of the sliding object, the problem of difficulty in taking into account fast turn and precise aiming in the prior art is solved, and the user's gaming experience is improved.
Patent Information
- Application Number
- CN202411972660.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-29
- Filing Date
- 2024-12-30
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is difficult to take into account both fast turn and precise aiming in games, making it difficult for users to achieve both sliding operations, affecting the gaming experience.
By implementing an object control method on an electronic device, the sliding distance of the sliding object in each frame of the scene is used to dynamically evaluate the sensitivity coefficient, and the specified angle of rotation of the virtual camera is determined based on the sliding distance, sensitivity coefficient and preset sensitivity. This enables dynamic adjustment of sensitivity.
This method allows users to flexibly control the rotation angle of the virtual camera by adjusting the speed of the sliding object, which can not only achieve rapid turn, but also accurately aim, reducing the difficulty of user operation and improving the gaming experience.
Smart Images

Figure CN119455389A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to an object control method, device and electronic equipment. Background Art
[0002] With the continuous development of communication technology, game players can experience a variety of games on various electronic devices, such as shooting games, elimination games, etc.
[0003] In various games, game scenes can be pre-built, and virtual cameras for capturing images of game scenes can be set. In this way, in various scenes of the game, the scene images seen by the user are images obtained by capturing images of the game scenes set in the game by the virtual camera set in the game. When the above-mentioned virtual camera changes the shooting angle, the user can see the scene images at different angles of the above-mentioned game scene. When the user wants to change the game scene currently seen, the user can control the rotation of the virtual camera by sliding the mouse or touching the screen to change the shooting direction of the virtual camera, so that the virtual camera can capture scene images at other shooting angles different from the current shooting angle, and in the above process, the game scene perceived by the user is that the user slides the mouse or touches the screen to rotate the manipulated game object, thereby changing the direction of the field of view. Therefore, the above-mentioned virtual camera can be rotated according to the user's operation, and when it is rotated to a certain shooting angle, the game scene at that angle is captured, so that the user can achieve the purpose of switching the game scene by controlling the rotation of the virtual camera.
[0004] That is to say, during the game, the user changes the field of view of the game object by manipulating the direction of the game object to view different scene images. The essence of this is that the user manipulates the virtual camera to change the shooting angle so that the virtual camera captures the scene image of the game scene at the changed angle and presents the scene image on the screen.
[0005] For example, in a shooting game, the scene image observed by the user through the shooting lens of the shooting tool is the scene image captured by the virtual camera. The user can control the shooting lens of the shooting tool to find the shooting target and aim at the shooting target by controlling the rotation of the virtual camera, and when aiming at the shooting target, the crosshairs of the shooting tool are always at the center of the lens of the virtual camera. When the user wants to change the shooting direction, the virtual camera can be turned to the game scene that the user wants to watch and shoot the game scene by aiming, wherein the above-mentioned aiming is to slide the screen to control the rotation of the virtual camera, so that from the user's perspective, the visual effect of changing the shooting direction of the shooting tool is achieved. Further, precise aiming is a stage in the aiming process, that is, when the crosshairs are very close to the target and only a few millimeters away, more delicate and subtle aiming operations are required at this time.
[0006] Usually, the turning and aiming of a shooting tool can be achieved by controlling the rotation angle of the virtual camera.
[0007] Among them, the so-called turning is to control the virtual camera to rotate at a larger angle, so as to achieve the effect of turning the shooting tool to the shooting target; the so-called aiming is to control the virtual camera to move at a smaller angle, so as to achieve the effect of aiming the crosshairs of the shooting tool at the shooting target.
[0008] In the related art, the rotation angle of the virtual camera is controlled according to the sliding operation of the user, and the sliding distance and the rotation angle of the virtual camera are in a fixed proportional relationship, such as 1° rotation in the game for every 1mm sliding. In this case, when the ratio of the sliding distance to the rotation angle of the virtual camera is large, sliding a shorter distance can achieve a larger angle rotation of the virtual camera. For example, sliding a shorter distance can achieve a 90° turn of the virtual camera, thereby achieving a quick turn operation, but it is impossible to achieve a precise aiming operation that only requires a small turn; and when the ratio of the sliding distance to the rotation angle of the virtual camera is small, sliding a longer distance will only achieve a smaller angle rotation of the virtual camera. For example, the sliding angle distance will only achieve a few degrees of turning of the virtual camera, thereby achieving a precise aiming operation, but if you want to achieve a larger angle rotation such as a turn operation, you need to slide the screen quickly and continuously (or slide a long cumulative distance) to achieve it. Therefore, since the rotation angle corresponding to turning and the rotation angle corresponding to aiming are different, that is, the two operations of turning and aiming have different requirements for the user's sliding operation, when the user controls the virtual lens to aim according to the sliding operation of turning, the rotation angle of the virtual camera will be too large, and the aiming accuracy will be poor; and when the user controls the virtual lens to turn according to the aiming operation, the speed of the virtual camera will be slow and the turning efficiency will be low. In this way, the user's sliding operation is difficult to take into account both fast turning and accurate aiming, which in turn affects the user's gaming experience. Summary of the invention
[0009] The purpose of the embodiments of the present invention is to provide an object control method, device and electronic device to enhance the user's gaming experience. The specific technical solution is as follows:
[0010] In a first aspect, an embodiment of the present invention provides an object control method, which is applied to an electronic device, and the method includes:
[0011] For each frame of the scene during the operation of the target application, determine the sliding distance of the sliding object used to control the rotation of the preset virtual camera in the frame of the scene; wherein the preset virtual camera is used to capture each frame of the scene;
[0012] For each frame of the scene picture, based on the preset dynamic evaluation parameter and the sliding distance, determine the sensitivity coefficient of the frame of the scene picture;
[0013] For each frame of the scene picture, according to the sliding distance, the sensitivity coefficient and the preset sensitivity, determining the specified angle to be rotated of the preset virtual camera for the next frame of the scene picture of the frame;
[0014] For each frame of the scene picture, the preset virtual camera is controlled to rotate based on the specified angle, and the preset virtual camera is controlled to capture the next frame of the scene picture when the rotation ends.
[0015] Optionally, in a specific implementation, controlling the rotation of the preset virtual camera based on the specified angle includes:
[0016] Controlling the preset virtual camera to rotate the specified angle; or,
[0017] Based on the current angle of the preset virtual camera and the specified angle when capturing the frame scene image, the target angle to which the preset virtual camera is to be rotated is determined, and based on the target angle, the rotation of the preset virtual camera is controlled.
[0018] Optionally, in a specific implementation, controlling the rotation of the preset virtual camera based on the target angle includes:
[0019] Controlling the preset virtual camera to rotate to the target angle; or,
[0020] Based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, determine the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after capturing the frame of scene picture, and control the preset virtual camera to rotate to the calibration angle; use the calibration angle as the current angle of the preset virtual camera when capturing the next frame of scene picture after capturing the frame of scene picture, and for the next frame of scene picture after the frame of scene picture, return to the step of determining the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after the frame of scene picture based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, until the angle of the preset virtual camera is the target angle when capturing the currently displayed scene picture.
[0021] Optionally, in a specific implementation, for each frame of the scene picture, determining the next frame of the scene picture for the frame of the scene picture according to the sliding distance, the sensitivity coefficient and the preset sensitivity, and the preset specified angle to be rotated of the virtual camera include:
[0022] For each frame of the scene picture, the first formula is used to calculate the specified angle to be rotated by the preset virtual camera for the next frame of the scene picture of the frame, wherein the first formula is:
[0023] ;
[0024] in, is the specified angle; X is the sliding distance; is the sensitivity coefficient; is the preset sensitivity.
[0025] Optionally, in a specific implementation, determining the calibration angle to which the preset virtual camera is to be rotated for the next frame of the scene picture based on the current angle of the preset virtual camera when the frame of the scene picture is captured, the target angle, and a preset smoothing coefficient, includes:
[0026] The second formula is used to calculate the calibration angle to which the preset virtual camera is to be rotated for the next frame of the scene frame, wherein the second formula is:
[0027] ;
[0028] in, is the calibration angle; is the preset smoothing coefficient; is the target angle; is the current angle.
[0029] Optionally, in a specific implementation, determining a sensitivity coefficient of the frame scene picture based on a preset dynamic evaluation parameter and the sliding distance includes:
[0030] Based on the preset dynamic evaluation parameter and the sliding distance, a calibration coefficient for the frame scene picture is determined, and a minimum value between the calibration coefficient and the preset coefficient is determined as the sensitivity coefficient for the frame scene picture.
[0031] In a second aspect, an embodiment of the present invention provides an object control device, which is applied to an electronic device, and the device includes:
[0032] A distance determination module, for determining, for each frame of a scene during the operation of a target application, a sliding distance of a sliding object used to control the rotation of a preset virtual camera in the frame of the scene; wherein the preset virtual camera is used to capture each frame of the scene;
[0033] A coefficient determination module, used to determine, for each frame of scene picture, a sensitivity coefficient for the frame of scene picture based on preset dynamic evaluation parameters and the sliding distance;
[0034] An angle determination module, used to determine, for each frame of scene picture, according to the sliding distance, the sensitivity coefficient and the preset sensitivity, a specified angle to be rotated by the preset virtual camera for the next frame of scene picture of the frame;
[0035] The moving module is used to control the preset virtual camera to rotate based on the specified angle for each frame of the scene picture, and control the preset virtual camera to capture the next frame of the scene picture when the rotation ends.
[0036] Optionally, in a specific implementation, the mobile module includes:
[0037] A control submodule, used to control the preset virtual camera to rotate to the specified angle; or,
[0038] The determination submodule is used to determine the target angle to which the preset virtual camera is to be rotated based on the current angle of the preset virtual camera when capturing the frame scene image and the specified angle, and control the rotation of the preset virtual camera based on the target angle.
[0039] Optionally, in a specific implementation, the determining submodule is specifically used to:
[0040] Controlling the preset virtual camera to rotate to the target angle; or,
[0041] Based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, determine the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after capturing the frame of scene picture, and control the preset virtual camera to rotate to the calibration angle; use the calibration angle as the current angle of the preset virtual camera when capturing the next frame of scene picture after capturing the frame of scene picture, and for the next frame of scene picture after the frame of scene picture, return to the step of determining the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after the frame of scene picture based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, until the angle of the preset virtual camera is the target angle when capturing the currently displayed scene picture.
[0042] Optionally, in a specific implementation, the angle determination module is specifically used to:
[0043] For each frame of the scene picture, the first formula is used to calculate the specified angle to be rotated by the preset virtual camera for the next frame of the scene picture of the frame, wherein the first formula is:
[0044] ;
[0045] in, is the specified angle; X is the sliding distance of the sliding object in the scene frame; is the sensitivity coefficient;
[0046] Optionally, in a specific implementation, the determining submodule is specifically used to:
[0047] The second formula is used to calculate the calibration angle to which the preset virtual camera is to be rotated for the next frame of the scene frame, wherein the second formula is:
[0048] ;
[0049] in, is the calibration angle; is the preset smoothing coefficient; is the target angle; is the current angle.
[0050] Optionally, in a specific implementation, the coefficient determination module is specifically used to:
[0051] Based on the preset dynamic evaluation parameter and the sliding distance, a calibration coefficient for the frame scene picture is determined, and a minimum value between the calibration coefficient and the preset coefficient is determined as the sensitivity coefficient for the frame scene picture.
[0052] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0053] Memory, used to store computer programs;
[0054] The processor is used to implement the steps of any of the above method embodiments when executing the program stored in the memory.
[0055] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above method embodiments are implemented.
[0056] In a fifth aspect, an embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps of any of the above method embodiments.
[0057] Beneficial effects of the embodiments of the present invention:
[0058] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, when controlling the preset virtual camera used to capture each frame of the scene picture, for each frame of the scene picture during the operation of the target application, the sliding distance of the sliding object used to control the rotation of the preset virtual camera in the frame of the scene picture can be first determined, and then the sensitivity coefficient of the frame of the scene picture can be determined based on the preset dynamic evaluation parameters and the above sliding distance. Then, the next frame of the scene picture of the frame of the scene picture can be determined based on the above sliding distance, the above sensitivity coefficient and the preset sensitivity, and the specified angle to be rotated of the preset virtual camera can be preset. In this way, the rotation of the preset virtual camera can be controlled based on the above specified angle, and the preset virtual camera can be controlled to capture the next frame of the scene picture when the rotation ends.
[0059] Based on this, the solution provided by the embodiment of the present invention is applied. Since the display duration of each frame of the scene picture is the same in the application, the sliding distance of the sliding object within the display duration of the frame of the scene picture can be used to characterize the sliding rate of the sliding object in the frame of the scene picture. In this way, the sliding distance of the sliding object in the current frame of the scene picture is used to determine the sensitivity coefficient of the current frame of the scene picture, and the sensitivity of the current frame of the scene picture is adjusted using the sensitivity coefficient, so that the adjusted sensitivity of the current frame of the scene picture can match the sliding rate of the sliding object in the current frame of the scene picture. In this way, the speed of the preset virtual camera rotation can be controlled by the speed at which the user moves the sliding object in each frame of the scene screen, that is, when the speed at which the user moves the sliding object is large, the adjusted sensitivity of the frame of the scene screen is large, and then the user's moving operation can control the preset virtual camera to rotate a large angle, so that, from the user's perspective, the effect of controlling the shooting tool to turn quickly is achieved; and when the speed at which the user moves the sliding object is small, the adjusted sensitivity of the frame of the scene screen is small, and then the user's moving operation can control the preset virtual camera to rotate a small angle, so that, from the user's perspective, the effect of controlling the shooting tool to accurately aim is achieved. In this way, from the user's perspective, when the virtual camera is controlled to rotate by sliding operation, the sensitivity of the sliding operation is not fixed, and it can be flexibly adjusted according to the specific operation type of the sliding operation, and only by adjusting the speed at which the sliding object is moved, the shooting tool can be controlled to turn quickly and accurately aim, thereby reducing the user's operation difficulty and improving the user's game experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0061] Figure 1 A schematic diagram of a flow chart of an object control method provided by an embodiment of the present invention;
[0062] Figure 2 A schematic diagram of an application program interface provided by an embodiment of the present invention;
[0063] Figure 3 A graph showing the relationship between the number of pixels and the sensitivity coefficient provided in the embodiment of the present statement;
[0064] Figure 4 Another schematic diagram of a flow chart of an object control method provided by an embodiment of the present invention;
[0065] Figure 5 A schematic diagram of another flow chart of the object control method provided by the embodiment of the present invention;
[0066] Figure 6 A schematic diagram of the structure of an object control device provided by an embodiment of the present invention;
[0067] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0069] In the related art, the rotation angle of the virtual camera is controlled according to the user's sliding operation. Since the rotation angle corresponding to turning and the rotation angle corresponding to aiming are different, that is, the two operations of turning and aiming have different requirements for the user's sliding operation. When the user controls the virtual lens to aim according to the sliding operation of turning, the rotation angle of the virtual camera will be too large, and the aiming accuracy will be poor; and when the user controls the virtual lens to turn according to the aiming operation, the speed of the virtual camera will be slow and the turning efficiency will be low. In this way, the user's sliding operation is difficult to take into account both fast turning and accurate aiming, which in turn affects the user's gaming experience.
[0070] In order to solve the above technical problem, an embodiment of the present invention provides an object control method.
[0071] Among them, the method is suitable for various scenarios of controlling the rotation of a preset virtual camera to achieve scene screen switching. For example, in a shooting game, the virtual camera is controlled to rotate by sliding the touch screen, and when the rotation ends, the scene screen where the shooting target is located is captured.
[0072] Furthermore, the method can be applied to various electronic devices, such as mobile phones, tablet computers, laptop computers, and LED (Light Emitting Diode) screens, etc. For the sake of clarity, the subject that executes the technical solution provided by this application is referred to as an electronic device below.
[0073] An object control method provided by an embodiment of the present invention is applied to an electronic device and may include the following steps:
[0074] For each frame of the scene during the operation of the target application, determine the sliding distance of the sliding object used to control the rotation of the preset virtual camera in the frame of the scene; wherein the preset virtual camera is used to capture each frame of the scene;
[0075] For each frame of the scene picture, based on the preset dynamic evaluation parameter and the sliding distance, determine the sensitivity coefficient of the frame of the scene picture;
[0076] For each frame of the scene picture, according to the sliding distance, the sensitivity coefficient and the preset sensitivity, determining the specified angle to be rotated of the preset virtual camera for the next frame of the scene picture of the frame;
[0077] For each frame of the scene picture, the preset virtual camera is controlled to rotate based on the specified angle, and the preset virtual camera is controlled to capture the next frame of the scene picture when the rotation ends.
[0078] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, when controlling a preset virtual camera, for each frame, the sliding distance of the sliding object used to control the movement of the virtual camera in the frame scene picture can be first determined, and then the sensitivity coefficient of the frame scene picture can be determined based on the preset dynamic evaluation parameters and the above sliding distance. Then, the specified angle to be rotated of the virtual camera in the frame scene picture can be determined based on the above sliding distance, the above sensitivity coefficient and the preset sensitivity. In this way, the movement of the virtual camera in the next frame of the frame scene picture can be controlled based on the above specified angle.
[0079] Based on this, the solution provided by the embodiment of the present invention is applied. Since the display duration of each frame of the scene picture is the same in the application, the sliding distance of the sliding object within the display duration of the frame of the scene picture can be used to characterize the sliding rate of the sliding object in the frame of the scene picture. In this way, the sliding distance of the sliding object in each frame of the scene picture is used to determine the sensitivity coefficient of the frame of the scene picture, and the sensitivity of the frame of the scene picture is adjusted using the sensitivity coefficient, so that the adjusted sensitivity of the frame of the scene picture can match the sliding rate of the sliding object in the frame of the scene picture. In this way, the speed of the preset virtual camera rotation can be controlled by the speed at which the user moves the sliding object in each frame of the scene screen, that is, when the speed at which the user moves the sliding object is large, the adjusted sensitivity of the frame of the scene screen is large, and then the user's moving operation can control the preset virtual camera to rotate a large angle, so that, from the user's perspective, the effect of controlling the shooting tool to turn quickly is achieved; and when the speed at which the user moves the sliding object is small, the adjusted sensitivity of the frame of the scene screen is small, and then the user's moving operation can control the preset virtual camera to rotate a small angle, so that, from the user's perspective, the effect of controlling the shooting tool to accurately aim is achieved. In this way, from the user's perspective, when the virtual camera is controlled to rotate by sliding operation, the sensitivity of the sliding operation is not fixed, and it can be flexibly adjusted according to the specific operation type of the sliding operation, and only by adjusting the speed at which the sliding object is moved, the shooting tool can be controlled to turn quickly and accurately aim, thereby reducing the user's operation difficulty and improving the user's game experience.
[0080] An object control method provided by an embodiment of the present invention is described in detail below in conjunction with the accompanying drawings.
[0081] Figure 1 A flow chart of an object control method provided by an embodiment of the present invention is provided. The method is applied to an electronic device, such as Figure 1 As shown, the following steps S101-S104 may be included:
[0082] S101: for each frame of a scene picture during the running of a target application, determining a sliding distance of a sliding object used to control the rotation of a preset virtual camera in the frame of the scene picture.
[0083] Among them, the preset virtual camera is used to capture each frame of the scene.
[0084] An electronic device capable of human-computer interaction can display scene images of various applications. Among them, the current frame scene image is a scene image in a preset application scene captured by a preset virtual camera at the current angle for capturing each frame of the scene image. In this way, when the user wants to change the scene image currently being viewed, the preset virtual camera can be controlled to rotate by sliding the mouse or touching the screen, thereby changing the capture angle of the preset virtual camera, and then, the preset virtual camera can capture scene images at other capture angles different from the current angle. In this way, what the user perceives is that the scene image is switched by sliding the mouse or touching the screen.
[0085] Among them, since the same application object can exist in different scene pictures, the effect of switching the scene pictures achieved by sliding the mouse or touching the screen is equivalent to: changing the position and / or posture of the same application object in different scene pictures by sliding the mouse or touching the screen, thereby displaying the scene pictures in different fields of view brought about by the position and / or posture switching of the same application object.
[0086] For example, in a sports game, a user can control a designated character in the sports game to move in various game scenes by continuously sliding a mouse that communicates with an electronic device.
[0087] For another example, in a shooting game, the user can control the shooting lens to turn and aim by sliding on the touch screen of the electronic device.
[0088] For example, Figure 2 The game interface of a shooting game displayed by an electronic device, such as Figure 2As shown, there are multiple control buttons on the game interface, among which 210 is a crouch button, 220 is a shooting button, 230 is a run and jump button, 240 is a movement button, and 250 is a direction button. The user can switch the state of the game character in the game by touching the crouch button 210, the shooting button 220 and the run and jump button 230 with a finger, and can also control the preset virtual camera to rotate in a specified direction by touching the movement button 240 and the direction button 250 with a finger. When the user wants to aim and shoot at the shooting object 280 in the game, the user can touch the shooting button 220 with a finger to switch the current state 260 of the game character to the shooting state. In this way, when the user slides the movement button 240 and the direction button 250 with a finger, the aiming area 270 can be controlled to rotate with the preset virtual camera to the game scene screen pointed to by the user's finger sliding operation, so that the preset virtual camera can capture the game scene screen, and the shooting object 280 in the game scene screen can enter the aiming area 270. Thus, the user can feel that by sliding the finger, the aiming area 270 can be controlled to move to the area where the shooting object 280 is located.
[0089] In the embodiment of the present invention, during the operation of the target application, the user can change the acquisition angle of the virtual camera by controlling the movement of the sliding object used to control the rotation of the preset virtual camera. Based on this, for each frame of the scene screen during the operation of the target application, the sliding distance of the sliding object used to control the rotation of the preset virtual camera in the frame of the scene screen can be determined, and the specified angle to be rotated of the preset virtual camera can be determined based on the sliding distance of the sliding object in each frame of the scene screen.
[0090] The display duration of each frame of the scene is the same, so the display duration of each frame of the scene can be used as a collection period to collect the sliding distance of the sliding object in the frame of the scene. For example, the display duration of each frame of the scene can be 16ms or 30ms, which is reasonable and is not specifically limited in the embodiments of the present invention.
[0091] Furthermore, for different electronic devices, the way of controlling the preset virtual camera may be different. For example, for an electronic device equipped with a touch screen, the user can control the preset virtual camera by sliding the touch screen with a finger; and for an electronic device connected to a mouse, the preset virtual camera can be controlled by sliding the mouse that communicates with the electronic device. Based on this, the above-mentioned sliding object can be various objects that can control the preset virtual camera, such as a mouse cursor, a touch pen, and a user's finger, etc., which are all reasonable and are not specifically limited in the embodiments of the present invention.
[0092] In addition, according to the size of the display screen of the electronic device, the sliding distance of the above-mentioned sliding object in each frame of the scene picture can be the number of pixels that the sliding object slides in the frame of the scene picture, for example, in the frame of the scene picture, the user's finger slides over 300 pixels on the touch screen of the electronic device; it can also be the actual length that the sliding object slides on the display screen of the electronic device, for example, in the frame of the scene picture, the user's finger slides over 3 centimeters on the touch screen of the electronic device. This is all reasonable and is not specifically limited in the embodiments of the present invention.
[0093] S102: For each frame of the scene picture, determine a sensitivity coefficient for the frame of the scene picture based on preset dynamic evaluation parameters and the sliding distance.
[0094] For each frame of the scene picture, after determining the sliding distance of the sliding object in the frame of the scene picture, the sensitivity coefficient of the frame of the scene picture can be determined by using the preset dynamic evaluation parameters and the sliding distance.
[0095] Optionally, a preset sensitivity coefficient calculation formula may be used to calculate the sensitivity coefficient of the frame scene image, wherein the sensitivity coefficient calculation formula may be expressed as:
[0096] ;
[0097] Wherein, A, B, C, and D are all preset dynamic evaluation parameters, and A, B, C, and D are all constants; X is the sliding distance of the sliding object in the scene picture of the frame; is the sensitivity coefficient.
[0098] Furthermore, the specific values of A, B, C, and D are related to the performance data of the electronic device and the frame rate of the target application running on the electronic device.
[0099] For example, when the frame rate of the target application run by the electronic device is 20 frames per second, the preset dynamic evaluation parameters A, B, C, and D may be 0.1, 0.03, 1.6, and 2000, respectively; and when the frame rate of the target application run by the electronic device is 60 frames per second, the preset dynamic evaluation parameters A, B, C, and D may be 0.12, 0.014, 1.78, and 1550, respectively.
[0100] In addition, it can be known from the above sensitivity coefficient calculation formula that, for each frame of scene picture, the sensitivity coefficient of the frame of scene picture is related to the sliding distance of the above sliding object in the frame of scene picture.
[0101] For example, when the sliding distance of the sliding object in the frame scene is the number of pixels, the relationship between the number of pixels and the sensitivity coefficient can be as follows: Figure 3 shown.
[0102] Among them, Figure 3 It can be seen that when the frame rate of the target application run by the electronic device is 40 frames per second and the preset dynamic evaluation parameters A, B, C, and D are 0.1, 0.03, 1.6, and 2000 respectively, the curve used to characterize the relationship between the sensitivity coefficient and the number of pixels is similar to the exponential curve. Thus, the changing trend of the sensitivity coefficient with the increase in the number of pixels is similar to the changing trend of the exponential curve. Therefore, the above-mentioned sensitivity coefficient increases with the increase in the number of pixels. That is to say, for each frame of the scene, the greater the sliding distance of the sliding object in the frame of the scene, the greater the sensitivity coefficient of the frame of the scene can be.
[0103] Generally, for the same sliding operation of the user, the greater the sensitivity coefficient, the greater the rotation angle of the preset virtual camera. Figure 3 As shown, for each frame of the scene, when the user controls the sliding object to move a large sliding distance in the frame of the scene, the value of the sensitivity coefficient of the frame of the scene is large, which leads to a large change between the next frame of the scene captured by the preset virtual camera and the frame of the scene captured by the preset virtual camera. As a result, the next frame of the scene of the frame cannot be reasonably connected with the current frame of the scene, affecting the user's gaming experience.
[0104] Based on this, a preset coefficient for sensitivity can be set in the target application. The preset coefficient is the extreme value of the sensitivity coefficient and is also the maximum value of the sensitivity coefficient that can reasonably transition between adjacent frame scene images. When the sensitivity coefficient of the current frame scene image is greater than the preset coefficient, it may cause the preset virtual camera to rotate too much, so that the change between the next frame scene image captured by the preset virtual camera and the current frame scene image captured by the preset virtual camera is too large to reasonably transition. Therefore, for each frame scene image, after determining a sensitivity coefficient based on the above-mentioned sliding distance, the minimum value between the determined sensitivity coefficient and the preset coefficient can be determined as the sensitivity coefficient of the frame scene image.
[0105] Optionally, in a specific implementation, the above step S102 may include the following step 11:
[0106] Step 11: Based on the preset dynamic evaluation parameters and the sliding distance, determine the calibration coefficient for the frame scene image, and determine the minimum value between the calibration coefficient and the preset coefficient as the sensitivity coefficient for the frame scene image.
[0107] In an embodiment of the present invention, after determining the sliding distance of the sliding object, a calibration coefficient regarding the sensitivity of the frame scene picture can be determined based on preset dynamic evaluation parameters and the sliding distance. In this way, after determining the above calibration coefficient, the minimum value of the above calibration coefficient and the preset coefficient can be determined as the sensitivity coefficient regarding the frame scene picture.
[0108] The calibration coefficient of the frame scene picture can be calculated using a preset calibration coefficient calculation formula, wherein the calibration coefficient calculation formula can be expressed as:
[0109] ;
[0110] in, is the calibration coefficient; A, B, C, and D are all preset dynamic evaluation parameters, and A, B, C, and D are all constants; X is the sliding distance of the sliding object in the scene of this frame.
[0111] The above process of determining the sensitivity coefficient of the frame scene image in the calibration coefficient and the preset coefficient can be expressed by the following coefficient selection formula:
[0112] ;
[0113] in, is the preset coefficient.
[0114] Moreover, the value of the above preset coefficient is related to the frame rate of the target application running on the electronic device. For example, when the frame rate of the target application is 20 frames per second, the preset coefficient is 0.5; and when the frame rate of the target application is 60 frames per second, the preset coefficient is 0.3.
[0115] In this way, by selecting a smaller value between the determined calibration coefficient and the preset coefficient as the sensitivity coefficient for the frame image, it is possible to avoid the preset virtual camera rotating at an excessively large angle due to the determined sensitivity coefficient being too large, thereby causing a situation where the change between the next frame of scene image captured by the preset virtual camera and the current frame of scene image captured by the preset virtual camera is too large to be reasonably transitioned. Instead, the rotation angle of the preset virtual camera is controlled within a reasonable range, so that the current frame of scene image captured by the preset virtual camera can be smoothly transitioned to the next frame of scene image captured by the preset virtual camera, thereby bringing a more comfortable gaming experience to the user.
[0116] S103: For each frame of the scene picture, determine the next frame of the scene picture for the frame of the scene picture according to the sliding distance, the sensitivity coefficient and the preset sensitivity, and preset a specified angle for the virtual camera to be rotated.
[0117] For each frame of the scene, after determining the sensitivity coefficient of the frame, the next frame of the scene for the frame can be determined based on the sensitivity coefficient, the sliding distance and the preset sensitivity, and the specified angle to be rotated of the virtual camera can be preset.
[0118] That is to say, the determined specified angle can be used to determine: the angle that the preset virtual camera needs to rotate at the current angle in order to capture the next frame of the scene picture of the frame; that is, after capturing the frame of the scene picture, the virtual camera can determine a rotation angle according to the above specified angle, thereby rotating the above determined rotation angle, and after the rotation is completed, the next frame of the scene picture of the frame is captured. The above rotation angle can be the above specified angle, or it can be another angle determined based on the above specified angle.
[0119] For each frame of the scene, since each frame of the scene has a display duration, the display duration of the frame of the scene and the moving distance of the sliding object in the frame of the scene can be used to characterize the speed at which the user moves the sliding object in the frame of the scene. Then, based on the above moving distance, the sensitivity coefficient of the frame of the scene is determined, and the preset sensitivity can be adjusted using the above sensitivity coefficient, and the product of the above sensitivity coefficient and the preset sensitivity is used as the adjusted sensitivity of the frame of the scene. In this way, the adjusted sensitivity of the frame of the scene can be matched with the speed at which the user moves the above sliding object in the frame of the scene. Among them, the sensitivity can also be called the aiming sensitivity, which can characterize the sliding distance of the sliding object used to control the rotation of the preset virtual camera in the frame of the scene, and the ratio of the rotation angle of the preset virtual camera. Under the same sliding distance, the higher the sensitivity, the larger the rotation angle of the preset virtual camera. Furthermore, the acquisition angle of the virtual camera can be preset for the next frame of the scene picture according to the adjusted sensitivity of the frame of the scene picture, thereby determining the specified angle of the virtual camera to be rotated for the next frame of the scene picture, so that the size of the determined specified angle matches the rate at which the user moves the above-mentioned sliding object in the frame of the scene picture.
[0120] Optionally, in a specific implementation, the above step S103 may include the following step 21: for each frame of the scene picture, using the first formula, calculate the next frame of the scene picture for the frame of the scene picture, and preset the specified angle to be rotated by the virtual camera, wherein the first formula is:
[0121] ;
[0122] in, is the specified angle; X is the sliding distance of the sliding object in the scene of this frame; is the sensitivity coefficient; is the preset sensitivity.
[0123] S104: For each frame of the scene, control the preset virtual camera to rotate based on the specified angle, and control the preset virtual camera to capture the next frame of the scene when the rotation ends.
[0124] For each frame, after determining the specified angle to be rotated of the preset virtual camera, the preset virtual camera can be controlled to rotate based on the specified angle, and the preset virtual camera can be controlled to capture the next frame of the scene when the rotation ends.
[0125] When the preset virtual camera in the target application is at the same acquisition angle, the continuous multiple frames of scene images captured by the preset virtual camera at the acquisition angle all correspond to the same scene image in the preset program scene, that is, the next frame of scene image captured by the preset virtual camera is the same as the current frame of scene image captured by the preset virtual camera. The sliding operation performed by the user on the sliding object in the current frame of scene image can present the control result of the sliding operation on the preset virtual camera in the next frame of scene image.
[0126] For example, in the current frame of the scene, the user can control the virtual camera to rotate 10 degrees by sliding the object to capture the preset application scene where the shooting target is located. When the preset virtual camera captures the next frame of the scene, its capture angle is rotated 10 degrees compared to the capture angle of the preset virtual camera when capturing the current frame of the scene, and the next frame of the scene captured by the preset virtual camera is the preset application scene where the shooting target is located.
[0127] That is to say, the operation performed by the user on the current frame of the scene can determine the angle at which the preset virtual camera captures the next frame of the scene. Based on this, for each frame of the scene, after determining the above-mentioned specified angle, the preset virtual camera can be controlled to rotate based on the above-mentioned specified angle, and when the preset virtual camera finishes rotating, the preset virtual camera can be controlled to capture the next frame of the scene.
[0128] When controlling the rotation of the preset virtual camera based on the above-mentioned specified angle, the preset virtual camera can be controlled to rotate to the above-mentioned specified angle; or the target angle to which the preset virtual camera is to be rotated can be first determined based on the above-mentioned specified angle and the current angle of the preset virtual camera, and then the preset virtual camera is controlled to rotate to the target angle. This is all reasonable. In the embodiments of the present application, the specific implementation method of controlling the rotation of the preset virtual camera based on the specified angle is not limited.
[0129] Optionally, in a specific implementation, such as Figure 4 As shown, the above step S104 may include the following step S1041:
[0130] S1041: Control the preset virtual camera to rotate to a specified angle.
[0131] In this specific implementation, after determining the specified angle to be rotated of the virtual camera, the preset virtual camera can be controlled to rotate the specified angle, so that the acquisition angle of the preset virtual camera is turned to the angle desired by the user.
[0132] Optionally, in a specific implementation, such as Figure 5 As shown, the above step S104 may include the following step S1042:
[0133] S1042: Determine a target angle to which the preset virtual camera is to be rotated based on the current angle and the designated angle of the preset virtual camera when the frame of the scene is captured, and control the rotation of the preset virtual camera based on the target angle.
[0134] In this specific implementation, after determining the specified angle to which the above-mentioned preset virtual camera is to be rotated, the above-mentioned specified angle and the current angle of the preset virtual camera when capturing the frame of the scene can be used to determine the target angle to which the preset virtual camera is to be rotated, that is, the capture angle of the preset virtual camera when the user wishes to capture the next frame of the scene. After that, the rotation of the preset virtual camera can be controlled based on the above-mentioned target angle.
[0135] After determining the specified angle and the current angle, the preset target angle calculation formula can be used to determine the target angle to which the preset virtual camera is to be rotated. The target angle calculation formula can be expressed as:
[0136] ;
[0137] in, is the target angle; is the current angle, is the specified angle.
[0138] When controlling the preset virtual camera to rotate based on the target angle, the preset virtual camera can be directly controlled to rotate from the current angle to the target angle.
[0139] Optionally, in a specific implementation, the above step S1042 may include the following step 31:
[0140] Step 31: Control the preset virtual camera to rotate to the target angle.
[0141] In this specific implementation, after determining the target angle, the preset virtual camera can be controlled to rotate to the target angle, that is, when capturing the next frame of the scene, the capture angle of the preset virtual camera is the target angle.
[0142] Usually, in actual operation, when the user wants to control the preset virtual camera to rotate to a larger angle, the sliding object can be controlled to move a larger sliding distance in the frame of the scene picture. However, since the frame rate of each frame of the scene picture is relatively low, if the preset virtual camera is directly controlled to rotate to the angle that the user wants the preset virtual camera to rotate, the next frame of the scene picture captured by the preset virtual camera may not be connected with the current frame of the scene picture, thereby causing the user to see the switching of the two unconnected frames of the scene picture being completed instantly, rather than a relatively smooth rotation from the current frame of the scene picture to the next frame of the scene picture, thereby affecting the user's viewing experience. Based on this, in order to make the adjacent two frames of scene images captured by the preset virtual camera switch more smoothly, a smoothing coefficient for the rotation angle of the preset virtual camera can be set, so that the acquisition angle of the preset virtual camera can be controlled to rotate more smoothly from the current angle of the scene frame to the target angle, that is, the preset virtual camera is controlled to rotate so that the acquisition angle of the preset virtual camera in the next frame of the scene is the target angle, which is changed to controlling the preset virtual camera to rotate smoothly so that the preset virtual camera gradually rotates the acquisition angle to the target angle in the process of capturing multiple consecutive frames of the scene after the current frame of the scene. Thereby, the above-mentioned preset virtual camera can rotate from the current angle to the target angle more smoothly.
[0143] Optionally, in a specific implementation, the above step S1042 may include the following steps 41-42:
[0144] Step 41: Based on the current angle, target angle and preset smoothing coefficient of the preset virtual camera when capturing the frame of scene image, determine the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene image captured by the frame of scene image, and control the preset virtual camera to rotate to the calibration angle.
[0145] Step 42: Using the calibration angle as the current angle of the virtual camera preset when capturing the next frame of the scene picture after the frame of the scene picture, and returning to the step of determining the calibration angle to which the preset virtual camera is to be rotated for the next frame of the scene picture after the frame of the scene picture, based on the current angle, target angle and preset smoothing coefficient of the virtual camera preset when capturing the frame of the scene picture, until the angle of the preset virtual camera is the target angle when capturing the currently displayed scene picture.
[0146] In this specific implementation, after determining the above-mentioned target angle, the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after capturing the frame of scene picture can be determined based on the current angle of the preset virtual camera when capturing the frame of scene picture, the above-mentioned target angle, and the preset smoothing coefficient. Then, the calibration angle is used as the current angle of the preset virtual camera when capturing the next frame of scene picture after the frame of scene picture. Thereafter, for the next frame of scene picture after the frame of scene picture, return to step 41 until the angle of the preset virtual camera is the target angle when capturing the currently displayed scene picture.
[0147] Optionally, in a specific implementation, based on the target angle, the current angle of the virtual camera and the preset smoothing coefficient, a second formula can be used to calculate the calibration angle to which the virtual camera is to be rotated for the next frame of the scene frame. The second formula can be expressed as:
[0148] ;
[0149] in, is the calibration angle; is the preset smoothing coefficient, is the current angle, is the target angle.
[0150] Moreover, the above-mentioned smoothing coefficient is related to the picture frame rate of the target application running on the electronic device. For example, when the picture frame rate of the target application is 20 frames / second, the above-mentioned smoothing coefficient can be 0.95; and when the picture frame rate of the target application is 60 frames / second, the above-mentioned smoothing coefficient can be 0.5.
[0151] After determining the calibration angle, the calibration angle to which the virtual camera is to be rotated can be preset based on the next frame of the scene frame, and the rotation angle of the preset virtual camera from the current angle to the calibration angle can be determined using the preset rotation angle calculation formula. The rotation angle calculation formula can be expressed as:
[0152] ;
[0153] in, is the rotation angle from the current angle to the calibration angle, is the calibration angle, is the current angle.
[0154] In this way, the preset virtual camera can be controlled to rotate to the above-mentioned calibration angle, so that the calibration angle can be used as the current angle of the preset virtual camera when capturing the next frame of the scene picture of the frame, and for the next frame of the scene picture of the frame, continue to execute the above-mentioned steps based on the current angle, target angle and preset smoothing coefficient of the preset virtual camera when capturing the frame of the scene picture, and determine the calibration angle to which the preset virtual camera is to be rotated for the next frame of the frame of the scene picture, until the angle of the preset virtual camera is the above-mentioned target angle when capturing the currently displayed scene picture.
[0155] In this way, the acquisition angle of the preset virtual camera can be smoothly rotated from the current angle to the target angle through several frames. In this process, since each frame of the scene captured by the preset virtual camera is continuous, the switching of each frame of the scene is also continuous. In this way, it can be avoided that the user experience is affected by the inability to connect two adjacent frames of the scene.
[0156] Since the device performance parameters of different electronic devices may be different, in order to take into account electronic devices with different device performance parameters, a relationship table 1 of preset coefficients, preset dynamic evaluation parameters, preset smoothing coefficients and the frame rate of the application program that can be applied to a variety of electronic devices is provided. As shown in Table 1, the table lists the preferred values of the preset coefficients, preset dynamic evaluation parameters and preset smoothing coefficients at different frame rates. When the frame rate of the application program is 20 frames per second, the preset dynamic evaluation parameters A, B, C, and D may be 0.1, 0.03, 1.6, and 2000, respectively, the preset coefficient may be 0.5, and the preset smoothing coefficient may be 0.95; when the frame rate of the application program is 25 frames per second, the preset dynamic evaluation parameters A, B, C, and D may be 0.1, 0.03, 1.6, and 2000, respectively. 2000, the preset coefficient may be 0.5, and the preset smoothing coefficient may be 0.95; when the frame rate of the application is 30 frames per second, the preset dynamic evaluation parameters A, B, C, and D may be 0.1, 0.03, 1.6, and 2000, respectively, the preset coefficient may be 0.5, and the preset smoothing coefficient may be 0.9; when the frame rate of the application is 40 frames per second, the preset dynamic evaluation parameters A, B, C, and D may be 0.1, 0.03, 1.6, and 2000, respectively, the preset coefficient may be 0.5, and the preset smoothing coefficient may be 0.7; and when the frame rate of the application is 60 frames per second, the preset dynamic evaluation parameters A, B, C, and D may be 0.12, 0.014, 1.78, and 1550, respectively, the preset coefficient may be 0.3, and the preset smoothing coefficient may be 0.5.
[0157] Table 1
[0158] Frame rate (frames / second) A B C D Preset coefficient Preset smoothing factor 20 0.1 0.03 1.6 2000 0.5 0.95 25 0.1 0.03 1.6 2000 0.5 0.95 30 0.1 0.03 1.6 2000 0.5 0.9 40 0.1 0.03 1.6 2000 0.5 0.7 60 0.12 0.014 1.78 1550 0.3 0.5
[0159] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, since the display duration of each frame of the scene picture is the same in the application, the sliding distance of the sliding object within the display duration of the frame of the scene picture can be used to characterize the sliding rate of the sliding object in the frame of the scene picture. In this way, the sliding distance of the sliding object in the current frame of the scene picture is used to determine the sensitivity coefficient of the current frame of the scene picture, and the sensitivity of the current frame of the scene picture is adjusted using the sensitivity coefficient, so that the adjusted sensitivity of the current frame of the scene picture can match the sliding rate of the sliding object in the current frame of the scene picture. In this way, the speed of the preset virtual camera rotation can be controlled by the speed at which the user moves the sliding object in each frame of the scene screen, that is, when the speed at which the user moves the sliding object is large, the adjusted sensitivity of the frame of the scene screen is large, and the user's moving operation can control the preset virtual camera to rotate a large angle, so that, from the user's perspective, the effect of controlling the shooting tool to turn quickly is achieved; and when the speed at which the user moves the sliding object is small, the adjusted sensitivity of the frame of the scene screen is small, and then, the user's moving operation can control the preset virtual camera to rotate a small angle, so that, from the user's perspective, the effect of controlling the shooting tool to accurately aim is achieved. In this way, from the user's perspective, when the virtual camera is controlled to rotate by sliding operation, the sensitivity of the sliding operation is not fixed, and it can be flexibly adjusted according to the specific operation type of the sliding operation, and only by adjusting the speed at which the sliding object is moved, the shooting tool can be controlled to turn quickly and accurately aim, thereby reducing the user's operating difficulty and improving the user's gaming experience.
[0160] Based on the same inventive concept, corresponding to the above-mentioned embodiment of the present invention, Figure 1 An object control method is shown, and an embodiment of the present invention also provides an object control device.
[0161] Figure 6 A schematic diagram of the structure of an object control device provided by an embodiment of the present invention is applied to electronic equipment, such as Figure 6 As shown, the device may include the following modules:
[0162] The distance determination module 610 is used to determine the sliding distance of the sliding object used to control the rotation of the preset virtual camera in each frame of the scene picture during the operation of the target application; wherein the preset virtual camera is used to capture each frame of the scene picture;
[0163] A coefficient determination module 620, configured to determine, for each frame of scene picture, a sensitivity coefficient for the frame of scene picture based on a preset dynamic evaluation parameter and the sliding distance;
[0164] An angle determination module 630, for determining, for each frame of the scene picture, according to the sliding distance, the sensitivity coefficient and the preset sensitivity, a specified angle to be rotated of the preset virtual camera for the next frame of the scene picture;
[0165] The moving module 640 is used to control the preset virtual camera to rotate based on the specified angle for each frame of the scene picture, and control the preset virtual camera to capture the next frame of the scene picture when the rotation ends.
[0166] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, since the display duration of each frame of the scene picture is the same in the application, the sliding distance of the sliding object within the display duration of the frame of the scene picture can be used to characterize the sliding rate of the sliding object in the frame of the scene picture. In this way, the sliding distance of the sliding object in the current frame of the scene picture is used to determine the sensitivity coefficient of the current frame of the scene picture, and the sensitivity of the current frame of the scene picture is adjusted using the sensitivity coefficient, so that the adjusted sensitivity of the current frame of the scene picture can match the sliding rate of the sliding object in the current frame of the scene picture. In this way, the speed of the preset virtual camera rotation can be controlled by the speed at which the user moves the sliding object in each frame of the scene screen, that is, when the speed at which the user moves the sliding object is large, the adjusted sensitivity of the frame of the scene screen is large, and then the user's moving operation can control the preset virtual camera to rotate a large angle, so that, from the user's perspective, the effect of controlling the shooting tool to turn quickly is achieved; and when the speed at which the user moves the sliding object is small, the adjusted sensitivity of the frame of the scene screen is small, and the user's moving operation can control the preset virtual camera to rotate a small angle, so that, from the user's perspective, the effect of controlling the shooting tool to accurately aim is achieved. In this way, from the user's perspective, when the virtual camera is controlled to rotate by sliding operation, the sensitivity of the sliding operation is not fixed, and it can be flexibly adjusted according to the specific operation type of the sliding operation, and only by adjusting the speed at which the sliding object is moved, the shooting tool can be controlled to turn quickly and accurately aim, thereby reducing the user's operating difficulty and improving the user's gaming experience.
[0167] Optionally, in a specific implementation, the moving module 640 includes:
[0168] A control submodule, used to control the preset virtual camera to rotate to the specified angle; or,
[0169] The determination submodule is used to determine the target angle to which the preset virtual camera is to be rotated based on the current angle of the preset virtual camera when capturing the frame scene image and the specified angle, and control the rotation of the preset virtual camera based on the target angle.
[0170] Optionally, in a specific implementation, the determining submodule is specifically used to:
[0171] Controlling the preset virtual camera to rotate to the target angle; or,
[0172] Based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, determine the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after capturing the frame of scene picture, and control the preset virtual camera to rotate to the calibration angle; use the calibration angle as the current angle of the preset virtual camera when capturing the next frame of scene picture after capturing the frame of scene picture, and for the next frame of scene picture after the frame of scene picture, return to the step of determining the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after the frame of scene picture based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, until the angle of the preset virtual camera is the target angle when capturing the currently displayed scene picture.
[0173] Optionally, in a specific implementation, the angle determination module 630 is specifically configured to:
[0174] For each frame of the scene picture, the first formula is used to calculate the specified angle to be rotated by the preset virtual camera for the next frame of the scene picture of the frame, wherein the first formula is:
[0175] ;
[0176] in, is the specified angle; X is the sliding distance of the sliding object in the scene frame; is the sensitivity coefficient; is the preset sensitivity.
[0177] Optionally, in a specific implementation, the determining submodule is specifically used to:
[0178] The second formula is used to calculate the calibration angle to which the preset virtual camera is to be rotated for the next frame of the scene frame, wherein the second formula is:
[0179] ;
[0180] in, is the calibration angle; is the preset smoothing coefficient; is the target angle; is the current angle.
[0181] Optionally, in a specific implementation, the coefficient determination module 620 is specifically used to:
[0182] Based on the preset dynamic evaluation parameter and the sliding distance, a calibration coefficient for the frame scene picture is determined, and a minimum value between the calibration coefficient and the preset coefficient is determined as the sensitivity coefficient for the frame scene picture.
[0183] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0184] Memory 703, used for storing computer programs;
[0185] The processor 701 is used to implement the steps of any object control method provided by the above-mentioned embodiment of the present invention when executing the program stored in the memory 703.
[0186] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0187] The communication interface is used for communication between the above electronic device and other devices.
[0188] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0189] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0190] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned object control methods are implemented.
[0191] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any object control method in the above embodiments.
[0192] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0193] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0194] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, electronic device embodiment, computer-readable storage medium embodiment, and computer program product embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0195] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An object control method, characterized in that: Applied to electronic equipment, the method comprises: For each frame of the scene during the operation of the target application, determine the sliding distance of the sliding object used to control the rotation of the preset virtual camera in the frame of the scene; wherein the preset virtual camera is used to capture each frame of the scene; For each frame of the scene picture, based on the preset dynamic evaluation parameter and the sliding distance, determine the sensitivity coefficient of the frame of the scene picture; For each frame of the scene picture, according to the sliding distance, the sensitivity coefficient and the preset sensitivity, determining the specified angle to be rotated of the preset virtual camera for the next frame of the scene picture of the frame; For each frame of the scene picture, the preset virtual camera is controlled to rotate based on the specified angle, and the preset virtual camera is controlled to capture the next frame of the scene picture when the rotation ends.
2. The method according to claim 1, characterized in that The controlling the rotation of the preset virtual camera based on the specified angle includes: Controlling the preset virtual camera to rotate the specified angle; or, Based on the current angle of the preset virtual camera and the specified angle when capturing the frame scene image, the target angle to which the preset virtual camera is to be rotated is determined, and based on the target angle, the rotation of the preset virtual camera is controlled.
3. The method according to claim 2, characterized in that The controlling the preset virtual camera to rotate based on the target angle includes: Controlling the preset virtual camera to rotate to the target angle; or, Based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, determine the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after capturing the frame of scene picture, and control the preset virtual camera to rotate to the calibration angle; use the calibration angle as the current angle of the preset virtual camera when capturing the next frame of scene picture after capturing the frame of scene picture, and for the next frame of scene picture after the frame of scene picture, return to the step of determining the calibration angle to which the preset virtual camera is to be rotated for the next frame of scene picture after the frame of scene picture based on the current angle of the preset virtual camera when capturing the frame of scene picture, the target angle and the preset smoothing coefficient, until the angle of the preset virtual camera is the target angle when capturing the currently displayed scene picture.
4. The method according to claim 1, characterized in that The step of determining, for each frame of the scene picture, the next frame of the scene picture for the frame of the scene picture according to the sliding distance, the sensitivity coefficient and the preset sensitivity, and the preset designated angle of the virtual camera to be rotated includes: For each frame of the scene picture, the first formula is used to calculate the specified angle to be rotated by the preset virtual camera for the next frame of the scene picture of the frame, wherein the first formula is: ; in, is the specified angle; is the sliding distance; is the sensitivity coefficient; is the preset sensitivity.
5. The method according to claim 3, characterized in that: The step of determining the calibration angle to which the preset virtual camera is to be rotated for the next frame of the scene picture based on the current angle of the preset virtual camera when the frame of the scene picture is captured, the target angle, and the preset smoothing coefficient includes: The second formula is used to calculate the calibration angle to which the preset virtual camera is to be rotated for the next frame of the scene frame, wherein the second formula is: ; in, is the calibration angle; is the preset smoothing coefficient; is the target angle; is the current angle.
6. The method according to any one of claims 1 to 5, characterized in that: The determining of the sensitivity coefficient of the frame scene picture based on the preset dynamic evaluation parameter and the sliding distance includes: Based on the preset dynamic evaluation parameter and the sliding distance, a calibration coefficient for the frame scene picture is determined, and a minimum value between the calibration coefficient and the preset coefficient is determined as the sensitivity coefficient for the frame scene picture.
7. An object control device, characterized in that: Applied to electronic equipment, the device comprises: A distance determination module, for determining, for each frame of a scene during the operation of a target application, a sliding distance of a sliding object used to control the rotation of a preset virtual camera in the frame of the scene; wherein the preset virtual camera is used to capture each frame of the scene; A coefficient determination module, used to determine, for each frame of scene picture, a sensitivity coefficient for the frame of scene picture based on preset dynamic evaluation parameters and the sliding distance; An angle determination module, used to determine, for each frame of scene picture, according to the sliding distance, the sensitivity coefficient and the preset sensitivity, a specified angle to be rotated by the preset virtual camera for the next frame of scene picture of the frame; The moving module is used to control the preset virtual camera to rotate based on the specified angle for each frame of the scene picture, and control the preset virtual camera to capture the next frame of the scene picture when the rotation ends.
8. The device according to claim 7, characterized in that The coefficient determination module is specifically used for: Based on the preset dynamic evaluation parameter and the sliding distance, a calibration coefficient for the frame scene picture is determined, and a minimum value between the calibration coefficient and the preset coefficient is determined as the sensitivity coefficient for the frame scene picture.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.