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

By constructing the motion trajectory constraint function of the virtual camera and synchronously adjusting the viewing angle and arm length, the problem of out-synchronization of the viewing angle and arm length of the virtual camera is solved, and control efficiency and user experience are improved.

CN114681918BActive Publication Date: 2025-07-04NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the existing virtual camera control method, the viewing angle and arm length adjustment of the virtual camera are not synchronized, resulting in a sudden change in the lens, affecting the naturalness of the video picture and user experience.

Method used

By obtaining the preset viewing angle parameters and theoretical arm length parameters of the virtual camera, a motion trajectory constraint function is constructed, the rotation amplitude is calculated based on the current viewing angle parameters, and the arm length of the virtual camera is synchronously adjusted to ensure the consistency and smoothness of lens movement.

Benefits of technology

The synchronous adjustment of the virtual camera perspective angle and arm length is achieved, the control efficiency is improved, the lens changes are avoided, and the naturalness and user experience of the video picture are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114681918B_ABST
    Figure CN114681918B_ABST
Patent Text Reader

Abstract

The present disclosure provides a virtual camera control method and apparatus, an electronic device, and a storage medium, relating to the field of computer technology. The virtual camera control method includes: obtaining preset viewing angle parameters of a virtual camera and theoretical arm length parameters corresponding to the preset viewing angle parameters; constructing a motion trajectory constraint function of the virtual camera based on the preset viewing angle parameters and the theoretical arm length parameters; reading current viewing angle parameters of the virtual camera, and calculating a current rotation amplitude of the virtual camera in combination with the preset viewing angle parameters; determining target arm length parameters of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and synchronously adjusting the arm length of the virtual camera based on the target arm length parameters. The technical solution of the embodiments of the present disclosure can synchronously control the viewing angle and arm length of a virtual camera, improving the efficiency of controlling the virtual camera, and at the same time avoiding the problem of unnatural video images caused by sudden changes in the virtual camera lens.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In more and more role-playing games, it is necessary to flexibly control the movement of the virtual camera to enhance the user's gaming immersion.

[0003] However, the related virtual camera control method adopts spherical camera movement and, after some logical operations, trims the unreasonable parts of the spherical camera movement trajectory to obtain a partial sphere. The viewing angle of the virtual camera can be adjusted on the partial sphere, but the arm length of the virtual camera corresponding to each viewing angle is fixed, resulting in the virtual camera's viewing angle and arm length adjustment being out of sync. There is also the problem of unnatural video images due to sudden changes in the lens, resulting in a poor user experience.

[0004] Therefore, providing a method for synchronously adjusting the viewing angle and arm length of a virtual camera has important practical significance.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the embodiments of the present disclosure is to provide a virtual camera control method, a virtual camera control device, an electronic device and a computer-readable storage medium, thereby at least to a certain extent overcoming the problems of the virtual camera's viewing angle and arm length adjustment being out of sync, and the unnatural video picture caused by sudden changes in the lens.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] According to a first aspect of an embodiment of the present disclosure, a method for training an obstacle recognition model is provided, comprising: obtaining preset viewing angle parameters of a virtual camera, and theoretical arm length parameters corresponding to the preset viewing angle parameters; constructing a motion trajectory constraint function of the virtual camera based on the preset viewing angle parameters and the theoretical arm length parameters; reading the current viewing angle parameters of the virtual camera, and calculating the current rotation amplitude of the virtual camera in combination with the preset viewing angle parameters; determining a target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and synchronously adjusting the arm length of the virtual camera based on the target arm length parameter.

[0009] In some example embodiments of the present disclosure, based on the aforementioned solution, the preset viewing angle parameters include a viewing angle upper limit parameter, a default viewing angle parameter, and a viewing angle lower limit parameter.

[0010] In some exemplary embodiments of the present disclosure, based on the foregoing solution, constructing the motion trajectory constraint function of the virtual camera based on the preset perspective parameter and the theoretical arm length parameter includes: obtaining the current perspective focus, and constructing a reference coordinate system with the current perspective focus as the origin; converting the perspective upper bound parameter and the theoretical arm length parameter corresponding to the perspective upper bound parameter into the first fixed point coordinates in the reference coordinate system; converting the default perspective parameter and the theoretical arm length parameter corresponding to the default perspective parameter into the second fixed point coordinates in the reference coordinate system, and converting the perspective lower bound parameter and the theoretical arm length parameter corresponding to the perspective lower bound parameter into the third fixed point coordinates in the reference coordinate system; constructing the motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates.

[0011] In some exemplary embodiments of the present disclosure, based on the foregoing solution, constructing the motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates includes: calculating the virtual control point coordinates based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; constructing the motion trajectory constraint function of the virtual camera passing through the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates by drawing the motion trajectory between sliding from the first fixed point coordinates to the virtual control point coordinates and sliding from the virtual control point coordinates to the third fixed point coordinates.

[0012] In some exemplary embodiments of the present disclosure, based on the foregoing solution, reading the current perspective parameter of the virtual camera and calculating the current rotation amplitude of the virtual camera in combination with the preset perspective parameter includes: in response to a perspective adjustment operation, determining the current perspective parameter of the virtual camera; calculating the current rotation amplitude of the virtual camera based on the current perspective parameter, the perspective upper bound parameter, and the perspective lower bound parameter.

[0013] In some exemplary embodiments of the present disclosure, based on the foregoing solution, determining the target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function includes: calculating the key point coordinates corresponding to the current perspective based on the current rotation amplitude, the motion trajectory constraint function, the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; determining the target arm length parameter of the virtual camera according to the coordinates of the current perspective focus and the key point coordinates.

[0014] In some exemplary embodiments of the present disclosure, based on the foregoing solution, determining the target arm length parameter of the virtual camera according to the coordinates of the current perspective focus and the coordinates of the key point includes: generating a target vector formed by the coordinates of the current perspective focus and the coordinates of the key point; calculating the magnitude of the target vector, and using the magnitude as the target arm length parameter of the virtual camera.

