Virtual camera shooting parameter adjusting method and device, electronic equipment and storage medium

By responding to the virtual character triggering plot events in the virtual camera system, calculating the conversion matrix and adjusting the shooting parameters, the problem that the virtual camera cannot adapt to different height differences and positions is solved, and the display effect of the game screen is improved.

CN119548816AActive Publication Date: 2025-03-04NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411595222.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-04
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

In the prior art, the shooting direction, shooting angle and shooting position of the virtual camera are fixed, and it cannot adapt to the different height differences and relative positions of the virtual character and the target object, resulting in poor display effect of the game screen.

Method used

The terminal device provides a graphical user interface. After responding to the virtual character triggering the plot event, the target plot and target object are determined, and the vector set in the two-dimensional shoulder shooting template is calculated to convert the conversion matrix of the actual position, and the shooting position, lens inclination and shooting direction of the virtual camera are adjusted to adapt to the current scene.

Benefits of technology

The shooting parameters of the virtual camera are adjusted, so that the virtual camera can adapt to the different height differences and positions of the virtual character and target object, and improve the display effect of the game screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119548816A_ABST
    Figure CN119548816A_ABST
Patent Text Reader

Abstract

The invention provides a virtual camera shooting parameter adjusting method and device, electronic equipment and a storage medium, in the application, a two-dimensional over-shoulder shooting template is reused, and on the basis of the two-dimensional over-shoulder shooting template, the shooting parameters of a virtual camera are adjusted. The shooting position, the lens inclination angle vector and the shooting direction vector of the virtual camera set in the two-dimensional shoulder crossing shooting template are adjusted, and the adjusted shooting position, the lens inclination angle and the shooting direction of the virtual camera can adapt to the height difference and the position of the current controlled virtual character and the target object; therefore, the picture effect shot by the adjusted shoulder crossing shooting mode is the same as the picture effect set by shooting of the two-dimensional shoulder crossing shooting template, so that the display effect of the game picture is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for adjusting shooting parameters of a virtual camera. Background Art

[0002] In 3D games, a virtual character will play a game plot after triggering a plot event. In order to make the game plot richer and enhance the viewing experience, the virtual camera generally uses an over-the-shoulder perspective to shoot. In the prior art, designers usually design many sets of two-dimensional over-the-shoulder shooting templates. The two-dimensional over-the-shoulder shooting templates can only show the designers the display effect of the two-dimensional plane, but cannot show the designers the three-dimensional display effect. The designers configure different two-dimensional over-the-shoulder shooting templates for different game plots according to the display effect of the two-dimensional plane, so that when the virtual character triggers the game plot, the corresponding two-dimensional over-the-shoulder shooting template is used for shooting. In addition, when using the two-dimensional over-the-shoulder shooting template for shooting, the shooting direction, shooting angle and shooting position of the virtual camera are all fixed. However, in the actual game, the height difference and relative position of the virtual character and the target object that triggers the game plot are not constant. This results in the inability to perfectly adapt to the current game scene when using the two-dimensional over-the-shoulder shooting template for shooting, resulting in the displayed picture failing to achieve the display effect designed by the two-dimensional over-the-shoulder shooting template. For example, when the height difference between the virtual character and the target object is large, the head of the target object may not be fully displayed in the game screen, resulting in poor display effect of the game screen. Summary of the invention

[0003] In view of this, embodiments of the present application provide a method, device, electronic device and storage medium for adjusting shooting parameters of a virtual camera to improve the display effect of the game screen.

[0004] In a first aspect, an embodiment of the present application provides a method for adjusting shooting parameters of a virtual camera, wherein a graphical user interface is provided through a terminal device, and the graphical user interface displays a game screen formed by shooting a game scene with a specified game perspective through a virtual camera, wherein the game scene includes a controlled virtual character, and the method includes:

