Virtual Camera Control Method, Device, Storage Medium and Electronic Device

By adjusting the relative distance between the virtual lens and the object in real time according to the movement speed and position information of the virtual object, the problem of single control of the virtual lens is solved, and a richer picture composition and smoother lens movement are achieved.

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

Patent Information

Application Number
CN202210623013.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-01
Publication Date
2025-07-25
Estimated Expiration
2042-06-01

AI Technical Summary

Technical Problem

The existing virtual lens control method is relatively single, and it cannot effectively adapt to the picture composition needs of virtual objects in different moving states, resulting in insufficient sense of speed and fluency in the game screen.

Method used

By determining the movement speed and position information of the virtual object, adjusting the relative distance between the virtual lens and the virtual object according to the object movement speed, and determining the target position of the virtual lens based on the relative distance and position information, thereby controlling the movement of the virtual lens in real time.

Benefits of technology

It improves the diversity and richness of virtual lens control, enhances the sense of speed of the game screen, and reduces the sense of lag in the movement of virtual lenses, and improves smoothness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114849234B_ABST
    Figure CN114849234B_ABST
Patent Text Reader

Abstract

The present disclosure provides a virtual camera control method, apparatus, storage medium, and electronic device, relating to the field of game technologies. The virtual camera control method includes: determining the object movement speed and object position information of a current virtual object; determining a relative distance between the virtual camera and the virtual object according to the object movement speed; wherein the current object movement speed is positively correlated with the lever arm length of the virtual camera; determining a target position of the virtual camera according to the relative distance and the object position information; and controlling the virtual camera to move to the target position. The technical problem of the relatively single current control method of the virtual camera is solved, and the technical effect of improving the diversification and richness of the virtual camera control method is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The lever - arm type game vision refers to a virtual camera implementation method applied to CG (Computer Graphics) movie shooting and games, which can effectively solve the vision or gaze problems of main objects such as virtual characters, so that when the virtual camera angle changes, the main object still remains at the corresponding position of the virtual camera.

[0003] In order to maintain the overall composition effect of the picture, currently, mainly by adjusting the lever - arm length between the virtual camera and the virtual character as in Figure 1 or by directly moving the lever - arm away from the virtual character or the virtual camera as in Figure 2 to adjust the relative position relationship between the virtual camera and the virtual character.

[0004] Currently, the control method of virtual cameras is relatively single. Summary of the Invention

[0005] The present disclosure provides a virtual camera control method, device, storage medium, and electronic device, thereby improving the technical effect of the diversification and richness of virtual camera control methods.

[0006] In a first aspect, an embodiment of the present disclosure provides a virtual camera control method, including:

[0007] Determine the object movement speed and object position information of the current virtual object;

[0008] Determine the relative distance between the virtual camera and the virtual object according to the object movement speed; wherein, the object movement speed is positively correlated with the relative distance;

[0009] Determine the target position of the virtual camera according to the relative distance and the object position information;

[0010] Control the virtual camera to move to the target position.

[0011] In an optional embodiment of the present disclosure, determining the relative distance between the virtual camera and the virtual object according to the object movement speed includes:

[0012] Determine the lever - arm movement speed of the virtual lever - arm of the virtual camera;

[0013] Determine the relative distance between the virtual camera and the virtual object according to the relative magnitudes of the object movement speed and the lever - arm movement speed.

[0014] In an optional embodiment of the present disclosure, determining the relative distance between the virtual camera and the virtual object according to the relative magnitudes of the object movement speed and the lever - arm movement speed includes:

[0015] If the moving speed of the object is greater than the moving speed of the lever arm, increase the distance between the virtual camera and the virtual object to obtain a relative distance.

[0016] In an optional embodiment of the present disclosure, determining the relative distance between the virtual camera and the virtual object according to the relative magnitudes of the moving speed of the object and the moving speed of the lever arm includes:

[0017] If the moving speed of the object is less than the moving speed of the lever arm, shorten the distance between the virtual camera and the virtual object to obtain a relative distance.

[0018] In an optional embodiment of the present disclosure, the numerical values after non-dimensionalization processing of the moving speed of the object and the relative distance are equal.

[0019] In an optional embodiment of the present disclosure, determining the target position of the virtual camera according to the relative distance and the object position information includes:

[0020] Determine the lens position information of the current virtual camera;

[0021] Determine the relative moving direction of the virtual object relative to the virtual camera according to the lens position information and the moving speed of the object;

[0022] Determine the target position of the virtual camera according to the relative moving direction, the relative distance, and the object position information.

[0023] In an optional embodiment of the present disclosure, determining the target position of the virtual camera according to the relative moving direction, the relative distance, and the object position information includes:

[0024] If the relative moving direction of the virtual object relative to the virtual camera is approaching the virtual camera, determine the position having the relative distance from the position where the virtual object is located as the target position of the virtual camera.

[0025] In an optional embodiment of the present disclosure, determining the target position of the virtual camera according to the relative moving direction, the relative distance, and the object position information includes:

[0026] If the relative moving direction of the virtual object relative to the virtual camera is away from the virtual camera, determine the control point position information of the lever arm control point of the virtual lever arm according to the object position information, the object moving speed, the lens position information, and a preset limit distance; wherein, the lever arm control point refers to the end point of the virtual lever arm away from the virtual camera;

[0027] Determine the target position of the virtual camera according to the control point position information, the relative distance, and the object position information.

[0028] In an optional embodiment of the present disclosure, determining the control point position information of the lever arm control point of the virtual lever arm according to the object position information, the object moving speed, the lens position information, and a preset limit distance includes:

[0029] Determine the first direction vector and the second direction vector of the virtual lens according to the lens position information; wherein, the plane where the first direction and the second direction are located is parallel to the plane where the virtual lens is located, and the first direction is perpendicular to the second direction;

[0030] Determine the target adjustment distance of the virtual lever arm according to the first direction vector, the second direction vector, the speed scalar vector of the object movement speed, and the preset limit distance;

[0031] Determine the control point position of the virtual lever arm according to the target adjustment distance and the object position information.

[0032] In an optional embodiment of the present disclosure, determining the target adjustment distance of the virtual lever arm according to the first direction vector, the second direction vector, the speed scalar vector of the object movement speed, and the preset limit distance includes:

[0033] Calculate the first inner product of the speed scalar vector of the object movement speed and the first direction vector;

