Method, system and device for controlling virtual camera and medium

CN116709030BActive Publication Date: 2026-11-03BEIJING IQIYI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310806263.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2026-11-03
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

Virtual cameras struggle to simulate the shooting effects of cameras mounted on other devices in real-world environments within virtual scenes, thus failing to achieve the desired shooting results.

Method used

By mapping the first control data used to control the virtual camera to the second control data used to control the target model, the target model is restricted to operate within its operating area, allowing the virtual camera to be attached to other devices, simulating the shooting effect of using other devices to support the camera in a real environment.

Benefits of technology

It enables the simulation of the camera's operation in a virtual environment by using other devices to carry the camera, achieving an effect similar to real shooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116709030B_ABST
    Figure CN116709030B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a virtual camera control method, system, device and medium, aiming to simulate the effect of using other devices to carry cameras for shooting in a real environment by controlling a virtual camera. The method comprises: receiving first control data for controlling a virtual camera; mapping the first control data to second control data for controlling a target model to run in a preset running area according to the first control data, the running area being a spatial area in which the target model is allowed to run, the target model comprising the virtual camera and a device model to which the virtual camera is attached; controlling the target model to run in the running area according to the second control data, and obtaining a picture shot by the virtual camera.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of virtual film and television production technology, and in particular to a method, system, device and medium for controlling a virtual camera. Background Technology

[0002] Virtual shooting technology is usually based on building virtual scenes using rendering engines and controlling virtual cameras in the virtual scene through peripheral devices to simulate real shooting situations. However, virtual cameras are free cameras that can move freely without restrictions, making it difficult to simulate the effect of using other equipment (such as tripods, track car bases that move along tracks, etc.) to support the camera in a real environment for shooting. Summary of the Invention

[0003] In view of the above problems, embodiments of this application provide a virtual camera control method, system, device, and medium to overcome or at least partially solve the above problems.

[0004] A first aspect of this application provides a method for controlling a virtual camera, the method comprising:

[0005] Receive the first control data used to control the virtual camera;

[0006] According to the pre-set operating area, the first control data is mapped to the second control data for controlling the target model to run in the operating area. The operating area is the spatial area in which the target model is allowed to run. The target model includes the virtual camera and the device model to which the virtual camera is attached.

[0007] Based on the second control data, the target model is controlled to run in the operating area, and the images captured by the virtual camera are acquired.

[0008] A second aspect of this application provides a control system for a virtual camera, the system including peripheral devices and a terminal device, wherein the peripheral devices are communicatively connected to the terminal device, and:

[0009] The peripheral device is used to collect first control data and send the first control data to the terminal device. The first control data is used to control the virtual camera.

[0010] The terminal device is used to map the first control data to the second control data for controlling the target model to run in the running area according to the pre-set running area. The running area is the space area in which the target model is allowed to run. The target model includes the virtual camera and the device model to which the virtual camera is attached. According to the second control data, the terminal device controls the target model to run in the running area, acquires the image captured by the virtual camera, and sends the image captured by the virtual camera to the peripheral device.

[0011] Therefore, the peripheral device is also used to receive and display the images captured by the virtual camera.

[0012] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the virtual camera control method as disclosed in the first aspect of this application.

[0013] A fourth aspect of this application provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the virtual camera control method as described in the first aspect of this application.

[0014] The embodiments of this application have the following advantages:

[0015] In this embodiment, the first control data used to control the virtual camera is mapped to the second control data used to control the target model. The second control data restricts the target model to run in its operating area, so that the virtual camera always runs dependent on other devices, and the operation of the virtual camera is subject to the operating area properties of the other devices it is attached to, thereby simulating the effect of using other devices to carry cameras for shooting in a real environment. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the steps of a virtual camera control method according to an embodiment of this application;

[0018] Figure 2 This is a flowchart illustrating the steps of a control method for a track vehicle model according to an embodiment of this application;

[0019] Figure 3 This is a schematic diagram illustrating the relationships between various models in a track vehicle model according to an embodiment of this application;

[0020] Figure 4 This is a schematic diagram of a railcar model according to an embodiment of this application;

[0021] Figure 5 This is a schematic diagram of a track model in an embodiment of this application;

[0022] Figure 6 This is a schematic diagram of a circular spline trajectory in an embodiment of this application;

[0023] Figure 7 This is a schematic diagram of the operation screen of a track vehicle model in an embodiment of this application;

[0024] Figure 8 This is a schematic diagram of the structure of a virtual camera control system according to an embodiment of this application;

[0025] Figure 9 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0026] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0027] Virtual shooting technology typically uses terminal devices such as laptops and desktop computers to build virtual scenes based on rendering engines such as Unreal Engine or Unity3D, and uses control data sent by peripheral devices such as mobile phones or tablets to control virtual cameras in the virtual scene to simulate shooting.

[0028] Virtual cameras are typically free-moving cameras that can move freely within a virtual scene without restrictions. They can be controlled to move or rotate freely to simulate real-world shooting situations. In contrast, cameras mounted on other devices in a real scene are subject to the operating rules of those devices, such as limitations on the height or length that the device can reach, or restrictions on its trajectory (e.g., it can only run on a track). As a result, it is difficult to simulate the operating state of cameras mounted on other devices in a real environment by controlling a free-moving camera in a virtual scene, and thus it is impossible to achieve the corresponding shooting effects in a virtual scene.

[0029] Based on the above analysis, in order to address the problem that it is difficult to simulate the shooting effect obtained by a camera mounted on other devices in a virtual scene, this application provides a virtual camera control scheme that can simulate the operating state of a camera mounted on other devices in a real environment.

[0030] Reference Figure 1 The diagram illustrates a flowchart of a virtual camera control method according to an embodiment of this application. Figure 1 As shown, the control method for this virtual camera includes the following steps:

[0031] Step S11: Receive the first control data for controlling the virtual camera.

[0032] In practical implementation, peripheral devices such as mobile phones and tablets can generate first control data based on user operations. For example, a mobile phone can detect its own rotation angle or detect the user's operation information on the virtual joystick displayed on the mobile phone to generate first control data and send it to the terminal device. This allows the terminal device to know what kind of control the user needs to perform on the operation of the virtual camera. For example, in response to receiving information about the rotation angle of the mobile phone, the terminal device will control the rotation of the virtual camera so that the virtual camera can shoot from different shooting angles (such as pitch angle). In response to receiving information about the operation of the virtual joystick of the mobile phone, the terminal device will control the position of the virtual camera (such as planar movement or height change) so that the virtual camera can shoot from different positions.

[0033] Step S12: Based on the pre-set operating area, map the first control data to second control data for controlling the target model to operate within the operating area.

[0034] The operating area is the spatial area in which the target model is allowed to operate, and the target model includes the virtual camera and the device model to which the virtual camera is attached.

[0035] The dependency relationship between device models set in the virtual scene (i.e., the parent-child relationship, where the child model depends on its parent model) is a simulation of the carrying relationship between devices in the real scene. For example, to simulate a track vehicle in the real scene, which consists of a camera supported by a track vehicle base, a parent-child relationship is set between the virtual camera and the track vehicle base in the virtual scene. In this case, the virtual camera, as the child model, will depend on the track vehicle base, which is its parent model, to form a track vehicle model corresponding to the real track vehicle. Similarly, all the devices carried by the real track vehicle can be regarded as device models in the virtual scene that are directly dependent on (such as telescopic rods placed directly on the track vehicle base) or indirectly dependent on (such as cameras placed directly on the telescopic rods) the track vehicle base in the virtual scene.