[0005] In response to the controlled virtual character triggering a designated plot event in the game scene, determining a triggered target plot and a target object in the target plot that performs plot interaction with the controlled virtual character, wherein a two-dimensional over-the-shoulder shooting template is configured corresponding to the target plot, and the two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot the plot scene corresponding to the target plot from an over-the-shoulder perspective;

[0006] In response to a target screen effect for the plot scene, determining a first vector and a second vector in the plot scene, wherein the first vector is determined based on positions of a first target part of the controlled virtual character and a second target part of the target object in the plot scene, and the second vector is determined based on positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in the visual cone of the virtual camera;

[0007] Calculate, according to the first vector and the second vector, a transformation matrix when transforming the second vector into the first vector;

[0008] Determine an angle between the third vector and the lens tilt vector according to a third vector generated when the lens tilt vector set in the two-dimensional over-the-shoulder shooting template is projected onto a normal plane corresponding to the first vector and the lens tilt vector, so as to use the angle as a first rotation matrix;

[0009] According to the transformation matrix and the first rotation matrix, the shooting position, the lens tilt vector and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template are adjusted so that the virtual camera presents the target picture effect when shooting the plot scene corresponding to the target plot according to the adjusted two-dimensional over-the-shoulder shooting template.

[0010] In a second aspect, an embodiment of the present application provides a device for adjusting shooting parameters of a virtual camera, wherein a graphical user interface is provided through a terminal device, and the graphical user interface displays a game screen formed by shooting a game scene with a specified game perspective through a virtual camera, wherein the game scene includes a controlled virtual character, and the device includes:

[0011] A first determining unit is configured to determine, in response to the controlled virtual character triggering a designated plot event in the game scene, a triggered target plot and a target object in the target plot that performs plot interaction with the controlled virtual character, wherein the target plot is correspondingly configured with a two-dimensional over-the-shoulder shooting template, and the two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot the plot scene corresponding to the target plot from an over-the-shoulder perspective;

[0012] A second determining unit is configured to determine a first vector and a second vector in the plot scene in response to a target screen effect for the plot scene, wherein the first vector is determined based on positions of a first target part of the controlled virtual character and a second target part of the target object in the plot scene, and the second vector is determined based on positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in a viewing cone of the virtual camera;

[0013] a calculation unit, configured to calculate, according to the first vector and the second vector, a transformation matrix when the second vector is transformed into the first vector;

[0014] a third determining unit, configured to determine an angle between the third vector and the lens tilt vector according to a third vector generated when the lens tilt vector set in the two-dimensional over-the-shoulder shooting template is projected onto a normal plane corresponding to the first vector and the lens tilt vector, so as to use the angle as a first rotation matrix;

[0015] An adjustment unit is used to adjust the shooting position, the lens tilt vector and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template according to the transformation matrix and the first rotation matrix, so that the virtual camera presents the target picture effect when shooting the plot scene corresponding to the target plot according to the adjusted two-dimensional over-the-shoulder shooting template.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for adjusting the shooting parameters of a virtual camera as described in any one of the first aspects.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for adjusting the shooting parameters of a virtual camera as described in any one of the first aspects are performed.

[0018] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0019] In the present application, a two-dimensional over-the-shoulder shooting template is reused, and after the controlled virtual character triggers a plot event, the two-dimensional over-the-shoulder shooting template configured for the triggered target plot and the target object that interacts with the controlled virtual character in the target plot are determined, and then the conversion matrix corresponding to the conversion from the second vector to the first vector is determined, that is, the conversion matrix corresponding to the conversion from the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in the visual cone of the virtual camera to the position of the first target part of the controlled virtual character and the second target part of the target object in the plot scene, and the angle between the third vector and the lens tilt vector generated when the lens tilt vector set in the two-dimensional over-the-shoulder shooting template is projected onto the normal plane corresponding to the first vector, and then according to the conversion matrix and the determined angle On the basis of the two-dimensional over-the-shoulder shooting template, the shooting position, lens tilt vector and shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template are adjusted. The above adjustment method is based on the two-dimensional over-the-shoulder shooting template, and is a compensatory adjustment made according to the actual position and height difference of the first target part and the second target part. When the first target part and the second target part are both the head, the compensatory adjustment is made according to the position and height difference of the controlled virtual character and the target object, so that the shooting position, lens tilt and shooting direction of the adjusted virtual camera can adapt to the height difference and position of the current controlled virtual character and the target object, thereby making the picture effect captured by the adjusted over-the-shoulder shooting method the same as the picture effect set by the two-dimensional over-the-shoulder shooting template, which is beneficial to improving the display effect of the game screen.