[0034] Calculate the product of the first inner product and the preset limit distance;

[0035] Calculate the second inner product of the speed scalar vector of the object movement speed and the second direction vector;

[0036] Calculate the sum of the product and the second inner product to obtain the target adjustment distance of the virtual lever arm.

[0037] In an optional embodiment of the present disclosure, if the relative movement direction of the virtual object with respect to the virtual lens is away from the virtual lens, determining the control point position information of the virtual lever arm according to the object position information, the object movement speed, the lens position information, and the preset limit distance includes:

[0038] If the relative movement direction of the virtual object with respect to the virtual lens is away from the virtual lens, determine whether the current position of the virtual object exceeds the preset trigger range according to the object position information;

[0039] If the current position of the virtual object exceeds the preset trigger range, determine the control point position information of the virtual lever arm according to the object position information, the object movement speed, the lens position information, and the preset limit distance.

[0040] In a second aspect, an embodiment of the present disclosure provides a virtual lens control device, and the device includes:

[0041] A first determination module, configured to determine the object movement speed and the object position information of the current virtual object;

[0042] A second determination module, configured to determine the relative distance between the virtual lens and the virtual object according to the object movement speed; wherein, the object movement speed is positively correlated with the relative distance;

[0043] A third determination module, configured to determine a target position of the virtual camera according to the relative distance and the object position information;

[0044] A control module, configured to control the virtual camera to move to the target position.

[0045] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0046] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the above method by executing the executable instructions.

[0047] The technical solution of the present disclosure has the following beneficial effects:

[0048] The virtual camera control method provided by the embodiment of the present disclosure first determines the object movement speed and object position information of the current virtual object, determines the relative distance between the virtual camera and the virtual object according to the object movement speed, then determines the target position of the virtual camera according to the relative distance and the object position information, and finally adjusts the virtual camera to the target position to complete the control of the virtual camera. In a first aspect, the embodiment of the present disclosure adjusts the relative distance between the virtual camera and the virtual object in real time according to the object movement speed of the virtual object, so that the relative distance between the virtual camera and the virtual object can be adjusted in real time according to different movement states of the virtual object, such as walking, jumping, running, flying, etc., to construct a picture composition corresponding to the current movement state, greatly enhancing the sense of speed of the game picture, thereby solving the technical problem that the current control method of the virtual camera is relatively single, and achieving the technical effect of improving the diversification and richness of the virtual camera control method;

[0049] In a second aspect, since the relative distance between the virtual camera and the virtual object is positively correlated with the movement speed of the virtual camera, that is to say, the farther the virtual lever arm is from the virtual object, the faster the movement speed of the virtual lever arm, and the closer the virtual lever arm is to the virtual object, the slower the movement speed of the virtual lever arm, so that the virtual camera is smoother when starting and stopping moving, the sense of jerk is greatly reduced, and the smoothness of the virtual camera movement is greatly improved.

[0050] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings here are incorporated into the description and form a part of this description, showing embodiments consistent with the present disclosure, and are used together with the description to explain the principles of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.

[0052] Figure 1 Schematic diagram of a graphical user interface provided by a terminal device during operation, showing an exemplary embodiment;

[0053] Figure 2 Schematic diagram of a graphical user interface provided by a terminal device during operation, showing an exemplary embodiment;

[0054] Figure 3 Schematic diagram of a graphical user interface provided by a terminal device during operation, showing an exemplary embodiment;

[0055] Figure 4 Flowchart showing a virtual lens control method in an exemplary embodiment;

[0056] Figure 5 Schematic diagram of a graphical user interface provided by a terminal device during operation, showing an exemplary embodiment;

[0057] Figure 6 Flowchart showing a virtual lens control method in an exemplary embodiment;

[0058] Figure 7 Flowchart showing a virtual lens control method in an exemplary embodiment;

[0059] Figure 8 Schematic diagram of a graphical user interface provided by a terminal device during operation, showing an exemplary embodiment;

[0060] Figure 9 Flowchart showing a virtual lens control method in an exemplary embodiment;

[0061] Figure 10 Flowchart showing a virtual lens control method in an exemplary embodiment;

[0062] Figure 11 Flowchart showing a virtual lens control method in an exemplary embodiment;

[0063] Figure 12 Schematic diagram of a graphical user interface provided by a terminal device during operation, showing an exemplary embodiment;

[0064] Figure 13Shows a schematic structural diagram of a virtual lens control device in this exemplary embodiment;

[0065] Figure 14 Shows a schematic structural diagram of an electronic device in this exemplary embodiment. Detailed implementation manners

[0066] Now, exemplary embodiments will be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be used. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.

[0067] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0068] The flowcharts shown in the accompanying drawings are only exemplary illustrations and do not necessarily include all steps. For example, some steps can be decomposed, while some steps can be combined or partially combined, so the actual execution order may change according to the actual situation.

[0069] In the related art, the lever - type game vision refers to a virtual lens implementation method applied to CG (Computer Graphics) movie shooting and games, which can effectively solve the visual or gaze problems of main objects such as virtual characters, so that when the virtual lens angle changes, the main object still remains at the corresponding position of the virtual lens. In order to ensure the composition effect of the overall picture, currently, mainly by Figure 1 adjusting the lever length between the virtual lens 110 and the virtual object 120, or as Figure 2The relative position between the virtual camera 110 and the virtual object 120 is adjusted by directly moving the lever arm away from the virtual object 120 or the virtual camera 110. Currently, the control method of the virtual camera is relatively single.

[0070] In view of the above problems, the embodiments of the present disclosure provide a virtual camera control method to improve the diversification, richness, and smoothness of the virtual camera control method. The application environment of the virtual camera control method provided by the embodiments of the present disclosure is briefly introduced as follows:

