A roaming flight method, device, electronic device and storage medium for a camera

By controlling the smooth transition of the camera and the rapid swing of the observation center point in three-dimensional roaming using scale factors and interpolation calculation methods, the difficulty of the user's viewpoint turning to the target scene in the prior art is solved, and the user experience and flight fluency is improved.

CN117557645BActive Publication Date: 2025-06-17ZHEJIANG KELAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311575808.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-06-17
Estimated Expiration
2043-11-23

AI Technical Summary

Technical Problem

In three-dimensional roaming, it is difficult for the prior art to quickly turn the user's viewpoint to the target scenario, resulting in the content seen by the user during flight that does not conform to human subjective reactions and affects the user experience.

Method used

By determining the first scale factor based on the camera flight time based on the virtual three-dimensional ball scene, and determining the second and third scale factors according to the factor and the interpolation calculation method, the camera is controlled to smoothly transition to the target position by first accelerating and then decelerating, and at the same time adjusting the observation center point to swing quickly towards the target position.

Benefits of technology

The camera's flight speed is achieved, reducing the vertigo caused by sudden changes, allowing users to observe the target scene faster and see the destination most of the flight time, thereby improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117557645B_ABST
    Figure CN117557645B_ABST
Patent Text Reader

Abstract

The present invention discloses a roaming flight method, device, electronic device and storage medium for a camera, which relates to the field of three-dimensional scenes. Based on the interpolation calculation method, the smooth transition processes of the camera position and the observation center point position of the camera are respectively controlled. According to the second proportionality factor, the camera is controlled to smoothly transition from the initial camera position to the target camera position in a manner of accelerating first and then decelerating, which makes the control of the flight speed of the camera more comfortable. The flight speed of the camera changes in a manner of accelerating first and then decelerating, which can reduce the dizziness caused by sudden changes. According to the third proportionality factor, the observation center point position of the camera is controlled to swing to the target position to be observed within a preset time, so that the camera can quickly swing the viewing point, that is, the observation center point, to the destination, ensuring that the user can observe the destination faster and can see the destination for most of the flight time. From multiple aspects, the user experience is further improved, which is beneficial to the application and promotion of the entire three-dimensional scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional scenes, and particularly to a roaming flight method, device, electronic device and storage medium for a camera. Background Art

[0002] Generally, the general roaming flight method starts from the initial position and attitude of the camera in the current scene, and interpolates and calculates the difference in the position and attitude of the camera between the initial situation and the target scene in a certain way, so as to calculate the position and attitude of the scene camera corresponding to a certain moment as time goes by, so as to simulate three-dimensional roaming flight. However, in three-dimensional roaming, users mainly view from the first perspective. This way of interpolating and calculating the difference in the position and attitude of the camera only focuses on the position change and attitude change of the camera itself, and does not take into account the specific position of the target scene, which will cause the user to not be able to quickly observe the destination, that is, the position of the target scene during the flight, and most of the time, what is seen is unimportant content, which does not conform to the subjective reaction of humans. Especially when the turning angle is large, this situation will be more aggravated, which is very unfriendly to the user experience. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a roaming flight method, device, electronic device and storage medium for a camera, which can control the flight speed of the camera more comfortably. The flight speed of the camera changes in a way of accelerating first and then decelerating, which can reduce the dizziness caused by sudden changes; at the same time, the camera can quickly swing the viewing point, that is, the observation center point, to the destination, ensuring that the user can observe the destination faster, and most of the flight time can see the destination, which further improves the user experience in many aspects and is conducive to the application and promotion of the entire three-dimensional scene. The specific solutions are as follows:

[0004] To solve the above technical problems, the present invention provides a roaming flight method for a camera, including:

[0005] Determining a first proportionality factor based on the flight time of the camera in the virtual three-dimensional ball scene, where the flight time is the flight time during the process of the camera flying towards the target position to be observed;

[0006] Determining a second proportionality factor based on the first proportionality factor and the first interpolation calculation method, and controlling the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a way of accelerating first and then decelerating according to the second proportionality factor;

[0007] Determine a third scale factor based on the second scale factor and the second interpolation calculation method, and control the observation center point of the camera to swing from the initial observation center point position to the target position to be observed within a preset time according to the third scale factor, so as to implement an observation operation on the target position to be observed through the camera.

[0008] Optionally, the determining the first scale factor based on the flight time of the camera in the virtual three-dimensional ball scene includes:

[0009] Determine the current flight time of the camera in the virtual three-dimensional ball scene and the entire flight time required for the camera to fly to the target camera position corresponding to the target position to be observed;

[0010] Calculate the first scale factor based on the current flight time of the camera, the entire flight time, and a preset relational expression;

[0011] The preset relational expression is:

[0012]

[0013] where, S t is the first scale factor, t is the current flight time of the camera, and T is the entire flight time.

[0014] Optionally, the determining the second scale factor based on the first scale factor and the first interpolation calculation method, and controlling the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating includes:

