A method and apparatus for adjusting virtual camera shooting parameters, an electronic device, and a storage medium

By calculating transformation and rotation matrices to adjust the shooting parameters of the virtual camera, the problem that the 2D over-the-shoulder shooting template could not adapt to the actual height difference was solved, thus improving the display effect and immersion of the game screen.

CN119548816BActive Publication Date: 2025-10-17NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, the two-dimensional over-the-shoulder shooting template of virtual cameras cannot adapt to the actual height difference and position of virtual characters and target objects, resulting in poor display effects of game screens.

Method used

By calculating the transformation and rotation matrices, the shooting position, lens tilt, and shooting direction of the virtual camera are adjusted to compensate for the actual position and height difference between the virtual character and the target object, so as to adapt to the current game scene.

Benefits of technology

The improved game visuals allow the virtual camera to capture images in a way that matches the visual effects of the 2D over-the-shoulder shooting template, enhancing the game's immersion and interactive experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119548816B_ABST
    Figure CN119548816B_ABST
Patent Text Reader

Abstract

The application provides a virtual camera shooting parameter adjustment method and device, electronic equipment and a storage medium. In the application, a two-dimensional over-the-shoulder shooting template is reused. On the basis of the two-dimensional over-the-shoulder shooting template, the shooting position, the lens tilt angle vector and the shooting direction vector of the virtual camera set in the two-dimensional over-the-shoulder shooting template are adjusted. The shooting position, the lens tilt angle and the shooting direction of the adjusted virtual camera can adapt to the height difference and the position of the current controlled virtual character and the target object, so that the picture effect of the picture taken by the adjusted over-the-shoulder shooting mode is the same as the picture effect set by the two-dimensional over-the-shoulder shooting template, and therefore 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 technical field of computer, in particular to a virtual camera shooting parameter adjustment method and device, electronic equipment and storage medium. BACKGROUND

[0002] In a 3D game, a virtual character will play a game plot after triggering a plot event. In order to make the game plot more rich and improve the experience of plot watching, the virtual camera generally adopts a shooting method of over-the-shoulder view angle. In the prior art, a designer designs many sets of two-dimensional over-the-shoulder shooting templates. The two-dimensional over-the-shoulder shooting template can only show a two-dimensional plane to the designer, and cannot show a three-dimensional display effect to the designer. The designer configures different two-dimensional over-the-shoulder shooting templates for different game plots according to the display effect of the two-dimensional plane, so that the virtual character uses the corresponding two-dimensional over-the-shoulder shooting template to shoot when triggering the game plot. When using the two-dimensional over-the-shoulder shooting template to shoot, the shooting direction, the shooting angle and the shooting position of the virtual camera are fixed. However, in the actual game, the height difference and the relative position of the virtual character and the target object triggering the game plot are not fixed. Therefore, when using the two-dimensional over-the-shoulder shooting template to shoot, it cannot perfectly adapt to the current game scene, resulting in that the displayed picture cannot 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 completely displayed in the game picture, resulting in poor display effect of the game picture. SUMMARY

[0003] Therefore, the present application provides a virtual camera shooting parameter adjustment method, device, electronic equipment and storage medium to improve the display effect of the game picture.

[0004] In a first aspect, the present application provides a virtual camera shooting parameter adjustment method. A terminal device provides a graphical user interface. The graphical user interface displays a game picture formed by a virtual camera shooting a game scene at a specified game view angle. The game scene includes a controlled virtual character. The method includes the following steps.

[0005] In response to the controlled virtual character triggering a specified plot event in the game scene, a target plot triggered and a target object interacting with the controlled virtual character in the target plot are determined. The target plot is configured with a two-dimensional over-the-shoulder shooting template. The two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot a plot scene corresponding to the target plot at an over-the-shoulder view angle.

[0006] determine a first vector and a second vector in the scenario scene in response to a target picture effect for the scenario scene, wherein the first vector is determined based on a first target part of the controlled virtual character and a second target part of the target object in the scenario scene, and the second vector is determined based on the first target part and the second target part in the view frustum of the virtual camera in the two-dimensional over-the-shoulder shooting template;