[0015] According to a second aspect of the embodiments of the present disclosure, there is provided a virtual camera control device, including: a data acquisition module, configured to acquire preset perspective parameters of the virtual camera and theoretical arm length parameters corresponding to the preset perspective parameters; a constraint function construction module, configured to construct a motion trajectory constraint function of the virtual camera based on the preset perspective parameters and the theoretical arm length parameters; a current rotation amplitude calculation module, configured to read the current perspective parameters of the virtual camera and calculate the current rotation amplitude of the virtual camera in combination with the preset perspective parameters; an arm length adjustment module, configured to determine the target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and synchronously adjust the arm length of the virtual camera based on the target arm length parameter.

[0016] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the constraint function construction module includes a constraint function construction unit, configured to obtain the current perspective focus and construct a reference coordinate system with the current perspective focus as the origin; convert the perspective upper bound parameter and the theoretical arm length parameter corresponding to the perspective upper bound parameter into first fixed point coordinates in the reference coordinate system; convert the default perspective parameter and the theoretical arm length parameter corresponding to the default perspective parameter into second fixed point coordinates in the reference coordinate system, and convert the perspective lower bound parameter and the theoretical arm length parameter corresponding to the perspective lower bound parameter into third fixed point coordinates in the reference coordinate system; construct a motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates.

[0017] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the constraint function construction module further includes a virtual control point coordinate determination unit, configured to calculate virtual control point coordinates based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; construct a motion trajectory of sliding from the first fixed point coordinates to the virtual control point coordinates and then from the virtual control point coordinates to the third fixed point coordinates, and construct a motion trajectory constraint function of the virtual camera passing through the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates based on the motion trajectory.

[0018] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the current rotation amplitude calculation module includes a current rotation amplitude calculation unit, and the current rotation amplitude calculation unit is configured to determine the current viewing angle parameter of the virtual camera in response to a viewing angle adjustment operation; and calculate the current rotation amplitude of the virtual camera based on the current viewing angle parameter, the viewing angle upper bound parameter, and the viewing angle lower bound parameter.

[0019] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the arm length adjustment module includes a key point coordinate calculation unit, and the key point coordinate calculation unit is configured to calculate the key point coordinates corresponding to the current viewing angle based on the current rotation amplitude, the motion trajectory constraint function, the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; and determine the target arm length parameter of the virtual camera according to the coordinates of the current viewing angle focus and the key point coordinates.

[0020] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the arm length adjustment module further includes a target arm length parameter determination unit, and the target arm length parameter determination unit is configured to generate a target vector formed by the coordinates of the current viewing angle focus and the key point coordinates; calculate the modulus of the target vector, and use the modulus as the target arm length parameter of the virtual camera.

[0021] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; and a memory, on which a computer-readable instruction is stored, and when the computer-readable instruction is executed by the processor, the virtual camera control method according to any one of the above is implemented.

[0022] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the virtual camera control method according to any one of the above is implemented.

[0023] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0024] The virtual camera control method in the example embodiment of the present disclosure obtains preset viewing angle parameters of the virtual camera and theoretical arm length parameters corresponding to the preset viewing angle parameters; constructs a motion trajectory constraint function of the virtual camera based on the preset viewing angle parameters and the theoretical arm length parameters corresponding to the preset viewing angle parameters; reads the current viewing angle parameters of the virtual camera, and calculates the current rotation amplitude of the virtual camera in combination with the preset viewing angle parameters; determines the target arm length parameters of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and synchronously adjusts the arm length parameters of the virtual camera based on the target arm length parameters. On the one hand, the current viewing angle parameters of the virtual camera can be read, and the current rotation amplitude of the virtual camera can be calculated in combination with the preset angle parameters, and then the target arm length parameters of the virtual camera can be calculated based on the current rotation angle of the virtual camera, so that while adjusting the viewing angle of the virtual camera according to the current viewing angle parameters, the arm length of the virtual camera can be linked and updated according to the target arm length parameters, thereby realizing the synchronous adjustment of the viewing angle and arm length of the virtual camera and improving the efficiency of controlling the virtual camera; on the other hand, the motion trajectory constraint function of the virtual camera can be constructed based on the preset viewing angle parameters and the theoretical arm length parameters corresponding to the preset viewing angle parameters, thereby ensuring the continuity and smoothness of the motion trajectory of the virtual camera lens, avoiding unnatural video images due to sudden lens changes, and improving user experience; on the other hand, by constructing the motion trajectory constraint function of the virtual camera and calculating the target arm length parameters of the virtual camera based on the current viewing angle parameters and the motion trajectory constraint equation, the real-time configuration of the lens parameters of the virtual camera is realized, thereby improving the configuration efficiency of the virtual camera.

[0025] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0027] Figure 1 A schematic diagram schematically illustrates a virtual camera control method process according to some embodiments of the present disclosure;

[0028] Figure 2 A schematic diagram schematically shows a motion trajectory constraint function construction method process according to some embodiments of the present disclosure;

[0029] Figure 3 A schematic diagram schematically shows a motion trajectory constraint function construction method process according to some embodiments of the present disclosure;

[0030] Figure 4 A schematic diagram schematically showing the flow of a current rotation amplitude calculation method according to some embodiments of the present disclosure;

[0031] Figure 5 A schematic diagram schematically showing the flow of a target arm length determination method according to some embodiments of the present disclosure;

[0032] Figure 6 A schematic diagram schematically showing a virtual camera control device according to some embodiments of the present disclosure;

[0033] Figure 7 A schematic diagram schematically showing the structure of a computer system of an electronic device according to some embodiments of the present disclosure;

[0034] Figure 8 A schematic diagram schematically showing a computer-readable storage medium according to some embodiments of the present disclosure.

[0035] In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed implementation manners