[0071] The embodiments of the present disclosure are applied to a terminal device, which may be a local terminal device, such as any electronic device with a human-computer interaction interface, such as a mobile phone, a tablet computer, a computer, etc., or a client device in a cloud interaction system, such as a server, etc. The embodiments of the present disclosure do not make specific limitations. Please continue to refer to Figure 1 and Figure 2 , when the terminal device is running, it can provide a graphical user interface 10, which includes at least one virtual object 120 and a virtual camera 110. The virtual object 120 is a specific object entity, such as a virtual character of a player in a game world, that is, the object that the player needs to control. The virtual object 120 may be any virtual image such as a person, an animal, a machine, etc. The embodiments of the present disclosure do not make specific limitations. The virtual object 120 can move based on the player's control in the graphical user interface 10, such as walking, running, jumping, flying, etc. The virtual camera 110 moves with the movement of the virtual object 120, continuously collects images in the field of view of the virtual object 120, and displays the collected pictures in the graphical user interface 10 for the player to observe the current field of view content of the virtual object 120 in the game world in real time. It should be noted that the virtual camera 110 is generally hidden in the graphical user interface 10, and of course, it can also be displayed in the graphical user interface 10 in real time or under a certain trigger instruction. The embodiments of the present disclosure do not make specific limitations and can be specifically set according to actual situations.

[0072] During the movement of the virtual object 120, in order to ensure the composition effect of the overall picture in the graphical user interface 10, the virtual camera 110 also moves continuously with the virtual object 120. Please refer to Figure 3 , when the virtual object 120 gradually approaches the reference object, Figure 3 (a) is the picture before the virtual object 120 moves, Figure 3 (b) is the picture after the virtual object 120 moves. If the length of the lever arm between the virtual camera 110 and the virtual object 120 remains fixed, the proportion of the virtual object 120 in the image user interface remains unchanged. However, as the virtual camera 110 gradually approaches the virtual reference object 130, the proportion of the virtual reference object 130 in Figure 3 (b) compared to Figure 3(a) becomes larger.

[0073] The following briefly explains some terms in the embodiments of the present disclosure:

[0074] A virtual camera lens refers to the image acquisition lens of a virtual camera in the game world, which is used to collect environmental information within the field of view of the subject object or in the virtual scene where the subject object is located.

[0075] The virtual lever arm is different from the adjustment lever arm of a camera in real life in the embodiments of the present disclosure. The virtual lever arms disclosed in the embodiments of the present disclosure all refer to the lever arms used to connect the virtual camera lens and the virtual object in the game world. One end of the virtual lever arm is connected to the virtual camera lens, and the other end is connected to the virtual object or opposite to the virtual object. If the virtual lever arm does not leave the virtual object, then the virtual lever arm is a line segment between the virtual camera lens and the virtual object; if the virtual lever arm leaves the virtual object, then the virtual lever arm is a line segment with a fixed length, one end connected to the virtual camera lens and the other end free.

[0076] Taking the above terminal device as the execution subject, an example is given below in which the virtual camera lens control method is applied to the above terminal device to adjust the position of the virtual camera lens. Please refer to Figure 4 , the virtual camera lens control method provided by the embodiments of the present disclosure includes the following steps 401-step 404:

[0077] Step 401, the terminal device determines the object movement speed and object position information of the current virtual object.

[0078] Among them, the object movement speed refers to the speed with direction and rate magnitude of the virtual object during the movement process, rather than simply the rate representing the magnitude; the object position information is used to indicate the position where the virtual object is currently located in the game world, and can be represented in any way such as coordinates. The object movement speed can be determined in the following several ways: The first way, the terminal device calculates the object movement speed through the distance between the position coordinates of the virtual object in two adjacent frames and the time interval between the two frames; The second way, the server terminal calculates the object movement speed based on the time consumed by the virtual object moving from the previous position coordinate to the current position coordinate in the game world and the distance between the previous position coordinate and the current position coordinate, and sends it to the terminal device; The third way, the object movement speed is pre-configured by the game developer according to different game scenarios. For example, the movement speed is 1m / s in the valley scene, 3m / s on the lawn scene, 200m / s in the air scene, etc. If the current virtual object moves in the valley scene, the corresponding object movement speed is 1m / s. Of course, the ways to determine the object movement speed include but are not limited to the above three ways, and will not be enumerated here.

[0079] Step 402: The terminal device determines the relative distance between the virtual camera and the virtual object according to the object movement speed.

[0080] Among them, the object movement speed is positively correlated with the relative distance. That is to say, the faster the object movement speed, the longer the relative distance. On the contrary, the slower the object movement speed, the shorter the relative distance. The terminal device can determine the relative distance in a qualitative way, that is, when the object movement speed increases, the distance between the two is stretched, and when the speed is smaller, the distance between the two is shortened; or determine the relative distance in a quantitative way. For example, a proportional coefficient is set, and the product of the value of the object movement speed and the proportional coefficient is calculated, and the obtained value is used as the value of the relative distance. Of course, the method of determining the relative distance of the virtual camera according to the object movement speed includes but is not limited to the above two. This embodiment will not enumerate them here and can be selected according to the actual situation, as long as the current object movement speed is positively correlated with the lever arm length of the virtual camera.

[0081] Step 403: The terminal device determines the target position of the virtual camera according to the relative distance and the object position information.

[0082] The terminal device takes the position corresponding to the current object position information of the virtual object as the origin, and constructs a line segment with a length of the relative distance along the direction of the optical axis of the virtual camera. The position of the end point of the line segment far from the virtual camera is the target position of the virtual camera.

[0083] Step 404: The terminal device controls the virtual camera to move to the target position.

[0084] After obtaining the target position of the virtual camera based on the above step 403, moving the virtual camera to the target position can make the picture composition formed by the image information currently collected by the virtual camera match the speed of the current virtual object.

[0085] The virtual camera control method provided by the embodiments of the present disclosure first determines the object movement speed and object position information of the current virtual object, determines the relative distance between the virtual camera and the virtual object according to the object movement speed, then determines the target position of the virtual camera according to the relative distance and the object position information, and finally adjusts the virtual camera to the target position to complete the control of the virtual camera. First, the embodiments of the present disclosure adjust the relative distance between the virtual camera and the virtual object in real time according to the object movement speed of the virtual object, so that the relative distance between the virtual camera and the virtual object can be adjusted in real time according to different movement states of the virtual object, such as walking, jumping, running, flying, etc., to construct a picture composition corresponding to the current movement state, greatly enhancing the sense of speed of the game picture, thereby solving the technical problem that the current control method of the virtual camera is relatively single, and achieving the technical effect of improving the diversification and richness of the virtual camera control method;

[0086] Secondly, since the relative distance between the virtual lens and the virtual object is positively correlated with the moving speed of the virtual lens, that is to say, the farther the virtual lever is from the virtual object, the faster the moving speed of the virtual lever, and the closer the virtual lever is to the virtual object, the slower the moving speed of the virtual lever. This makes the virtual lens smoother when starting and stopping, the sense of lag is greatly reduced, and the smoothness of the movement of the virtual lens is greatly improved.