[0036] In practical implementation, the operating area of ​​the target model can be set according to the operating rules corresponding to the target model in the real scene (such as the height change limit of the combination equipment of tripod and camera, the restriction that the track car carrying the camera should move along the track, etc.) or actual needs (such as the user wanting the virtual camera attached to other equipment to always be within a certain height range). For example, the operating area used to restrict the operation of the target model can be determined according to the coverage area of ​​the track model where the track car model is located, and / or the height range that the target model can reach (if the target model does not contain deformation units, such as the virtual camera being placed directly on the base of the track car, the height range can be set to a certain value). And the second control data for the track car model can be determined according to the first control data and the operating area.

[0037] For example, the terminal device can determine the initial second control data for the planar movement of the track vehicle model based on the first control data for the planar movement of the virtual camera, and detect whether the initial second control data will cause the track vehicle model to move outside the coverage area of ​​the track model. If the initial second control data will cause the track vehicle model to move outside the coverage area of ​​the track model, the terminal device will modify the second control data to ensure that the movement of the track vehicle model is always within the coverage area of ​​the track model, thereby realizing the simulation of the operation of shooting a real track vehicle through the limitation of the operating area.

[0038] Step S13: According to the second control data, control the target model to run in the running area and acquire the images captured by the virtual camera.

[0039] In practical implementation, the terminal device adjusts the position, shape (i.e., scaling and shrinking of the target model), or rotation angle of the target model based on the second control data. This indirectly adjusts the position, height, or rotation angle of the virtual camera within the target model, simulating the effect of a camera's operation changing in a real scene in response to the operation of other devices supporting the camera. During the operation of the target model within the operating area, the terminal device acquires images captured by the virtual camera. The terminal device can then display these images or send them to external devices for display, allowing the user to adjust the virtual camera's operating status or parameters based on the captured images. The terminal device can also acquire images of the target model's movement within the virtual scene (e.g., a track vehicle model moving along a track model) and display these images via the terminal device or external devices, providing the user with a clear understanding of the virtual camera's operating status.

[0040] The technical solution of this application embodiment maps the first control data for controlling the virtual camera to the second control data for controlling the target model. The second control data restricts the target model to run in its operating area, so that the virtual camera always runs dependent on other devices, and the operation of the virtual camera is subject to the operating area properties of the other devices it is dependent on, thereby simulating the effect of using other devices to carry cameras for shooting in a real environment.

[0041] Reference Figure 2 As shown, a flowchart illustrating the steps of a control method for a target model in an embodiment of this application is presented, as follows: Figure 2 As shown, the method includes the following steps:

[0042] Step S21: Based on the type of data contained in the first control data, determine the first model to be controlled for operation from the various device models contained in the target model.

[0043] The first model includes at least the virtual camera, and the type of the first control data may include displacement control data and rotation control data of the virtual camera in different directions.

[0044] In practice, the target model will include multiple device models, including virtual cameras. Based on the load-bearing relationship between the devices in the structure of the real device (such as a railcar) corresponding to the target model, a parent-child relationship can be established between these multiple device models.

[0045] For example, see the railcar model. Figure 3 As shown, the track vehicle base is the parent model of the deformation unit (the virtual camera is directly attached to the camera control point at the top of the deformation unit) and the virtual camera attached to the track vehicle base. The deformation unit is the parent model of the virtual camera attached to the deformation unit. Changes in the operating state of the parent model will cause changes in the operating state of the child models attached to the parent model (e.g., the movement of the track vehicle base should cause all components carried by the track vehicle base to move). Changes in the operating state of the child models usually do not cause changes in the operating state of the parent model (e.g., the rotation of the virtual camera should not cause the rotation of the track vehicle base). Therefore, for different first control data, the terminal device can determine the parent model associated with the first control data and convert the first control into second control data for a first model that includes the parent model and the child models of the parent model. The second control data can accurately change the operating state of the part of the track vehicle model that needs to be controlled (i.e., the first model) to better simulate the operation effect of the track vehicle in the real environment.

[0046] Step S22: Based on the operating area, map the first control data to third control data for controlling the operation of the first model within the operating area.

[0047] The operating area is the spatial region in which the first model is allowed to run.

[0048] Specifically, the operating area for restricting the first model can be determined based on the type of the first control data. For example, if the first control data is displacement control data, since the first control data will not change the height or rotation angle of the first model, the operating area can be determined based on the spatial area that the target model is allowed to move in by the user or the target model's operating rules (such as the spatial area covered by the track model), so that the first model can only move in the spatial area that is allowed to move (such as only along the track model). At this time, there is no need to consider the height range that the target model can reach or other restrictions unrelated to displacement control.

[0049] Step S23: Control the first model to run in the operating area according to the third control data.

[0050] It is understandable that, considering that if the operation of the virtual camera is directly adjusted according to the first data in the manner of controlling the free camera, on the one hand, the way in which the movement of the virtual camera changes and the movement of the device model it is attached to changes does not conform to the actual operation of the track vehicle, and on the other hand, it is difficult to restrict the operation of the virtual camera according to the operation rules of the device model, and it is easy to cause deformation of the track vehicle model (such as the virtual camera being located outside the operation area while the track vehicle base is restricted within the operation area, resulting in stretching deformation of the track vehicle model), the embodiments of this application adopt the method of controlling the first model to operate in the operation area according to the third control data, so as to achieve operation restriction and indirect control of the virtual camera, and enable the target model to better simulate the bearing relationship and operation effect between the camera and other devices in the real scene.

[0051] In one optional embodiment, the first control data includes displacement control data in the first direction, that is, the terminal device needs to implement displacement control of the virtual camera in the first direction, and the displacement change of the virtual camera in the first direction (such as the horizontal direction) is based on user needs or the limitations of the actual device structure, and needs to be achieved by the displacement change of the first model in the direction corresponding to the first direction (such as along the direction of the track vehicle).

[0052] Understandably, for a first model that needs to move along a fixed route (such as a track vehicle model that needs to move along a track model on a horizontal plane), the first direction should be determined according to the direction of the fixed route (such as the horizontal direction). However, for a first model that can move freely (such as a virtual camera that can move freely in three dimensions), the first direction can be set freely (such as the three-dimensional direction). In this case, the operating area is mainly limited by the position range of the fixed route.

[0053] At this time, the terminal device can determine the first displacement information that the virtual camera needs to move in the first direction based on the first control data. Since the model control points of the virtual camera and the model control points of the first device are usually in different positions in the virtual scene, it is necessary to map the first control data generated for the model control points of the virtual camera to the second control data for the model control points of the first model through spatial transformation, and ensure that the first model can always be within the operating area when controlling the first model according to the second control data. Therefore, the first displacement information can be mapped to the operating area to obtain the second displacement information. The operating area includes the spatial area in which the first model is allowed to move. Then, based on the second displacement information, the third control data for controlling the first model to move is determined.