[0020] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 A flowchart of a method for adjusting shooting parameters of a virtual camera provided in an embodiment of the present application;

[0023] Figure 2 A schematic diagram of an over-the-shoulder shooting provided in an embodiment of the present application;

[0024] Figure 3 A schematic diagram of positions set in a two-dimensional over-the-shoulder shooting template provided in an embodiment of the present application;

[0025] Figure 4 A schematic diagram of a flow chart of another method for adjusting shooting parameters of a virtual camera provided in an embodiment of the present application;

[0026] Figure 5 A schematic diagram of the structure of a device for adjusting shooting parameters of a virtual camera provided in an embodiment of the present application;

[0027] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0029] It should be explained in advance that the two-dimensional over-the-shoulder shooting template is a template information in which the designer predetermines the position and orientation of the characters and the camera in the production of electronic games. It can be easily applied to the production of regular game plots to quickly generate the camera position for character dialogues and achieve over-the-shoulder shooting (also called over-the-shoulder shooting).

[0030] Over-the-shoulder shooting refers to a method of shooting a virtual character (also called a controlled virtual character) and a target object by aiming a virtual camera at the shoulder of a virtual character. This shooting method allows players to better experience the perspective and scenario when communicating with the target object, increases the realism of communication between the virtual character and the target object, makes it easier for players to immerse themselves in the game plot, and better understand and experience the dialogue interaction in the game.

[0031] The two-dimensional over-the-shoulder shooting template is set with shooting parameters. The two-dimensional over-the-shoulder shooting template can display a two-dimensional picture effect for designers. The two-dimensional picture includes the distance between the virtual character and the target object, and the position of the virtual character and the target object in the picture, that is, the distance from the edge of the picture. The shooting parameters can be used to determine information such as the shooting direction, shooting position and lens inclination of the virtual camera.

[0032] The following is a description of the detailed technical solution of this application.

[0033] Figure 1 A flowchart of a method for adjusting shooting parameters of a virtual camera provided in an embodiment of the present application is provided, wherein a graphical user interface is provided through a terminal device, and the graphical user interface displays a game screen formed by shooting a game scene with a specified game perspective through a virtual camera, wherein the game scene includes a controlled virtual character, such as Figure 1 As shown, the method comprises the following steps:

[0034] Step 101, in response to the controlled virtual character triggering a designated plot event in the game scene, determining a triggered target plot and a target object in the target plot that performs plot interaction with the controlled virtual character, wherein the target plot is correspondingly configured with a two-dimensional over-the-shoulder shooting template, and the two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot the plot scene corresponding to the target plot from an over-the-shoulder perspective.

[0035] Step 102: In response to a target screen effect for the plot scene, determine a first vector and a second vector in the plot scene, wherein the first vector is determined based on positions of a first target part of the controlled virtual character and a second target part of the target object in the plot scene, and the second vector is determined based on positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in a viewing cone of the virtual camera.

[0036] Step 103: Calculate a conversion matrix from the second vector to the first vector according to the first vector and the second vector.

[0037] Step 104: Determine the angle between the third vector and the lens tilt vector according to a third vector generated when the lens tilt vector set in the two-dimensional over-the-shoulder shooting template is projected onto the normal plane corresponding to the first vector and the lens tilt vector, so as to use the angle as a first rotation matrix.