[0087] The following explanation is given to the embodiment of the present disclosure regarding the enhancement of the sense of speed of the game screen by adjusting the lever arm:

[0088] The current object movement speed of the virtual object is positively correlated with the relative distance between the virtual lens and the virtual object. The sense of speed is generated by the displacement of other elements around the virtual object. The faster the virtual object moves, the longer the virtual lever arm is, the farther the relative distance between the virtual object and the virtual lens is, and the more scene elements are captured by the virtual lens. The current sense of speed of the virtual object can be characterized by the number or type of scene element changes per unit time, and more information can also be provided to players to facilitate players to judge the current scene status. Correspondingly, the slower the virtual object moves, the shorter the virtual lever arm is, the closer the relative distance between the virtual object and the virtual lens is, and the closer the scene elements around the virtual object are to the virtual lens, the greater the displacement difference displayed on the current interface will be, thereby enhancing the sense of speed of the virtual object.

[0089] In view of the fact that the current object moving speed of the virtual object is positively correlated with the lever arm length of the virtual lens, the embodiment of the present disclosure is explained as follows:

[0090] See also Figure 5 , point A is used to represent the position of the virtual object 120, and point B is used to represent the end point of the virtual lens 110 arm close to the virtual object 120. Assuming that the time interval between the current frame game screen and the previous frame game screen is t, the coordinates of the virtual object A in the current frame are Anew, and the coordinates in the previous frame are Aold, the coordinates of the end point B of the virtual lens arm in the current frame are Bnew, and the coordinates in the previous frame are Bold, and the arm mixing coefficient is T, then,

[0091] The arm velocity of the virtual lens Bv = (Bnew-Bold) / t (1)

[0092] The coordinates of the virtual lens in the current frame are Bnew = [Anew × clamp (t / T, 0, 1)] + {Bold × [1-clamp (t / T, 0, 1)]} (2)

[0093] clamp(A, B, C) represents a responsive layout function used to limit the value of A to be not less than B and not greater than C. If the arm lever mixing coefficient T = 1 and 0 < t < 1, the above formula (2) can be converted into the following formula (3):

[0094] Bnew = (Anew × t) + [Bold × (1 - t)] (3)

[0095] The above formula (3) is simplified as follows:

[0096] Bnew = (Anew × t) + [Bold × (1 - t)] (3)

[0097] Bnew = (Anew × t) + Bold – (Bold × t)

[0098] Bnew - Bold = (Anew × t) – (Bold × t)

[0099] (Bnew - Bold) / t = Anew – Bold (4)

[0100] Combining formula (1) and formula (4), the following can be obtained:

[0101] The arm lever speed Bv = Anew – Bold (5)

[0102] The object movement speed Av of the virtual object = (Anew - Aold) / t (6)

[0103] When the arm lever speed Bv of the virtual camera is consistent with the object movement speed Av of the virtual object, the distance between the virtual object and the arm lever of the virtual camera remains unchanged, that is, the distance from the virtual camera remains fixed:

[0104] Av = Bv (7)

[0105] Then substituting the above formulas (5) and (6) into formula (7), the following formula (8) can be obtained:

[0106] (Anew - Aold) / t = Anew – Bold (8)

[0107] At the same time, the distance moved by the virtual arm lever per unit time is consistent with the distance moved by the virtual object per unit time, that is, Anew - Aold = Bnew - Bold. Substituting this into formula (8), the following formula (9) can be obtained:

[0108] (Bnew - Bold) / t = Anew – Bold (9)

[0109] It can be clearly seen from Formulas (8) and (9) that Formula (2) can make the distance between the starting point of the virtual lever arm and the virtual object infinitely close to the moving speed value of the virtual object. Although their physical units are different, the dimensionless numerical values can be infinitely close. That is to say, the moving speed of the virtual camera and the distance from the virtual object will be automatically adjusted according to the moving speed of the virtual object. During the adjustment process, when the distance between the virtual lever arm and the virtual object is pulled to be equal to (or a ratio of) the moving speed value of the virtual object, the distance between the virtual camera and the virtual object remains at a constant value.

[0110] Regarding the improvement of the smoothness of virtual camera movement mentioned above, the embodiments of the present disclosure are explained as follows:

[0111] Assumption: A x is the coordinate of the virtual object A at the Xth frame, and C x is the coordinate of the endpoint C on the side of the virtual lever arm of the virtual camera away from the virtual object A at the Xth frame; A x+1 is the coordinate of the virtual object A at the (X + 1)th frame, and C x+1 is the coordinate of the endpoint C of the lever arm at the (X + 1)th frame; A x+2 is the coordinate of the virtual object A at the (X + 2)th frame, and C x+2 is the coordinate of the endpoint C of the lever arm at the (X + 2)th frame.

[0112] When the time interval between two frames is t, and 0 < t < 1, according to Formula (3) above, the coordinate of the endpoint C of the virtual lever arm at the 1st frame is:

[0113] C x+1 = (A x+1 × t) + [C x × (1 - t)] (10)

[0114] The coordinate of the endpoint C of the virtual lever arm at the 2nd frame is:

[0115] C x+2 = (A x+2 × t) + [C x+1 × (1 - t)] (11)

[0116] Assume that the object A is stationary between two frames, then that is A x+1 = A x+2 , substituting into Formula (11) to obtain:

[0117] C x+2 = (A x+1 × t) + [C x+1 × (1 - t)] (12)

[0118] Subtracting formula (12) from formula (10) gives:

[0119] C x+2 -C x+1 = (A x+1 × t) + [C x+1 × (1 - t)] - (A x+1 × t) - [C x × (1 - t)]

[0120] C x+2 -C x+1 = (1 - t) × (C x+1 -C x ) (13)

[0121] It can be seen from formula (13) that:

[0122] When the virtual lever arm continuously approaches the virtual object A, the speed becomes smaller and smaller and approaches 0 infinitely. And the current moving distance of the virtual lever arm is (1 - t) times the moving distance of the previous frame. When the frame interval time is equal, the virtual lever arm has a decelerating ability. Conversely, when the virtual lever arm continuously moves away from the virtual object A, the speed of the virtual lever arm becomes larger and larger and approaches the speed of the virtual object A infinitely. And the virtual lever arm makes a gradually accelerating motion until the distance between the virtual lever arm and the virtual object A is pulled to be the same as the value (or a ratio) of the speed of the virtual A, the distance between the virtual camera and the virtual character A remains at a constant value.