[0007] calculate a conversion matrix when the second vector is converted into the first vector according to the first vector and the second vector;

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

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

[0010] In a second aspect, an embodiment of the present application provides a virtual camera shooting parameter adjustment device, which provides a graphical user interface through a terminal device, and the graphical user interface displays a game picture formed by shooting a game scene at a specified game perspective through a virtual camera, wherein the game scene includes a controlled virtual character, and the device includes:

[0011] a first determination unit configured to determine a target scenario triggered by the controlled virtual character in the game scene and a target object in the target scenario for scenario interaction with the controlled virtual character in response to a specified scenario event triggered by the controlled virtual character in the game scene, wherein the target scenario is 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 a scenario scene corresponding to the target scenario at an over-the-shoulder perspective;

[0012] a second determination unit configured to determine a first vector and a second vector in the scenario scene in response to a target picture effect for the scenario scene, wherein the first vector is determined based on a first target part of the controlled virtual character and a second target part of the target object in the scenario scene, and the second vector is determined based on the first target part and the second target part in the view frustum of the virtual camera in the two-dimensional over-the-shoulder shooting template;

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

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

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

[0016] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a storage medium and a bus, the storage medium stores machine readable instructions executable by the processor, when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine readable instructions to perform the steps of the virtual camera shooting parameter adjustment method according to any one of the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program performs the steps of the virtual camera shooting parameter adjustment method according to any one of the first aspect when the computer program is run by a processor.

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

[0019] In the present application, a two-dimensional over-the-shoulder shooting template is reused, and after a controlled virtual character triggers a plot event, a two-dimensional over-the-shoulder shooting template configured for the triggered target plot is determined, and a target object that interacts with the controlled virtual character in the target plot is determined, then a 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 of the positions of the first target part and the second target part set in the two-dimensional over-the-shoulder shooting template in the viewing volume of the virtual camera to 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 angle between the third vector generated when the lens tilt angle 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 angle vector, then the shooting position of the virtual camera, the lens tilt angle vector and the shooting direction vector set in the two-dimensional over-the-shoulder shooting template are adjusted on the basis of the two-dimensional over-the-shoulder shooting template according to the conversion matrix and the determined angle, the above adjustment method is a compensation adjustment according to the actual positions and height difference of the first target part and the second target part on the basis of the two-dimensional over-the-shoulder shooting template, when the first target part and the second target part are both head, the compensation adjustment according to the positions and height difference of the controlled virtual character and the target object is made, so that the shooting position, the lens tilt angle and the shooting direction of the adjusted virtual camera can adapt to the height difference and the positions of the controlled virtual character and the target object, and then the picture effect shot by the adjusted over-the-shoulder shooting method is the same as the picture effect set by the two-dimensional over-the-shoulder shooting template, so as to improve the display effect of the game picture.

[0020] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0022] Figure 1 A flowchart of a virtual camera shooting parameter adjustment method provided by an embodiment of the present application;

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

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

[0025] Figure 4 A flowchart of another method for adjusting a virtual camera shooting parameter provided by an embodiment of the present application is shown in FIG. 6.

[0026] Figure 5 A structural diagram of a device for adjusting a virtual camera shooting parameter provided by an embodiment of the present application is shown in FIG. 7.

[0027] Figure 6 A structural diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 8. DETAILED DESCRIPTION

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will be a clear and complete description of the technical solutions in the embodiments of the present application with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents 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 creative work fall within the scope of the present application.

[0029] It should be noted in advance that the two-dimensional over-the-shoulder shooting template is a template information in which the positions and orientations of characters and shots are determined in advance by a designer in electronic game production, which can be conveniently applied to conventional game plot production to quickly generate shot positions for character dialog and realize over-the-shoulder shooting (also called over-the-shoulder shooting).