[0015] Calculate the second scale factor based on the first scale factor and the first Bézier curve, where the slope of the first Bézier curve first increases and then decreases as the first scale factor increases;

[0016] Perform linear interpolation based on the initial camera position, the target camera position of the camera, and the second scale factor to determine a first correspondence between the camera position of the camera and the flight time;

[0017] Control the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating based on the first correspondence.

[0018] Optionally, the determining the third scale factor based on the second scale factor and the second interpolation calculation method, and controlling the observation center point of the camera to swing from the initial observation center point position to the target position to be observed within a preset time includes:

[0019] Calculate a third scale factor based on the second scale factor and the second Bézier curve, where the slope of the second Bézier curve increases as the second scale factor increases and reaches a preset slope value within a preset time;

[0020] Perform linear interpolation based on the initial observation center point position of the observation center point of the camera, the target position to be observed, and the third scale factor to determine a second correspondence between the observation center point position of the observation center point of the camera and the flight time;

[0021] Control the observation center point of the camera to swing from the initial observation center point position to the target position to be observed within a preset time based on the second correspondence.

[0022] Optionally, before controlling the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating according to the second scale factor, it further includes:

[0023] Elevate the current camera position of the camera.

[0024] Optionally, the elevating the current camera position of the camera includes:

[0025] Calculate the straight-line distance that the camera needs to move from the initial camera position to the target camera position;

[0026] Calculate a fourth scale factor based on the first scale factor and the third Bézier curve, and elevate the current camera position of the camera based on the fourth scale factor and the straight-line distance.

[0027] Optionally, the elevating the current camera position of the camera based on the fourth scale factor and the straight-line distance includes:

[0028] Determine the height that the viewpoint needs to be elevated based on the fourth scale factor and the straight-line distance;

[0029] Add the height that needs to be elevated to the current camera position of the camera in a direction perpendicular to the ground direction to elevate the current camera position of the camera.

[0030] To solve the above technical problems, the present invention also provides a roaming flight device for a camera, including:

[0031] A first scale factor determination unit for determining a first scale factor based on the flight time of the camera in a virtual three-dimensional ball scene, where the flight time is the flight time during the process of the camera flying towards the target position to be observed;

[0032] A camera position determination unit, configured to determine a second scale factor based on the first scale factor and the first interpolation calculation method, and control the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating according to the second scale factor;

[0033] An observation center point position determination unit, configured to determine a third scale factor based on the second scale factor and the second interpolation calculation method, and control the observation center point of the camera to swing from the initial observation center point position to the target position to be observed within a preset time according to the third scale factor, so as to implement an observation operation on the target position to be observed through the camera.

[0034] To solve the above technical problems, the present invention further provides an electronic device, which includes a processor and a memory; wherein, the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the roaming flight method of the camera as described above.

[0035] To solve the above technical problems, the present invention further provides a computer-readable storage medium, which is used to store a computer program, and the computer program implements the roaming flight method of the camera as described above when executed by a processor.

[0036] The present invention discloses a roaming flight method, device, electronic device and storage medium for a camera, which respectively control the smooth transition process of the camera position and the observation center point position of the camera based on an interpolation calculation method. According to the second scale factor, the camera is controlled to smoothly transition from the initial camera position to the target camera position in a manner of first accelerating and then decelerating, which makes the control of the flight speed of the camera more comfortable. The flight speed of the camera changes in a manner of first accelerating and then decelerating, which can reduce the dizziness caused by sudden changes; according to the third scale factor, the observation center point position of the camera is controlled to swing to the target position to be observed within a preset time, so that the camera can quickly swing the viewpoint, that is, the observation center point, to the destination, ensuring that the user can observe the destination faster, and most of the flight time can see the destination, which further improves the user experience from multiple aspects and is beneficial to the application and promotion of the entire three-dimensional scene. Description of the Drawings

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0038] Figure 1 It is a schematic flowchart of a roaming flight method for a camera provided by the present invention;

[0039] Figure 2 Schematic diagram of a virtual three-dimensional ball scene provided by the present invention;

[0040] Figure 3 Schematic diagram of an implementation method of a first Bezier curve provided by the present invention;

[0041] Figure 4 Schematic diagram of an implementation method of a second Bezier curve provided by the present invention;

[0042] Figure 5 Schematic diagram of an implementation method of a third Bezier curve provided by the present invention;

[0043] Figure 6 Schematic diagram of the structure of a roaming flight device of a camera provided by the present invention;

[0044] Figure 7 Schematic diagram of the structure of an electronic device provided by the present invention. Detailed implementation manners

[0045] The core of the present invention is to provide a roaming flight method, device, electronic device and storage medium for a camera, which can control the flight speed of the camera more comfortably. The flight speed of the camera changes in a way of first accelerating and then decelerating, which can reduce the dizziness caused by sudden changes. At the same time, the camera can quickly swing the viewpoint, that is, the observation center point, to the destination, ensuring that the user can observe the destination faster, and most of the flight time can see the destination, further improving the user experience in many aspects and being beneficial to the application and promotion of the entire three-dimensional scene.