[0038] Step 105: According to the transformation matrix and the first rotation matrix, the shooting position, the lens tilt vector and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template are adjusted so that the virtual camera presents the target picture effect when shooting the plot scene corresponding to the target plot according to the adjusted two-dimensional over-the-shoulder shooting template.

[0039] Specifically, the player can control the controlled virtual character to move in the game scene, and let the controlled virtual character execute corresponding game instructions. The game scene includes many virtual characters or objects (i.e., target objects) that can trigger plot events, such as NPC (non-player character, non-player character) in the game, such as buildings, stones, vegetation, etc., or even two virtual characters controlled by players. When the player controls the controlled virtual character to approach or click on the target object, a corresponding plot event will be triggered, thereby triggering the corresponding plot, and the designer pre-configures corresponding two-dimensional over-the-shoulder shooting templates for different plots. After the plot is triggered, the two-dimensional over-the-shoulder shooting template configured for the corresponding plot (i.e., the target plot) is called to obtain the basic parameters of the two-dimensional over-the-shoulder shooting template. Since the relative position of the first target part (e.g., head) of the controlled virtual character that triggers the plot event and the second target part (e.g., head) of the target object, and the height difference between the first target part of the controlled virtual character and the second target part of the target object may be different from the relative position and height difference between the first target part of the controlled virtual character and the second target part of the target object set by the two-dimensional over-the-shoulder shooting template, if over-the-shoulder shooting is performed according to the parameters set by the two-dimensional over-the-shoulder shooting template, the captured picture effect cannot achieve the picture effect (i.e., the target picture effect) set by the two-dimensional over-the-shoulder shooting template for the plot scene.

[0040] There is a difference between the relative position and height difference between the first target part of the currently controlled virtual character and the second target part of the target object and the relative position and height difference between the first target part of the controlled virtual character and the second target part of the target object set by the two-dimensional over-the-shoulder shooting template. If this difference is compensated on the basis of the parameters set by the two-dimensional over-the-shoulder shooting template, then over-the-shoulder shooting is performed using the compensated parameters. At this time, the picture effect obtained can achieve the picture effect set by the two-dimensional over-the-shoulder shooting template for the plot scene. Therefore, it is necessary to determine the first vector formed by the positions of the first target part of the controlled virtual character and the second target part of the target object in the plot scene, and the second vector formed by the positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in the visual cone of the virtual camera, and then convert the second vector into the first vector, and determine the translation matrix, rotation matrix and scaling matrix that occur during the conversion process, so as to obtain the conversion matrix based on the above three matrices.

[0041] If compensation is performed using only a conversion matrix based on the parameters set in the two-dimensional over-the-shoulder shooting template, when the compensated parameters are used to adjust the shooting position of the virtual camera, since the compensated virtual camera lens inclination is deflected relative to the lens inclination set in the two-dimensional over-the-shoulder shooting template (caused by the rotation matrix), the lens inclination set in the two-dimensional over-the-shoulder shooting template also needs to be compensated. At this time, it is necessary to determine the angle between the third vector generated when the lens inclination vector set in the two-dimensional over-the-shoulder shooting template is projected onto the normal plane corresponding to the first vector and the lens inclination vector, and the angle is used as the first rotation matrix.

[0042] After obtaining the first rotation matrix and the conversion matrix, the first rotation matrix and the conversion matrix are used to make adjustments based on the shooting position, lens tilt vector and shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template. The adjusted shooting position and shooting direction of the virtual camera are proportionally adjusted to the shooting position and shooting direction of the virtual camera set in the two-dimensional over-the-shoulder shooting template, and the shooting direction is also adjusted according to the relative position and height difference between the first target part and the second target part. Therefore, when the virtual camera shoots the plot scene corresponding to the target plot according to the adjusted two-dimensional over-the-shoulder shooting template, the picture effect presented is the same as the picture effect set by the two-dimensional over-the-shoulder shooting template. Therefore, the above method is conducive to improving the display effect of the game screen.