[0123] Formula (3) makes the motion law of the virtual lever arm show acceleration control according to distance, and this law is the same as the motion law of tying a spring between the starting point of the virtual lever arm and the virtual object A.

[0124] Please refer to Figure 6 , in an optional embodiment of the present disclosure, the above step 402, determining the relative distance between the virtual camera and the virtual object according to the object moving speed, includes the following steps 601 - step 602:

[0125] Step 601, the terminal device determines the lever arm moving speed of the virtual lever arm of the virtual camera.

[0126] The lever arm moving speed can be the moving speed of the end of the lever arm close to the virtual object, and of course it can also be the moving speed of any other position on the virtual lever arm. This embodiment does not make a specific limitation.

[0127] Step 602, the terminal device determines the relative distance between the virtual camera and the virtual object according to the relative magnitude of the object moving speed and the lever arm moving speed.

[0128] As described in the above steps, the moving speed of the object is positively correlated with the moving speed of the virtual lever arm. The terminal device can determine the magnitude of the moving speed of the object based on a preset moving speed. In this embodiment, the terminal device determines the relative magnitude of the moving speed of the object through the moving speed of the lever arm, and the relative distance between the virtual lens and the virtual object obtained is more matched with the state of the virtual object in the actual game scene, and the reliability is higher.

[0129] In an alternative embodiment of the present disclosure, the above step 602, where the terminal device determines the relative distance between the virtual lens and the virtual object according to the relative magnitudes of the moving speed of the object and the moving speed of the lever arm, includes the following two cases:

[0130] In the first case, if the moving speed of the object is greater than the moving speed of the lever arm, the distance between the virtual lens and the virtual object is increased to obtain the relative distance.

[0131] In the second case, if the moving speed of the object is less than the moving speed of the lever arm, the distance between the virtual lens and the virtual object is shortened to obtain the relative distance.

[0132] The terminal device can first determine the relative magnitudes of the moving speed of the object and the moving speed of the lever arm. If the moving speed of the object is greater than the moving speed of the lever arm, it means that the current virtual object moves faster, and correspondingly, the distance between the virtual lens and the virtual object is increased; on the contrary, if the moving speed of the object is less than the moving speed of the lever arm, it means that the virtual object moves slower currently, and correspondingly, the distance between the virtual lens and the virtual object is shortened. Judging the moving speed of the virtual object through the relative magnitude with the moving speed of the lever arm makes the relative distance of the obtained virtual lens more matched with the state of the virtual object in the actual game scene, and the reliability is higher.

[0133] In an alternative embodiment of the present disclosure, the numerical values after dimensionless processing of the moving speed of the object and the relative distance are equal.

[0134] As the above formula (9):

[0135] Av = Bv

[0136] =(Bnew - Bold) / t = Anew – Bold (9)

[0137] Wherein, Av is the moving speed of the object, and Anew – Bold is the relative distance. By adjusting the numerical values of the two to be equal, the moving speed of the object of the virtual object and the moving speed of the lever arm of the virtual lens can be made equal, which also means that the relative distance between the virtual object and the virtual lens reaches the maximum value. More information can be collected while maintaining the picture composition for the player to judge the current environment where the virtual object is located, further improving the player's gaming experience.

[0138] Please refer toFigure 7 , in an optional embodiment of the present disclosure, in step 403 above, the terminal device determines the target position of the virtual lens according to the relative distance and the object position information, including the following steps 701-703:

[0139] Step 701, the terminal device determines the lens position information of the current virtual lens.

[0140] The terminal device embodiment determines the position where the virtual lens is currently located, and this lens position information can be represented in any way such as coordinates.

[0141] Step 702, the terminal device determines the relative movement direction of the virtual object relative to the virtual lens according to the lens position information and the object movement speed.

[0142] Speed has a direction. In this embodiment, the directionality of the speed and the lens position are used to determine the relative movement direction of the virtual object relative to the virtual lens. This relative movement direction can be moving left, moving right, moving forward or moving backward, etc.; of course, the terminal device can also determine the specific angle of the relative movement direction of the virtual object relative to the virtual lens according to the specific direction scalar of the speed. This embodiment does not make specific limitations.

[0143] Step 703, the terminal device determines the target position of the virtual lens according to the relative movement direction, the relative distance and the object position information.

[0144] For example Figure 8 in, the relative movement direction is moving forward, the relative distance is 10m, and the object position information of the virtual object 120 is point A(x0, y0, z0). The terminal device then emits a ray from point A(x0, y0, z0) as the source point to the virtual lens 110, and the position corresponding to the point on this ray that is 10m away from the virtual object 120 ( Figure 8 point C in) is the target position corresponding to this virtual lens.

[0145] The embodiment of the present disclosure first determines the relative movement direction of the virtual object relative to the virtual lens according to the lens position information and the object movement speed, and then determines the target position of the virtual lens according to the relative movement direction, the relative distance and the object position information, which can take into account the different lens requirements of the virtual object in different movement directions to the greatest extent, so as to determine the target position of the corresponding virtual lens according to the actual movement direction, further improving the flexibility, comprehensiveness and reliability of the virtual lens control method in the embodiment of the present disclosure.

[0146] In an optional embodiment of the present disclosure, in step 703 above, the terminal device determines the target position of the virtual lens according to the relative movement direction, the relative distance and the object position information, including the following two cases:

[0147] In the first case, if the relative movement of the virtual object with respect to the virtual camera is in a direction approaching the virtual camera, the terminal device determines the target position of the virtual camera as the position that is at a relative distance from the position where the virtual object is located.

[0148] The relative movement direction of the virtual object with respect to the virtual camera is approaching the virtual camera, that is to say, the virtual object is moving forward with respect to the virtual camera. In this case, the virtual camera can capture most of the scene elements in the environment where the virtual object is located. Therefore, the terminal device can directly determine the position that is at a relative distance from the position where the virtual object is located as the target position of the virtual camera based on the method described in step 703 above.

[0149] In the second case, if the relative movement direction of the virtual object with respect to the virtual camera is away from the virtual camera, the terminal device determines the control point position information of the virtual lever arm according to the object position information, the object movement speed, the camera position information, and the preset limit distance.