[0046] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0047] Please refer to Figure 1 , Figure 1 Schematic flowchart of a roaming flight method of a camera provided by the present invention; Please refer to Figure 2 , Figure 2 Schematic diagram of a virtual three-dimensional ball scene provided by the present invention; To solve the above technical problems, the present invention provides a roaming flight method for a camera, including:

[0048] S11: Determine a first scale factor based on the flight time of the camera in the virtual three-dimensional ball game scene, where the flight time is the flight time during the process of the camera flying towards the target position to be observed;

[0049] It is not difficult to understand that this application abandons the interpolation calculation logic of the camera pose in the prior art, and performs interpolation calculation according to the camera position, the camera observation center point position, and time, controlling the camera position and the camera observation center point position to smoothly transition to the corresponding target camera position and the target position to be observed over time. In this process, it is necessary to establish a first correspondence between the camera position and the flight time, as well as a second correspondence between the camera observation center point position and the flight time, so as to determine the real-time camera position and the real-time camera observation point position during the smooth transition process, and accurately implement the entire smooth transition flight process. Therefore, it is necessary to first determine the first scale factor corresponding to the flight time of the camera. The flight time is the various flight times during the entire flight process of the camera from the initial position to the target position during a certain flight.

[0050] Specifically, the roaming flight method of the camera provided in this application can be applied to various types of three-dimensional ball game scenes, especially the roaming flight process in a three-dimensional earth scene. This application does not make special limitations on the specific type and implementation manner of the camera, etc., and can be selected and adjusted according to the actual application scenario and specific situation. The smooth transition process means that the camera position or the camera observation center point position can move from the corresponding initial position to the corresponding target position along a smooth curve, so as to ensure the smoothness of the flight and the visual effect of the user.

[0051] S12: Determine a second scale factor based on the first scale factor and the first interpolation calculation method, and control the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a way of accelerating first and then decelerating;

[0052] It can be understood that the first interpolation calculation is performed based on the first scale factor corresponding to the flight time to obtain the second scale factor. The obtained second scale factor changes with the change of the first scale factor. Therefore, during the process of controlling the camera position based on the second scale factor, the camera position will change with time, thus realizing the flight process of the camera. At the same time, considering that the speed of the camera during the flight process will also have a certain impact on the user's visual experience, the camera flies in a way of accelerating first and then decelerating during the process of smoothly transitioning from the initial camera position to the target camera position corresponding to the target position to be observed, so as to avoid the impact of sudden speed changes on the user experience.

[0053] S13: Determine a third scale factor based on the second scale factor and the second interpolation calculation method, and control the observation center point of the camera to swing from the initial observation center point position to the target position to be observed within a preset time, so as to observe the target position to be observed through the camera.

[0054] It is not difficult to understand that if you want to control the camera to observe the target position to be observed, you not only need to control the camera position to reach the target camera position corresponding to the target position to be observed, but also need to ensure that the posture or angle of the camera can observe the target position to be observed at the target camera position. Therefore, it is also necessary to control and adjust the position of the observation center point of the camera, and the position of the observation center point of the camera needs to be based on the camera position. Therefore, it is necessary to perform a second interpolation calculation based on the second scale factor to obtain the third scale factor. At the same time, to ensure that the user can quickly observe the target position to be observed, during the process of controlling the movement of the observation center point of the camera according to the third scale factor, it is necessary to control the observation center point of the camera to be able to swing from the initial observation center point position to the target position to be observed within a preset time, so that the observation center point of the camera quickly swings to the target position to be observed. The specific value of the preset time and the like are not specifically limited in this application, and can be selected and adjusted according to the actual application scenario and specific situation, as long as the duration can meet the user experience and the target position to be observed can be observed in time.

[0055] Specifically, the first interpolation calculation method and the second interpolation calculation method can adopt the idea of Bezier curve to design the algorithm to ensure that the interpolation calculation is a smooth transition. The specific types and implementation methods of the first interpolation calculation method and the second interpolation calculation method are not specifically limited in this application, and any interpolation calculation method that can meet the smooth transition of the camera position and the position of the observation center point of the camera is acceptable.

[0056] The present invention relates to a method for roaming and flying in a three-dimensional earth scene, mainly used in a three-dimensional spherical scene, moving the scene observation camera from the initial camera position and posture (pitch angle, yaw angle, and roll angle) to the target camera position and posture by this roaming method, ensuring that the entire flight process conforms to the human subjective reaction, and ensuring that the observation range of the camera contains the target position to be observed for most of the roaming flight time, improving the user experience of roaming and flying in the three-dimensional scene.