[0030] Over-the-shoulder shooting refers to a shooting method in which a virtual camera is aimed at the shoulder position of a virtual character to shoot the virtual character (also called a controlled virtual character) and a target object. This shooting method can make the player better feel the perspective and scene when having a dialog with the target object, can increase the realism of the communication between the virtual character and the target object, and can make the player more easily immersed in the game plot and better understand and experience the dialog interaction in the game.

[0031] The two-dimensional over-the-shoulder shooting template is provided with shooting parameters, and the two-dimensional over-the-shoulder shooting template can display a two-dimensional picture effect for the designer, the two-dimensional picture including the distance between the virtual character and the target object and the positions of the virtual character and the target object in the picture, i.e., the distance from the edge of the picture. The shooting parameters can determine the shooting direction, shooting position, and lens tilt angle of the virtual camera and other information.

[0032] The following is a detailed description of the technical solutions of the present application.

[0033] The following is a detailed description of the technical solutions of the present application.Figure 1 A flowchart of an adjustment method of a virtual camera shooting parameter provided for an embodiment of the present application is shown in the figure. A graphical user interface is provided by a terminal device, and a game picture formed by a virtual camera shooting a game scene at a specified game perspective is displayed in the graphical user interface. The game scene includes a controlled virtual character, as shown in the figure. The method includes the following steps: Figure 1

[0034] Step 101, in response to the controlled virtual character triggering a specified plot event in the game scene, determining a target plot triggered and a target object in the target plot for plot interaction with the controlled virtual character, wherein the target plot is 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 a plot scene corresponding to the target plot at an over-the-shoulder perspective.

[0035] Step 102, in response to a target picture effect of the plot scene, determining a first vector and a second vector in the plot scene, wherein the first vector is determined based on 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 the first target part and the second target part in the virtual camera's view volume in the two-dimensional over-the-shoulder shooting template.

[0036] Step 103, according to the first vector and the second vector, calculating a conversion matrix when the second vector is converted into the first vector.

[0037] Step 104, according to a third vector generated when a lens tilt angle 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 angle vector, determining an included angle between the third vector and the lens tilt angle vector, and taking the included angle as a first rotation matrix.

[0038] Step 105, according to the conversion matrix and the first rotation matrix, adjusting a shooting position of the virtual camera, the lens tilt angle vector and a shooting direction vector set in the two-dimensional over-the-shoulder shooting template, 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 make the controlled virtual character execute corresponding game instructions. The game scene includes many virtual characters or objects (i.e., target objects) that can trigger a plot event, such as: NPC (non-player character) in the game, buildings, stones, vegetation, and even two virtual characters controlled by players. When the player controls the controlled virtual character to approach or click the target object, the corresponding plot event is triggered, thereby triggering the corresponding plot, and the designer pre-configures a corresponding two-dimensional over-the-shoulder shooting template for different plots. After the plot is triggered, the two-dimensional over-the-shoulder shooting template configured for the corresponding plot (i.e., target plot) is called to obtain the basic parameters of the two-dimensional over-the-shoulder shooting template. Since the relative positions of the first target part (for example, the head) of the controlled virtual character and the second target part (such as the head) of the target object, and the height difference of the first target part of the controlled virtual character and the second target part of the target object may be different from the relative positions of the first target part of the controlled virtual character and the second target part of the target object and the height difference set in the two-dimensional over-the-shoulder shooting template, if the over-the-shoulder shooting is performed according to the parameters set in the two-dimensional over-the-shoulder shooting template, the picture effect obtained cannot reach the target picture effect set by the two-dimensional over-the-shoulder shooting template for the plot scene.

[0040] The relative positions of the first target part of the controlled virtual character and the second target part of the target object, and the height difference of the first target part of the controlled virtual character and the second target part of the target object may be different from the relative positions of the first target part of the controlled virtual character and the second target part of the target object and the height difference set in the two-dimensional over-the-shoulder shooting template. If the difference is compensated on the basis of the parameters set in the two-dimensional over-the-shoulder shooting template, the over-the-shoulder shooting is performed by using the compensated parameters, and the picture effect obtained at this time can reach the picture effect set by the two-dimensional over-the-shoulder shooting template for the plot scene. Therefore, it is necessary to determine a first vector formed by the positions of the first target part and the second target part of the controlled virtual character in the plot scene, and a 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 viewing volume of the virtual camera, then convert the second vector into the first vector, and determine the translation matrix, rotation matrix and scaling matrix occurring in the conversion process, so as to obtain a conversion matrix according to the above three matrices.