[0036] Now, example embodiments will be described more fully with reference to the accompanying drawings. However, the example 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 example embodiments to those skilled in the art.

[0037] In addition, the described features, structures, or characteristics can 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. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present disclosure.

[0038] In addition, the accompanying drawings are only schematic diagrams and are not necessarily drawn to scale. The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, 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.

[0039] In the present example embodiment, first, a virtual camera control method is provided, and the virtual camera control method can be applied to terminal devices, such as electronic devices like mobile phones and computers.Figure 1 The following is a schematic diagram showing the flow of a virtual camera control method according to some embodiments of the present disclosure. Figure 1 As shown, the virtual camera control method may include the following steps:

[0040] In step S110, a preset viewing angle parameter of the virtual camera and a theoretical arm length parameter corresponding to the preset viewing angle parameter are obtained;

[0041] In step S120, a motion trajectory constraint function of the virtual camera is constructed based on the preset viewing angle parameter and the theoretical arm length parameter;

[0042] In step S130, the current viewing angle parameters of the virtual camera are read, and the current rotation amplitude of the virtual camera is calculated in combination with the preset viewing angle parameters;

[0043] In step S140, a target arm length parameter of the virtual camera is determined based on the current rotation amplitude and the motion trajectory constraint function, and the arm length of the virtual camera is synchronously adjusted based on the target arm length parameter.

[0044] According to the virtual camera control method in this example embodiment, on the one hand, the current viewing angle parameters of the virtual camera can be read, and the current rotation amplitude of the virtual camera can be calculated in combination with the preset angle parameters, and then the target arm length parameters of the virtual camera can be calculated based on the current rotation angle of the virtual camera, so that while adjusting the viewing angle of the virtual camera according to the current viewing angle parameters, the arm length of the virtual camera can be linked and updated according to the target arm length parameters, thereby realizing synchronous adjustment of the viewing angle and arm length of the virtual camera and improving the efficiency of controlling the virtual camera; on the other hand, a motion trajectory constraint function of the virtual camera can be constructed based on the preset viewing angle parameters and the theoretical arm length parameters corresponding to the preset viewing angle parameters, thereby ensuring the continuity and smoothness of the motion trajectory of the virtual camera lens, avoiding unnatural video images due to sudden lens changes, and improving user experience; on the other hand, by constructing the motion trajectory constraint function of the virtual camera and calculating the target arm length parameters of the virtual camera based on the current viewing angle parameters and the motion trajectory constraint equation, real-time configuration of the lens parameters of the virtual camera is realized, thereby improving the configuration efficiency of the virtual camera.

[0045] Next, the virtual camera control method in this exemplary embodiment will be further described.

[0046] In step S110, a preset viewing angle parameter of the virtual camera and a theoretical arm length parameter corresponding to the preset viewing angle parameter are obtained.

[0047] In an exemplary embodiment of the present disclosure, the preset viewing angle parameter may refer to a preset pitch angle parameter relative to the viewing angle focus. For example, the preset viewing angle parameter may be a preset upper bound value of the viewing angle relative to the viewing angle focus, the preset viewing angle parameter may also be a preset lower bound value of the viewing angle relative to the viewing angle focus, the preset viewing angle parameter may further be a preset default viewing angle parameter relative to the viewing angle focus. Of course, the preset viewing angle parameter may also be other pitch angle parameters relative to the viewing angle focus, and this exemplary embodiment does not make special limitations thereto. Among them, the upper bound value of the viewing angle may refer to the upper bound value of the elevation angle relative to the viewing angle focus, and the lower bound value of the viewing angle may refer to the lower bound value of the depression angle relative to the viewing angle focus.

[0048] The theoretical arm length parameter may refer to an arm length parameter corresponding to the preset viewing angle parameter. For example, the preset viewing angle parameter may be the upper bound value of the viewing angle, and the theoretical arm length parameter may be the arm length parameter corresponding to the preset upper bound value of the viewing angle. The preset viewing angle parameter may also be the lower bound value of the viewing angle, and the theoretical arm length parameter may also be the arm length parameter corresponding to the preset lower bound value of the viewing angle. The preset viewing angle parameter may further be a preset default viewing angle parameter, and the theoretical arm length parameter may further be the arm length parameter corresponding to the default viewing angle parameter. Of course, the theoretical arm length parameter may also be the arm length parameter corresponding to other preset viewing angle parameters, and this exemplary embodiment does not make special limitations thereto.

[0049] The theoretical arm length parameters corresponding to each preset viewing angle parameter can be measured through practice. For example, the theoretical arm length parameter corresponding to the upper bound value of the viewing angle, the theoretical arm length parameter corresponding to the lower bound value of the viewing angle, and the theoretical arm length parameter corresponding to the default viewing angle parameter can be measured. Furthermore, an array composed of the preset viewing angle parameter and the theoretical arm length parameter corresponding to the preset viewing angle parameter can be generated and stored in the database of the terminal device in advance, so as to flexibly obtain the array from the database through an interface.

[0050] In step S120, a motion trajectory constraint function of the virtual camera is constructed based on the preset viewing angle parameter and the theoretical arm length parameter.

[0051] In an exemplary embodiment of the present disclosure, the motion trajectory constraint function may refer to a function of the motion trajectory of the virtual camera composed of the preset viewing angle parameter and the theoretical arm length parameter corresponding to the preset viewing angle parameter. For example, the motion trajectory constraint function may be a quadratic curve function such as a parabola function of the motion trajectory of the virtual camera constructed by each fixed point determined by the preset viewing angle parameter and the theoretical arm length parameter corresponding to the preset viewing angle. The motion trajectory function may also be a Bezier curve function of the motion trajectory of the virtual camera constructed by each fixed point of the virtual camera composed of the preset viewing angle parameter and the theoretical arm length parameter corresponding to the preset viewing angle parameter. Of course, the motion trajectory function may also be other aspheric curve functions of the motion trajectory of the virtual camera constructed by each fixed point determined by the preset viewing angle parameter and the theoretical arm length parameter corresponding to the preset viewing angle parameter, and this exemplary embodiment does not make special limitations thereto.