[0057] The present invention discloses a roaming flight method for a camera, which respectively controls the smooth transition process of the camera position and the observation center point position of the camera based on interpolation calculation. According to the second proportionality factor, the camera is controlled to smoothly transition from the initial camera position to the target camera position in a manner of first accelerating and then decelerating, which makes the control of the camera's flight speed more comfortable. The flight speed of the camera changes in a manner of first accelerating and then decelerating, which can reduce the dizziness caused by sudden changes. According to the third proportionality factor, the observation center point position of the camera is controlled to swing to the target position to be observed within a preset time, so that the camera can quickly swing the viewing point, that is, the observation center point, to the destination, ensuring that the user can observe the destination faster and can see the destination for most of the flight time, further improving the user experience from multiple aspects and being beneficial to the application and promotion of the entire three-dimensional scene.

[0058] Based on the above embodiments:

[0059] As an optional embodiment, determining the first proportionality factor based on the flight moment of the camera in the virtual three-dimensional ball scene includes:

[0060] Determining the current flight moment of the camera in the virtual three-dimensional ball scene and the entire flight time required for the camera to fly to the target camera position corresponding to the target position to be observed;

[0061] Calculating the first proportionality factor based on the current flight moment of the camera, the entire flight time, and a preset relational expression;

[0062] The preset relational expression is:

[0063]

[0064] Where S t is the first proportionality factor, t is the current flight moment of the camera, and T is the entire flight time.

[0065] It is not difficult to understand that it is necessary to calculate the time ratio of the current flight moment to the end of the flight to obtain the first proportionality factor, so as to combine the flight moment with the camera position and the observation center point position of the camera. Therefore, the first proportionality factor can be determined through the preset relational expression. The entire flight time can be a default value or a duration set in advance by humans, and can be adjusted according to different users or application scenarios. The present application does not make special limitations on the acquisition methods of the current flight moment and the entire flight time, and can be implemented by setting a clock program or other means.

[0066] Specifically, the corresponding relationship between the first proportionality factor and the flight moment of the camera is further clarified through the preset relational expression, so as to effectively realize the process of changing the camera position and the observation center point position of the camera over time using the first proportionality factor, and further improve the entire roaming flight method.

[0067] Please refer to Figure 3 , Figure 3 which is a schematic diagram of an implementation method of a first Bezier curve provided by the present invention; as an optional embodiment, a second scale factor is determined based on a first scale factor and a first interpolation calculation method, and the camera is controlled according to the second scale factor to smoothly transition from an initial camera position to a target camera position corresponding to a target observation position in a manner of first accelerating and then decelerating, including:

[0068] Calculating a second scale factor based on the first scale factor and the first Bezier curve, wherein the slope of the first Bezier curve first increases and then decreases as the first scale factor increases;

[0069] Performing linear interpolation according to the initial camera position, the target camera position of the camera and the second scale factor to determine a first correspondence between the camera position of the camera and the flight time;

[0070] Controlling the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target observation position in a manner of first accelerating and then decelerating based on the first correspondence.

[0071] It is not difficult to understand that the interpolation calculation of the second scale factor can be implemented by using the first Bezier curve, and considering that the camera needs to smoothly transition from the initial camera position to the target camera position corresponding to the target observation position in a manner of first accelerating and then decelerating, the slope of the first Bezier curve needs to satisfy the trend of first increasing and then decreasing as the first scale factor increases, as Figure 3 shown, taking point A(0, 0), point B(1, 0), point C(0, 1) and point D(1, 1) as the control points of the first Bezier curve to calculate the second scale factor; and the slope of the first Bezier curve is preferably kept in a uniform change process so that the entire flight process of the camera remains in a uniform speed state, further improving the user experience. The specific implementation of the first Bezier curve and the like are not particularly limited in this application. After obtaining the second scale factor, the real-time camera position E of the camera can be obtained by using the linear interpolation calculation method t : E t =(1 - S e ) * E0 + S e * E1, where E0 is the initial camera position of the camera, S e is the second scale factor, E1 is the target camera position, and E t is the real-time camera position; that is, determining the first correspondence between the camera position of the camera and the flight time, and controlling the real-time change of the camera position according to the real-time camera position of the camera over time, thereby realizing the entire flight process.

[0072] Specifically, the first Bezier curve can be used as the interpolation calculation method for the second scale factor, and subsequently, the linear interpolation calculation method can be used to accurately determine the real-time camera position of the camera. The Bezier curve has high precision, strong flexibility, is easy to calculate, store, and draw, can realize flexible control of the camera position, expand the applicable range of the entire roaming flight method, and is beneficial to the wide application of the entire three-dimensional scene.

[0073] Please refer to Figure 4 , Figure 4 FIG. is a schematic diagram of an implementation manner of a second Bezier curve provided by the present invention; as an optional embodiment, a third scale factor is determined based on the second scale factor and the second interpolation calculation method, and the observation center point of the camera is controlled to swing from the initial observation center point position to the target position to be observed within a preset time, including:

[0074] Calculating a third scale factor based on the second scale factor and the second Bezier curve, wherein the slope of the second Bezier curve increases as the second scale factor increases and reaches a preset slope value within a preset time;