[0054] Optionally, when the target model is a track vehicle model used to carry the virtual camera to move along the track model, the running area includes the spatial area that the first model needs to pass through to move along the track model. In this case, the terminal device can map the first displacement information to the running area based on a spatial transformation matrix or other methods to obtain the second displacement information.

[0055] In this embodiment, the track vehicle model may include a track vehicle base for moving along the track model and device models attached to the track vehicle base. The device models attached to the track vehicle base include at least the virtual camera. The terminal device determines the track vehicle base for moving along the track model and all device models attached to the track vehicle base from the various device models included in the track vehicle model, and determines the track vehicle base and all device models attached to the track vehicle base as the first model.

[0056] For example, the terminal device can determine the first model based on the track vehicle base in the track vehicle model and all equipment models (such as virtual cameras) attached to the track vehicle base, so as to convert the first control data into third control data for displacement control of the first model.

[0057] As one possible implementation, since the track vehicle base is the parent model that drives the virtual camera and other sub-models to move, the terminal device can determine the first displacement information required for the virtual camera to move based on the first control data, determine the second displacement information required for the track vehicle base to move along the track model based on the first displacement information, and then determine the third control data based on the second displacement information. The running area of ​​the track vehicle model is determined based on the area where the track model is located (such as the XY plane area covered by the track model).

[0058] For example, the terminal device can determine the first displacement information, such as the displacement distance, displacement direction, or displacement vector of the virtual camera, based on the first control data such as the operation direction (i.e., the direction in which the virtual camera needs to move in the XY plane) and displacement speed of the peripheral device. Then, the first displacement information is converted into the second displacement information, such as the displacement distance, displacement direction, or displacement vector of the track vehicle base. Based on the second displacement information, the running trajectory of the track vehicle base along the track model can be determined, thereby generating the third control data for controlling the track vehicle base to move along the running trajectory. At this time, it is only necessary to ensure that the relative position between each model attached to the track vehicle base and the track vehicle base remains unchanged to achieve the overall movement effect of the first model.

[0059] Optionally, the terminal device can determine the target position identifier based on the current position of the track vehicle base on the track model, the length of the spline trajectory used to establish the track model, and the second displacement information, and determine the target position identifier as the third control data, wherein the target position identifier is used to characterize the position on the track model that the first model needs to reach.

[0060] It is understood that this application embodiment provides a position identifier (referred to as CurrentPositionOnRail) attribute for the track vehicle model. The CurrentPositionOnRail value at the starting point of the track model is 0, and the CurrentPositionOnRail value at the ending point of the track model is 1. The CurrentPositionOnRail values ​​at each position point between the starting and ending points of the track model correspond one-to-one with the values ​​between 0 and 1. When the virtual camera in the peripheral device control device terminal moves along the horizontal direction (i.e., the XY plane), the terminal device can change the position identifier of the track vehicle model according to the target position identifier, so that the track vehicle model moves along the track model to the corresponding position, thereby achieving the effect of virtual camera movement.

[0061] like Figure 4 As shown, at this point, the direction vector v(x, y, 0) required for the virtual camera (i.e., the camera origin) to move in the XY plane can be determined based on the first control data sent by the peripheral device, where the values ​​of x and y are both in the range [0, 1]. The terminal device then transforms this direction into the relative spatial transformation between the track vehicle base and the track model, that is, it converts the direction vector into the direction vector v′(x′, y′, 0) required for the track vehicle base (i.e., the model origin) to move on the track model through a spatial transformation matrix, thereby obtaining the second displacement information. The distance that the virtual camera needs to move in the XY plane can be determined by the following formula:

[0062] Distance=UnitTranslate*TranslateSpeed*DeltaTime

[0063] Among them, Distance represents the distance the virtual camera needs to move in the XY plane, DeltaTime represents the rendering time taken by the rendering engine per frame, TranslateSpeed ​​represents the displacement speed (used to describe how many units of displacement are moved per unit time), and UnitTranslate represents the unit displacement (the size of the unit displacement can be set by the user).

[0064] At this point, based on the direction vector v′(x′, y′, 0), the displacements of the track vehicle base in the X and Y directions are:

[0065]

[0066]

[0067] Where LenX represents the displacement of the track vehicle base in the X direction, LenY represents the displacement of the track vehicle base in the Y direction, and Distance represents the distance the virtual camera needs to move in the XY plane.

[0068] Compared to the current position of the track vehicle base, the distance the track vehicle base has moved in the XY plane is:

[0069]

[0070] Where Len represents the distance the track vehicle base moves in the XY plane, LenX represents the displacement of the track vehicle base in the X direction, and LenY represents the displacement of the track vehicle base in the Y direction.

[0071] The target location identifier (i.e., the value that CurrentPositionOnRail needs to be set) is:

[0072]

[0073] Wherein, SplineLen represents the length of the entire spline trajectory corresponding to the track model, CurrentPosition represents the current position of the track vehicle base on the track model, and Len represents the distance the track vehicle base moves in the XY plane (i.e., the second displacement information). When it is necessary to control the track vehicle base to move backward along the track model, Len in the above formula can be set to -Len.

[0074] Finally, it is necessary to ensure that the obtained CurrentPositionOnRial value is between [0, 1] to conform to the attribute format of CurrentPositionOnRial. For example, if the obtained CurrentPositionOnRial value is less than 0 and the entire spline trajectory is not a full circle, set the CurrentPositionOnRial value to 0; if the obtained CurrentPositionOnRial value is less than 0 and the entire spline trajectory is a full circle, set the CurrentPositionOnRial value to (1 + CurrentPositionOnRial); if the obtained CurrentPositionOnRial value is greater than 1 and the entire spline trajectory is not a full circle, set the CurrentPositionOnRial value to 1; if the obtained CurrentPositionOnRial value is greater than 1 and the entire spline trajectory is a full circle, set the CurrentPositionOnRial value to (CurrentPositionOnRial - 1). By setting the position of the track vehicle base on the track model based on the final obtained CurrentPostionOnRail value, the movement effect of the virtual camera can be achieved.

[0075] In one optional embodiment, the first control data includes displacement control data in the second direction. That is, the terminal device needs to control the displacement of the virtual camera in the second direction, and the displacement change of the virtual camera in the second direction (such as the height or length direction of the first model) is limited by user requirements or the actual device structure, and must be achieved by the first model extending or retracting in that second direction. For example, for a track vehicle model that can only move along a horizontal track model, the height change of the virtual camera in the track vehicle model can only be achieved by the extension and retraction of the deformation unit to which the virtual camera is attached in the height direction. Therefore, the operating area is mainly limited by the extension and retraction range of the deformation unit in the height direction.

[0076] At this time, the terminal device can determine the displacement change value of the virtual camera in the second direction based on the first control data. By mapping the displacement change value in the second direction to the operating area, third control data for controlling the first model to stretch and contract in the second direction is obtained. The operating area includes the spatial area in which the first model is allowed to stretch and contract, that is, the displacement of the virtual camera in the second direction is mainly limited by the stretching and contraction range of the first model in the corresponding direction.

[0077] It is understood that the first model should at least include a deformation unit (such as a telescopic bracket in a tripod, a telescopic rod in a track vehicle, etc.) to achieve telescopic movement. That is, the first model should include the deformation unit in the target model and all the device models in the target model that are attached to the deformation unit. The device models that are attached to the deformation unit include at least the virtual camera. The deformation unit is used to telescopically move in the second direction.