[0150] Among them, the lever arm control point refers to an end point of the lever arm of the virtual camera that is away from the virtual camera. The relative movement direction of the virtual object with respect to the virtual camera is away from the virtual camera, that is, the virtual object is moving left, right, or backward with respect to the virtual camera. When the virtual object is moving left, right, or backward with respect to the virtual camera, the virtual camera stays behind the virtual object and captures fewer scene elements. Therefore, in this case, the terminal device determines the control point position information of the virtual lever arm according to the object position information, the object movement speed, the camera position information, and the preset limit distance, and then determines the target position of the virtual camera based on the lever arm control point information, which can ensure that the virtual camera captures more information to the greatest extent, enhance the sense of speed during the movement of the virtual object, and further improve the player's gaming experience.

[0151] Please refer to Figure 9 , in an optional embodiment of the present disclosure, in the above second case, the terminal device determines the control point position information of the virtual lever arm according to the object position information, the object movement speed, the camera position information, and the preset limit distance, including the following steps 901-step 903:

[0152] Step 901, the terminal device determines the first direction vector and the second direction vector of the virtual camera according to the camera position information.

[0153] Among them, the lens position information refers to the position where the virtual lens is located. Based on this position, the first direction and the second direction of the virtual lens are determined. The plane where the first direction and the second direction are located is parallel to the plane where the virtual lens is located, and the first direction and the second direction are perpendicular to each other. For example, if the plane where the virtual lens is located is the yz plane of the spatial coordinate system, the first direction can be +x, and the second direction can be -y or +y. Or in other words, the first direction is in front of the lens relative to the lens, and the second direction is to the left or right of the lens relative to the lens.

[0154] Step 902: The terminal device determines the target adjustment distance of the virtual lever arm according to the first direction vector, the second direction vector, the velocity scalar vector of the object movement speed, and the preset limit distance.

[0155] The velocity scalar vector refers to the unit vector of the virtual object movement speed. The preset limit distance refers to the maximum range or the maximum distance that the virtual object can move. The target adjustment distance refers to the distance between the end point of the virtual lever arm and the virtual object. When the relative movement direction of the virtual object with respect to the virtual lens is away from the virtual lens, the terminal device determines the target adjustment distance of the virtual lever arm according to the first direction vector and the second direction vector of the virtual lens, as well as the velocity scalar vector of the object movement speed and the preset limit distance, so that the lever arm of the virtual lens can automatically adjust this distance according to the actual movement state of the virtual object to obtain the target adjustment distance that is most suitable for the current state.

[0156] Step 903: The terminal device determines the control point position of the virtual lever arm according to the target adjustment distance and the object position information.

[0157] For example, if the object position information of the virtual object is (x1, y1, z1), the terminal device draws a circle horizontally with (x1, y1, z1) as the center and the target adjustment distance as the radius. The position of the intersection of this circle and the virtual lever arm is the position of the lever arm control point.

[0158] In the embodiment of the present disclosure, when the relative movement direction of the virtual object with respect to the virtual lens is away from the virtual lens, the terminal device determines the target adjustment distance of the virtual lever arm according to the first direction vector and the second direction vector of the virtual lens, as well as the velocity scalar vector of the object movement speed and the preset limit distance, and determines the control point position of the virtual lever arm according to the target adjustment distance, so that the position of the lever arm control point of the virtual lever arm can automatically adjust this distance according to the actual movement state of the virtual object to obtain the target position that is most suitable for the current state, greatly improving the flexibility and reliability of virtual lens control.

[0159] Please refer to Figure 10In an optional embodiment of the present disclosure, in step 902, the terminal device determines the target adjustment distance of the virtual force arm according to the first direction vector, the second direction vector, the speed scalar vector of the object movement speed, and the preset limit distance, including the following steps 1001 to 1004:

[0160] Step 1001: Calculate the first inner product of the speed scalar vector of the object movement speed and the first direction vector;

[0161] Step 1002: Calculate the product of the first inner product and the preset limit distance;

[0162] Step 1003: Calculate the second inner product of the speed scalar vector of the object movement speed and the second direction vector;

[0163] Step 1004: Calculate the sum of the product and the second inner product to obtain the target adjustment distance of the virtual force arm.

[0164] For example, the terminal device can calculate the target adjustment distance through the following formula (14):

[0165] D = S × [clamp(C RV dotP V , -1, 1) + clamp(C FV dotP V , -1, 0)] (14)

[0166] In formula (14), D represents the target adjustment distance, S represents the preset limit distance, C RV represents the first direction vector of the virtual lens, C FV represents the second direction vector of the virtual lens, P V represents the speed scalar vector of the virtual object in the current frame, clamp(A, B, C) represents a responsive layout function, which is used to limit the value of A to be not less than B and not greater than C. In the embodiment of the present application, it means that the value of C RV dotP V is not less than -1 and not greater than 1, and dot represents the dot product, that is, the product of two vectors.

[0167] In an optional embodiment of the present disclosure, after obtaining the target adjustment distance, the terminal device can calculate the endpoint position of the virtual force arm through the following formula (15):

[0168] P D = P L + D (15)

[0169] In formula (15), P D represents the position coordinate of the endpoint of the virtual force arm close to the virtual object, P LIt represents the current position coordinates of the virtual object, and D represents the target adjustment distance.

[0170] In the embodiments of the present disclosure, first, the target adjustment distance of the virtual lever arm is determined according to the first direction vector, the second direction vector, the velocity vector of the object moving speed, and the preset limit distance. Finally, the end point position of the virtual lever arm can be calculated through the target adjustment distance. The calculation method is simple and fast, and can be adapted to any scenario that requires real-time calculation, greatly improving the efficiency of virtual camera control.

[0171] In the embodiments of the present disclosure, a range trigger control point for detecting the current position movement of the preset trigger range can also be configured. The terminal device detects the position information of the range trigger control point in real time, and calculates the distance between the range trigger control point and the center point of the preset trigger range to determine whether the current movement amplitude of the virtual object exceeds the preset trigger range. If it exceeds the preset trigger range, the target adjustment distance of the virtual lever arm is re-determined according to the above steps 1001-step 1004, and the end point position of the virtual lever arm is adjusted according to the target adjustment distance; if it does not exceed the preset trigger range, there is no need to adjust the end point position of the virtual lever arm.