[0043] It should be noted that the first target part and the second target part can be the same part or different parts. For example, the first target part can be the arm and the second target part can be the head, or the first target part can be the head and the second target part can be the arm, or the first target part can be the shoulder and the second target part can be the leg. The specific parts can be set according to the actual scenario and needs, and are not specifically limited here.

[0044] When the virtual camera is shooting, the shooting space is in the shape of a cone, and this space area is the viewing cone.

[0045] In one possible embodiment, Figure 2 A schematic diagram of an over-the-shoulder shooting provided in an embodiment of the present application, Figure 2 The dotted arrow in the figure indicates the shooting direction of the virtual camera. Figure 2 The virtual camera in the game is shooting at the shoulder of the controlled virtual character. Figure 3 A schematic diagram of a position set in a two-dimensional over-the-shoulder shooting template provided in an embodiment of the present application, Figure 3 In the figure, the dotted arrow indicates the lens tilt angle (i.e., the angle rotated with the shooting direction as the axis), and the dotted line indicates the shooting direction. Figure 2 and Figure 3As shown, the two-dimensional over-the-shoulder shooting template is provided with a first position of the first target part in the visual frustum, a second position of the second target part in the visual frustum, a third position of the virtual camera in the plot scene, a fourth position for indicating the shooting direction of the virtual camera, and a fifth position for indicating the vertical direction of the shooting picture of the virtual camera. The two-dimensional over-the-shoulder shooting template defines the target picture effect through the first position, the second position, the third position, the fourth position, and the fifth position; the lens inclination vector is obtained through the third position and the fifth position, and the shooting direction vector is obtained through the third position and the fourth position.

[0046] In one possible embodiment, Figure 4 A flowchart of another method for adjusting shooting parameters of a virtual camera provided in an embodiment of the present application is shown as follows: Figure 4 As shown, when executing step 105, it can be achieved by the following steps:

[0047] Step 401: perform product calculation on the rotation matrix in the conversion matrix and the first rotation matrix to obtain a second rotation matrix.

[0048] Step 402: Adjust the third position and the shooting direction vector according to the translation matrix and the scaling matrix in the conversion matrix.

[0049] Step 403: According to the second rotation matrix, the lens tilt vector is adjusted with the first vector as the rotation axis.

[0050] Specifically, the virtual camera can be adjusted according to the difference between the first vector and the second vector on the basis of the two-dimensional over-the-shoulder shooting template through the transformation matrix. However, the lens tilt angle of the adjusted virtual camera is skewed from the lens tilt angle of the target picture effect. Therefore, it is necessary to adjust the lens tilt angle through a second rotation matrix obtained by multiplying the rotation matrix in the transformation matrix and the first rotation matrix, so that the adjusted shooting position, lens tilt angle vector and shooting direction are the same as the target picture effect.

[0051] In a feasible implementation scheme, after the virtual camera is adjusted, the virtual camera is controlled to shoot the plot scene using an over-the-shoulder perspective according to the adjusted shooting position, lens tilt vector and shooting direction vector; the captured plot scene picture is displayed on the graphical user interface, and the plot scene picture displayed at this time has the same effect as the target picture.

[0052] In one feasible embodiment, the first target site and the second target site are the same site.

[0053] Specifically, setting the first target part and the second target part to be the same part can make the picture effect look relatively uniform, making the game picture more ornamental.

[0054] In one feasible embodiment, the first target site and the second target site are both the head.

[0055] Specifically, when the first target part and the second target part are both the head and an over-the-shoulder perspective is used for shooting, a more natural and immersive observation experience can be provided to players. Players can better feel the perspective and scenario when talking with NPCs, and the realism of communication between characters can be increased, making it easier for players to immerse themselves in the game plot and better understand and experience the dialogue interactions in the game.

[0056] In a feasible implementation manner, the designated game perspective includes a first game perspective or a third game perspective.