[0052] The preset perspective parameters and the theoretical arm length parameters corresponding to the preset perspective parameters can be converted into fixed-point coordinates, and then the fixed points formed by the preset perspective parameters and the theoretical arm length parameters corresponding to the preset perspective parameters can be determined. For example, the first vertex formed by the upper bound value of the perspective and the theoretical arm length parameter corresponding to the upper bound value of the perspective can be used as the starting point, the second fixed point formed by the default perspective parameter and the theoretical arm length parameter corresponding to the default perspective parameter can be used as the midpoint, and the third fixed point formed by the lower bound value of the perspective and the theoretical arm length parameter corresponding to the lower bound value of the perspective can be used as the end point, and a motion trajectory constraint function of the virtual camera can be constructed based on the starting point, the midpoint, and the end point.

[0053] In step S130, the current perspective parameter of the virtual camera is read, and the current rotation amplitude of the virtual camera is calculated in combination with the preset perspective parameter.

[0054] In an exemplary embodiment of the present disclosure, the current perspective parameter may refer to the perspective parameter determined by detecting a perspective adjustment operation. For example, the current perspective parameter may be the perspective parameter determined by detecting a user's screen swiping operation, the current perspective parameter may also be the perspective parameter determined by detecting a user's mouse wheel scrolling operation. Of course, the current perspective parameter may also be the perspective parameter determined by detecting other perspective adjustment operations. This exemplary embodiment does not make special limitations on this.

[0055] The current rotation amplitude may refer to the rotation offset degree of the current perspective parameter relative to the preset perspective parameter. For example, the current rotation amplitude may be the rotation direction offset degree of the current perspective parameter relative to the upper bound value and the lower bound value of the perspective, the current rotation amplitude may also be the rotation offset angle of the current perspective parameter relative to the upper bound value and the lower bound value of the perspective. Of course, the current rotation amplitude may also be other rotation offset degrees of the current perspective parameter relative to the preset perspective parameter. This exemplary embodiment does not make special limitations on this.

[0056] The current perspective parameter of the virtual camera can be determined by detecting a user's perspective adjustment operation, and in combination with the preset perspective parameter, the rotation amplitude of the current perspective parameter relative to the preset perspective parameter can be calculated. Based on the current rotation amplitude of the virtual camera and the motion trajectory constraint function, the target arm length parameter corresponding to the current perspective parameter of the virtual camera can be determined, and then by dynamically adjusting the arm length parameter of the virtual camera to the target arm length parameter, the synchronous adjustment of the perspective and the arm length of the virtual camera is realized, and the control efficiency of the virtual camera is improved.

[0057] In step S140, based on the current rotation amplitude and the motion trajectory constraint function, the target arm length parameter of the virtual camera is determined, and the arm length of the virtual camera is synchronously adjusted based on the target arm length parameter.

[0058] In an exemplary embodiment of the present disclosure, the target arm length parameter may refer to the arm length parameter corresponding to the current viewing angle parameter calculated in combination with a preset viewing angle parameter. For example, the current viewing angle parameter may be a viewing angle parameter between the upper viewing angle limit value and the lower viewing angle limit value. The target arm length parameter may be the arm length parameter determined by calculating the current rotation amplitude of the current viewing angle parameter relative to the upper viewing angle limit value and the lower viewing angle limit value and in combination with the motion trajectory function of the virtual camera. Of course, the target arm length parameter may also be the arm length parameter corresponding to the current viewing angle parameter calculated in combination with the current rotation amplitude and other preset viewing angle parameters. This exemplary embodiment does not make special limitations in this regard.

[0059] The current rotation amplitude of the virtual camera may be calculated, and based on the motion trajectory function of the virtual camera and the current rotation amplitude, the target point coordinates corresponding to the current viewing angle parameter and relative to the current viewing angle focus of the virtual camera may be calculated. Furthermore, a target vector constructed by the current viewing angle focus and the target point coordinates may be generated, and the magnitude of the target vector may be used as the target arm length parameter of the virtual camera, so as to adjust the arm length of the virtual camera according to the target arm length parameter, realize the synchronous adjustment of the viewing angle and the arm length of the virtual camera, improve the flexibility of controlling the virtual camera, and also improve the timeliness of configuring the lens parameters of the virtual camera.

[0060] Figure 2 Schematically shows a schematic diagram of the method flow for constructing a motion trajectory constraint function according to some embodiments of the present disclosure. Refer to Figure 2 As shown, the method for constructing the motion trajectory constraint function may include the following steps:

[0061] In step S210, obtain the current viewing angle focus, and construct a reference coordinate system with the current viewing angle focus as the origin;

[0062] In step S220, convert the upper viewing angle parameter and the theoretical arm length parameter corresponding to the upper viewing angle parameter into the first fixed point coordinates in the reference coordinate system;

[0063] In step S230, convert the default viewing angle parameter and the theoretical arm length parameter corresponding to the default viewing angle parameter into the second fixed point coordinates in the reference coordinate system, and convert the lower viewing angle parameter and the theoretical arm length parameter corresponding to the lower viewing angle parameter into the third fixed point coordinates in the reference coordinate system;

[0064] In step S240, construct the motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates.

[0065] Among them, the reference coordinate system can be a two-dimensional plane coordinate system, or a three-dimensional plane coordinate system. Of course, the reference coordinate system can also be other multi-dimensional coordinate systems, and this example embodiment does not make special limitations on this. It should be noted that in the exemplary embodiments of the present disclosure, a two-dimensional plane coordinate system is taken as an example, but constructing the motion trajectory constraint function of the virtual camera based on other multi-dimensional coordinate systems and other fixed-point coordinates still falls within the scope of protection of this solution.