[0075] Performing linear interpolation according to the initial observation center point position, the target position to be observed, and the third scale factor of the observation center point of the camera to determine a second correspondence relationship between the observation center point position of the observation center point of the camera and the flight time;

[0076] Controlling the observation center point of the camera to swing from the initial observation center point position to the target position to be observed within a preset time based on the second correspondence relationship.

[0077] It is not difficult to understand that the second Bezier curve can be used to implement the interpolation calculation of the third scale factor. Considering that the observation center point of the camera needs to swing rapidly from the initial observation center point position to the target position to be observed, the slope of the second Bezier curve needs to satisfy the condition that it increases as the second scale factor increases. As Figure 4 shown, taking point E(0, 0), point F(1, 1), and point G(1, 0) as the control points of the second Bezier curve to calculate the third scale factor; and the slope of the second Bezier curve is preferably rapidly increased to the preset slope so that the observation center point of the camera can rapidly swing to the target position to be observed, further improving the user experience. The specific implementation of the second Bezier curve and the like are not particularly limited in this application. After obtaining the third scale factor, the linear interpolation calculation method can be used to obtain the real-time observation center point position C of the camera t : C t =(1 - S c ) * C0 + S c * C1, where C0 is the initial observation center point position, S cis the third scale factor, C1 is the target position to be observed, and C t is the real-time observation center point position; that is, to determine the second correspondence between the observation center point position of the observation center point of the camera and the flight time, and to control the real-time change of the observation center point of the camera according to the real-time observation center point position of the camera over time, so as to realize the entire flight process.

[0078] Specifically, the second Bezier curve can be used as the interpolation calculation method for the third scale factor, and the linear interpolation calculation method is adopted subsequently to accurately determine the real-time observation center point position of the camera. The Bezier curve has high precision, strong flexibility, easy to calculate, store and draw, can realize flexible control of the camera position, expand the applicable range of the entire roaming flight method, and is beneficial to the wide application of the entire three-dimensional scene.

[0079] As an optional embodiment, before controlling the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a way of accelerating first and then decelerating according to the second scale factor, it further includes:

[0080] Elevate the current camera position of the camera.

[0081] It is not difficult to understand that considering the three-dimensional scene on the spherical surface, if the initial camera position and the target camera position of the camera are far apart, there may be a situation of penetrating the terrain during the flight process. Therefore, during the flight process of the camera, the flight process of the camera can be further elevated, that is, during the flight process, for different flight times, the current camera position of the camera is correspondingly elevated. Take Figure 2 as an example. Suppose the camera is elevated during the process of flying straight from the initial camera position E0 to the target camera position E1. Then the camera will start from the initial camera position, first fly upward away from the center of the sphere for a certain time over time, and then fly downward closer to the center of the sphere for a certain time, and finally fly from the initial camera position E0 to the target camera position E1 in a curve way of first rising and then falling. The specific elevation processing method and elevation height, etc. are not particularly limited in this application, and can be set and adjusted according to the specific situation of the initial camera position and the target camera position during the actual flight process. The elevation processing not only includes the elevation of the camera position, but also includes the subsequent corresponding falling process.

[0082] Specifically, in order to avoid the situation of the camera flying through the terrain during the flight process, the current camera position of the camera at each flight time can be elevated during the flight process of the camera, so as to avoid the influence of the situation of flying through the terrain on the user's visual effect and further improve the user experience.

[0083] Please refer to Figure 5 ,Figure 5 Schematic diagram of an implementation method of a third - order Bézier curve provided by the present invention; As an optional embodiment, raising the current camera position of the camera includes:

[0084] Calculating the straight - line distance that the camera needs to move from the initial camera position to the target camera position;

[0085] Calculating a fourth proportionality factor based on the first proportionality factor and the third - order Bézier curve, and raising the current camera position of the camera based on the fourth proportionality factor and the straight - line distance.

[0086] It is not difficult to understand that the process of raising the camera position can also be implemented by an interpolation calculation process based on the third - order Bézier curve, and the slope of the third - order Bézier curve can first decrease and then increase as the first proportionality factor increases. As Figure 5 shown, taking points H(0, 0), I(0.5, 0), J(1, 0), and K(0.5, 1) as the control points of the third - order Bézier curve to calculate the fourth proportionality factor; thereby realizing a slow raising of the camera position and avoiding situations such as user dizziness caused by an instant excessive raising. The specific implementation of the third - order Bézier curve and the like are not particularly limited in this application. It should be noted that the straight - line distance refers to the straight - line distance between the initial camera position and the target camera position of the camera, that is, the distance that can be represented by the modulus of a vector For the raising process of the camera position, the corresponding straight - line distance needs to be used as the vertical leap height in the vertical direction, and the vertical direction refers to the vertical direction perpendicular to the spherical surface.

[0087] Specifically, the raising process of the camera position can also be implemented by an interpolation calculation method based on the third - order Bézier curve. The interpolation calculation method can improve the smoothness of the raising and falling processes of the camera position and avoid the impact of uneven raising on the user experience.