[0057] Specifically, when the virtual camera follows the controlled virtual character to shoot, it shoots from the first game perspective or the third game perspective. When the controlled virtual character triggers a plot event, and the shooting direction, shooting position and lens inclination of the virtual camera are determined based on the two-dimensional over-the-shoulder shooting template, the plot scene corresponding to the triggered plot event is shot using an over-the-shoulder shooting method, that is: different scenes are shot by changing the shooting perspective.

[0058] In a feasible implementation manner, in the two-dimensional over-the-shoulder shooting template, the controlled virtual character is set as a close-up character, and the target object is set as a distant character.

[0059] Specifically, in the two-dimensional over-the-shoulder shooting template, the controlled virtual character is set as a close-up character, and the target object is set as a distant character. After the shooting direction, shooting position and lens inclination of the virtual camera are determined based on the two-dimensional over-the-shoulder shooting template, the controlled virtual character will be shot as the close-up character and the target object will be shot as the distant character. That is, when shooting over the shoulder, the virtual camera shoots over the shoulder of the controlled virtual character. This shooting method allows players to better feel the perspective and situation when talking with the target object, which is conducive to improving the player's gaming experience.

[0060] In a feasible implementation manner, the target object is a non-player virtual character (ie, an NPC in a game scene).

[0061] It should be noted that the target object can also be other virtual items, such as buildings, virtual props in scenes, etc. The target object can be set according to the type of virtual items set in the game that can trigger plot events. The specific target object is not specifically limited here.

[0062] Figure 5 A schematic diagram of a structure of a virtual camera shooting parameter adjustment device provided in an embodiment of the present application, wherein a graphical user interface is provided through a terminal device, and the graphical user interface displays a game screen formed by shooting a game scene with a specified game perspective through a virtual camera, wherein the game scene includes a controlled virtual character, such as Figure 5 As shown, the device comprises:

[0063] A first determining unit 51 is used for determining, in response to the controlled virtual character triggering a designated plot event in the game scene, a triggered target plot and a target object in the target plot that interacts with the controlled virtual character, wherein a two-dimensional over-the-shoulder shooting template is configured corresponding to the target plot, and the two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot the plot scene corresponding to the target plot from an over-the-shoulder perspective;

[0064] A second determining unit 52 is configured to determine a first vector and a second vector in the plot scene in response to a target screen effect for the plot scene, wherein the first vector is determined based on positions of a first target part of the controlled virtual character and a second target part of the target object in the plot scene, and the second vector is determined based on positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in the visual cone of the virtual camera;

[0065] A calculation unit 53, configured to calculate a conversion matrix when converting the second vector into the first vector according to the first vector and the second vector;

[0066] a third determining unit 54, configured to determine an angle between the third vector and the lens tilt vector according to a third vector generated when the lens tilt vector set in the two-dimensional over-the-shoulder shooting template is projected onto a normal plane corresponding to the first vector and the lens tilt vector, so as to use the angle as a first rotation matrix;

[0067] The adjustment unit 55 is used to adjust the shooting position, the lens tilt vector and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template according to the transformation matrix and the first rotation matrix, so that the virtual camera presents the target picture effect when shooting the plot scene corresponding to the target plot according to the adjusted two-dimensional over-the-shoulder shooting template.

[0068] In a feasible implementation manner, the two-dimensional over-the-shoulder shooting template is provided with a first position of the first target part in the visual frustum, a second position of the second target part in the visual frustum, a third position of the virtual camera in the plot scene, a fourth position for indicating the shooting direction of the virtual camera, and a fifth position for indicating the vertical direction of the shooting picture of the virtual camera. The two-dimensional over-the-shoulder shooting template defines the target picture effect through the first position, the second position, the third position, the fourth position, and the fifth position;

[0069] The lens tilt angle vector is obtained through the third position and the fifth position, and the shooting direction vector is obtained through the third position and the fourth position.