[0078] At this time, the terminal device will first determine the extension range of the deformation unit in the second direction corresponding to the operating area, so as to know the maximum and minimum extension amount of the deformation unit. Then, based on the extension range, the current position of the deformation unit and the displacement change value in the second direction, it will determine the target position that the deformation unit needs to extend and retract to reach. Based on the target position that the deformation unit needs to extend and retract to reach, it will determine the target extension value of the deformation unit in the second direction and determine the target extension value as the third control data.

[0079] Taking the target model as a track vehicle model used to carry the virtual camera along the track model, and the second direction as the height direction of the first model as an example, it can be understood that, due to the restrictions of the actual track vehicle's operating rules, the track vehicle model should not move in the height direction (such as the direction perpendicular to the track plane) away from the track model. Therefore, the displacement change of the virtual camera in the height direction is mainly achieved through the expansion and contraction changes of the deformation unit to which it is attached.

[0080] At this time, the terminal device can determine the first model based on the deformation unit (such as a telescopic rod) in the track vehicle model that can extend and retract in the height direction, and all equipment models (such as virtual cameras) attached to the deformation unit, so as to convert the first control data into third control data for the height control of the first model.

[0081] As one possible implementation, the terminal device can determine the height change value of the virtual camera based on the first control information, and determine the target height (i.e., target position) that the first model needs to reach in the operating area. The operating area includes a spatial region where the first model is allowed to extend and retract in the height direction. Based on the target height, third control data for controlling the movement of the first model in the height direction is determined. Here, the operating area of ​​the track vehicle model is determined based on the deformation range of the deformation unit (e.g., the scaling range of the telescopic rod), to restrict the movement of the virtual camera in the height direction within a certain spatial range, thus mitigating the height movement limitation caused by the telescopic rod's extension length limitation in the real environment of the model.

[0082] Optionally, the terminal device can determine the height variation range of the deformation unit corresponding to the operating area, determine the target height that the deformation unit needs to reach based on the height variation range, the current position of the deformation unit and the height variation value of the virtual camera, and then determine the target deformation amount that the deformation unit needs to change in the height direction based on the target height that the deformation unit needs to reach, and determine the target deformation amount as the third control data.

[0083] For example, after determining the initial target position (i.e., target height) of the deformation unit, the terminal device can detect whether the initial target position is within the height range of the operating area. If the initial target position exceeds the maximum value of the height range of the operating area, the target position is set to the maximum value of the height range. If the initial target position is lower than the minimum value of the height range of the operating area, the target position is set to the minimum value of the height range. If the current position of the deformation unit is already the maximum value of the height range of the operating area, the terminal device will not generate third control data to increase the height of the first model. If the current position of the deformation unit is already the minimum value of the height range of the operating area, the terminal device will not generate third control data to decrease the height of the first model. Thus, the height change of the virtual camera is limited according to the height range of the track vehicle model.

[0084] The terminal device can then determine the target deformation information of the deformation unit based on the target location, the distance between the fulcrum of the deformation unit (such as the contact point between the telescopic rod and the equipment model to which it is directly attached (such as the base of the railcar)) and the ground, the current position of the deformation unit, and the current deformation information of the deformation unit, and determine the third control data based on the target deformation information.

[0085] It's understandable that controlling the virtual camera's height visually manifests as controlling its vertical movement (i.e., the Z-plane). Therefore, when changing the virtual camera's height, its rotation angle and displacement (XY plane) remain unchanged. To ensure the integrity of the entire target model, changing the virtual camera's height actually requires changing the deformation of the deformation elements (such as the scaling value of the vertical telescopic rod), that is, scaling the telescopic rod proportionally in the vertical direction.

[0086] Taking the railcar model as an example, such as Figure 4As shown, when the height of the telescopic boom changes, the vertical position of the camera control point at the top of the boom changes accordingly, causing the virtual camera attached to that control point to rise or fall. However, based on the specifications of the track vehicle in a real-world scenario (i.e., the height range supported by the track vehicle), different track vehicles have a certain range of permissible height operations. This embodiment of the application specifies the height range of the operating area [height]. min height max To simulate the allowed operating range, where height max Indicates the maximum height. min This represents the minimum height.

[0087] The first control data can include vertical displacement velocity and unit displacement (which can be set by the user). The height change per frame for the virtual camera (i.e., the camera origin) is then:

[0088] Distance1=UnitTranslate*TranslateSpeed*DeltaTime

[0089] Where Distance1 represents the height change value per frame, DeltaTime represents the rendering time taken by the rendering engine per frame, TranslateSpeed ​​represents the displacement speed, and UnitTranslate represents the unit displacement.

[0090] The target position that the deformation unit (i.e., the camera control point) needs to achieve at this time is:

[0091] Distance2=Distance1+Location.Z

[0092] Where Distance2 represents the target location (i.e., target height), Distance1 represents the height change value per frame, and Location.z represents the current location (i.e., current height) of the camera control point.

[0093] When the target location is within the height range of the operating area, the deformation information of the deformation unit can be determined. For example, the scaling value of the telescopic rod can be determined by the following formula:

[0094]

[0095] Wherein, ScaleOnZ represents the scaling value of the telescopic rod in the Z plane (i.e., the target deformation), Distance2 represents the target position, OriginalStructHeight represents the distance from the telescopic rod fulcrum to the ground, PreHeight represents the position of the camera control point last time, and this parameter will be set to the current value (i.e., the current position) after each height setting, and CurrentStructScaleOnZ is the scaling value of the telescopic rod in the Z plane at the current height (i.e., the current deformation information).

[0096] Finally, the complete scaling vector of the telescopic pole can be determined as v(ScaleX, ScaleY, ScaleOnZ), thus obtaining the third control data. Here, ScaleX represents the current scaling value of the telescopic pole in the X plane, and ScaleY represents the current scaling value of the telescopic pole in the Y plane. These two scaling values ​​will not change due to changes in the height of the telescopic pole.

[0097] In one optional embodiment, the first control data includes rotation control data, i.e., the terminal device needs to control the rotation angle of the virtual camera. Considering that other device models carrying the virtual camera in the real environment may have limited rotation angle ranges, and considering that there may be relative rotation angles between the device models, so that the first control model and the required rotation angle of the virtual camera may be inconsistent, the terminal device can first determine the required rotation angle change of the virtual camera based on the first control data, and then map the required rotation angle change of the virtual camera to the running area to obtain the required rotation angle change of the first model. The running area includes the spatial area that the first model needs to pass through to rotate, and determine the third control data for controlling the rotation of the first model based on the required rotation angle change of the first model.

[0098] Optionally, when the target model is a railcar model, the terminal device can determine the rotating unit and all the device models attached to the rotating unit from the various device models included in the railcar model. The device models attached to the rotating unit include at least the virtual camera. The rotating unit is used to carry the virtual camera to rotate relative to the railcar base, and the rotating unit and all the device models attached to the rotating unit are determined as the first model.

[0099] In this embodiment, the terminal device can determine the first model based on the virtual camera and the parent model to which the virtual camera in the track vehicle model is directly attached (such as the camera control point at the top of the deformation unit, which can be used as the aforementioned rotation unit), so as to convert the first control data into third control data for the rotation angle control of the first model.