[0041] If the compensation is made by only the conversion matrix based on the parameters of the two-dimensional over-shoulder shooting template, when the shooting position of the virtual camera is adjusted by the compensated parameters, the lens tilt angle of the virtual camera set in the two-dimensional over-shoulder shooting template needs to be compensated because the lens tilt angle of the virtual camera after the compensation is deflected (caused by the rotation matrix) relative to the lens tilt angle set in the two-dimensional over-shoulder shooting template. At this time, the included angle between the third vector generated when the lens tilt angle vector set in the two-dimensional over-shoulder shooting template is projected onto the normal plane corresponding to the first vector pair and the lens tilt angle vector is determined as the first rotation matrix.

[0042] After the first rotation matrix and the conversion matrix are obtained, the shooting position, the lens tilt angle vector and the shooting direction vector of the virtual camera set in the two-dimensional over-shoulder shooting template are adjusted by the first rotation matrix and the conversion matrix. The shooting position and the shooting direction of the virtual camera after the adjustment are proportionally adjusted with the shooting position and the shooting direction of the virtual camera set in the two-dimensional over-shoulder shooting template, and the shooting direction is also adjusted according to the relative position and the height difference of the first target part and the second target part. Therefore, when the virtual camera shoots the scene corresponding to the target plot according to the adjusted two-dimensional over-shoulder shooting template, the picture effect is the same as the picture effect set in the two-dimensional over-shoulder shooting template. Therefore, the above method is helpful to improve the display effect of the game picture.