[0070] In a feasible implementation manner, the adjustment unit is used to adjust the shooting position, the lens tilt vector, and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template according to the conversion matrix and the first rotation matrix, including:

[0071] Performing product calculation on the rotation matrix in the conversion matrix and the first rotation matrix to obtain a second rotation matrix;

[0072] Adjusting the third position and the shooting direction vector according to the translation matrix and the scaling matrix in the conversion matrix;

[0073] According to the second rotation matrix, the lens tilt vector is adjusted with the first vector as a rotation axis.

[0074] In a feasible embodiment, the device further comprises:

[0075] A shooting unit, used for controlling the virtual camera to shoot the plot scene using an over-the-shoulder perspective according to the adjusted shooting position, lens tilt vector and shooting direction vector;

[0076] The display unit is used to display the captured plot scene images on the graphical user interface.

[0077] In one feasible embodiment, the first target site and the second target site are the same site.

[0078] In one feasible embodiment, the first target site and the second target site are both the head.

[0079] In a feasible implementation manner, the designated game perspective includes a first game perspective or a third game perspective.

[0080] In a feasible implementation manner, in the two-dimensional over-the-shoulder shooting template, the controlled virtual character is set as a close-up character, and the target object is set as a distant character.

[0081] In a feasible implementation manner, the target object is a non-player virtual character.

[0082] about Figure 5 For explanation of the principles of related content, please refer to Figure 1-4 The relevant instructions will not be repeated in detail here.

[0083] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application includes: a processor 61, a storage medium 62 and a bus 63, wherein the storage medium 62 stores machine-readable instructions executable by the processor 61. When the electronic device runs the above-mentioned method for adjusting the shooting parameters of the virtual camera, the processor 61 communicates with the storage medium 62 via the bus 63, and the processor 61 executes the machine-readable instructions to execute Figure 1 The method steps of the related content are shown.

[0084] For specific implementation methods, steps and principles, see Figure 1-Figure 4 The description will not be repeated in detail here.

[0085] Embodiment 4 of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for adjusting the shooting parameters of the virtual camera are executed.

[0086] For specific implementation methods, steps and principles, see Figure 1-Figure 4 The description will not be repeated in detail here.

[0087] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0088] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0089] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0090] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0091] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0092] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for adjusting shooting parameters of a virtual camera, characterized in that: A graphical user interface is provided through a terminal device, wherein the graphical user interface displays a game screen formed by shooting a game scene through a virtual camera at a specified game perspective, wherein the game scene includes a controlled virtual character, and the method includes: In response to the controlled virtual character triggering a designated plot event in the game scene, determining a triggered target plot and a target object in the target plot that performs plot interaction with the controlled virtual character, wherein a two-dimensional over-the-shoulder shooting template is configured corresponding to the target plot, and the two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot the plot scene corresponding to the target plot from an over-the-shoulder perspective; In response to a target screen effect for the plot scene, determining a first vector and a second vector in the plot scene, wherein the first vector is determined based on positions of a first target part of the controlled virtual character and a second target part of the target object in the plot scene, and the second vector is determined based on positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in the visual cone of the virtual camera; Calculate, according to the first vector and the second vector, a transformation matrix when transforming the second vector into the first vector; Determine an angle between the third vector and the lens tilt vector according to a third vector generated when the lens tilt vector set in the two-dimensional over-the-shoulder shooting template is projected onto a normal plane corresponding to the first vector and the lens tilt vector, so as to use the angle as a first rotation matrix; According to the transformation matrix and the first rotation matrix, the shooting position, the lens tilt vector and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template are adjusted so that the virtual camera presents the target picture effect when shooting the plot scene corresponding to the target plot according to the adjusted two-dimensional over-the-shoulder shooting template.