[0066] The first fixed-point coordinate can refer to the point coordinate obtained by performing data conversion processing on the upper bound parameter of the viewing angle and the theoretical arm length parameter corresponding to the upper bound parameter of the viewing angle. For example, the upper bound parameter of the viewing angle can be P, and the theoretical arm length parameter corresponding to the upper bound parameter of the viewing angle can be I. The first fixed-point coordinate can be (sin(p)*I, cos(p)*I). Of course, the first fixed-point coordinate can also be the point coordinate obtained by performing other data conversion processing on the upper bound parameter of the viewing angle and the theoretical arm length parameter corresponding to the upper bound parameter of the viewing angle, and this example embodiment does not make special limitations on this.

[0067] The second fixed-point coordinate can refer to the point coordinate obtained by performing data conversion processing on the default viewing angle parameter and the theoretical arm length parameter corresponding to the default viewing angle parameter. For example, the default viewing angle parameter can be P1, and the theoretical arm length parameter corresponding to the default viewing angle parameter can be I1. The second fixed-point coordinate can be (sin(p1)*I1, cos(p1)*I1). Of course, the second fixed-point coordinate can also be the point coordinate obtained by performing other data conversion processing on the default viewing angle parameter and the theoretical arm length parameter corresponding to the default viewing angle parameter, and this example embodiment does not make special limitations on this.

[0068] The third fixed-point coordinate can refer to the point coordinate obtained by performing data conversion processing on the lower bound parameter of the viewing angle and the theoretical arm length parameter corresponding to the lower bound parameter of the viewing angle. For example, the lower bound parameter of the viewing angle can be P2, and the theoretical arm length parameter corresponding to the lower bound parameter of the viewing angle can be I2. The third fixed-point coordinate can be (sin(p2)*I2, cos(p2)*I2). Of course, the third fixed-point coordinate can also be the point coordinate obtained by performing other data conversion processing on the lower bound parameter of the viewing angle and the theoretical arm length parameter corresponding to the lower bound parameter of the viewing angle, and this example embodiment does not make special limitations on this.

[0069] It can detect the single-finger sliding operation of the user on the user graphical interface or the scrolling operation of the mouse wheel, determine the current perspective focus, and can construct a reference coordinate system with the current perspective focus as the origin. At the same time, it can convert the preset perspective parameters and the theoretical arm length parameters corresponding to the preset perspective parameters into specific fixed-point coordinates, and map the fixed-point coordinates into the reference coordinate system, so as to construct the motion trajectory constraint function of the virtual camera through the fixed-point coordinates determined by the preset perspective parameters and the theoretical arm length parameters corresponding to the preset perspective parameters. Furthermore, it can use the motion trajectory constraint function of the virtual camera to control the arm length of the virtual camera, avoid the unnatural video picture caused by the sudden change of the lens, and improve the user experience.

[0070] Figure 3 Schematically shows a schematic diagram of the method flow for constructing the motion trajectory constraint function according to some embodiments of the present disclosure. Refer to Figure 3 As shown, the method for constructing the motion trajectory constraint function may include the following steps:

[0071] In step S310, calculate the virtual control point coordinates based on the first fixed-point coordinate, the second fixed-point coordinate, and the third fixed-point coordinate;

[0072] In step S320, draw the motion trajectory from the first fixed-point coordinate to the virtual control point coordinate and from the virtual control point coordinate to the third fixed-point coordinate, and construct the motion trajectory constraint function of the virtual camera passing through the first fixed-point coordinate, the second fixed-point coordinate, and the third fixed-point coordinate based on the motion trajectory.

[0073] Among them, the virtual control point coordinates may refer to the control point coordinates used to combine the first fixed-point coordinate, the second fixed-point coordinate, and the third fixed-point coordinate to generate the motion trajectory constraint function passing through the second fixed-point coordinate. For example, the motion trajectory constraint function may be a Bezier curve function, and the virtual control point coordinates may be the control point coordinates of the Bezier curve function used to combine the first fixed-point coordinate, the second fixed-point coordinate, and the third fixed-point coordinate to generate the Bezier curve function passing through the third fixed-point coordinate. The motion trajectory constraint function may be a parabola function, and the virtual control point coordinates may be the control point coordinates of the parabola function used to combine the first fixed-point coordinate, the second fixed-point coordinate, and the third fixed-point coordinate to generate the parabola function passing through the second fixed-point coordinate. Of course, the virtual control point coordinates may also be the control point coordinates of other motion trajectory constraint functions used to combine the first fixed-point coordinate, the second fixed-point coordinate, and the third fixed-point coordinate to generate the motion trajectory constraint function passing through the second fixed-point coordinate. This example embodiment does not make special limitations on this.

[0074] For example, the first fixed point coordinate is p1(x1, y1), the second fixed point coordinate is p2(x2, y2), and the third fixed point coordinate is p3(x3, y3). If the movement trajectory of the virtual camera is an aspherical Bezier curve starting from the first fixed point coordinate, ending at the third fixed point coordinate, and passing through the second fixed point coordinate, then the virtual control point pc satisfies the condition of arithmetic expression (1):

[0075]

[0076] After determining the virtual control point, the movement trajectory formed by all moving points moving from the first fixed point coordinate to the virtual control point coordinate and from the virtual control point coordinate to the third fixed point coordinate can be drawn in the two-dimensional coordinate system. Furthermore, a movement trajectory constraint function of the virtual camera passing through the first fixed point coordinate, the second fixed point coordinate, and the third fixed point coordinate can be constructed based on this movement trajectory. Among them, the movement trajectory constraint function p(t) of the virtual camera corresponding to the aspherical Bezier curve satisfies the condition of arithmetic expression (2):

[0077] p(t) = t * t * p1 + 2t(1 - t)p2 + (1 - t) * (1 - t) * p3 (2)

[0078] Wherein, t can represent the rotation amplitude of the virtual camera, p1 can represent the first fixed point coordinate, P2 can represent the second fixed point coordinate, and p3 can represent the third fixed point coordinate;