[0100] In one possible implementation, the terminal device can map the required rotation angle change of the virtual camera to the operating area to obtain the required rotation angle change of the first model relative to the track vehicle base. The operating area includes the spatial region that the first model needs to traverse to rotate relative to the track vehicle base. Based on the required rotation angle change of the first model relative to the track vehicle base and the current rotation angle of the first model relative to the track vehicle base, the target rotation angle that the first model needs to achieve relative to the track vehicle base is determined, and the target rotation angle is determined as third control data for controlling the rotation of the first model relative to the track vehicle base. The operating area of ​​the track vehicle model is determined based on the operating area of ​​the first model relative to the track vehicle base within the track vehicle model. Thus, using the track vehicle base as a reference, the target rotation angle of the camera control point is determined, and the rotation of the camera control point drives the virtual camera to rotate to the target rotation angle desired by the user, thereby simulating the rotation of a camera on a track vehicle in a real scene.

[0101] The first control data may include rotational information such as pitch, yaw, and roll. Pitch is the rotation angle around the Y-axis, yaw is the rotation angle around the Z-axis, and roll is the rotation angle around the X-axis.

[0102] It is understandable that when the virtual camera is rotated, the entire track vehicle model should not have any displacement or height change, because the virtual camera is attached to the camera control point, and there is a parent-child relationship between the two. Therefore, what needs to be changed at this time is only the rotation angle of the camera control point.

[0103] Specifically, first obtain the current rotation angle R0 of the camera control point relative to the base of the track vehicle, then calculate the required rotation angle change R1 of the virtual camera, and finally obtain the target rotation angle R = R0 + R1 of the camera control point relative to the base of the track vehicle. Then set the target rotation angle R as the relative rotation angle between the camera control point and the base of the track vehicle. In this way, after the camera control point rotates, its child nodes (i.e., virtual cameras) will also rotate together.

[0104] Optionally, the rotation angle change R1 (which represents the required rotation angle change of the camera in the current frame) is determined by the following formula:

[0105] R1=UnitRatator*RotatorSpeed*DetalTime

[0106] Wherein, DetalTime represents the time the engine spends rendering each frame, UnitRatator represents the unit rotation angle, and RotatorSpeed ​​represents the rotation speed.

[0107] Optionally, in one embodiment, considering that tracks in real-world scenes are mostly arc-shaped and straight, the entire track can be combined with arc-shaped and straight tracks to form multi-shaped tracks to meet the shooting area. However, in related technologies, arc-shaped track models are usually built by dragging and dropping, which cannot meet the need for rapid track model building. Therefore, this application embodiment also provides a method for rapid track model building for arc-shaped tracks, which mainly includes the following two steps:

[0108] (1) Draw the first spline trajectory based on the drawing points and the radius input by the user through the dot operation: The terminal device receives the radius information of the arc-shaped track model (which can be the radius of the arc-shaped spline trajectory) and each drawing point input by the peripheral device. For the first drawing point of the target type among the drawing points, according to the radius information, an interpolation point is set between the first drawing point and the next drawing point along the drawing direction of the first drawing point. Based on the first drawing point, the next drawing point, and the interpolation point, the arc-shaped spline trajectory between the first drawing point and the next drawing point is drawn. The combination of the spline trajectories between the drawing points is determined as the first spline trajectory.

[0109] In practice, each drawing point can be traversed sequentially according to the drawing direction. The information of two points before and after each point is compared. If the previous point is an arc point (i.e., the first drawing point of the target type), an arc-shaped spline trajectory is drawn between the two points. If the previous point is a straight point, a straight-line spline trajectory is drawn between the two points. After the spline trajectory between the two points is completed, the next point is used as the previous point for the next drawing, until the spline trajectories between each drawing point are completed. Then, the combination of each spline trajectory can be used as the first spline trajectory.

[0110] (2) Based on the first spline trajectory, the trajectory model is established using a grid spline component.

[0111] In practice, the terminal device can display the first spline trajectory to the user, who can then draw a track grid along the first spline trajectory using the grid spline component, thereby establishing a track model.

[0112] Taking the SplineMeshComponent as an example, the terminal device sets the start and end points in the SplineMeshComponent based on two adjacent points (start point, interpolation point, or end point, etc.) in the first spline trajectory. Subsequently, the track mesh in the SplineMeshComponent transforms according to the set start and end point information, thereby generating multiple combined unit track models (such as a combination of a unit circular track and a unit straight track) along the first spline trajectory, resulting in... Figure 5 The track model shown. The radius of the circular track in this track model can be automatically determined based on the radius of the arc track in the first track, or it can be determined by the radius of the arc track directly input by the user. Similarly, the radius of the arc track can also be automatically determined based on the radius of the arc track model input by the user (e.g., the average of the inner track model radius and the outer track model radius is determined as the radius of the arc track).

[0113] As one possible implementation, the terminal device can take the first drawing point as the starting point of the arc spline trajectory and the next drawing point as the ending point of the arc spline trajectory, determine the first arc angle between the first position vector corresponding to the starting point and the second position vector corresponding to the ending point, determine the number of interpolation points based on the first arc angle and the angle accuracy of the interpolation points, determine the position of each interpolation point based on the number of interpolation points, the first arc angle, and the radius information, and set each interpolation point between the first drawing point and the next drawing point based on the position of each interpolation point.

[0114] Understandably, spline components in rendering engines, such as SplineComponent, primarily draw curves based on Bézier curves, requiring manual manipulation of the curve's shape by dragging points on that curve. This makes it difficult to accurately and quickly draw circular arc spline trajectories. Therefore, this application's embodiments modify the spline components in the rendering engine to achieve the ability to quickly draw circular arc trajectories, resulting in a spline component named IVizSplineComponent (IViz Spline Component). This component uses Bézier curves to draw spline trajectories, with each segment of the spline trajectory generated by combining multiple short straight lines.

[0115] Optionally, considering the length of a single short straight line (i.e., if the angle precision of the interpolation point is too large, resulting in too few interpolation points), the entire spline trajectory will not look round; it will not look like an arc but a polygon, which is obviously not the desired result. Therefore, in order to better conform to the characteristics of a circle, the entire circle can be divided into 360 parts. Here, the value of each short straight line segment can be 1 / 360 of the circumference of the arc-shaped trajectory (i.e., the angle precision of the interpolation point is 1 degree, that is, an interpolation point is set every 1 degree). The arc-shaped spline trajectory drawn in this way is more in line with the characteristics of a circle.

[0116] When drawing a circular arc spline trajectory, the center position of each circle can be assumed to be (0.0, 0.0), and the radius is radius. Since the height is fixed when drawing the spline trajectory and will not change midway, the vertical direction can be ignored for now.

[0117] like Figure 6 As shown, the default starting vector of the circular spline trajectory corresponding to the arc spline trajectory can be set to v0(-radius, 0.0) (directly below the center of the circle). When drawing, if the vector (i.e., the position vector) of the first point is v1(x1, y1), since both vectors originate from the origin (0.0, 0.0), the angle θ0 between the starting vector and the vector of the first point can be obtained using the following formula:

[0118]

[0119] Substituting the position vectors above into specific values, we get the following formula:

[0120]