[0172] Please refer to Figure 11 , in an optional embodiment of the present disclosure, in the above second case, if the relative movement direction of the virtual object relative to the virtual camera is away from the virtual camera, the terminal device determines the control point position information of the virtual lever arm according to the object position information, the object movement speed, the camera position information, and the preset limit distance, including the following steps 1101-step 1002:

[0173] Step 1101, if the relative movement direction of the virtual object relative to the virtual camera is away from the virtual camera, the terminal device determines whether the current position of the virtual object exceeds the preset trigger range according to the object position information.

[0174] Step 1102, if the current position of the virtual object exceeds the preset trigger range, the terminal device determines the control point position information of the virtual lever arm according to the object position information, the object movement speed, the camera position information, and the preset limit distance.

[0175] Please refer to Figure 12, the preset trigger range 1200 refers to the threshold for triggering the adjustment of the arm length of the virtual lens 110. Only when the virtual object 120 touches the edge of the preset trigger range 1200 or moves outside the preset trigger range, the terminal device starts to control the virtual lens 110, that is, determines the control point position information of the arm of the virtual lens 110 according to the object position information, the object movement speed, the lens position information and the preset limit distance. Moreover, when the virtual object 120 is within the preset trigger range 1200, the virtual lens 110 remains fixed and no adjustment is made. In this way, frequent adjustment of the position of the virtual lens 110 can be avoided, which greatly increases the computing amount of the terminal device, thereby saving the computing resources of the terminal device.

[0176] Please refer to Figure 13 , to implement the above virtual lens control method, in an embodiment of the present disclosure, a virtual lens control device 1300 is provided. Figure 13 FIG. shows a schematic architecture diagram of the virtual lens control device 1300, including: a first determination module 1310, a second determination module 1320, a third determination module 1330, and a control module 1340, where:

[0177] The first determination module 1310 is used to determine the object movement speed and object position information of the current virtual object;

[0178] The second determination module 1320 is used to determine the relative distance between the virtual lens and the virtual object according to the object movement speed; wherein, the object movement speed is positively correlated with the relative distance;

[0179] The third determination module 1330 is used to determine the target position of the virtual lens according to the relative distance and the object position information;

[0180] The control module 1340 is used to control the virtual lens to move to the target position.

[0181] In an optional embodiment of the present disclosure, the second determination module 1320 is specifically used to determine the arm movement speed of the virtual arm of the virtual lens; and determine the relative distance between the virtual lens and the virtual object according to the relative magnitude of the object movement speed and the arm movement speed.

[0182] In an optional embodiment of the present disclosure, the second determination module 1320 is specifically used to increase the distance between the virtual lens and the virtual object to obtain the relative distance if the object movement speed is greater than the arm movement speed.

[0183] In an optional embodiment of the present disclosure, the second determination module 1320 is specifically used to shorten the distance between the virtual lens and the virtual object to obtain the relative distance if the object movement speed is less than the arm movement speed.

[0184] In an alternative embodiment of the present disclosure, the dimensionless value of the object movement speed and the relative distance are equal.

[0185] In an alternative embodiment of the present disclosure, the third determination module 1330 is specifically configured to determine the lens position information of the current virtual lens; determine the relative movement direction of the virtual object relative to the virtual lens according to the lens position information and the object movement speed; and determine the target position of the virtual lens according to the relative movement direction, the relative distance, and the object position information.

[0186] In an alternative embodiment of the present disclosure, the third determination module 1330 is specifically configured to, if the relative movement direction of the virtual object relative to the virtual lens is towards the virtual lens, determine the position having a relative distance from the position where the virtual object is located as the target position of the virtual lens.

[0187] In an alternative embodiment of the present disclosure, the third determination module 1330 is specifically configured to, if the relative movement direction of the virtual object relative to the virtual lens is away from the virtual lens, determine the control point position information of the force arm control point of the virtual force arm according to the object position information, the object movement speed, the lens position information, and a preset limit distance; where the force arm control point refers to the end point of the virtual force arm away from the virtual lens; and determine the target position of the virtual lens according to the control point position information, the relative distance, and the object position information.

[0188] In an alternative embodiment of the present disclosure, the third determination module 1330 is specifically configured to determine a first direction vector and a second direction vector of the virtual lens according to the lens position information; where the plane where the first direction and the second direction are located is parallel to the plane where the virtual lens is located, and the first direction and the second direction are perpendicular; determine the target adjustment distance of the virtual force arm according to the first direction vector, the second direction vector, the speed scalar vector of the object movement speed, and a preset limit distance; and determine the control point position of the virtual force arm according to the target adjustment distance and the object position information.

[0189] In an alternative embodiment of the present disclosure, the third determination module 1330 is specifically configured to calculate a first inner product of the speed scalar vector of the object movement speed and the first direction vector; calculate the product of the first inner product and the preset limit distance; calculate a second inner product of the speed scalar vector of the object movement speed and the second direction vector; and calculate the sum of the product and the second inner product to obtain the target adjustment distance of the virtual force arm.

[0190] In an optional embodiment of the present disclosure, the third determination module 1330 is specifically configured to, if the relative movement direction of the virtual object with respect to the virtual camera is away from the virtual camera, determine whether the current position of the virtual object exceeds a preset trigger range according to the object position information; if the current position of the virtual object exceeds the preset trigger range, determine the control point position information of the virtual force arm according to the object position information, the object movement speed, the camera position information, and a preset limit distance.

[0191] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which can be implemented in the form of a program product. The program product includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification. In one embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device.

[0192] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0193] The computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium, and the readable medium can send, propagate, or transmit a program for use by or combined with an instruction execution system, apparatus, or device.

[0194] The program code included on the readable medium can be transmitted by any appropriate medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above.

[0195] The program code for performing the operations of the present disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider). In the embodiments of the present disclosure, when the program code stored in the computer-readable storage medium is executed, any step in the above virtual lens control method can be implemented.

[0196] Please refer to Figure 14 , an exemplary embodiment of the present disclosure also provides an electronic device 1400, which can be a back-end server of an information platform. The following will be described with reference to Figure 14 this electronic device 1400. It should be understood that Figure 14 the electronic device 1400 shown is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.