[0079] After determining the current rotation amplitude of the virtual camera, the target arm length of the virtual camera relative to the current view focus can be calculated based on the movement trajectory constraint function of the virtual camera. Furthermore, the arm length of the virtual camera can be adjusted to the target arm length to achieve synchronous adjustment of the view angle and arm length of the virtual camera. Of course, the movement trajectory constraint function of the virtual camera can also be a function passing through the first fixed point coordinate, the second fixed point coordinate, and the third fixed point coordinate generated by other movement trajectories formed by moving points moving along the first fixed point coordinate and the virtual control point coordinate, and the virtual control point coordinate and the third control point coordinate. This embodiment does not make special limitations on this.

[0080] Figure 4 Schematically shows a schematic diagram of the current rotation amplitude calculation method flow according to some embodiments of the present disclosure. Refer to Figure 4 As shown, the current rotation amplitude calculation method may include the following steps:

[0081] In step S410, in response to a view angle adjustment operation, determine the current view angle parameters of the virtual camera;

[0082] In step S420, based on the current view angle parameters, as well as the view angle upper bound parameters and the view angle lower bound parameters, calculate the current rotation amplitude of the virtual camera.

[0083] Among them, the perspective adjustment operation may refer to an operation for adjusting the perspective of a virtual camera. For example, the perspective adjustment operation may be a single-finger sliding operation of the user on the user image interface, or the perspective adjustment operation may be a scrolling operation of the user on the mouse wheel. Of course, the perspective adjustment operation may also be other operations for adjusting the perspective of the virtual camera. This example embodiment does not make special limitations on this.

[0084] The perspective information of the virtual camera for each frame can be listened to through the camera component, and the current perspective parameters of the virtual camera can be obtained by calling an interface, and the current rotation amplitude of the virtual camera can be calculated in combination with the upper perspective limit parameter and the lower perspective limit parameter. Among them, the current rotation amplitude t of the virtual camera can be calculated by the arithmetic expression (3):

[0085] t = (d - d2) / (d1 - d2) (3)

[0086] Among them, d can represent the current perspective parameter of the virtual camera, d1 can represent the upper perspective limit parameter of the virtual camera, and d2 can represent the lower perspective limit parameter of the virtual camera.

[0087] During this process, the current perspective parameter of the virtual camera can be determined by detecting the single-finger sliding operation of the user on the user graphical interface, or detecting the scrolling operation of the user on the mouse wheel during entertainment, and the current rotation amplitude of the virtual camera can be calculated in combination with the upper perspective limit parameter and the lower perspective limit parameter of the virtual camera, so as to determine the target arm length of the virtual camera according to the current rotation amplitude of the virtual camera and the motion trajectory constraint function, and then dynamically adjust the arm length of the virtual camera to the target arm length, realizing the synchronous adjustment of the perspective and arm length of the virtual camera, avoiding the user from touching the perspective switching button and sliding the user graphical interface to adjust the arm length of the virtual camera, improving the convenience of adjusting the perspective and arm length of the virtual camera, and thus improving the efficiency of controlling the virtual camera; at the same time, it also avoids the unnatural video picture generated by the sudden change of the lens due to improper user operation, and avoids the video picture from freezing due to instantaneously loading excessive game resources, or the video picture jumping greatly causing the user to feel dizzy, improving the user experience.

[0088] Figure 5 Schematically shows a schematic diagram of the process of a method for determining a target arm length according to some embodiments of the present disclosure. Refer to Figure 5 As shown, the method for determining the target arm length may include the following steps:

[0089] In step S510, based on the current rotation amplitude, the motion trajectory constraint function, and the first fixed-point coordinate, the second fixed-point coordinate, and the third fixed-point coordinate, calculate the key-point coordinates corresponding to the current perspective;

[0090] In step S520, according to the coordinates of the current perspective focus and the key point coordinates, determine the target arm length parameter of the virtual camera.

[0091] Among them, the key point coordinates can refer to the point coordinates used to calculate the virtual camera arm length corresponding to the current perspective parameter in combination with the current perspective focus. For example, the key point coordinates can be the point coordinates obtained by substituting the current perspective parameter of the virtual camera into the motion trajectory constraint function of the virtual camera that satisfies the Bezier curve in the reference coordinate system determined relative to the current perspective focus. Of course, the key point coordinates can also be the point coordinates obtained by substituting the current perspective parameter of the virtual camera into other motion trajectory constraint functions of the virtual camera in the reference coordinate system determined relative to the current perspective focus for calculating the virtual camera arm length corresponding to the current time. This example embodiment does not make special limitations on this.

[0092] The current rotation amplitude of the virtual camera, as well as the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates, can be substituted into the motion trajectory constraint function of the virtual camera to calculate the key point coordinates corresponding to the current perspective parameter of the virtual camera in the reference coordinate system corresponding to the current perspective focus, and based on the distance between the key point coordinates and the coordinates of the current perspective focus, determine the target arm length parameter corresponding to the current perspective parameter, so as to adjust the arm length of the virtual camera to the target length matching the current perspective parameter according to the target arm length parameter, avoiding sudden changes in the lens caused by improper user perspective adjustment operations, thereby making the video picture unnatural and reducing the user experience; at the same time, the current rotation amplitude of the virtual camera, as well as the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates, can be directly substituted into the motion trajectory constraint function of the virtual camera, and the key point coordinates for calculating the target arm length parameter corresponding to the current perspective parameter of the virtual camera can be obtained. Furthermore, according to the coordinates of the current perspective focus and the key point coordinates, the target arm length parameter matching the current perspective parameter of the virtual camera can be determined, reducing the complexity of configuring the lens parameters of the virtual camera and improving the configuration efficiency of the lens parameters of the virtual camera.