[0121] In this embodiment, the positive direction of the track vehicle is assumed to be clockwise. Therefore, after calculating the angle θ0 between the two, the value range of θ0 is [0, π]. This obviously cannot satisfy all cases. For example, when drawing the entire circular spline trajectory (i.e., the arc spline trajectory with an arc angle of 360 degrees), the included angle range needs to be [0, 2π]. Therefore, another conversion is required. Specifically, there are the following cases:

[0122] 1. When y1 < 0 in vector v1(x1, y1), θ0 is equal to the calculated value.

[0123] 2. When y1>0 in vector v1(x1, y1), then θ0=360-θ0.

[0124] 3. When θ0 = 0, the included angle θ0 needs to be determined by combining the float (floating-point number) attribute CurrentPositionOnRail. When CurrentPositionOnRail = 0 (indicating that the starting point is this position), it means... and The included angle θ0 is 0; when CurrentPositionOnRail = 1 (indicating that the position is the endpoint), it means... and The included angle θ0 is 360°.

[0125] When the position vector of the second point is v2(x2, y2), the angle between it and v0(-radius, 0.0) can be calculated as θ1 using a similar method. Then, the arc angle to be drawn between the first point (such as the starting point) and the second point (such as the ending point) is: θ = θ1 - θ0.

[0126] However, if drawing a complete circle (i.e., a circular spline trajectory), the drawing direction must also be determined, meaning the drawing direction of each point needs to be specified (this can be uniformly set to a default direction). Specific direction types include clockwise and counter-clockwise. The specific drawing scenarios are as follows:

[0127] 1. When θ1>θ0 and the first point to the second point is drawn in a clockwise direction, θ=θ1-θ0.

[0128] 2. When θ1>θ0 and the first point to the second point is drawn counterclockwise, θ=360-(θ1-θ0).

[0129] 3. When θ1 < θ0 and the first point to the second point is drawn in a clockwise direction, θ = 360 - (θ0 - θ1).

[0130] 4. When θ1 < θ0 and the first point to the second point is drawn counterclockwise, θ = θ0 - θ1.

[0131] 5. When θ1 = θ0, θ = 360. At this time, the drawing direction can be drawn based on the direction from the first point to the second point.

[0132] After obtaining the final arc angle θ to be drawn, the position of each point on the circle needs to be obtained when drawing the spline trajectory. This can be obtained using the following formula:

[0133]

[0134]

[0135] The circle has a center (x0, y0) and a radius of r. The arc angle to be drawn is θ, and the position of any point on the circle is (x1, y1). The angle needs to be converted to radians during the calculation.

[0136] It should be noted that since the coordinate system in the rendering engine is a left-handed coordinate system, and the default starting point of the complete circle in this embodiment is the position directly below the circle, the coordinate system in the rendering engine needs to be transformed accordingly during calculation.

[0137] Assuming the radius of the track is r, then the circumference is c = 2πr, and the arc length corresponding to a 1-degree angle is... To avoid the need to determine the sign of a point on the circle using the cosine function, the position (x1, y1) can be determined using the following formula:

[0138]

[0139]

[0140] After obtaining the formula for calculating the position of a point on the circle, the angle between the vectors of the first and second points (i.e., the first arc angle) is θ. This angle represents the length of the arc to be drawn. The first point v1(x1,y1) corresponds to the starting point of the arc-shaped spline trajectory. To ensure that the drawn spline is closer to a perfect circle, an interpolation point can be inserted every 1 degree. Therefore, the number of interpolation points is n = |θ| / 1.0, and the remainder is |θ|%1.0. When remainder is not 0 (i.e., not divisible), n = n+1. Then the coordinates of the interpolation point (x1,y1) are... i y i )for:

[0141]

[0142]

[0143] Where i ranges from [1, n-1], and when the direction from the starting point to the ending point is counterclockwise, the above i is set to -i. The position of the last point (i.e., the ending point) is then:

[0144]

[0145]

[0146] Following the above method, an arc-shaped spline trajectory can be drawn by connecting adjacent points in sequence. Drawing a straight-line spline trajectory is much simpler; you can directly draw a Bézier curve between two points.

[0147] Optionally, in one embodiment, for post-capture playback, during the process of controlling the track vehicle model to run in the operating area according to the second control data, in response to receiving a marking operation for the location of the track vehicle model, the system records the points generated by the marking operation and the target running state of the track vehicle model corresponding to the target location point, draws various spline trajectories between each of the target location points, and determines the combination of various spline trajectories between each of the target location points as a second spline trajectory. For example, based on the above drawing method, the drawing of second spline trajectories such as circular arc spline trajectories, straight line spline trajectories, and spline trajectories combining the two can be implemented. Then, based on each of the target locations... The target running state corresponding to each point is determined, and the target running state corresponding to each point in the spline trajectory between the target positions is determined. At this time, the second spline trajectory will be associated with the target running state corresponding to the virtual camera on the track model at the time of the point marking, including the position and rotation angle on the track, and the target running state corresponding to each position point will be supplemented by linear interpolation and quaternion linear interpolation. For example, if the virtual camera of the first target position point rotates to +90 degrees and the virtual camera of the second target position point rotates to -90 degrees, then each position point between the first target position point and the second target position point will record the rotation degree that the virtual camera has rotated from +90 degrees to -90 degrees. Finally, based on the bispline trajectory and the associated target running states, the track vehicle model is controlled to run along the track model corresponding to the bispline trajectory, and the images captured by the virtual camera are acquired. That is, during playback, the virtual camera on the track vehicle model will automatically run according to the target running states associated with this bispline trajectory, and acquire the images captured by the virtual camera throughout the entire operation. In addition, the running images of the track vehicle model can also be acquired, such as... Figure 7 As shown.

[0148] In this embodiment, the present application provides a track vehicle recording and marking function. By generating a spline trajectory, the track vehicle model can automatically run according to the spline trajectory. During the operation of the virtual camera controlled by the peripheral device, the target running status of the current virtual camera can be recorded at any time. Each target position point can be associated with the displacement and rotation information of the current camera control point, the aperture, focal length and focal plane distance of the virtual camera, the running direction corresponding to the target position point (clockwise or counterclockwise for a circular spline trajectory, and forward or backward for a straight line), the track type of the target position point (circular track or straight track), and other information (i.e., the target running status). Based on this information, different running trajectories (i.e., second spline trajectories) can be drawn, thereby combining them into multi-form running trajectories.

[0149] The track vehicle model will subsequently be configured with corresponding values ​​based on the information of each point on the running trajectory. Specifically, information such as position, aperture, focal length, and focal plane can be obtained by linear interpolation, while rotation information can be set by quaternion interpolation, thereby enabling the playback function.

[0150] It is understandable that, since users typically mark the locations of camera control points to generate target position points for recording the current target's running status, and the operation of the track vehicle model is restricted by the track model, the shape of the running trajectory generated based on the above target position points (which is actually located above the track model) matches the shape of the spline trajectory corresponding to the track model, so as to ensure that the operation of the virtual camera still conforms to the track vehicle rules during playback, that is, the virtual camera must always move and shoot along the track model.

