Virtual camera track control method and device, computer equipment and storage medium
By building the camera and target position curves, obtaining the anchor point correspondence relationship, and accurately defining the virtual camera trajectory, the problems of insufficient control accuracy and poor flexibility in the existing technology are solved, and high-precision and flexible virtual camera control are achieved, which is suitable for a variety of scenarios and projects.
Patent Information
- Application Number
- CN202510530320.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-12
AI Technical Summary
The existing virtual camera track control technology has problems such as insufficient control accuracy, lack of flexibility and poor adaptability to complex scenes, which limits its application in the fields of virtual reality, augmented reality and 3D animation production.
By constructing the camera position curve and the target position curve, obtain the corresponding relationship between the camera anchor point and the target anchor point, combine the camera direction and user parameter configuration, accurately define the trajectory and mirror operation of the virtual camera to achieve high-precision control.
It realizes high-precision control of the virtual camera running trajectory, enhances control flexibility and adaptability, reduces the need for manual adjustments and repeated trials, reduces production costs, and improves work efficiency.
Smart Images

Figure CN120471986A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual camera technology, and in particular to a virtual camera trajectory control method, device, computer equipment and storage medium. Background Art
[0002] With the development of technology and the increasing demand of various industries, 3D design software is being used more and more widely. In many scenarios, it is necessary to create animations of the designed models within the design software or using external software to facilitate further application of the models.
[0003] Existing virtual camera trajectory control technologies suffer from insufficient control accuracy, lack of flexibility, and poor adaptability to complex scenes. These issues limit the application of virtual cameras in fields such as virtual reality (VR), augmented reality (AR), and 3D animation. Summary of the Invention
[0004] In view of this, the present invention provides a virtual camera trajectory control method, apparatus, computer equipment and storage medium to solve the problems of insufficient control accuracy, lack of flexibility and poor adaptability to complex scenes in virtual camera trajectory control technology.
[0005] In a first aspect, the present invention provides a virtual camera trajectory control method, the method comprising:
[0006] Get the camera position and target position;
[0007] Based on the camera position, construct a camera position curve;
[0008] Based on the target position, construct a target position curve;
[0009] Based on the camera position curve and the target position curve, obtaining a correspondence between a camera anchor point, a target anchor point, and the camera anchor point and the target anchor point, wherein the camera anchor point is located on the camera position curve and the target anchor point is located on the target position curve;
[0010] Determining a camera direction of the virtual camera based on a line between a point on the camera position curve and a point on the target position curve;
[0011] In response to the user's parameter configuration, the trajectory and movement of the virtual camera are controlled by combining the camera direction, camera position curve and target position curve.
[0012] In this invention, by precisely defining the camera trajectory and target trajectory, high-precision control of the virtual camera's trajectory is achieved, meeting the stringent accuracy requirements of professional applications. Users can freely add anchor points and set segment parameters as needed, making virtual camera control more flexible and adaptable to various complex shooting requirements. For complex scenes, the position and orientation of the virtual camera can be precisely controlled, maintaining stable control even in changing environments. This reduces the need for manual adjustments and trial and error, saving time and human resources, and reducing production costs. Through standardized control methods, the reusability of the virtual camera trajectory is improved, making it applicable to a variety of scenarios and projects, and improving work efficiency.
[0013] In an optional embodiment, the camera position curve includes a camera spline curve, a camera arc, and a camera polyline. The camera position curve is constructed based on the camera position, including:
[0014] Get the key points of the camera position, the weights corresponding to the key points, and the time parameters corresponding to the key points;
[0015] Create a spline curve list, calculate the control point coordinates based on the key points and weights, add the control point coordinates to the spline curve list, and construct the camera spline curve;
[0016] Create an arc list, calculate the arc point coordinates based on the key points and time parameters, add the arc point coordinates to the arc list, and construct the camera arc;
[0017] Create a polyline list, calculate the coordinates of the polyline points based on the key points and time parameters, add the coordinates of the polyline points to the polyline list, and construct the camera polyline.
[0018] In this method, a variety of camera position curves including camera spline curves, camera arcs and camera polylines are constructed through the camera position, which facilitates the subsequent use of the camera trajectory and target trajectory curves to control the position and direction of the virtual camera respectively, improving the ability to accurately control the virtual camera position in complex scenes and meeting the strict requirements for accuracy in professional applications.
[0019] In an optional embodiment, the target position curve includes a target spline curve, a target arc, and a target polyline. Constructing the target position curve based on the target position includes:
[0020] Obtain the key points of the target position, the weights corresponding to the key points, and the time parameters corresponding to the key points;
[0021] Create a spline curve list, calculate the control point coordinates based on the key points and weights, add the control point coordinates to the spline curve list, and construct the target spline curve;
[0022] Create an arc list, calculate the arc point coordinates based on the key points and time parameters, add the arc point coordinates to the arc list, and construct the target arc;
[0023] Create a polyline list, calculate the coordinates of the polyline points based on the key points and time parameters, add the coordinates of the polyline points to the polyline list, and construct the target polyline.
[0024] In this method, a variety of target position curves including target spline curves, target arcs and target polylines are constructed through the target position, which facilitates the subsequent use of the target trajectory and target trajectory curves to control the position and direction of the virtual target respectively, improving the ability to accurately control the virtual target position in complex scenes and meeting the strict requirements for accuracy in professional applications.
[0025] In an optional embodiment, obtaining a correspondence between a camera anchor point, a target anchor point, and the camera anchor point and the target anchor point based on the camera position curve and the target position curve includes:
[0026] Establish an initial anchor point list and an initial anchor point correspondence list;
[0027] In response to a user's camera anchor point selection and a target anchor point selection, determining a camera anchor point and a target anchor point;
[0028] Based on the camera anchor point and the target anchor point, a correspondence between the camera anchor point and the target anchor point is constructed;
[0029] Add the camera anchor point and the target anchor point to the initial anchor point list, and add the correspondence between the camera anchor point and the target anchor point to the initial anchor point correspondence list.
[0030] In this way, by obtaining the correspondence between the camera anchor point, the target anchor point, and the camera anchor point and the target anchor point, the user is allowed to control the motion characteristics of the virtual camera by adding anchor points and configuring the line segment parameters between the anchor points, providing a new way for user participation and creation, enhancing the user's creative freedom, and further improving the user experience.
[0031] In an optional embodiment, determining the camera direction of the virtual camera based on a line between a point on the camera position curve and a point on the target position curve includes:
[0032] Create an initial camera movement trajectory list;
[0033] With the time interval as the step length, the camera equidistant points of the camera position curve and the target equidistant points of the target position curve are generated, and the camera position coordinates corresponding to the camera equidistant points and the target position coordinates corresponding to the target equidistant points are calculated;
[0034] Based on the camera position coordinates and the target position coordinates, a heading vector is calculated, and the camera position coordinates and the heading vector are added to the initial camera movement trajectory list to obtain a camera movement trajectory list;
[0035] The camera movement trajectory list is smoothed to obtain the final camera movement trajectory list and determine the camera direction of the virtual camera.
[0036] In this approach, the camera trajectory is created with several equally spaced points, and the target trajectory is created with several equally spaced points. The line connecting the two sets of points represents the virtual camera's orientation, and continuous movement constitutes the camera's movement. This not only improves the technical performance of virtual camera trajectory control, but also provides users with a more intuitive and flexible operating experience, while lowering the threshold and cost of technical application. This enhances the flexibility of virtual camera trajectory control, freeing it from fixed conditions.
[0037] In an optional implementation, calculating a heading vector based on the camera position coordinates and the target position coordinates includes:
[0038] By formula Calculate the initial heading vector, where is the initial orientation vector, C1(t) is the camera position coordinate, and C2(t) is the target position coordinate;
[0039] Normalize the initial heading vector to obtain the heading vector.
[0040] In this way, the camera direction of the virtual camera is determined by calculating the orientation vector, thereby improving the control accuracy of the virtual camera's trajectory and achieving accurate control.
[0041] In a second aspect, the present invention provides a virtual camera trajectory control device, the device comprising:
[0042] Position acquisition module, used to obtain camera position and target position;
[0043] A camera position curve construction module is used to construct a camera position curve based on the camera position;
[0044] A target position curve construction module is used to construct a target position curve based on the target position;
[0045] An anchor point acquisition module, used for acquiring a camera anchor point, a target anchor point, and a correspondence between the camera anchor point and the target anchor point based on a camera position curve and a target position curve, wherein the camera anchor point is located on the camera position curve and the target anchor point is located on the target position curve;
[0046] a direction determination module, for determining a camera direction of the virtual camera based on a line between a point on the camera position curve and a point on the target position curve;
[0047] The camera control module is used to control the trajectory and movement of the virtual camera in response to the user's parameter configuration, combined with the camera direction, camera position curve and target position curve.
[0048] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to thereby execute the virtual camera trajectory control method of the first aspect or any corresponding embodiment thereof.
[0049] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the virtual camera trajectory control method of the first aspect or any corresponding embodiment thereof.
[0050] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, which are used to enable a computer to execute the virtual camera trajectory control method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 4 is a flow chart of a virtual camera trajectory control method according to an embodiment of the present invention.
[0053] Figure 2 is a flowchart of a virtual camera trajectory control method according to an embodiment of the present invention.
[0054] Figure 3 3 is a schematic diagram of a trajectory in which a virtual camera position corresponds to a target position in one-to-one correspondence according to an embodiment of the present invention.
[0055] Figure 4 This is a schematic diagram of trajectories corresponding to a virtual camera position and multiple target positions according to an embodiment of the present invention.
[0056] Figure 5 1 is a schematic diagram of trajectories corresponding to multiple virtual camera positions and a target position according to an embodiment of the present invention.
[0057] Figure 64 is a flow chart of another virtual camera trajectory control method according to an embodiment of the present invention.
[0058] Figure 7 4 is a flow chart of another virtual camera trajectory control method according to an embodiment of the present invention.
[0059] Figure 8 4 is a structural block diagram of a virtual camera trajectory control device according to an embodiment of the present invention.
[0060] Figure 9 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0061] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0062] Existing virtual camera trajectory control technologies suffer from insufficient control accuracy, lack of flexibility, and poor adaptability to complex scenes. These issues limit the application of virtual cameras in fields such as virtual reality (VR), augmented reality (AR), and 3D animation.
[0063] Most current software supports the method of creating continuous animation by binding the camera's trajectory within the design software. However, the camera trajectory bound by the current software often has the following problems:
[0064] 1. The camera trajectory control accuracy is insufficient, making it difficult to achieve accurate control;
[0065] 2. Lack of flexibility, requiring the camera to be positioned under fixed conditions;
[0066] 3. For complex scenes, it is impossible to accurately control the position and movement of the camera.
[0067] To address the above-mentioned issues, embodiments of the present invention provide a virtual camera trajectory control method for use in a computer device. It should be noted that the execution subject may be a virtual camera trajectory control device, which may be implemented as part or all of the computer device through software, hardware, or a combination of software and hardware. The computer device may be a terminal, client, or server. The server may be a single server or a server cluster consisting of multiple servers. The terminal in the embodiments of the present application may be a smartphone, personal computer, tablet computer, or other intelligent hardware device. The following method embodiments are all described using a computer device as the execution subject.
[0068] The computer device in this embodiment is suitable for use in three-dimensional design software, and a continuous animation usage scenario is formed by binding the camera's running trajectory within the design software. The present invention provides a virtual camera trajectory control method, which achieves high-precision control of the virtual camera's running trajectory by accurately defining the camera trajectory and target trajectory, meeting the strict accuracy requirements in professional applications. Users can freely add anchor points and set line segment parameters as needed, making the control of the virtual camera more flexible and adaptable to various complex shooting needs. For complex scenes, the position and direction of the virtual camera can be precisely controlled, and a stable control effect can be maintained even in a changing environment. At the same time, the need for manual adjustment and repeated trials is reduced, saving time and human resources, and reducing production costs. Through standardized control methods, the reusability of the virtual camera trajectory is improved, applicable to a variety of scenes and projects, and improving work efficiency.
[0069] According to an embodiment of the present invention, an embodiment of a virtual camera trajectory control method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0070] In this embodiment, a virtual camera trajectory control method is provided, which can be used in the above-mentioned computer device. Figure 1 : is a flow chart of a virtual camera trajectory control method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0071] Step S101, obtaining the camera position and target position.
[0072] Step S102: constructing a camera position curve based on the camera position.
[0073] In one example, a camera position curve C1(t) is constructed based on the camera position to control the position of the virtual camera in the virtual scene. The camera position curve can be a spline curve, an arc, or a polyline. A spline curve can be created by specifying several control points and fitting the curve. An arc can be created by specifying the center, radius, start point, and end point. A polyline can be created by specifying several endpoints to form a multi-segment polyline.
[0074] Step S103: constructing a target position curve based on the target position.
[0075] In one example, a target position curve C2(t) is constructed based on the target position to control the position of the target captured by the virtual camera. The target position curve can be a spline, arc, or polyline. The creation method is the same as the camera trajectory, and the target position curve C2(t) is output.
[0076] Step S104 : Based on the camera position curve and the target position curve, obtain the corresponding relationship between the camera anchor point, the target anchor point, and the camera anchor point and the target anchor point.
[0077] In an embodiment of the present invention, the camera anchor point is located on the camera position curve, and the target anchor point is located on the target position curve.
[0078] In one example, anchor points are added to the camera position curve and the target position curve. The user-selected position on the camera position curve is defined as the camera position anchor point; the user-selected position on the target position curve is defined as the target position anchor point. Keyframes are set using the anchor points, and a correspondence is established between the camera and target anchor points. This correspondence is established using the Anchor Point Connection tool. After enabling the Connection tool, select the camera anchor point first, then the target anchor point, to complete the connection. The selection order can be reversed, and anchor points can be set to zero, one, or multiple pairs.
[0079] Step S105 : determining the camera direction of the virtual camera based on the line between the point on the camera position curve and the point on the target position curve.
[0080] In one example, the virtual camera's orientation is determined by connecting points on the camera trajectory with those on the target trajectory. Create n equally spaced points along the camera trajectory and n equally spaced points along the target trajectory. The line connecting the two sets of points represents the virtual camera's orientation, and continuous movement constitutes camera movement.
[0081] Step S106 , in response to the user's parameter configuration, the trajectory and the movement of the virtual camera are controlled in combination with the camera direction, the camera position curve, and the target position curve.
[0082] In one example, the virtual camera's movement speed is controlled based on user-configured parameters, including the overall camera trajectory, camera parameters for the anchor points (e.g., focal length, dwell time), and motion parameters for the line segments between the anchor points. This allows for multiple aspects of controlling the virtual camera's movement characteristics.
[0083] Specifically, the inputs for controlling the trajectory and movement of the virtual camera include: an anchor point list A, containing camera and target anchor points; an anchor point correspondence list R, containing the correspondences between camera and target anchor points; and a user interface tool for setting parameters. The output includes a parameter configuration list P, containing camera and motion parameters.
[0084] Exemplarily, the algorithm steps include: 1. Initialization: Create an empty parameter configuration list P for storing all parameter configurations. 2. User Interface Interaction: Provide user interface tools that allow users to set overall camera trajectory parameters, camera anchor point parameters, and motion parameters of segments between anchor points. Users use the interface tools to set overall camera trajectory parameters, such as the default focal length and default movement speed. 3. Camera Anchor Point Parameter Setting: For each camera position anchor point A1, the user uses the interface tools to set camera parameters, such as focal length f and dwell time d. The set parameters (f, d) are associated with anchor point A1 in the format (A1, f, d). The associated parameters are added to the parameter configuration list P. 4. Motion Parameter Setting for Segments Between Anchor Points: For each segment between a pair of anchor points (A1, A2), the user uses the interface tools to set motion parameters, such as movement speed v and acceleration a. The set motion parameters (v, a) are associated with the anchor point pair (A1, A2) in the format ((A1, A2), v, a). The associated motion parameters are added to the parameter configuration list P. 5. Parameter Verification: Verify the consistency of the parameter configuration list P. Ensure that the parameters of each anchor point and the motion parameters between each pair of anchor points are reasonable and consistent. 6. Output parameter configuration: Return the parameter configuration list P.
[0085] In one implementation scenario, Figure 2 is a flow chart of a virtual camera trajectory control method according to an embodiment of the present invention. Figure 2 As shown, the virtual camera trajectory control method includes: 1. Drawing the virtual camera's own position trajectory C1. 2. Drawing the virtual camera's target position trajectory C2. 3. Defining camera anchor points A1 and A2 on trajectory C1. 4. Defining target anchor points B1 and B2 on trajectory C2. 5. Defining the teammate relationship between anchor points A and B. 6. Previewing the virtual camera animation effect and adjusting it as needed. 7. Outputting the final virtual camera trajectory data.
[0086] In Example 1, Figure 3 is a trajectory diagram of a one-to-one correspondence between a virtual camera position and a target position according to an embodiment of the present invention, such as Figure 3 As shown in the figure, the camera trajectory C1 and the target trajectory C2 define the position and orientation of the virtual camera in the virtual scene, respectively. Through the user interface, the user adds anchor points A1, A2, A3, and A4 to the position trajectory C1 and anchor points B1, B2, B3, and B4 to the target trajectory C2. The user then sets the correspondence between anchor points A and B. The virtual camera's orientation is determined by calculating the line connecting the anchor points on the two trajectories. The user controls the virtual camera's motion characteristics by configuring virtual camera parameters, such as focal length and movement speed, at the anchor points on C1 and along the line segments between them.
[0087] In Example 2, Figure 4 is a schematic diagram of a trajectory corresponding to a virtual camera position and multiple target positions according to an embodiment of the present invention, such as Figure 4 As shown in the figure, the camera anchor point A1 is a single camera trajectory, and the anchor points B1 and B2 on the target trajectory C2 correspond to A1. Therefore, the camera position A1 remains unchanged, and the target moves from B1 to B2 along C2, forming a rotating camera movement.
[0088] In Example 3, Figure 5 is a schematic diagram of trajectories corresponding to multiple virtual camera positions and a target position according to an embodiment of the present invention, such as Figure 5 As shown in FIG, the target anchor point B1 is a single target trajectory, and the anchor points A1 and A2 on the camera trajectory C1 correspond to B1. Therefore, the target position B1 remains unchanged, and the camera moves along C1 from A1 to A2 in a circular camera motion.
[0089] The virtual camera trajectory control method provided in this embodiment achieves high-precision control of the virtual camera's trajectory by precisely defining the camera trajectory and the target trajectory, meeting the strict accuracy requirements in professional applications. Users can freely add anchor points and set segment parameters as needed, making the control of the virtual camera more flexible and adaptable to various complex shooting needs. For complex scenes, the position and direction of the virtual camera can be precisely controlled, maintaining stable control effects even in changing environments. At the same time, the need for manual adjustment and trial and error is reduced, saving time and human resources and reducing production costs. Through standardized control methods, the reusability of the virtual camera trajectory is improved, making it applicable to a variety of scenarios and projects, and improving work efficiency.
[0090] In this embodiment, a virtual camera trajectory control method is provided, which can be used in the above-mentioned computer device. Figure 6 is a flow chart of another virtual camera trajectory control method according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:
[0091] Step S601: Get the camera position and target position. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0092] Step S602: construct a camera position curve based on the camera position.
[0093] Specifically, the camera position curve includes a camera spline curve, a camera arc, and a camera polyline. The above step S602 includes:
[0094] Step S6021: Obtain key points of the camera position, weights corresponding to the key points, and time parameters corresponding to the key points.
[0095] Step S6022: Create a spline curve list, calculate the control point coordinates based on the key points and weights, add the control point coordinates to the spline curve list, and construct the camera spline curve.
[0096] Step S6023: Create an arc list, calculate the arc point coordinates based on the key points and time parameters, add the arc point coordinates to the arc list, and construct the camera arc.
[0097] Step S6024: Create a polyline list, calculate the polyline point coordinates based on the key points and time parameters, add the polyline point coordinates to the polyline list, and construct the camera polyline.
[0098] In one example, creating a camera track may include:
[0099] a) Create NURBS spline curve: Input: a set of key points of camera position {(x1,y1,z1),(x2,y2,z2),…,(x n ,y n ,z n )}; The weight corresponding to each key point {w1,w2,…,w n}; the order of the spline curve p (usually 3, indicating a cubic spline); the node vector U = {u0,u1,…,u m} (usually a uniform knot vector). Output: Camera position curve C1(t) (NURBS spline curve).
[0100] Exemplarily, the algorithm for creating a NURBS spline curve includes: 1. Initialization: creating an empty NURBS spline curve list S. Creating an empty time parameter list T.
[0101] 2. Input key points and weights: Get the key points of the camera position {(x1,y1,z1),(x2,y2,z2),…,(x n ,y n ,z n )} and the weights {w1,w2,…,wn}. Get the spline order p and knot vector U={u0,u1,…,u m}.
[0102] 3. Construct NURBS spline curve: calculate the homogeneous coordinates P of each key point i =(w i x i ,w i y i ,w i z i ,w i ). For each time parameter t in the range [0,1]: calculate the position of the parameter u in the knot vector U. Use De Boor's algorithm to calculate the point P(t) on the NURBS spline curve: Among them, N i,p (u) is the B-spline basis function, which can be calculated by the recursive formula: Calculate the final control point coordinates P(t): Add the control point coordinates P(t) to the NURBS spline curve list S.
[0103] 4. Parameterization: Parameterize the NURBS spline curve so that it can dynamically determine the camera position based on time t. For any time t in the range [0,1], calculate the camera position P(t):
[0104] 5. Output camera position curve: Returns the camera position curve C1(t).
[0105] b) Create camera arc: Input: a set of key points of camera position {(x1,y1,z1),(x2,y2,z2),…,(x n ,y n ,z n )}; the time parameters corresponding to each key point {t1, t2,…, t n}; The arc's center C, radius R, starting angle θ1, and ending angle θ2. Output: Camera position curve C1(t) (arc).
[0106] Exemplarily, the algorithm for creating a camera arc includes: 1. Initialization: Create an empty arc list A for storing each segment of the arc. Create an empty time parameter list T for storing the time parameter of each segment of the arc.
[0107] 2. Input key points and arc parameters: Get the key points of the camera position {(x1,y1,z1),(x2,y2,z2),…,(x n ,yn ,z n )} and the corresponding time parameters {t1, t2,…, t n Get the arc's center C = (cx, cy, cz), radius R, start angle θ1, and end angle θ2 from the user interface.
[0108] 3. Construct the arc: Calculate the total angle of the arc Δθ = θ2 - θ1. Calculate each time interval Δt i =t i+1 -t i Corresponding angle increment For each time point t i :Calculate the current angle θ i =θ1+i·Δθ i . Calculate point P on the current arc i :P i =(cx+Rcos(θ i ),cy+Rsinθi,cz adds the point Pi and time parameter ti to the arc list A.
[0109] 4. Parameterization processing: Parameterize the arc so that the camera position can be dynamically determined according to the time tt.
[0110] For any time t in [t i ,t i+1 ] range, calculate the camera position P(t):
[0111] 5. Output camera position curve: Returns the camera position curve C1(t).
[0112] c) Create a polyline: Input: a set of key points of the camera position {(x1,y1,z1),(x2,y2,z2),…,(x n ,y n ,z n )}; the time parameters corresponding to each key point {t1, t2,…, t n Output: Camera position curve C1(t) (polyline).
[0113] Exemplarily, the algorithm for creating a polyline includes: 1. Initialization: creating an empty polyline list L for storing each polyline segment. Creating an empty time parameter list T for storing the time parameter of each polyline segment.
[0114] 2. Input key points: Get the key points of the camera position {(x1,y1,z1),(x2,y2,z2),…,(x n ,y n ,z n)} and the corresponding time parameters {t1, t2,…, t n}.
[0115] 3. Construct polylines: For each pair of adjacent key points (x i ,y i ,z i ) and (x i+1 ,y i+1 ,z i+1 ): Calculate the starting point P of the line segment i =(x i ,y i ,z i ) and the end point P i+1 =(x i+1 ,y i+1 ,z i+1 ). Calculate the length of the line segment Δt i =t i+1 -t i . The line segment (P i ,P i+1 ,Δt i ) is added to the polyline list L.
[0116] 4. Parametric processing: Parameterize the polyline so that the camera position can be dynamically determined according to time t.
[0117] For any time t in [t i ,t o+1 ] range, calculate the camera position P(t):
[0118] 5. Output camera position curve: Returns the camera position curve C1(t).
[0119] In this method, a variety of camera position curves including camera spline curves, camera arcs and camera polylines are constructed through the camera position, which facilitates the subsequent use of the camera trajectory and target trajectory curves to control the position and direction of the virtual camera respectively, improving the ability to accurately control the virtual camera position in complex scenes and meeting the strict requirements for accuracy in professional applications.
[0120] Step S603: construct a target position curve based on the target position.
[0121] Specifically, the target position curve includes a target spline curve, a target arc, and a target polyline. The above step S603 includes:
[0122] Step S6031: Obtain the key points of the target location, the weights corresponding to the key points, and the time parameters corresponding to the key points.
[0123] Step S6032: Create a spline curve list, calculate the control point coordinates based on the key points and weights, add the control point coordinates to the spline curve list, and construct the target spline curve.
[0124] Step S6033: Create an arc list, calculate the arc point coordinates based on the key points and time parameters, add the arc point coordinates to the arc list, and construct the target arc.
[0125] Step S6034: Create a polyline list, calculate the polyline point coordinates based on the key points and time parameters, add the polyline point coordinates to the polyline list, and construct the target polyline.
[0126] In one example, a target position curve is defined to control the position of the target captured by the virtual camera. The target position curve can be a spline, arc, or polyline. The creation method is the same as the camera trajectory, and the target position curve C2(t) is output.
[0127] In this method, a variety of target position curves including target spline curves, target arcs and target polylines are constructed through the target position, which facilitates the subsequent use of the target trajectory and target trajectory curves to control the position and direction of the virtual target respectively, improving the ability to accurately control the virtual target position in complex scenes and meeting the strict requirements for accuracy in professional applications.
[0128] Step S604 : Based on the camera position curve and the target position curve, obtain the corresponding relationship between the camera anchor point, the target anchor point, and the camera anchor point and the target anchor point.
[0129] Specifically, the above step S604 includes:
[0130] Step S6041: Establish an initial anchor point list and an initial anchor point correspondence relationship list.
[0131] Step S6042: Determine the camera anchor point and the target anchor point in response to the user's camera anchor point selection and the target anchor point selection.
[0132] Step S6043: Based on the camera anchor point and the target anchor point, a correspondence relationship between the camera anchor point and the target anchor point is established.
[0133] Step S6044: Add the camera anchor point and the target anchor point to the initial anchor point list, and add the correspondence between the camera anchor point and the target anchor point to the initial anchor point correspondence list.
[0134] In one example, the user is allowed to add anchor points on the camera position curve and the target position curve. The user selects a position on the camera position curve, which is defined as the camera position anchor point; the user selects a position on the target position curve, which is defined as the target position anchor point. Keyframes are set through the anchor points, and a correspondence between the camera and target anchor points is created. The anchor point correspondence is created through the anchor point connection tool. After enabling the connection tool, first select the camera anchor point, then select the target anchor point to complete the association. The order can also be reversed. Anchor points can be set to zero, one pair, or multiple pairs. Input: camera position curve C1(t), target position curve C2(t), user interface tool (for selecting and defining anchor points). Output: anchor point list A (containing camera position anchor points and target position anchor points), anchor point correspondence list R (containing the correspondence between camera position anchor points and target position anchor points).
[0135] Exemplarily, the algorithm for setting anchor points includes: 1. Initialization: Create an empty anchor point list A for storing all anchor points. Create an empty anchor point correspondence list R for storing correspondences between anchor points.
[0136] 2. User Interface Interaction: Provides user interface tools that allow users to select positions on the camera position curve C1(t) and the target position curve C2(t). The user selects a position on the camera position curve using the interface tool (e.g., by clicking a mouse), which is defined as the camera position anchor point A1. The user also selects a position on the target position curve using the interface tool, which is defined as the target position anchor point A2.
[0137] 3. Anchor point selection: For each user-selected position: Record the selected position (x, y, z) and the corresponding time parameter t. Add the selected position and time parameters to the anchor point list A. Mark the anchor point type (camera position anchor or target position anchor).
[0138] 4. Anchor Point Correspondence Creation: User interface tools (such as the Connect tool) allow users to create correspondences between anchor points. After the user activates the Connect tool, they select a camera anchor point A1 and a target anchor point A2. The correspondence between the anchor points (A1, A2) is recorded and added to the anchor point correspondence list R. Users are allowed to reverse the selection order, i.e., select target anchor point A2 first and then camera anchor point A1.
[0139] 5. Anchor point verification: Verify the consistency of the anchor point list A and the anchor point correspondence list R. Ensure that A1 and A2 in each anchor point correspondence (A1, A2) exist in the anchor point list A.
[0140] 6. Output anchor points and correspondences: Return the anchor point list A and the anchor point correspondence list R.
[0141] In this way, by obtaining the correspondence between the camera anchor point, the target anchor point, and the camera anchor point and the target anchor point, the user is allowed to control the motion characteristics of the virtual camera by adding anchor points and configuring the line segment parameters between the anchor points, providing a new way for user participation and creation, enhancing the user's creative freedom, and further improving the user experience.
[0142] Step S605: Determine the camera direction of the virtual camera based on the line between the point on the camera position curve and the point on the target position curve. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0143] Step S606: In response to the user's parameter configuration, the trajectory and movement of the virtual camera are controlled in combination with the camera direction, camera position curve, and target position curve. Figure 1 Step S106 of the illustrated embodiment will not be described in detail here.
[0144] The virtual camera trajectory control method provided in this embodiment constructs a variety of camera position curves including camera spline curves, camera arcs, and camera polylines through the camera position, facilitating the subsequent use of the camera trajectory and target trajectory curves to control the position and direction of the virtual camera respectively, thereby improving the ability to accurately control the position of the virtual camera in complex scenes and meeting the strict requirements for accuracy in professional applications. Through the target position, a variety of target position curves including target spline curves, target arcs, and target polylines are constructed, facilitating the subsequent use of the target trajectory and target trajectory curves to control the position and direction of the virtual target respectively, thereby improving the ability to accurately control the position of the virtual target in complex scenes and meeting the strict requirements for accuracy in professional applications. By obtaining the correspondence between the camera anchor point, the target anchor point, and the camera anchor point and the target anchor point, the user is allowed to control the motion characteristics of the virtual camera by adding anchor points and configuring the line segment parameters between the anchor points, providing a new way for user participation and creation, enhancing the user's creative freedom, and further improving the user experience.
[0145] In this embodiment, a virtual camera trajectory control method is provided, which can be used in the above-mentioned computer device. Figure 7 is a flowchart of another virtual camera trajectory control method according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:
[0146] Step S701: Get the camera position and target position. Figure 6 Step S601 of the illustrated embodiment will not be described in detail here.
[0147] Step S702: Construct a camera position curve based on the camera position. Figure 6Step S602 of the illustrated embodiment will not be described in detail here.
[0148] Step S703: construct a target position curve based on the target position. Figure 6 Step S603 of the illustrated embodiment will not be described in detail here.
[0149] Step S704: Based on the camera position curve and the target position curve, obtain the corresponding relationship between the camera anchor point, the target anchor point, and the camera anchor point and the target anchor point. Figure 6 Step S604 of the illustrated embodiment will not be described in detail here.
[0150] Step S705 : determining the camera direction of the virtual camera based on the line between the point on the camera position curve and the point on the target position curve.
[0151] Specifically, the above step S705 includes:
[0152] Step S7051: Create an initial camera movement trajectory list.
[0153] Step S7052: Generate camera equidistant points of the camera position curve and target equidistant points of the target position curve with the time interval as the step length, and calculate the camera position coordinates corresponding to the camera equidistant points and the target position coordinates corresponding to the target equidistant points.
[0154] Step S7053: Calculate a direction vector based on the camera position coordinates and the target position coordinates, add the camera position coordinates and the direction vector to the initial camera movement trajectory list, and obtain a camera movement trajectory list.
[0155] In some optional implementations, the above step S7053 includes:
[0156] Step a1, by formula Calculate the initial heading vector, where is the initial orientation vector, C1(t) is the camera position coordinate, and C2(t) is the target position coordinate.
[0157] Step a2: normalize the initial orientation vector to obtain an orientation vector.
[0158] In this way, the camera direction of the virtual camera is determined by calculating the orientation vector, thereby improving the control accuracy of the virtual camera's trajectory and achieving accurate control.
[0159] Step S7054: Smoothing the camera movement trajectory list to obtain a final camera movement trajectory list and determine the camera direction of the virtual camera.
[0160] In one example, the orientation of the virtual camera is determined by connecting the points on the camera trajectory with the points on the target trajectory. Create n points on the camera trajectory at equal intervals, and create n points on the target trajectory at equal intervals. The line connecting the two sets of points is the orientation of the virtual camera, and continuous movement constitutes the camera movement. Input: camera position trajectory C1(t), target position trajectory C2(t), animation refresh rate n (i.e., the number of points created per second). Output: camera movement trajectory (Contains the camera position and orientation at each time point).
[0161] Exemplarily, the camera direction algorithm steps include: 1. Initialization: Create an empty camera movement trajectory list T to store the camera position and orientation at each time point. Calculate the time interval
[0162] 2. Generate equidistant points: For time t from 0 to 1, generate equidistant points with a step size of Δt: Calculate the camera position C1(t). Calculate the target position C2(t).
[0163] 3. Calculate the orientation vector: For each time point t: Calculate the orientation vector Will face the vector Normalize to ensure its length is 1: The camera position C1(t) and the orientation vector Add to the camera movement track list T, the format is
[0164] 4. Interpolation and smoothing: For the interpolation between each time point t: use linear interpolation or spline interpolation method to ensure that the camera position and orientation vector transition smoothly between time points. For the camera position C1(t) and orientation vector C1(t)=(1-α)C1(t i )+αC1(t o+1 ), in,
[0165] 5. Output camera movement trajectory: Return the camera movement trajectory list T.
[0166] In this approach, the camera trajectory is created with several equally spaced points, and the target trajectory is created with several equally spaced points. The line connecting the two sets of points represents the virtual camera's orientation, and continuous movement constitutes the camera's movement. This not only improves the technical performance of virtual camera trajectory control, but also provides users with a more intuitive and flexible operating experience, while lowering the threshold and cost of technical application. This enhances the flexibility of virtual camera trajectory control, freeing it from fixed conditions.
[0167] Step S706: In response to the user's parameter configuration, the trajectory and movement of the virtual camera are controlled in combination with the camera direction, camera position curve, and target position curve. Figure 6 Step S606 of the illustrated embodiment will not be described in detail here.
[0168] The virtual camera trajectory control method provided in this embodiment creates several equidistant points along the camera trajectory and several equidistant points along the target trajectory. The line connecting the two sets of points represents the orientation of the virtual camera, and continuous movement constitutes the camera movement. This not only improves the technical performance of virtual camera trajectory control, but also provides users with a more intuitive and flexible operating experience, while lowering the threshold and cost of technology application. The flexibility of virtual camera trajectory control is enhanced, and it is no longer restricted to fixed conditions. By calculating the orientation vector and determining the camera direction of the virtual camera, the control accuracy of the virtual camera trajectory is improved, achieving accurate control.
[0169] This embodiment also provides a virtual camera trajectory control device, which is used to implement the above-mentioned embodiments and preferred implementations. Details that have already been described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0170] This embodiment provides a virtual camera trajectory control device, such as Figure 8 As shown, including:
[0171] The position acquisition module 801 is used to obtain the camera position and target position. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0172] The camera position curve construction module 802 is used to construct a camera position curve based on the camera position. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0173] The target position curve construction module 803 is used to construct a target position curve based on the target position. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0174] The anchor point acquisition module 804 is used to acquire the camera anchor point, the target anchor point, and the corresponding relationship between the camera anchor point and the target anchor point based on the camera position curve and the target position curve, wherein the camera anchor point is located on the camera position curve and the target anchor point is located on the target position curve. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0175] The direction determination module 805 is used to determine the camera direction of the virtual camera based on the line between the points on the camera position curve and the points on the target position curve. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0176] The camera control module 806 is used to control the trajectory and movement of the virtual camera in response to the user's parameter configuration, combined with the camera direction, camera position curve and target position curve. Figure 1 Step S106 of the illustrated embodiment will not be described in detail here.
[0177] In some optional implementations, the camera position curve includes a camera spline curve, a camera arc, and a camera polyline, and the camera position curve construction module 802 includes:
[0178] The first data acquisition unit is used to acquire key points of the camera position, weights corresponding to the key points, and time parameters corresponding to the key points.
[0179] The camera spline curve construction unit is used to create a spline curve list, calculate the control point coordinates based on key points and weights, add the control point coordinates to the spline curve list, and construct the camera spline curve.
[0180] The camera arc construction unit is used to create an arc list, calculate the arc point coordinates based on key points and time parameters, add the arc point coordinates to the arc list, and construct the camera arc.
[0181] The camera polyline construction unit is used to create a polyline list, calculate the coordinates of the polyline points based on key points and time parameters, add the coordinates of the polyline points to the polyline list, and construct the camera polyline.
[0182] In some optional implementations, the target position curve includes a target spline curve, a target arc, and a target polyline, and the target position curve construction module 803 includes:
[0183] The second data acquisition unit is used to acquire key points of the target position, weights corresponding to the key points, and time parameters corresponding to the key points.
[0184] The target spline curve construction unit is used to create a spline curve list, calculate the control point coordinates based on key points and weights, add the control point coordinates to the spline curve list, and construct the target spline curve.
[0185] The target arc construction unit is used to create an arc list, calculate the arc point coordinates based on the key points and time parameters, add the arc point coordinates to the arc list, and construct the target arc.
[0186] The target polyline construction unit is used to create a polyline list, calculate the coordinates of the polyline points based on the key points and time parameters, add the coordinates of the polyline points to the polyline list, and construct the target polyline.
[0187] In some optional implementations, the anchor point acquisition module 804 includes:
[0188] The first list creation unit is configured to create an initial anchor point list and an initial anchor point correspondence relationship list.
[0189] The anchor point determination unit is configured to determine a camera anchor point and a target anchor point in response to a camera anchor point selection and a target anchor point selection by a user.
[0190] The correspondence building unit is used to build a correspondence between the camera anchor point and the target anchor point based on the camera anchor point and the target anchor point.
[0191] The list adding unit is used to add the camera anchor point and the target anchor point to the initial anchor point list, and add the correspondence between the camera anchor point and the target anchor point to the initial anchor point correspondence list.
[0192] In some optional implementations, the direction determination module 805 includes:
[0193] The second list creation unit is used to create an initial camera movement trajectory list.
[0194] The equidistant point generating unit is used to generate camera equidistant points of the camera position curve and target equidistant points of the target position curve with the time interval as the step length, and calculate the camera position coordinates corresponding to the camera equidistant points and the target position coordinates corresponding to the target equidistant points.
[0195] The heading vector calculation unit is used to calculate the heading vector based on the camera position coordinates and the target position coordinates, and add the camera position coordinates and the heading vector to the initial camera movement trajectory list to obtain the camera movement trajectory list.
[0196] The list smoothing processing unit is used to smooth the camera movement trajectory list to obtain the final camera movement trajectory list and determine the camera direction of the virtual camera.
[0197] In some optional implementations, the heading vector calculation unit includes:
[0198] Towards vector calculation subunit, used to calculate the direction of the equation Calculate the initial heading vector, where is the initial orientation vector, C1(t) is the camera position coordinate, and C2(t) is the target position coordinate.
[0199] The vector normalization subunit is used to normalize the initial heading vector to obtain a heading vector.
[0200] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0201] The virtual camera trajectory control device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0202] The embodiment of the present invention also provides a computer device having the above Figure 8 The virtual camera trajectory control device is shown.
[0203] See also Figure 9 , Figure 9 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 9 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 9 A processor 10 is taken as an example.
[0204] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0205] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0206] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0207] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0208] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 9 The bus connection is taken as an example.
[0209] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, an indicator stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0210] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0211] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0212] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A virtual camera trajectory control method, characterized in that: The method comprises: Get the camera position and target position; constructing a camera position curve based on the camera position; constructing a target position curve based on the target position; Based on the camera position curve and the target position curve, obtaining a camera anchor point, a target anchor point, and a correspondence between the camera anchor point and the target anchor point, wherein the camera anchor point is located on the camera position curve and the target anchor point is located on the target position curve; determining a camera direction of a virtual camera based on a line connecting a point on the camera position curve and a point on the target position curve; In response to the user's parameter configuration, the trajectory and mirror movement of the virtual camera are controlled in combination with the camera direction, the camera position curve and the target position curve.
2. The method according to claim 1, characterized in that The camera position curve includes a camera spline curve, a camera arc and a camera polyline. The camera position curve is constructed based on the camera position, including: Obtaining key points of the camera position, weights corresponding to the key points, and time parameters corresponding to the key points; Creating a spline curve list, calculating the coordinates of control points based on the key points and the weights, adding the coordinates of the control points to the spline curve list, and constructing the camera spline curve; Creating an arc list, calculating arc point coordinates based on the key points and the time parameters, adding the arc point coordinates to the arc list, and constructing the camera arc; A polyline list is created, and based on the key points and the time parameters, the coordinates of the polyline points are calculated, and the coordinates of the polyline points are added to the polyline list to construct the camera polyline.
3. The method according to claim 1, characterized in that The target position curve includes a target spline curve, a target arc and a target polyline. The target position curve is constructed based on the target position, including: Obtaining key points of the target location, weights corresponding to the key points, and time parameters corresponding to the key points; Creating a spline curve list, calculating the coordinates of control points based on the key points and the weights, adding the coordinates of the control points to the spline curve list, and constructing the target spline curve; Creating an arc list, calculating arc point coordinates based on the key points and the time parameters, adding the arc point coordinates to the arc list, and constructing the target arc; A polyline list is created, and based on the key points and the time parameters, the coordinates of the polyline points are calculated, the coordinates of the polyline points are added to the polyline list, and the target polyline is constructed.
4. The method according to claim 1, wherein The acquiring, based on the camera position curve and the target position curve, a camera anchor point, a target anchor point, and a correspondence between the camera anchor point and the target anchor point, includes: Establish an initial anchor point list and an initial anchor point correspondence list; In response to a user's camera anchor point selection and a target anchor point selection, determining the camera anchor point and the target anchor point; Based on the camera anchor point and the target anchor point, construct a correspondence between the camera anchor point and the target anchor point; The camera anchor point and the target anchor point are added to the initial anchor point list, and the correspondence between the camera anchor point and the target anchor point is added to the initial anchor point correspondence list.
5. The method according to claim 1, wherein The determining the camera direction of the virtual camera based on a line between a point on the camera position curve and a point on the target position curve includes: Create an initial camera movement trajectory list; Generating camera equidistant points of the camera position curve and target equidistant points of the target position curve with a time interval as a step length, and calculating the camera position coordinates corresponding to the camera equidistant points and the target position coordinates corresponding to the target equidistant points; Calculating a direction vector based on the camera position coordinates and the target position coordinates, and adding the camera position coordinates and the direction vector to the initial camera movement trajectory list to obtain a camera movement trajectory list; The camera movement trajectory list is smoothed to obtain a final camera movement trajectory list, and the camera direction of the virtual camera is determined.
6. The method according to claim 5, characterized in that The calculating a direction vector based on the camera position coordinates and the target position coordinates includes: By formula Calculate the initial heading vector, where is the initial orientation vector, C1(t) is the camera position coordinate, and C2(t) is the target position coordinate; The initial orientation vector is normalized to obtain the orientation vector.
7. A virtual camera trajectory control device, characterized in that: The device comprises: Position acquisition module, used to obtain camera position and target position; A camera position curve construction module, configured to construct a camera position curve based on the camera position; A target position curve construction module, configured to construct a target position curve based on the target position; an anchor point acquisition module, configured to acquire a camera anchor point, a target anchor point, and a correspondence between the camera anchor point and the target anchor point based on the camera position curve and the target position curve, wherein the camera anchor point is located on the camera position curve and the target anchor point is located on the target position curve; a direction determination module, configured to determine a camera direction of the virtual camera based on a line connecting a point on the camera position curve and a point on the target position curve; The camera control module is used to control the trajectory and movement of the virtual camera in response to the user's parameter configuration and in combination with the camera direction, the camera position curve and the target position curve.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the virtual camera trajectory control method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the virtual camera trajectory control method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the virtual camera trajectory control method according to any one of claims 1 to 6.