[0093] In an exemplary embodiment of the present disclosure, a target vector composed of the coordinates of the current perspective focus and the key point coordinates can be generated; calculate the modulus length of the target vector and use the modulus length as the target arm length parameter of the virtual camera.

[0094] Among them, the target vector can refer to a vector constructed with the current perspective focus as the starting point and the point corresponding to the key point coordinates as the ending point.

[0095] Based on the coordinates of the current perspective focus and the key point coordinates, the distance between the current perspective focus and the key point corresponding to the key point coordinates can be calculated, and this distance can be used as the modulus of the target vector formed by the coordinates of the current perspective focus and the key point coordinates. Of course, since in the exemplary embodiments of the present disclosure, the current perspective focus can be used as the origin to construct a reference coordinate system, and then the modulus of the target vector formed by the coordinates of the current perspective focus and the key point coordinates can be directly calculated according to the Pythagorean theorem. This exemplary embodiment does not make special limitations on this.

[0096] After calculating the modulus of the target vector formed by the coordinates of the current perspective focus and the key point coordinates, this modulus can be used as the target arm length parameter that matches the current perspective parameter of the virtual camera, and the arm length of the virtual camera can be automatically adjusted according to this target arm length parameter, realizing the synchronous adjustment of the perspective and arm length of the virtual camera, avoiding the user from asynchronously performing the adjustment operations of the perspective and arm length, or using two-finger touch on the user interface to adjust the perspective or arm length of the virtual camera, reducing the complexity of adjusting the perspective and arm length of the virtual camera, and also reducing the interference to other operations of the user, improving the user experience.

[0097] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be executed in this specific order, or that all the steps shown must be executed to achieve the desired result. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution, etc.

[0098] In addition, in this exemplary embodiment, a virtual camera control device is also provided. Referring to Figure 6 As shown, the virtual camera control device 600 includes: a data acquisition module 610, a constraint function construction module 620, a current rotation amplitude calculation module 630, and an arm length adjustment module 640. Among them: the data acquisition module 610 is used to acquire the preset perspective parameter of the virtual camera and the theoretical arm length parameter corresponding to the preset perspective parameter; the constraint function construction module 620 is used to construct the motion trajectory constraint function of the virtual camera based on the preset perspective parameter and the theoretical arm length parameter; the current rotation amplitude calculation module 630 is used to read the current perspective parameter of the virtual camera and calculate the current rotation amplitude of the virtual camera in combination with the preset perspective parameter; the arm length adjustment module 640 is used to determine the target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and synchronously adjust the arm length of the virtual camera based on the target arm length parameter.

[0099] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the constraint function construction module 620 includes a constraint function construction unit, and the constraint function construction unit is configured to obtain the current perspective focus, and construct a reference coordinate system with the current perspective focus as the origin; convert the perspective upper bound parameter and the theoretical arm length parameter corresponding to the perspective upper bound parameter into the first fixed point coordinates in the reference coordinate system; convert the default perspective parameter and the theoretical arm length parameter corresponding to the default perspective parameter into the second fixed point coordinates in the reference coordinate system, and convert the perspective lower bound parameter and the theoretical arm length parameter corresponding to the perspective lower bound parameter into the third fixed point coordinates in the reference coordinate system; construct the motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates.

[0100] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the constraint function construction module 620 further includes a virtual control point coordinate determination unit, and the virtual control point coordinate determination unit is configured to calculate the virtual control point coordinates based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; construct the motion trajectory of sliding from the first fixed point coordinates to the virtual control point coordinates and then to the third fixed point coordinates, and construct the motion trajectory constraint function of the virtual camera passing through the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates based on the motion trajectory.

[0101] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the current rotation amplitude calculation module 630 includes a current rotation amplitude calculation unit, and the current rotation amplitude calculation unit is configured to determine the current perspective parameter of the virtual camera in response to a perspective adjustment operation; calculate the current rotation amplitude of the virtual camera based on the current perspective parameter, the perspective upper bound parameter, and the perspective lower bound parameter.

[0102] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the arm length adjustment module 640 includes a key point coordinate calculation unit, and the key point coordinate calculation unit is configured to calculate the key point coordinates corresponding to the current perspective based on the current rotation amplitude, the motion trajectory constraint function, and the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; determine the target arm length parameter of the virtual camera according to the coordinates of the current perspective focus and the key point coordinates.

[0103] In some exemplary embodiments of the present disclosure, based on the foregoing solution, the arm length adjustment module 640 further includes a target arm length parameter determination unit, which is configured to generate a target vector composed of the coordinates of the current perspective focus and the key point coordinates according to the key point coordinates; calculate the modulus of the target vector, and use the modulus as the target arm length parameter of the virtual camera.

[0104] The specific details of each module of the virtual camera control device have been described in detail in the corresponding virtual camera control method, so they will not be repeated here.

[0105] It should be noted that although several modules or units of the virtual camera control device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0106] In addition, in the exemplary embodiments of the present disclosure, an electronic device capable of implementing the above virtual camera control method is also provided.

[0107] 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 embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuit", "module", or "system" here.

[0108] Next, refer to Figure 7 to describe the electronic device 700 according to this embodiment of the present disclosure. Figure 7 The illustrated electronic device 700 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0109] As Figure 7 shown, the electronic device 700 is presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one of the above-mentioned processing units 710, at least one of the above-mentioned storage units 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.

[0110] Among them, the storage unit stores program code, and the program code can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section above of this specification. For example, the processing unit 710 can execute steps such as Figure 1 shown in S110, obtaining the preset viewing angle parameters of the virtual camera and the corresponding theoretical arm length parameters; step S120, constructing a motion trajectory constraint function of the virtual camera based on the preset viewing angle parameters and the theoretical arm length parameters; step S130, reading the current viewing angle parameters of the virtual camera and calculating the current rotation amplitude of the virtual camera in combination with the preset viewing angle parameters; step S140, determining the target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and adjusting the arm length of the virtual camera based on the target arm length parameter.