2. The adjustment method according to claim 1, characterized in that: The two-dimensional over-the-shoulder shooting template is provided with a first position of the first target part in the visual frustum, a second position of the second target part in the visual frustum, a third position of the virtual camera in the plot scene, a fourth position for indicating the shooting direction of the virtual camera, and a fifth position for indicating the vertical direction of the shooting picture of the virtual camera. The two-dimensional over-the-shoulder shooting template defines the target picture effect through the first position, the second position, the third position, the fourth position, and the fifth position; The lens tilt angle vector is obtained through the third position and the fifth position, and the shooting direction vector is obtained through the third position and the fourth position.

3. The adjustment method according to claim 2, characterized in that: The step of adjusting the shooting position of the virtual camera, the lens tilt vector, and the shooting direction vector set in the two-dimensional over-the-shoulder shooting template according to the conversion matrix and the first rotation matrix includes: Performing product calculation on the rotation matrix in the conversion matrix and the first rotation matrix to obtain a second rotation matrix; Adjusting the third position and the shooting direction vector according to the translation matrix and the scaling matrix in the conversion matrix; According to the second rotation matrix, the lens tilt vector is adjusted with the first vector as a rotation axis.

4. The adjustment method according to claim 1, characterized in that: The method further comprises: Controlling the virtual camera to shoot the plot scene using an over-the-shoulder perspective according to the adjusted shooting position, lens tilt vector, and shooting direction vector; The captured plot scene pictures are displayed on the graphical user interface.

5. The adjustment method according to claim 1, characterized in that: The first target site and the second target site are the same site.

6. The adjustment method according to claim 5, characterized in that: The first target part and the second target part are both the head.

7. The adjustment method according to claim 1, characterized in that: The designated game perspective includes a first game perspective or a third game perspective.

8. The adjustment method according to claim 1, characterized in that: In the two-dimensional over-the-shoulder shooting template, the controlled virtual character is set as a close-up character, and the target object is set as a distant character.

9. The adjustment method according to claim 1, characterized in that: The target object is a non-player virtual character.

10. A device for adjusting shooting parameters of a virtual camera, characterized in that: A graphical user interface is provided through a terminal device, wherein the graphical user interface displays a game screen formed by shooting a game scene through a virtual camera at a specified game perspective, wherein the game scene includes a controlled virtual character, and the device includes: A first determining unit is configured to determine, in response to the controlled virtual character triggering a designated plot event in the game scene, a triggered target plot and a target object in the target plot that performs plot interaction with the controlled virtual character, wherein the target plot is correspondingly configured with a two-dimensional over-the-shoulder shooting template, and the two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot the plot scene corresponding to the target plot from an over-the-shoulder perspective; A second determining unit is configured to determine a first vector and a second vector in the plot scene in response to a target screen effect for the plot scene, wherein the first vector is determined based on positions of a first target part of the controlled virtual character and a second target part of the target object in the plot scene, and the second vector is determined based on positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in a viewing cone of the virtual camera; a calculation unit, configured to calculate, according to the first vector and the second vector, a transformation matrix when the second vector is transformed into the first vector; a third determining unit, configured to determine an angle between the third vector and the lens tilt vector according to a third vector generated when the lens tilt vector set in the two-dimensional over-the-shoulder shooting template is projected onto a normal plane corresponding to the first vector and the lens tilt vector, so as to use the angle as a first rotation matrix; An adjustment unit is used to adjust the shooting position, the lens tilt vector and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template according to the transformation matrix and the first rotation matrix, so that the virtual camera presents the target picture effect when shooting the plot scene corresponding to the target plot according to the adjusted two-dimensional over-the-shoulder shooting template.

11. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for adjusting the shooting parameters of a virtual camera as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for adjusting the shooting parameters of a virtual camera as claimed in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Virtual world picture display method and device, equipment and medium

    CN110755845A

  • Display method and device and storage medium

    CN114053701A

  • Virtual scene display method and device, readable storage medium and electronic equipment

    CN114917582A

  • Game system, server device, program, and game providing method

    JP2024058072A