[0197] As Figure 14 shown, the electronic device 1400 is presented in the form of a general-purpose computing device. The components of the electronic device 1400 may include, but are not limited to: at least one processing unit 1410, at least one storage unit 1420, and a bus 1430 connecting different system components (including the storage unit 1420 and the processing unit 1410).

[0198] Among them, the storage unit stores program code, and the program code can be executed by the processing unit 1410, so that the processing unit 1410 executes the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification. For example, the processing unit 1410 can execute the method steps as Figure 4 shown, etc.

[0199] The storage unit 1420 may include a volatile storage unit, such as a random access storage unit (RAM) 1421 and / or a cache storage unit 1422, and may further include a read-only storage unit (ROM) 1423.

[0200] The storage unit 1420 may also include a program / utility 1424 having a set (at least one) of program modules 1425. Such program modules 1425 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.

[0201] The bus 1430 may include a data bus, an address bus, and a control bus.

[0202] The electronic device 1400 may also communicate with one or more external devices 2000 (such as a keyboard, a pointing device, a Bluetooth device, etc.). Such communication may be carried out through the input / output (I / O) interface 1440. The electronic device 1400 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 1450. As shown in the figure, the network adapter 1450 communicates with other modules of the electronic device 141400 through the bus 1430. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0203] In the embodiments of the present disclosure, when the program code stored in the electronic device is executed, any step in the above virtual lens control method may be implemented.

[0204] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more of the above-described modules or units may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided and embodied by multiple modules or units.

[0205] Those skilled in the art can understand that various aspects of the present disclosure can be implemented as a system, a method, or a program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuitry", "module", or "system" here. After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other embodiments of the present disclosure. The present disclosure aims to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0206] It should be understood that the present disclosure is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only defined by the appended claims.

Claims

1. A virtual lens control method, characterized in that, Including: Determine the object movement speed and object position information of the current virtual object; Determine the lever movement speed of the virtual lever of the virtual lens; If the object movement speed is greater than the lever movement speed, increase the distance between the virtual lens and the virtual object to obtain a relative distance. If the object movement speed is less than the lever movement speed, shorten the distance between the virtual lens and the virtual object to obtain a relative distance; wherein, the object movement speed is positively correlated with the lever movement speed, and the object movement speed is positively correlated with the relative distance; Determine the lens position information of the current virtual lens; determine the relative movement direction of the virtual object relative to the virtual lens according to the lens position information and the object movement speed; determine the target position of the virtual lens according to the relative movement direction, the relative distance and the object position information; Control the virtual lens to move to the target position.

2. The virtual lens control method according to claim 1, wherein The numerical values of the object movement speed and the relative distance after dimensionless processing are equal.

3. The virtual lens control method according to claim 1, characterized in that, The determining the target position of the virtual lens according to the relative movement direction, the relative distance and the object position information includes: If the relative movement direction of the virtual object relative to the virtual lens is towards the virtual lens, determine the position with the relative distance from the position where the virtual object is located as the target position of the virtual lens.

4. The virtual lens control method according to claim 1, wherein, The determining the target position of the virtual lens according to the relative movement direction, the relative distance and the object position information includes: If the relative movement direction of the virtual object relative to the virtual lens is away from the virtual lens, determine the control point position information of the lever control point of the virtual lever according to the object position information, the object movement speed, the lens position information and a preset limit distance; wherein, the lever control point refers to the end point of the virtual lever away from the virtual lens; Determine the target position of the virtual lens according to the control point position information, the relative distance and the object position information.

5. The virtual lens control method according to claim 4, wherein [[ The determining the control point position information of the lever control point of the virtual lever according to the object position information, the object movement speed, the lens position information and a preset limit distance includes: ]] The determining the control point position information of the lever control point of the virtual lever according to the object position information, the object movement speed, the lens position information and a preset limit distance includes: Determine the first direction vector and the second direction vector of the virtual lens according to the lens position information; wherein, the plane where the first direction and the second direction are located is parallel to the plane where the virtual lens is located, and the first direction and the second direction are perpendicular; Determine the target adjustment distance of the virtual lever according to the first direction vector, the second direction vector, the speed scalar vector of the object movement speed and the preset limit distance; Determine the control point position of the virtual lever according to the target adjustment distance and the object position information.

6. The virtual lens control method according to claim 5, wherein, The determining the target adjustment distance of the virtual lever according to the first direction vector, the second direction vector, the speed scalar vector of the object movement speed and the preset limit distance includes: Calculate a first inner product of a velocity scalar vector for calculating the moving speed of the object and the first direction vector; Calculate a product of the first inner product and the preset limit distance; Calculate a second inner product of a velocity scalar vector for calculating the moving speed of the object and the second direction vector; Calculate a sum of the product and the second inner product to obtain the target adjustment distance of the virtual lever arm.

7. The virtual lens control method according to claim 5, wherein If the relative moving direction of the virtual object with respect to the virtual lens is away from the virtual lens, then determining the control point position information of the virtual lever arm according to the object position information, the object moving speed, the lens position information, and the preset limit distance includes: If the relative moving direction of the virtual object with respect to the virtual lens is away from the virtual lens, then determine whether the current position of the virtual object exceeds a preset trigger range according to the object position information; If the current position of the virtual object exceeds the preset trigger range, then determine the control point position information of the virtual lever arm according to the object position information, the object moving speed, the lens position information, and the preset limit distance.

8. A virtual lens control device, characterized in that, The device includes: A first determination module, configured to determine the object moving speed and the object position information of the current virtual object; A second determination module, configured to determine the lever arm moving speed of the virtual lever arm of the virtual lens; if the object moving speed is greater than the lever arm moving speed, then increase the distance between the virtual lens and the virtual object to obtain a relative distance, if the object moving speed is less than the lever arm moving speed, then shorten the distance between the virtual lens and the virtual object to obtain a relative distance; wherein, the object moving speed and the lever arm moving speed are positively correlated, and the object moving speed and the relative distance are positively correlated; A third determination module, configured to determine the lens position information of the current virtual lens; determine the relative moving direction of the virtual object with respect to the virtual lens according to the lens position information and the object moving speed; determine the target position of the virtual lens according to the relative moving direction, the relative distance, and the object position information; A control module, configured to control the virtual lens to move to the target position.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, Including: A processor; And A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the method according to any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • Game display control method and device, storage medium and electronic equipment

    CN113440846A

  • Entertainment apparatus, storage medium and object display method

    EP1125608A2