[0088] As an optional embodiment, raising the current camera position of the camera based on the fourth proportionality factor and the straight - line distance includes:

[0089] Determining the height that the viewing point needs to be raised based on the fourth proportionality factor and the straight - line distance;

[0090] Adding the height that needs to be raised to the current camera position of the camera in the direction perpendicular to the ground direction to raise the current camera position of the camera.

[0091] It is not difficult to understand that the height by which the camera position, i.e., the viewpoint, needs to be raised during the elevation process also needs to change in real time with time and has different change processes according to different straight-line distances. Therefore, the fourth proportionality factor is used to realize the correspondence between the elevation height and the flight time, and then based on the fourth proportionality factor and the straight-line distance, the height D by which the viewpoint needs to be raised is determined. t = S d * D, where D t is the height by which the current viewpoint needs to be raised, S d is the fourth proportionality factor, and D is the straight-line distance. At this time, the height by which the current viewpoint needs to be raised is added to the current camera position in the direction perpendicular to the ground direction, and the resulting position is the real-time camera position after the elevation process.

[0092] Specifically, the real-time elevation height corresponding to the current flight process is determined according to the flight time and the straight-line distance between the initial camera position and the target camera position. Then, based on the real-time camera position of the camera obtained according to the first Bézier curve before, the real-time camera position after the elevation process is calculated. Based on this, controlling the camera can realize the flight process of the camera after the elevation process, further improving the user experience.

[0093] As a specific embodiment, as Figure 2 shown, the three-dimensional center point position (O), the initial camera position (E0), the initial observation center point position (C0), the target camera position (E1), the target observation center point position (C1), and the flight time (T) are known. By calculating the real-time camera position (E t ) and the real-time observation center point position (C t ) at the current flight time t (0 ≤ t ≤ T), and controlling the camera based on the real-time camera position and the real-time observation center point position over time, the control process of flying the camera to the target position to be observed is realized.

[0094] The specific scheme steps include four steps: The first step is to calculate the time ratio at time t to the end time T of the flight to obtain the first proportionality factor: where, S t is the first proportionality factor, t is the current flight time of the camera, T is the entire flight time, and the first proportionality factor is used as the control factor for subsequent Bézier curve interpolation calculation. The second step is to calculate the real-time camera position E t . First, according to the S t calculated in the previous step and the first Bézier curve interpolation method shown in Figure 3 , S e is calculated, so as to control the movement of the camera viewpoint to change in a way of first accelerating slowly and then decelerating slowly. The camera viewpoint is the camera position; then, linear interpolation is performed according to E0, E1, and S e to obtain Et : E t = (1 - S e ) * E0 + S e * E1. The third step is to raise the viewing point E t , because it is a flight process under a spherical system, when the two points before and after flight are far apart, the flight process may penetrate the terrain, so E t also needs to be raised. Calculate the straight-line distance D that needs to be moved: Use this as the hop height in the vertical direction. The raising distance is related to time t and D. According to S t and Figure 5 shown by the Bezier curve interpolation method to calculate the corresponding fourth proportional factor S d at time t, and then according to D t = S d * D, calculate the height D t that the viewing point needs to be raised at this time; add D t to the viewing point position at this time in the vertical direction perpendicular to the ground, and the resulting is the final E t : The process of the raising process is represented by a vector method. The fourth step is to calculate the position C t of the real-time observation center point. According to the S t calculated in the second step and Figure 4 shown by the Bezier curve interpolation method to calculate the position S c of the observation center point corresponding to time t. This Bezier curve can quickly move the center point to the corresponding area of the target position to be observed; then perform linear interpolation according to C0, C1 and S c to obtain C t : C t = (1 - S c ) * C0 + S c * C1.

[0095] Using the camera roaming flight method provided by the present application can make the flight speed control of the camera more comfortable. The flight speed of the camera viewing point changes in a way of first accelerating and then decelerating, which can reduce the dizziness caused by sudden changes; during the flight process, the viewing point can be quickly moved to the destination, ensuring that the user can observe the destination faster, and most of the flight time can see the destination from different angles.

[0096] Please refer to Figure 6 , Figure 6 which is the structural schematic diagram of a camera roaming flight device provided by the present invention; to solve the above technical problems, the present invention also provides a camera roaming flight device, including:

[0097] The first scale factor determination unit 11 is configured to determine a first scale factor based on the flight time of the camera in the virtual three-dimensional ball game scene, where the flight time is the flight time during the process of the camera flying towards the target position to be observed;

[0098] The camera position determination unit 12 is configured to determine a second scale factor based on the first scale factor and the first interpolation calculation method, and control the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating according to the second scale factor;

[0099] The observation center point position determination unit 13 is configured to determine a third scale factor based on the second scale factor and the second interpolation calculation method, and control the observation center point of the camera to swing from the initial observation center point position to the target position to be observed within a preset time, so as to implement the observation operation on the target position to be observed through the camera.

[0100] As an optional embodiment, the first scale factor determination unit 11 includes:

[0101] The flight time determination unit is configured to determine the current flight time of the camera in the virtual three-dimensional ball game scene and the entire flight time required for the camera to fly to the target camera position corresponding to the target position to be observed;

[0102] The first scale factor determination subunit is configured to calculate the first scale factor based on the current flight time of the camera, the entire flight time, and a preset relational expression.

[0103] As an optional embodiment, the camera position determination unit 12 includes:

[0104] The second scale factor determination unit is configured to determine the second scale factor based on the first scale factor and the first Bezier curve, where the slope of the first Bezier curve first increases and then decreases as the first scale factor increases;

[0105] The first correspondence determination unit is configured to perform linear interpolation according to the initial camera position, the target camera position of the camera, and the second scale factor to determine the first correspondence between the camera position of the camera and the flight time;

[0106] The first control unit is configured to control the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating based on the first correspondence.

[0107] As an optional embodiment, the observation center point position determination unit 13 includes:

[0108] A third proportional factor determination unit, configured to calculate a third proportional factor based on the second proportional factor and a second Bezier curve, wherein a slope of the second Bezier curve increases as the second proportional factor increases and reaches a preset slope value within a preset time;

[0109] A second correspondence determination unit, configured to perform linear interpolation according to an initial observation center point position of an observation center point of the camera, the target observation position to be observed, and the third proportional factor to determine a second correspondence between an observation center point position of the observation center point of the camera and a flight moment;

[0110] A second control unit, configured to control the observation center point of the camera to swing from the initial observation center point position to the target observation position within a preset time based on the second correspondence.

[0111] As an optional embodiment, it further includes:

[0112] An elevation processing unit, configured to perform elevation processing on a current camera position of the camera.

[0113] As an optional embodiment, the elevation processing unit includes:

[0114] A straight-line distance determination unit, configured to calculate a straight-line distance that the camera needs to move from an initial camera position to a target camera position;

[0115] An elevation processing subunit, configured to calculate a fourth proportional factor based on the first proportional factor and a third Bezier curve, and perform elevation processing on the current camera position of the camera based on the fourth proportional factor and the straight-line distance.

[0116] As an optional embodiment, the elevation processing subunit includes:

[0117] A height determination unit, configured to determine a height that a viewpoint needs to be elevated based on the fourth proportional factor and the straight-line distance;

[0118] A height addition unit, configured to add the height that needs to be elevated to the current camera position of the camera in a direction perpendicular to the ground direction to perform elevation processing on the current camera position of the camera.

[0119] For the introduction of a roaming flight device of a camera provided by the present invention, please refer to the embodiments of the roaming flight method of the camera above, and the present invention will not be elaborated herein.

[0120] Please refer to Figure 7 , Figure 7The figure is a schematic structural diagram of an electronic device provided by the present invention. To solve the above technical problems, the present invention also provides an electronic device, which includes a processor 22 and a memory 21; wherein, the memory 21 is used to store a computer program, and the computer program is loaded and executed by the processor 22 to implement the roaming flight method of the camera as described above.

[0121] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 may be implemented in at least one hardware form of DSP (Digital Signal Processor), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the central processing unit; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 22 may integrate a GPU (graphics processing unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0122] The memory 21 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 21 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 21 is at least used to store the following computer program. After the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the roaming flight method of the camera disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 21 may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, the roaming flight method of the camera, etc.

[0123] In some embodiments, the electronic device may further include a display screen, an input / output interface, a communication interface, a power supply, and a communication bus.

[0124] Those skilled in the art can understand that Figure 7The structure shown does not constitute a limitation on the electronic device, and it may include more or fewer components than those shown in the figure.

[0125] For the introduction of an electronic device provided by the present invention, please refer to the embodiments of the roaming flight method of the above-mentioned camera, and the present invention will not be elaborated herein.

[0126] To solve the above technical problems, the present invention also provides a computer-readable storage medium for storing a computer program, and when the computer program is executed by a processor, it implements the roaming flight method of the camera as described above.

[0127] It can be understood that if the method in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present application. Specifically, the computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical discs, and mobile hard disks, etc., or any type of medium or device suitable for storing instructions and data, etc. The present application does not make special limitations here.

[0128] For the introduction of a computer-readable storage medium provided by the present invention, please refer to the embodiments of the roaming flight method of the above-mentioned camera, and the present invention will not be elaborated herein.

[0129] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0130] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0131] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.