[0151] To support users in secondary editing of the aforementioned running trajectories (especially circular arc spline trajectories) and ensure that the virtual camera's operation still conforms to the track vehicle rules during playback, the original drag-and-drop function in the spline component can be modified. This allows the IVizSplineComponent component in this embodiment to support users in performing secondary editing operations such as rotation and trajectory extension on the circular arc spline trajectory by dragging position points within it, while ensuring that the spline trajectory remains circular after secondary editing. For example, users can use the aforementioned secondary editing operations to rotate the circular arc spline trajectory corresponding to the upper semicircle of the same circle into the circular arc spline trajectory corresponding to the lower semicircle, or extend the circular arc spline trajectory corresponding to the semicircle of the same circle into the circular arc spline trajectory corresponding to the entire circle.

[0152] Specifically, when the target trajectory model includes a circular arc trajectory model, the terminal device first draws a third spline trajectory in a similar manner to the drawing of the first spline trajectory, based on the radius information of each target position point and the circular arc spline trajectory in the target trajectory model. For the circular arc spline trajectory corresponding to the circular arc trajectory model in the third spline trajectory, the circular curve region corresponding to the circular arc spline trajectory is determined based on the radius information of the circular arc spline trajectory. This circular curve region can limit the range of movement of the user dragging position points, so that the radius of the second spline trajectory drawn subsequently based on the moved position points is the same as the radius of the third spline trajectory. The user can drag any point in the third spline trajectory (such as the target point or other points selected by the user) to move it within the circular curve area. Subsequently, in response to receiving a drag operation on at least one point in the arc-shaped spline trajectory, the terminal device adjusts the position of the at least one point in the circular curve area, and then redraws the spline trajectory in a similar manner to drawing the first spline trajectory based on the various points associated with the third spline trajectory (including the points after being dragged and moved), thereby obtaining the second spline trajectory.

[0153] Based on the above embodiments, this application provides a method for drawing arc-shaped spline trajectories, which can quickly create spline trajectories of various shapes to meet the needs of free combination of all track groups during real shooting. According to different track requirements, this application can quickly create different track mesh models in a virtual scene based on the drawn spline trajectories, and the shape can be changed at any time by secondary editing of the spline trajectories, reducing the time for track model production and avoiding the huge time spent in IViz components due to drawing different mesh models according to different needs, thus enhancing scalability.

[0154] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0155] Figure 8 This is a schematic diagram of the structure of a virtual camera control system according to an embodiment of this application. The system includes peripheral devices and terminal devices, and the peripheral devices are communicatively connected to the terminal devices, wherein:

[0156] The peripheral device is used to collect first control data and send the first control data to the terminal device. The first control data is used to control the virtual camera.

[0157] The terminal device is used to map the first control data to the second control data for controlling the target model to run in the running area according to the pre-set running area. The running area is the space area in which the target model is allowed to run. The target model includes the virtual camera and the device model to which the virtual camera is attached. According to the second control data, the terminal device controls the target model to run in the running area, acquires the image captured by the virtual camera, and sends the image captured by the virtual camera to the peripheral device.

[0158] Therefore, the peripheral device is also used to receive and display the images captured by the virtual camera.

[0159] The technical solution of this application embodiment maps the first control data for controlling the virtual camera to the second control data for controlling the target model. The second control data restricts the target model to run in its operating area, so that the virtual camera always runs dependent on other devices, and the operation of the virtual camera is subject to the operating area properties of the other devices it is dependent on, thereby simulating the effect of using other devices to carry cameras for shooting in a real environment.

[0160] It should be noted that the system implementation and the method implementation are similar, so the description is relatively simple. For relevant details, please refer to the method implementation.

[0161] This application also provides an electronic device, see embodiments thereof. Figure 9 , Figure 9 This is a schematic diagram of the electronic device proposed in an embodiment of this application. Figure 9 As shown, the electronic device 100 includes a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus for communication. The memory 110 stores a computer program that can run on the processor 120 to implement the steps in the virtual camera control method disclosed in the embodiments of this application.

[0162] This application also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the virtual camera control method disclosed in this application.

[0163] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0164] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0165] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0166] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0167] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0168] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

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

[0170] The foregoing has provided a detailed description of a virtual camera control method, system, device, and medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for controlling a virtual camera, characterized in that, The method includes: Receive first control data for controlling a virtual camera; the first control data includes displacement control data in a first direction, displacement control data in a second direction, and rotation control data; the first direction is the horizontal direction of the first model, and the second direction is the height direction or length direction of the first model; According to a pre-set operating area, the first control data is mapped to second control data for controlling the target model to run within the operating area. The operating area is the spatial area where the target model is allowed to run. The target model includes the virtual camera and the device model to which the virtual camera is attached. The attachment relationship between device models set in the virtual scene is a simulation of the carrying relationship between devices in the real scene. Based on the second control data, the target model is controlled to run in the operating area, and the images captured by the virtual camera are acquired; The step of mapping the first control data to second control data for controlling the target model to run within the pre-set operating area includes: Based on the type of data contained in the first control data, a first model to be controlled for operation is determined from the various device models contained in the target model, wherein the first model includes at least the virtual camera; Based on the operating region, the first control data is mapped to third control data for controlling the operation of the first model within the operating region, wherein the operating region is the spatial region in which the first model is allowed to operate, and the operating region is determined according to the type of the first control data.

2. The method according to claim 1, characterized in that, The step of controlling the target model to run in the operating area according to the second control data includes: Based on the third control data, the first model is controlled to run in the operating area.

3. The method according to claim 1, characterized in that, The step of mapping the first control data to third control data for controlling the operation of the first model within the operating region, based on the operating region, includes: Based on the first control data, determine the first displacement information required for the virtual camera to move in the first direction; The first displacement information is mapped to the operating area to obtain the second displacement information, wherein the operating area includes the spatial region in which the first model is allowed to move. Based on the second displacement information, third control data for controlling the first model to move in position is determined.

4. The method according to claim 3, characterized in that, The target model is a track vehicle model used to carry the virtual camera and move along the track model; The step of mapping the first displacement information to the operating region to obtain the second displacement information includes: The first displacement information is mapped to the running area to obtain the second displacement information. The running area includes the spatial region that the first model needs to pass through to move along the track model.

5. The method according to claim 4, characterized in that, The track vehicle model includes a track vehicle base for moving along the track model and a device model attached to the track vehicle base, wherein the device model attached to the track vehicle base includes at least the virtual camera; The step of determining the first model to be controlled for operation from the various device models included in the target model based on the type of data contained in the first control data includes: From the various equipment models included in the track vehicle model, determine the track vehicle base for moving along the track model and all equipment models attached to the track vehicle base; The railcar base and all equipment models attached to the railcar base are defined as the first model.

6. The method according to claim 4, characterized in that, The step of determining the third control data for controlling the movement of the first model based on the second displacement information includes: Based on the current position of the track vehicle base on the track model, the length of the spline trajectory used to establish the track model, and the second displacement information, a target position identifier is determined. The target position identifier is used to characterize the position on the track model that the first model needs to reach. The target location identifier is determined as the third control data.

7. The method according to claim 1, characterized in that, The step of mapping the first control data to third control data for controlling the operation of the first model within the operating region, based on the operating region, includes: Based on the first control data, determine the displacement change value of the virtual camera in the second direction; The displacement change value in the second direction is mapped to the operating region to obtain third control data for controlling the first model to expand and contract in the second direction. The operating region includes the spatial region in which the first model is allowed to expand and contract.