[0111] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 721 and / or a cache storage unit 722, and may further include a read-only storage unit (ROM) 723.

[0112] The storage unit 720 may further include a program / utilities 724 having a set (at least one) of program modules 725. Such program modules 725 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 an implementation of a network environment.

[0113] The bus 730 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus structures.

[0114] The electronic device 700 can also communicate with one or more external devices 770 (such as a keyboard, a pointing device, a Bluetooth device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 750. Moreover, the electronic device 700 can 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 760. As shown in the figure, the network adapter 760 communicates with other modules of the electronic device 700 through the bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 700, 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.

[0115] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software, or can be implemented by the way of software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, and the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0116] In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0117] Reference Figure 8 As shown, a program product 800 for implementing the above virtual camera control method according to an embodiment of the present disclosure is described. It can adopt a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. 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 in combination with an instruction execution system, apparatus, or device.

[0118] The program product may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 foregoing.

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

[0120] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0121] The program code for performing the operations of the present disclosure may 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 may execute entirely on the user's computing device, partially on the user's device, as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may 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 may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0122] In addition, the above drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not for limiting purposes. It is easy to understand that the processes shown in the above drawings do not indicate or limit the chronological order of these processes. Additionally, it is also easy to understand that these processes may be executed, for example, synchronously or asynchronously in multiple modules.

[0123] From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0124] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0125] It should be understood that the present disclosure is not limited to the exact structures described above 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 limited by the appended claims.

Claims

1. A virtual camera control method, characterized in that, Including: Obtaining the preset perspective parameters of the virtual camera and the corresponding theoretical arm length parameters; Constructing a motion trajectory constraint function of the virtual camera based on the preset perspective parameters and the theoretical arm length parameters; the motion trajectory constraint function includes a curve function; Reading the current perspective parameters of the virtual camera and calculating the current rotation amplitude of the virtual camera in combination with the preset perspective parameters; Determining the target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and synchronously adjusting the arm length of the virtual camera based on the target arm length parameter; Among them, constructing the motion trajectory constraint function of the virtual camera based on the preset perspective parameters and the theoretical arm length parameters includes: Obtaining the current perspective focus and constructing a reference coordinate system with the current perspective focus as the origin; Converting the perspective upper bound parameter and the corresponding theoretical arm length parameter into the first fixed point coordinates in the reference coordinate system; Converting the default perspective parameter and the corresponding theoretical arm length parameter into the second fixed point coordinates in the reference coordinate system, and converting the perspective lower bound parameter and the corresponding theoretical arm length parameter into the third fixed point coordinates in the reference coordinate system; Constructing the motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates.

2. The virtual camera control method according to claim 1, wherein The preset perspective parameters include a perspective upper bound parameter, a default perspective parameter, and a perspective lower bound parameter.

3. The virtual camera control method according to claim 1, wherein Constructing the motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates includes: Calculating virtual control point coordinates based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; Drawing a motion trajectory from the first fixed point coordinates to the virtual control point coordinates and then from the virtual control point coordinates to the third fixed point coordinates, and constructing the motion trajectory constraint function of the virtual camera passing through the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates based on the motion trajectory.

4. The virtual camera control method according to claim 1, wherein Reading the current perspective parameters of the virtual camera and calculating the current rotation amplitude of the virtual camera in combination with the preset perspective parameters includes: Responding to a perspective adjustment operation to determine the current perspective parameters of the virtual camera; Calculating the current rotation amplitude of the virtual camera based on the current perspective parameters, the perspective upper bound parameter, and the perspective lower bound parameter.

5. The virtual camera control method according to claim 1 or 3, characterized in that, Determining the target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function includes: Calculating the key point coordinates corresponding to the current perspective based on the current rotation amplitude, the motion trajectory constraint function, and the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates; Determining the target arm length parameter of the virtual camera according to the coordinates of the current perspective focus and the key point coordinates.

6. The virtual camera control method according to claim 5, characterized in that, Determining the target arm length parameter of the virtual camera according to the coordinates of the current perspective focus and the key point coordinates includes: Generate a target vector composed of the coordinates of the current perspective focus and the coordinates of the key point; Calculate the modulus of the target vector and use the modulus as the target arm length parameter of the virtual camera.

7. A virtual camera control device, characterized in that, Comprising: A data acquisition module for acquiring the preset perspective parameters of the virtual camera and the corresponding theoretical arm length parameters; A constraint function construction module for constructing a motion trajectory constraint function of the virtual camera based on the preset perspective parameters and the theoretical arm length parameters; the motion trajectory constraint function includes a curve function; A current rotation amplitude calculation module for reading the current perspective parameters of the virtual camera and calculating the current rotation amplitude of the virtual camera in combination with the preset perspective parameters; An arm length adjustment module for determining the target arm length parameter of the virtual camera based on the current rotation amplitude and the motion trajectory constraint function, and synchronously adjusting the arm length of the virtual camera based on the target arm length parameter; Wherein, constructing the motion trajectory constraint function of the virtual camera based on the preset perspective parameters and the theoretical arm length parameters includes: Obtain the current perspective focus and construct a reference coordinate system with the current perspective focus as the origin; Convert the perspective upper bound parameter and the corresponding theoretical arm length parameter into the first fixed point coordinates in the reference coordinate system; Convert the default perspective parameter and the corresponding theoretical arm length parameter into the second fixed point coordinates in the reference coordinate system, and convert the perspective lower bound parameter and the corresponding theoretical arm length parameter into the third fixed point coordinates in the reference coordinate system; Construct the motion trajectory constraint function of the virtual camera based on the first fixed point coordinates, the second fixed point coordinates, and the third fixed point coordinates.

8. An electronic device, characterized in that, Comprising: A processor; And A memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the virtual camera control method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that, On which a computer program is stored, and when the computer program is executed by the processor, the virtual camera control method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Control method and apparatus for virtual camera, and device

    WO2022063177A1