[0132] The technical solutions provided in this application have been introduced in detail above. Specific examples are used in this text to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A roaming flight method for a camera, characterized in that, Including: Determining a first scale factor based on the flight moment of a camera in a virtual three-dimensional ball game scene, where the flight moment is the flight moment during the process of the camera flying towards a target position to be observed; Determining a second scale factor based on the first scale factor and a first interpolation calculation method, and controlling the camera to smoothly transition from an initial camera position to a target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating according to the second scale factor; Determining a third scale factor based on the second scale factor and a second interpolation calculation method, and controlling the observation center point of the camera to swing from an initial observation center point position to the target position to be observed within a preset time according to the third scale factor, so as to implement an observation operation on the target position to be observed through the camera; The determining the first scale factor based on the flight moment of a camera in a virtual three-dimensional ball game scene includes: Determining the current flight moment of a camera in a virtual three-dimensional ball game scene and the entire flight time required for the camera to fly to a target camera position corresponding to the target position to be observed; Calculating the first scale factor based on the current flight moment of the camera, the entire flight time, and a preset relational expression; The preset relational expression is: Among them, S t is the first scale factor, t is the current flight time of the camera, and T is the entire flight time; The determining the second scale factor based on the first scale factor and a first interpolation calculation method includes: Determining the second scale factor based on the first scale factor and a first Bezier curve, where the slope of the first Bezier curve first increases and then decreases as the first scale factor increases; The determining the third scale factor based on the second scale factor and a second interpolation calculation method includes: Determining the third scale factor based on the second scale factor and a second Bezier curve, where the slope of the second Bezier curve increases as the second scale factor increases and reaches a preset slope value within a preset time.

2. The roaming flight method for a camera according to claim 1, characterized in that, Controlling the camera to smoothly transition from an initial camera position to a target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating according to the second scale factor includes: Performing linear interpolation based on the initial camera position, the target camera position, and the second scale factor of the camera to determine a first correspondence relationship between the camera position of the camera and the flight moment; Controlling the camera to smoothly transition from an initial camera position to a target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating based on the first correspondence relationship.

3. The roaming flight method for a camera according to claim 1, characterized in that, Controlling the observation center point of the camera to swing from an initial observation center point position to the target position to be observed within a preset time according to the third scale factor includes: Performing linear interpolation based on the initial observation center point position of the observation center point of the camera, the target position to be observed, and the third scale factor to determine a second correspondence relationship between the observation center point position of the observation center point of the camera and the flight moment; Controlling the observation center point of the camera to swing from an initial observation center point position to the target position to be observed within a preset time based on the second correspondence relationship.

4. The roaming flight method for a camera according to any one of claims 1 to 3, characterized in that, Before controlling the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating according to the second scale factor, the method further includes: Elevating the current camera position of the camera.

5. The roaming flight method for a camera according to claim 4, characterized in that, The elevating the current camera position of the camera includes: Calculating a straight-line distance that the camera needs to move from the initial camera position to the target camera position; Calculating a fourth scale factor based on the first scale factor and a third Bezier curve, and elevating the current camera position of the camera based on the fourth scale factor and the straight-line distance.

6. The roaming flight method for a camera according to claim 5, characterized in that, The elevating the current camera position of the camera based on the fourth scale factor and the straight-line distance includes: Determining a height by which the viewpoint needs to be elevated based on the fourth scale factor and the straight-line distance; Adding the height by which the viewpoint needs to be elevated to the current camera position of the camera in a direction perpendicular to the ground direction to elevate the current camera position of the camera.

7. A roaming flight device for a camera, characterized in that, The method includes: A first scale factor determining unit, configured to determine a first scale factor based on a flight time of a camera in a virtual three-dimensional ball game scene, where the flight time is a flight time during the process of the camera flying towards a target position to be observed; A camera position determining unit, configured to determine a second scale factor based on the first scale factor and a first interpolation calculation method, and control the camera to smoothly transition from the initial camera position to the target camera position corresponding to the target position to be observed in a manner of first accelerating and then decelerating according to the second scale factor; An observation center point position determining unit, configured to determine a third scale factor based on the second scale factor and a second interpolation calculation method, and control an observation center point of the camera to swing from an initial observation center point position to the target position to be observed within a preset time, so as to implement an observation operation on the target position to be observed through the camera; The first scale factor determining unit includes: A flight time determining unit, configured to determine a current flight time of a camera in a virtual three-dimensional ball game scene and an entire flight time required for the camera to fly to a target camera position corresponding to the target position to be observed; A first scale factor determining subunit, configured to calculate a first scale factor based on the current flight time of the camera, the entire flight time, and a preset relational expression; The preset relational expression is: where S t is the first scale factor, t is the current flight time of the camera, and T is the entire flight time; The camera position determining unit includes: A second scale factor determining unit, configured to calculate a second scale factor based on the first scale factor and a first Bezier curve, where a slope of the first Bezier curve first increases and then decreases as the first scale factor increases; The observation center point position determining unit includes: A third scale factor determining unit, configured to calculate a third scale factor based on the second scale factor and a second Bezier curve, where a slope of the second Bezier curve increases as the second scale factor increases and reaches a preset slope value within a preset time.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein, the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the roaming flight method of the camera according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, For saving a computer program, the computer program, when executed by a processor, implements the roaming flight method of the camera according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Flight positioning method and device based on three-dimensional scene, storage medium and electronic device

    CN113870345A

  • Urban scene three-dimensional modeling method and device and electronic equipment

    CN116958449A