[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 an arm, and the second target part can be a head. Alternatively, the first target part can be a head, and the second target part can be an arm. Alternatively, the first target part can be a shoulder, and the second target part can be a leg. The specific part can be set according to the actual scene and requirements, which is not limited here.

[0044] When the virtual camera shoots, the shooting space is a cone shape, and the space area is a view cone.

[0045] In a feasible embodiment, Figure 2 A schematic diagram of over-shoulder shooting provided for the embodiment of the application, Figure 2 The dotted arrow in indicates the shooting direction of the virtual camera, Figure 2 The virtual camera in shoots the shoulder of the controlled virtual character, Figure 3 A schematic diagram of the position set in the two-dimensional over-shoulder shooting template provided for the embodiment of the application, Figure 3 In the two-dimensional over-shoulder shooting template, 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, as shown in Figure 2 and Figure 3As shown, the first position of the first target part in the visual cone, the second position of the second target part in the visual cone, the third position of the virtual camera in the plot scene, the fourth position for indicating the shooting direction of the virtual camera and the fifth position for indicating the vertical direction of the shooting picture of the virtual camera are set in the two-dimensional over-the-shoulder shooting template, and 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 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 a feasible implementation, Figure 4 Another flowchart of the adjustment method of the virtual camera shooting parameter provided by the embodiment is shown in the figure. Figure 4 As shown in step 105, the following steps can be implemented:

[0047] Step 401, multiply 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, adjust the lens tilt vector according to the second rotation matrix and taking 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 conversion matrix, but the lens tilt of the adjusted virtual camera is deviated from the lens tilt of the target picture effect, so the second rotation matrix obtained by multiplying the rotation matrix in the conversion matrix and the first rotation matrix is needed to adjust the lens tilt, so that the adjusted shooting position, lens tilt vector and shooting direction are the same as the target picture effect.

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

[0052] In a feasible implementation, the first target part and the second target part are the same part.

[0053] Specifically, setting the first target part and the second target part as the same part can make the picture effect look relatively uniform, so that the game picture is more attractive.

[0054] In an implementable embodiment, the first target part and the second target part are both the head.

[0055] Specifically, when the first target part and the second target part are both the head and the shooting is performed in the over-the-shoulder view, a more natural and immersive observation experience can be provided for the player, the player can better feel the view and the scene when the player has a dialogue with the NPC, and the authenticity of the communication between the characters can be increased, so that the player is more likely to be immersed in the game plot and better understand and experience the dialogue interaction in the game.

[0056] In an implementable embodiment, the specified game view includes a first game view or a third game view.

[0057] Specifically, the virtual camera shoots in the first game view or the third game view when following the controlled virtual character to shoot, and after the shooting direction, the shooting position and the lens tilt angle of the virtual camera are determined on the basis of the two-dimensional over-the-shoulder shooting template, the virtual camera shoots the triggered scenario scene corresponding to the triggered scenario event in the over-the-shoulder shooting manner, that is, different scenes are shot by changing the shooting view.

[0058] In an implementable embodiment, the controlled virtual character is set as a close-up character and the target object is set as a long shot character in the two-dimensional over-the-shoulder shooting template.

[0059] Specifically, the controlled virtual character is set as a close-up character and the target object is set as a long shot character in the two-dimensional over-the-shoulder shooting template, and after the shooting direction, the shooting position and the lens tilt angle of the virtual camera are determined on the basis of the two-dimensional over-the-shoulder shooting template, the controlled virtual character is shot as a close-up character and the target object is shot as a long shot character, that is, the virtual camera shoots over the shoulder of the controlled virtual character when performing over-the-shoulder shooting, so that the player can better feel the view and the scene when the player has a dialogue with the target object, and the game experience of the player can be improved.

[0060] In an implementable embodiment, the target object is a non-player virtual character (i.e., an NPC in the game scene).

[0061] It should be noted that the target object can also be other virtual objects, such as a virtual prop in the scene, and the target object can be set according to the type of virtual object that can trigger a scenario event in the game, and the specific target object is not limited here.

[0062] Figure 5 A structural diagram of an adjustment device for virtual camera shooting parameters is provided for an embodiment of the present application. A graphical user interface is provided through a terminal device. A game picture formed by a virtual camera shooting a game scene at a specified game perspective is displayed in the graphical user interface. The game scene includes a controlled virtual character, as shown in the figure. The device includes: Figure 5

[0063] A first determination unit 51 is configured to determine a target plot triggered by the controlled virtual character in the game scene and a target object in the target plot for plot interaction with the controlled virtual character in response to the controlled virtual character triggering a specified plot event in the game scene. The target plot is configured with a two-dimensional over-the-shoulder shooting template. The two-dimensional over-the-shoulder shooting template is used to control the virtual camera to shoot a plot scene corresponding to the target plot at an over-the-shoulder perspective.

[0064] A second determination unit 52 is configured to determine a first vector and a second vector in the plot scene in response to a target picture effect of the plot scene. The first vector is determined based on a first target part of the controlled virtual character and a second target part of the target object in the plot scene. The second vector is determined based on the first target part and the second target part in the virtual camera's view volume in the two-dimensional over-the-shoulder shooting template.

[0065] A calculation unit 53 is configured to calculate a conversion matrix when the second vector is converted to the first vector according to the first vector and the second vector.

[0066] A third determination unit 54 is configured to determine an included angle between a third vector and a lens tilt angle vector in the two-dimensional over-the-shoulder shooting template when the lens tilt angle vector is projected onto a normal plane corresponding to the first vector, and to take the included angle as a first rotation matrix.

[0067] An adjustment unit 55 is configured to adjust a shooting position of the virtual camera, the lens tilt angle vector, and a shooting direction vector in the two-dimensional over-the-shoulder shooting template according to the conversion 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 an implementation, the two-dimensional over-the-shoulder shooting template is configured with a first position of the first target part in the view frustum, a second position of the second target part in the view frustum, a third position of the virtual camera in the scenario, a fourth position for indicating a shooting direction of the virtual camera, and a fifth position for indicating a vertical direction of a shooting picture of the virtual camera, and 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 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 an implementation, the adjusting unit is configured to, when adjusting the shooting position of the virtual camera, the lens tilt vector, and the shooting direction vector in the two-dimensional over-the-shoulder shooting template according to the conversion matrix and the first rotation matrix, include:

[0071] performing a product calculation on a 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 a translation matrix and a scaling matrix in the conversion matrix;

[0073] adjusting the lens tilt vector with the first vector as an axis of rotation according to the second rotation matrix.

[0074] In an implementation, the device further includes:

[0075] a shooting unit configured to control the virtual camera to shoot the scenario using an over-the-shoulder view according to the adjusted shooting position, the lens tilt vector, and the shooting direction vector;

[0076] a display unit configured to display a picture of the scenario obtained through shooting on the graphical user interface.

[0077] In an implementation, the first target part and the second target part are the same part.

[0078] In an implementation, the first target part and the second target part are both head parts.

[0079] In an implementation, the specified game view includes a first game view or a third game view.

[0080] In a feasible implementation, the two-dimensional over-shoulder shooting template sets the controlled virtual character as a close-up character and sets the target object as a long shot character.

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

[0082] As to Figure 5 The principle explanation of the related content can refer to the related description of Figures 1-4 , which will not be described in detail here.

[0083] Figure 6 A structural schematic diagram of an electronic device provided in the embodiment of the present application, comprising: a processor 61, a storage medium 62 and a bus 63, the storage medium 62 stores machine readable instructions executable by the processor 61, when the electronic device runs the above-mentioned virtual camera shooting parameter adjustment method, the processor 61 and the storage medium 62 communicate through the bus 63, the processor 61 executes the machine readable instructions to execute Figure 1 the method steps of the related content shown.

[0084] As to the specific executed method steps and principles, refer to the description of Figures 1-4 , which will not be described in detail here.

[0085] The fourth embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is run by a processor to execute the above-mentioned virtual camera shooting parameter adjustment method steps.

[0086] As to the specific executed method steps and principles, refer to the description of Figures 1-4 , which will not be described 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 only schematic. For example, the division of the units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interface, device or unit, and can be electrical, mechanical or other forms.

[0088] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e. may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

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

[0090] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application can be embodied in the form of software product, and the computer software product is stored in a storage medium, including a plurality of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various media that can store program codes.

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

[0092] Finally, it should be pointed out that: the above described embodiments are only specific embodiments of the present application, used to illustrate the technical solutions of the present application, and not to limit it, the protection scope of the present application is not limited to this, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical scope disclosed by the present application, can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. All should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to 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 specified plot event in the game scene, determining a triggered target plot and a target object in the target plot that interacts 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; In response to a target visual 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 frustum of the virtual camera; Calculating a transformation matrix from the second vector to the first vector according to the first vector and the second vector; determining an angle between the third vector and the lens tilt vector, based on 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 using the lens tilt vector 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, wherein: 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 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, wherein: The adjusting, according to the conversion matrix and the first rotation matrix, 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 includes: Performing a 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, wherein: 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 images are displayed on the graphical user interface.

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

6. The adjustment method according to claim 5, wherein: The first target site and the second target site are both the head.

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

8. The adjustment method according to claim 1, wherein: 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, wherein: 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 apparatus includes: a first determining unit configured to determine, in response to the controlled virtual character triggering a specified 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 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, configured to determine, in response to a target visual effect for the plot scene, 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 frustum of the virtual camera; a calculation unit, configured to calculate, based on the first vector and the second vector, a conversion matrix when converting the second vector into the first vector; a third determining unit, configured to determine an angle between the lens tilt vector set in the two-dimensional over-the-shoulder shooting template and the third vector generated by projecting the lens tilt vector 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. When the electronic device is running, the processor and the storage medium communicate 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 according to any one of claims 1 to 9 are performed.

Citation Information

Patent Citations

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

    CN110755845A

  • Display method and device and storage medium

    CN114053701A