8. The method according to claim 7, characterized in that, The first model includes a deformation unit in the target model and all device models in the target model that are attached to the deformation unit. The device models that are attached to the deformation unit include at least the virtual camera. The deformation unit is used to stretch or contract in the second direction. The step of mapping the displacement change value in the second direction to the operating region to obtain third control data for controlling the expansion and contraction of the first model in the second direction includes: Determine the extension and retraction range of the deformation unit corresponding to the operating area in the second direction; Based on the expansion range, the current position of the deformation unit, and the displacement change value in the second direction, the target position that the deformation unit needs to expand and contract to reach is determined; Based on the target position that the deformation unit needs to reach through expansion and contraction, determine the target expansion and contraction value of the deformation unit in the second direction; The target scaling value is determined as the third control data.

9. The method according to claim 7 or 8, characterized in that, The target model is a track vehicle model used to carry the virtual camera and move along the track model, and the second direction is the height direction of the first model.

10. The method according to claim 1, characterized in that, The step of mapping the first control data to third control data for controlling the operation of the first model within the operating region, based on the operating region, includes: Based on the first control data, determine the required rotation angle change of the virtual camera; The required rotation angle change of the virtual camera is mapped to the running area to obtain the required rotation angle change of the first model. The running area includes the spatial area that the first model needs to traverse to rotate. Based on the required rotation angle change of the first model, third control data is determined to control the rotation of the first model.

11. The method according to claim 10, characterized in that, The target model is a track vehicle model used to carry the virtual camera and move along the track model; The step of mapping the required rotation angle change of the virtual camera to the running area to obtain the required rotation angle change of the first model includes: The required rotation angle change of the virtual camera is mapped to the running area to obtain the required rotation angle change of the first model relative to the track vehicle base. The running area includes the spatial area that the first model needs to traverse to rotate relative to the track vehicle base. The step of determining the third control data for controlling the rotation of the first model based on the required change in rotation angle of the first model includes: Based on the change in the required rotation angle of the first model relative to the railcar base and the current rotation angle of the first model relative to the railcar base, determine the target rotation angle that the first model needs to achieve relative to the railcar base. The target rotation angle is determined as third control data for controlling the rotation of the first model relative to the track vehicle base.

12. The method according to claim 11, characterized in that, The step of determining the first model to be controlled for operation from the various device models included in the target model based on the type of data contained in the first control data includes: From the various device models included in the track vehicle model, a rotating unit and all device models attached to the rotating unit are determined. The all device models attached to the rotating unit include at least the virtual camera. The rotating unit is used to carry the virtual camera to rotate relative to the track vehicle base. The rotating unit and all the device models attached to the rotating unit are defined as the first model.

13. The method according to claim 1, characterized in that, The target model is a track vehicle model used to carry the virtual camera along a track model, the track model comprising at least a circular arc track model; the method further includes: Obtain the radius information and drawing points of the circular arc track model input from the peripheral device; For the first drawing point belonging to the target type among the various drawing points, an interpolation point is set between the first drawing point and the next drawing point along the drawing direction of the first drawing point according to the radius information, and an arc-shaped spline trajectory between the first drawing point and the next drawing point is drawn according to the first drawing point, the next drawing point, and the interpolation point. The combination of spline trajectories between the various drawing points is determined as the first spline trajectory; Based on the first spline trajectory, the trajectory model is established using a mesh spline component.

14. The method according to claim 13, characterized in that, Setting an interpolation point between the first drawing point and the next drawing point along the drawing direction includes: Taking the first drawing point as the starting point of the arc spline trajectory and the next drawing point as the ending point of the arc spline trajectory, determine the first arc angle between the first position vector corresponding to the starting point and the second position vector corresponding to the ending point; The number of interpolation points is determined based on the first arc angle and the angle accuracy of the interpolation points; The position of each interpolation point is determined based on the number of interpolation points, the first arc angle, and the radius information. Based on the position of each interpolation point, each interpolation point is set between the first drawing point and the next drawing point.

15. The method according to claim 1, characterized in that, The target model is a track vehicle model used to carry the virtual camera along the track model; the method further includes: During the process of controlling the track vehicle model to run in the operating area according to the second control data, in response to receiving a marking operation for the location of the track vehicle model, the target location point generated by the marking operation is recorded, and the target operating state of the track vehicle model corresponding to the target location point is recorded. Draw spline trajectories between each of the target location points, and determine the combination of spline trajectories between each of the target location points as a second spline trajectory; determine the target running state corresponding to each location point in the spline trajectory between each of the target location points according to the target running state corresponding to each of the target location points. Based on the second spline trajectory and the running states of each target associated with the second spline trajectory, the track vehicle model is controlled to run along the track model corresponding to the second spline trajectory, and the images captured by the virtual camera are obtained.

16. The method according to claim 15, characterized in that, The trajectory model includes a circular arc trajectory model. The step of drawing spline trajectories between each of the target position points and determining the combination of these spline trajectories as a second spline trajectory includes: Based on the target location points and the radius information of the circular arc track model in the track model, a third spline trajectory is drawn; For the circular arc spline trajectory corresponding to the circular arc track model in the third spline trajectory, the circular curve region corresponding to the circular arc spline trajectory is determined based on the radius information of the circular arc spline trajectory; In response to receiving a drag operation on at least one location point in the arc-shaped spline trajectory, the position of the at least one location point in the circular curve region is adjusted; Based on the position points associated with the third spline trajectory, the spline trajectory is redrawn to obtain the second spline trajectory.

17. A control system for a virtual camera, characterized in that, The system includes peripheral devices and terminal devices, wherein the peripheral devices are communicatively connected to the terminal devices, and: The peripheral device is used to collect first control data and send the first control data to the terminal device. The first control data is used to control the virtual camera. The first control data includes displacement control data in a first direction, displacement control data in a second direction, and rotation control data. The first direction is the horizontal direction of the first model, and the second direction is the height direction or length direction of the first model. The terminal device is used to map the first control data to second control data for controlling the target model to run within a pre-set operating area. The operating area is a spatial region where the target model is allowed to run. The target model includes the virtual camera and the device model to which the virtual camera is attached. According to the second control data, the terminal device controls the target model to run within the operating area, acquires the images captured by the virtual camera, and sends the images captured by the virtual camera to the peripheral device. The attachment relationship between the device models set in the virtual scene is a simulation of the carrying relationship between devices in the real scene. The peripheral device is also used to receive and display the images captured by the virtual camera; The step of mapping the first control data to second control data for controlling the target model to run within the pre-set operating area includes: Based on the type of data contained in the first control data, a first model to be controlled for operation is determined from the various device models contained in the target model, wherein the first model includes at least the virtual camera; Based on the operating region, the first control data is mapped to third control data for controlling the operation of the first model within the operating region, wherein the operating region is the spatial region in which the first model is allowed to operate, and the operating region is determined according to the type of the first control data.

18. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the virtual camera control method according to any one of claims 1 to 16.

19. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the control method for the virtual camera as described in any one of claims 1 to 16.

Citation Information

Patent Citations

  • Virtual shooting method and device and storage medium

    CN114422696A

  • Manipulating Virtual Camera Dolly in Multi-Dimensional Space to Produce Visual Effect

    US20190005146A1