Camera parameter configuration method and device, computer equipment and storage medium

By setting camera walls in the two-dimensional virtual scene to limit the movement direction of the virtual camera and adjusting the camera parameters, the problem of poor visual effects of the virtual camera is solved, and a better visual experience and parameter configuration reliability are achieved.

CN120605501APending Publication Date: 2025-09-09TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410270150.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-08
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

In the existing technology, the virtual camera cannot effectively limit the movement direction in a two-dimensional virtual scene, resulting in poor visual effects. In particular, when the virtual character moves to the boundary of the scene, a blank area may be captured, affecting the user experience.

Method used

By setting a camera wall in the two-dimensional virtual scene, the movement direction of the virtual camera is restricted, and the position of the framing frame is adjusted according to the camera wall and camera parameters, thereby adjusting the camera parameters to ensure that the field of view is always within the two-dimensional virtual scene.

Benefits of technology

This effectively prevents the virtual camera's framing frame from exceeding the range of the two-dimensional virtual scene, improves visual effects, reduces the difficulty of camera parameter configuration, and improves the reliability and maintainability of parameter configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120605501A_ABST
    Figure CN120605501A_ABST
Patent Text Reader

Abstract

The invention provides a camera parameter configuration method and device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the steps of obtaining camera parameters of a virtual camera in a two-dimensional virtual scene based on an area where a virtual character is located in the two-dimensional virtual scene; under the condition that the moving process of the virtual camera is limited by any camera wall, determining the position of a view-finding frame of the virtual camera at the next moment based on the camera wall and the camera parameters; and adjusting the camera parameters based on the position of the view-finding frame of the virtual camera at the next moment. According to the technical scheme, the moving direction of the virtual camera can be limited through the camera wall, so that the camera parameters are adjusted, it is guaranteed that the visual field range of a user is always in the two-dimensional virtual scene, and the visual effect 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, apparatus, computer device, and storage medium for configuring camera parameters. Background Art

[0002] As terminal functionality diversifies, the variety of games available on these devices is increasing. Horizontal-scrolling games are a popular type of game, allowing users to control virtual characters within a two-dimensional virtual scene. A virtual camera within the two-dimensional virtual scene can capture the virtual character's actions within the scene and display them on the terminal screen. Configuring the virtual camera's parameters to optimally capture the virtual character's actions within the scene is a key research topic in this field.

[0003] Currently, the commonly used approach is for the virtual camera to follow the movement of the avatar. Specifically, the virtual camera's displacement parameters are adjusted based on the avatar's displacement within the two-dimensional virtual scene, following the movement relationship between the virtual camera and the avatar. This movement relationship indicates the correspondence between the avatar's movement data (direction and distance) and the virtual camera's movement data.

[0004] However, the aforementioned technical solution cannot restrict camera movement in certain directions, which may result in poor visual effects at certain locations. For example, if the user continuously controls the avatar to move leftward, when the avatar reaches the left edge of the 2D virtual scene, the virtual camera will likely capture scenes further left of the left edge, as it typically captures the avatar. This means that the virtual camera's capture range exceeds the 2D virtual scene, while the area outside the 2D virtual scene is blank, resulting in poor visual effects. Summary of the Invention

[0005] The embodiments of the present application provide a method, apparatus, computer device, and storage medium for configuring camera parameters. By using a camera wall, the movement direction of a virtual camera can be restricted, thereby adjusting the camera parameters and ensuring that the user's field of view is always within the two-dimensional virtual scene, thereby improving the visual effect. The technical solution is as follows:

[0006] In one aspect, a method for configuring camera parameters is provided, the method comprising:

[0007] Obtaining, based on an area where the virtual character is located in a two-dimensional virtual scene, camera parameters of a virtual camera in the two-dimensional virtual scene, where the camera parameters are camera parameters of the virtual camera at a current moment, and where at least one camera wall exists in the two-dimensional virtual scene, and the camera wall is used to limit a movement direction of the virtual camera;

[0008] In the event that the movement of the virtual camera is restricted by any camera wall, determining, based on the camera wall and the camera parameters, a position of a framing frame of the virtual camera at a next moment, the framing frame being used to indicate a field of view of the virtual camera in the two-dimensional virtual scene;

[0009] The camera parameters are adjusted based on the position of the framing frame of the virtual camera at the next moment.

[0010] In another aspect, a device for configuring camera parameters is provided, the device comprising:

[0011] an acquisition module, configured to acquire camera parameters of a virtual camera in a two-dimensional virtual scene based on an area where the virtual character is located in the two-dimensional virtual scene, wherein the camera parameters are the camera parameters of the virtual camera at a current moment, and wherein at least one camera wall exists in the two-dimensional virtual scene, and the camera wall is used to limit the movement direction of the virtual camera;

[0012] a determination module, configured to determine, when the movement of the virtual camera is restricted by any camera wall, a position of a framing frame of the virtual camera at a next moment based on the camera wall and the camera parameters, the framing frame being used to indicate a field of view of the virtual camera in the two-dimensional virtual scene;

[0013] The adjustment module is used to adjust the camera parameters based on the position of the framing frame of the virtual camera at the next moment.

[0014] In some embodiments, the acquisition module is used to obtain a camera parameter instance corresponding to the area in response to the virtual character entering the area, the two-dimensional virtual scene includes multiple areas, the area is any area of ​​the multiple areas, and the camera parameter instance is used to indicate the initial camera parameters of the virtual camera when the virtual character is in the area.

[0015] In some embodiments, the determining module includes:

[0016] an acquiring unit, configured to acquire, for any camera wall in the two-dimensional virtual scene, attribute information of the camera wall when a framing frame of the virtual camera collides with the camera wall, wherein the collision of the framing frame of the virtual camera with the camera wall indicates that the virtual camera is restricted by the camera wall, and the attribute information indicates a restriction condition on the virtual camera;

[0017] A determining unit is used to determine the position of the framing frame of the virtual camera at a next moment based on the attribute information of the camera wall and the camera parameters.

[0018] In some embodiments, the determination unit is used to obtain the blocking direction of the camera wall based on the attribute information of the camera wall, and the blocking direction is used to indicate the direction in which the virtual camera cannot move; based on the camera parameters and the blocking direction, determine the position of the framing frame of the virtual camera at the next moment.

[0019] In some embodiments, the camera wall is a one-way wall, and the framing frame of the virtual camera can pass through the camera wall in the opposite direction of the blocking direction;

[0020] The determining module is further configured to determine, when the frame of the virtual camera does not pass through the camera wall, a position of the frame of the virtual camera at a next moment based on the camera parameters and the movement of a follow target, where the follow target refers to a target that the virtual camera follows;

[0021] The determination module is further configured to determine, when the framing frame of the virtual camera passes through the camera wall, a position of the framing frame of the virtual camera at a next moment based on the camera parameters and the blocking direction.

[0022] In some embodiments, the determination module is used to determine the position of the framing frame of the virtual camera at the next moment based on the camera parameters and the movement of the follow target, if the framing frame of the virtual camera does not pass through the camera wall and the attribute information of the camera wall does not include a thrust direction. The thrust direction is used to indicate that the camera wall pushes the framing frame of the virtual camera to move along the thrust direction, and the thrust direction of the camera wall is opposite to the blocking direction of the camera wall.

[0023] In some embodiments, the determination module is used to determine the position of the framing frame of the virtual camera at the next moment based on the thrust direction and the camera parameters, if the framing frame of the virtual camera does not pass through the camera wall and the attribute information of the camera wall includes the thrust direction.

[0024] In some embodiments, the apparatus further comprises:

[0025] The determination module is further configured to, in response to a movement operation on the virtual character, determine the focus position of the virtual camera at the next moment based on the camera parameters and the position indicated by the movement operation, when the virtual camera is not restricted by any camera wall during its movement; determine the position and rotation information of the virtual camera at the next moment based on the focus position and the camera parameters, the rotation information being used to indicate the rotation angle of the virtual camera; and determine the position of the framing frame of the virtual camera at the next moment based on the position of the virtual camera at the next moment and the rotation information.

[0026] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the camera parameter configuration method in the embodiment of the present application.

[0027] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the camera parameter configuration method in the embodiment of the present application.

[0028] On the other hand, a computer program product is provided, including a computer program stored in a computer-readable storage medium. The computer program is read from the computer-readable storage medium by a processor of a computer device, and the processor executes the computer program, causing the computer device to perform the camera parameter configuration method provided in the above-mentioned various aspects or various optional implementations of various aspects.

[0029] Embodiments of the present application provide a method for configuring camera parameters. Corresponding camera parameters are configured for each area in a two-dimensional virtual scene. When a virtual character enters any area, the camera parameters corresponding to that area are obtained as the current camera parameters of the virtual camera. This method does not need to consider parameter changes in the virtual camera's historical movement trajectory; only the area where the character is currently located needs to be considered. Even if the camera parameters corresponding to a certain area have problems and need to be modified, the camera parameters corresponding to other areas do not need to be changed. This reduces the difficulty of configuring the camera parameters, improves the reliability of parameter configuration, and facilitates finding and modifying problematic camera parameters. Furthermore, a camera wall can exist in the two-dimensional virtual scene. The camera wall can be used to limit the movement direction of the virtual camera, thereby adjusting the camera parameters. This can prevent the framing frame of the virtual camera from exceeding the range of the two-dimensional virtual scene during movement, resulting in poor visual effects. This ensures that the user's field of view remains within the two-dimensional virtual scene, improving the visual effect. Since the controlled virtual character generally does not leave the user's field of view, limiting the movement direction of the virtual camera by the camera wall, thereby limiting the user's field of view, can, to a certain extent, guide the behavior of the virtual character and prevent the virtual character from leaving the two-dimensional virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0031] Figure 1 1 is a schematic diagram of an implementation environment of a camera parameter configuration method provided in an embodiment of the present application;

[0032] Figure 2 is a flowchart of a method for configuring camera parameters provided in an embodiment of the present application;

[0033] Figure 3 is a flowchart of another camera parameter configuration method provided according to an embodiment of the present application;

[0034] Figure 4 is a schematic diagram of a camera wall provided according to an embodiment of the present application;

[0035] Figure 5 is a schematic diagram of a camera wall blocking the movement of an object according to an embodiment of the present application;

[0036] Figure 6 is a schematic diagram of a wall direction provided according to an embodiment of the present application;

[0037] Figure 7 This is a schematic diagram of a framing frame passing through a camera wall according to an embodiment of the present application;

[0038] Figure 8 is a schematic diagram of a camera wall pushing a blocking object to move according to an embodiment of the present application;

[0039] Figure 9 This is a schematic diagram of a camera wall driving a framing frame to move according to an embodiment of the present application;

[0040] Figure 10 This is a schematic diagram of a camera wall driving a framing frame to move according to an embodiment of the present application;

[0041] Figure 11 is a schematic diagram of a configuration interface provided according to an embodiment of the present application;

[0042] Figure 12 is a flowchart of another camera parameter configuration method provided according to an embodiment of the present application;

[0043] Figure 13 is a block diagram of a camera parameter configuration device provided according to an embodiment of the present application;

[0044] Figure 14 This is a structural block diagram of a terminal provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0046] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on the quantity and execution order.

[0047] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more.

[0048] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the operations and parameters involved in this application are obtained with full authorization.

[0049] For ease of understanding, the terms involved in this application are explained below.

[0050] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0051] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0052] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, digital twins, virtual humans, robots, artificial intelligence generated content (AIGC), conversational interaction, smart medical care, smart customer service, game AI, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role. The camera parameter configuration method provided in the embodiment of the present application can be applied to the field of game AI.

[0053] Virtual scene: refers to the virtual scene displayed (or provided) when the application is running on the terminal. This virtual scene can be a simulation of the real world, a virtual scene that is semi-simulated and semi-fictional, or a purely fictional virtual scene. The virtual scene can be a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. For example, the virtual scene may include the sky, land, ocean, etc. The land may include environmental elements such as deserts and cities. Users can control the movement of virtual characters in the virtual scene.

[0054] A virtual character refers to an movable object in a virtual world. The movable object can be at least one of a virtual person, a virtual animal, and an animated character. In some embodiments, when the virtual world is a three-dimensional virtual world, the virtual character is a three-dimensional model. Each virtual character has its own shape and volume in the three-dimensional virtual world and occupies a portion of the space in the three-dimensional virtual world. In some embodiments, the virtual character is a three-dimensional character constructed based on three-dimensional human skeleton technology, and the virtual character achieves different external appearances by wearing different skins. In some embodiments, the virtual character can be implemented using a 2.5-dimensional or 2-dimensional model, which is not limited in the embodiments of the present application.

[0055] A side-scrolling game is a game in which the character's movement path is controlled on a horizontal screen, and the character's movement in the virtual scene is limited to left-to-right or right-to-left. In all or most of the virtual scene screens in a side-scrolling game, the character's movement path is horizontal. Based on content, side-scrolling games are categorized into side-scrolling level-pushing, side-scrolling adventure, side-scrolling competitive, and side-scrolling strategy games. Based on technology, side-scrolling games are categorized into two-dimensional side-scrolling games and three-dimensional side-scrolling games. The camera parameter configuration method provided in the embodiments of this application can be applied to two-dimensional side-scrolling games.

[0056] Virtual Camera: Specifically refers to the concept of Camera in game engines. The game engine can use parameters such as the position and rotation angle of the virtual camera to obtain the screen image through a series of geometric operations.

[0057] Framing frame: This refers to the cross-section of the virtual camera's viewing cone on the two-dimensional plane representing the two-dimensional virtual scene. This cross-section can be a rectangle approximately the size of the terminal screen. The framing frame indicates the virtual camera's field of view within the two-dimensional virtual scene. In other words, the virtual scene presented within the framing frame is the virtual scene captured by the virtual camera, and is also the virtual scene seen by the user. The framing frame is also called the camera border.

[0058] Camera Config Data: refers to a series of parameters related to the virtual camera that are pre-set by the game designer in the virtual scene of the game level during the game development process.

[0059] Camera Switch Trigger: A specific trigger configured by the game designer within a game level. When the character in the game enters the scene indicated by the Camera Switch Trigger, the virtual camera's parameters will change to the camera parameters corresponding to the Camera Switch Trigger.

[0060] Camera Constraint: A line segment or rectangle (a collection of line segments) that game designers place in a game level. A camera constraint restricts the movement of the virtual camera in certain directions.

[0061] Camera Toggle Trigger: A specific trigger configured by the game designer within a game level. When the in-game character enters the scene indicated by the Camera Toggle Trigger, the Camera Parameter Triggers, Camera Walls, and other Camera Toggle Triggers associated with that Camera Toggle Trigger will be turned on or off.

[0062] Field of view (FOV): refers to the field of view of the virtual scene seen by the human eye (display).

[0063] Air Wall: refers to the rectangular collision box at the frame of the virtual camera, which prevents the virtual character from moving out of the field of view of the virtual camera.

[0064] Chunk: This refers to an area of ​​the level that's roughly the size of the virtual camera's field of view. After the avatar enters the Chunk for the first time, they can't leave until they complete their mission. For example, they can only leave the Chunk if they defeat a designated enemy within it.

[0065] The camera parameter configuration method provided in the embodiment of the present application can be executed by a computer device. In some embodiments, the computer device is a terminal or a server. The following first takes the computer device as an example to introduce the implementation environment of the camera parameter configuration method provided in the embodiment of the present application. Figure 1 Schematic diagram of an implementation environment of a camera parameter configuration method provided in accordance with an embodiment of the present application. Figure 1 The implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.

[0066] In some embodiments, terminal 101 is a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, smart voice interaction device, smart home appliance, car terminal, etc., but is not limited to this. Terminal 101 installs and runs an application that supports virtual scenes. The application is any one of a horizontal action mobile game, a third-person shooter game, a virtual reality application, a three-dimensional map program, or a multiplayer gun battle survival game. Terminal 101 is a terminal used by a user, and a user account is logged in. The user uses terminal 101 to operate a virtual character in a virtual scene to perform activities, and the activities include but are not limited to: adjusting body posture, crawling, walking, running, riding, jumping, attacking, and releasing skills. Among them, the virtual character is a virtual character, such as a simulated character or an anime character.

[0067] It should be noted that the number of the above terminals can be more or less. For example, the above terminal is one, or the above terminals are dozens or hundreds, or more. The embodiment of the present application does not limit the number of terminals and device types.

[0068] In some embodiments, the server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 102 is used to provide background services for applications that support virtual scenes. In some embodiments, the server 102 undertakes the main computing work and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work and the terminal 101 undertakes the main computing work; or, the server 102 and the terminal 101 adopt a distributed computing architecture for collaborative computing.

[0069] Figure 2 This is a flowchart of a method for configuring camera parameters according to an embodiment of the present application. Figure 2 In the embodiment of the present application, the configuration method of the camera parameters is described as follows:

[0070] 201. The terminal obtains camera parameters of a virtual camera in the two-dimensional virtual scene based on the area where the virtual character is located in the two-dimensional virtual scene. The camera parameters are the camera parameters of the virtual camera at the current moment. There is at least one camera wall in the two-dimensional virtual scene, and the camera wall is used to limit the movement direction of the virtual camera.

[0071] In the embodiment of the present application, the virtual character refers to an object controlled by the user. The user can control the virtual character to move in a two-dimensional virtual scene. There is a virtual camera in the two-dimensional virtual scene. The virtual camera can shoot the two-dimensional virtual scene. Then, the terminal can present the two-dimensional virtual scene shot by the virtual camera on the screen so that the user can see the objects in the two-dimensional virtual scene. As the virtual character moves, the virtual camera in the two-dimensional virtual scene will also move with the movement of the virtual character. That is, the camera parameters of the virtual camera change with the different positions of the virtual character in the two-dimensional virtual scene. The terminal obtains the camera parameters of the virtual camera based on the area where the virtual character is located in the two-dimensional virtual scene. The embodiment of the present application does not limit the specific content of the camera parameters.

[0072] A two-dimensional virtual scene may contain at least one camera wall. The present embodiment does not restrict the location or number of camera walls. Camera walls can restrict the movement of a virtual camera. When a virtual camera moves within a two-dimensional virtual scene, it may encounter any camera wall. This camera wall restricts the movement of the virtual camera, preventing it from moving in certain directions.

[0073] 202. When the movement of the virtual camera is restricted by any camera wall, the terminal determines the position of the virtual camera's framing frame at the next moment based on the camera wall and camera parameters. The framing frame is used to indicate the field of view of the virtual camera in the two-dimensional virtual scene.

[0074] In the embodiment of the present application, as the virtual camera moves, the position of the virtual camera's framing frame also changes accordingly. The two-dimensional virtual scene captured by the virtual camera's framing frame is the virtual scene presented to the user by the terminal. In other words, the virtual camera's field of view changes as it moves. During the movement of the virtual camera, if the virtual camera is restricted by any camera wall, the terminal calculates the position of the virtual camera's framing frame at the next moment based on the attribute information of the camera wall and the camera parameters. The attribute information of the camera wall is used to indicate the blocking direction of the camera wall.

[0075] 203. The terminal adjusts camera parameters based on the position of the framing frame of the virtual camera at the next moment.

[0076] In this embodiment of the present application, the framing frame of the virtual camera at the next moment reflects the range of the two-dimensional virtual scene to be captured by the virtual camera at the next moment. The terminal adjusts the camera parameters of the virtual camera based on the position of the framing frame of the virtual camera at the next moment. The terminal then captures the two-dimensional virtual scene based on the adjusted camera parameters and displays it on the screen, allowing the user to see the two-dimensional virtual scene at the next moment.

[0077] Embodiments of the present application provide a method for configuring camera parameters. Corresponding camera parameters are configured for each area in a two-dimensional virtual scene. When a virtual character enters any area, the camera parameters corresponding to that area are obtained as the current camera parameters of the virtual camera. This method does not need to consider parameter changes in the virtual camera's historical movement trajectory; only the area where the character is currently located needs to be considered. Even if the camera parameters corresponding to a certain area have problems and need to be modified, the camera parameters corresponding to other areas do not need to be changed. This reduces the difficulty of configuring the camera parameters, improves the reliability of parameter configuration, and facilitates finding and modifying problematic camera parameters. Furthermore, a camera wall can exist in the two-dimensional virtual scene. The camera wall can be used to limit the movement direction of the virtual camera, thereby adjusting the camera parameters. This can prevent the framing frame of the virtual camera from exceeding the range of the two-dimensional virtual scene during movement, resulting in poor visual effects. This ensures that the user's field of view remains within the two-dimensional virtual scene, improving the visual effect. Since the controlled virtual character generally does not leave the user's field of view, limiting the movement direction of the virtual camera by the camera wall, thereby limiting the user's field of view, can, to a certain extent, guide the behavior of the virtual character and prevent the virtual character from leaving the two-dimensional virtual scene.

[0078] Figure 3is a flowchart of another camera parameter configuration method provided in accordance with an embodiment of the present application, see Figure 3 In the embodiment of the present application, the configuration method of the camera parameters is described as follows:

[0079] 301. In response to the virtual character entering an area, the terminal obtains a camera parameter instance corresponding to the area. The two-dimensional virtual scene includes multiple areas, and the area is any area among the multiple areas. The camera parameter instance is used to indicate the initial camera parameters of the virtual camera when the virtual character is in the area. There is at least one camera wall in the two-dimensional virtual scene, and the camera wall is used to limit the movement direction of the virtual camera.

[0080] In an embodiment of the present application, a two-dimensional virtual scene includes multiple areas. An area may be an area where grass, a tower, or a suspension bridge are located in a two-dimensional virtual scene, and this embodiment of the present application is not limited thereto. The terminal may configure camera parameter instances for multiple areas in the two-dimensional virtual scene respectively. Each camera parameter instance contains all camera parameters corresponding to the area. The camera parameters corresponding to different areas are different. When a virtual character enters any area, the terminal obtains the camera parameter instance corresponding to the area. Based on the camera parameter instance, the terminal initializes the camera parameters of the virtual camera. That is, the terminal reads the camera parameters in the camera parameter instance as the initial camera parameters of the virtual camera when the virtual character is in the area. The camera parameters of the virtual camera may include any of the following items, and this embodiment of the present application is not limited thereto.

[0081] The first item is the horizontal deflection angle of the virtual camera. The horizontal deflection angle refers to the deflection angle of the virtual camera in the left and right directions.

[0082] The second item is the vertical deflection angle of the virtual camera. The vertical deflection angle refers to the deflection angle of the virtual camera in the up and down direction. The vertical deflection angle can also be called the pitch angle of the virtual camera.

[0083] The third item is the screen tilt angle of the virtual camera. The screen tilt angle refers to the rotation angle of the virtual camera around the center point of the terminal screen.

[0084] The fourth item is the field of view (FOV) of the virtual camera. The field of view refers to the range of the two-dimensional virtual scene presented on the terminal screen.

[0085] The fifth item is the offset of the virtual camera. The offset refers to the moving distance of the virtual camera relative to the follow target. The follow target can be a virtual character, a projection point of the virtual character on the moving line, or a fixed point, etc., and the embodiments of the present application are not limited to this. The virtual camera can move as the follow target moves. The moving line refers to the route of the virtual character's movement. The projection point of the virtual character on the moving line can be the projection point of the virtual character's position in a certain coordinate direction (for example, the x direction or the y direction). The fixed point can be a point on the virtual character, or a point on the virtual mouse, etc., and the embodiments of the present application are not limited to this. The vector of the offset is parallel to the screen of the terminal.

[0086] The sixth item is the distance between the virtual camera and the target. The closer the distance, the larger the virtual object captured by the virtual camera, which is equivalent to zooming in on the virtual object in the 2D virtual scene. The farther the distance, the smaller the virtual object captured by the virtual camera, which is equivalent to zooming out on the virtual object in the 2D virtual scene.

[0087] The seventh item is the smooth movement time of the virtual camera (in seconds). The smooth movement time refers to the time required for the virtual camera to move smoothly to the new position when the virtual camera follows the target for a certain amount of displacement.

[0088] Item 8: Virtual camera rotation smoothing time (seconds). The rotation smoothing time refers to the time required for the virtual camera to smoothly rotate to the final angle when the horizontal deflection angle, vertical deflection angle, or screen tilt angle changes.

[0089] Item 9: Smoothing time (seconds) for changes in the virtual camera's field of view. The smoothing time for changes in the field of view refers to the time required for the virtual camera's field of view to smoothly transition to the final value when the parameters of the virtual camera's field of view change.

[0090] The tenth item is the virtual camera's motion constraint method. There are two motion constraint methods: follow the virtual character's movement and follow the motion line. Following the motion line means following the projection point on the virtual character's motion line.

[0091] Item 11: Additional offset of the virtual camera. The additional offset refers to the offset of the virtual camera relative to the target being followed in the direction of the virtual character. For example, the additional offset is b. When the virtual character moves x to the right, the virtual camera should also move to the right accordingly, with the moving distance being X corresponding to x. If the direction of the virtual character after the movement is left, which is opposite to the direction of movement, the final moving distance of the virtual camera is Xb. That is, when the moving direction of the virtual character is opposite to the direction of movement, the terminal can deduct the additional offset based on the moving distance of the virtual camera.

[0092] Item 12: Prohibited directions for movement of the virtual camera. Prohibited directions refer to directions in which the virtual camera is prohibited from moving. Prohibited directions can be up, down, left, or right. The prohibited directions for movement of the virtual camera can be one or more directions, and this embodiment of the application does not limit this.

[0093] Item 13: Disabling the virtual camera's air wall. The air wall is a rectangular collision box surrounding the virtual camera's framing frame that prevents the avatar from moving outside the camera's field of view. The terminal can disable the functionality of any one or more of the top, bottom, left, and right sides of the air wall. When any side of the air wall is disabled, the avatar can temporarily move out of the camera's field of view from the corresponding side of the framing frame.

[0094] Item 14: The inward offset ratio of the camera air wall. This refers to the ratio by which each side of the camera air wall is offset from the center. The higher this ratio, the smaller the range of movement of the avatar within the framing frame (field of view).

[0095] Item 15: The virtual camera's target tracking mode. Target tracking modes include following the virtual character, following a fixed point, following a linear movement, and following the virtual character's x-coordinate. The target tracking mode determines the camera's base position.

[0096] Item 16: The death side of the virtual camera's framing frame. The death side of the framing frame refers to the side of the framing frame where the virtual character will die if it collides with it. The death side can be any of the top, bottom, left, or right sides of the framing frame.

[0097] Item 17, transformation rules for camera parameters. Transformation rules refer to how the camera parameters are configured when the virtual character moves between different areas. For example, multiple areas configured with camera parameter instances are discontinuous. When the virtual character leaves the first area where he is currently located and has not entered other areas, if the virtual character has passed through the second area before entering the first area, the terminal sets the camera parameters of the virtual camera to the camera parameters corresponding to the second area. That is, when the virtual character leaves a certain area, the camera parameters of the virtual camera are restored to the previous state (the camera parameters of the previous area).

[0098] When the virtual character moves in the area, the terminal adjusts the camera parameters of the virtual camera based on the camera parameter instance corresponding to the area and the movement of the virtual character in the area. There may be at least one camera wall in the area. The camera wall is in a hidden state. That is, the terminal does not display the camera wall to avoid the camera wall blocking the two-dimensional virtual scene. In order to describe the camera wall more clearly, the camera wall in the drawings of the embodiment of the present application is in a displayed state. But essentially, the user cannot see the camera wall. The camera wall can be stationary or moving, and the embodiment of the present application does not limit this. The camera wall can be a line segment or a square composed of multiple line segments. The embodiment of the present application does not limit the form of the camera wall. For example, Figure 4 Schematic diagram of a camera wall provided according to an embodiment of the present application. Figure 4 , Figure 4 401 in the figure is a camera wall in the form of a line segment. Figure 4 402 is a rectangular camera wall including four line segments (edges) at the top, bottom, left and right.

[0099] When the avatar leaves one area and enters the next, the terminal can adjust the virtual camera's parameters directly to the initial camera parameters corresponding to the next area. In other words, each area in the two-dimensional virtual scene is independent of each other, and the camera parameters corresponding to each area do not interfere with each other. All camera parameters corresponding to each area are integrated and can be regarded as an inseparable camera parameter instance. When the avatar switches areas, the terminal can fully replace all camera parameters of the virtual camera based on the camera parameter instance.

[0100] The terminal can record each change in camera parameters. That is, the terminal records the initial camera parameters (camera parameter instances) corresponding to each area in the order of changes in the area where the virtual character is located (the order of passing through each area). This is equivalent to recording the movement route of the virtual character in the two-dimensional virtual scene. This method improves the maintainability of camera parameters and reduces the difficulty of debugging. In this case, there is no need to consider the historical trajectory of the virtual camera, nor the possible changes in camera parameters. You only need to care about the initial camera parameters of the area where the current character is located, thereby reducing the configuration difficulty and improving the configuration reliability.

[0101] 302. For any camera wall in the two-dimensional virtual scene, when the framing frame of the virtual camera collides with the camera wall, the terminal obtains attribute information of the camera wall. The collision between the framing frame of the virtual camera and the camera wall is used to indicate that the virtual camera is restricted by the camera wall, and the attribute information is used to indicate the restriction conditions on the virtual camera.

[0102] In an embodiment of the present application, during the movement of the virtual camera, the virtual camera may encounter any camera wall in the two-dimensional virtual scene. When the framing frame of the virtual camera collides with the camera wall, the terminal obtains the attribute information of the camera wall. Collision means that the boundary of the framing frame and the boundary of the camera wall are at the same position in the two-dimensional virtual scene, that is, there is overlap. The attribute information of the camera wall may include information such as the blocking object, the blocking direction, and whether it has thrust attributes, etc., which is not limited in this embodiment of the present application. The thrust attribute means that the camera wall can push the blocking object to move, which is equivalent to the effect of "thrust".

[0103] The blocking object can be a virtual camera or a virtual character, and the embodiment of the present application does not limit this. The blocking object of the camera wall can be one or more, and the embodiment of the present application does not limit this. That is, for any camera wall, the camera wall can block the virtual camera from moving in certain directions, and can also block the virtual character from moving in a certain direction. For example, Figure 5 is a schematic diagram of a camera wall blocking the movement of an object according to an embodiment of the present application. Figure 5 , Figure 5 Three camera walls in different positions are shown as an example. The camera wall 501 on the left is used to limit the movement direction of the virtual camera's framing frame 504 and the virtual character 505. The camera wall 502 in the middle is used to limit the movement direction of the virtual camera's framing frame 504. The camera wall 503 on the right is used to limit the movement direction of the virtual character 505. The implementation of this application does not limit the size of the camera wall. When configuring a camera wall for a two-dimensional virtual scene, the terminal can display the configured camera wall in the two-dimensional virtual scene to show the configuration effect of the camera wall to the technician performing the configuration. For camera walls of different objects, the terminal can display the camera wall in different display forms. Different display forms can be line segments of different colors, line segments of different thicknesses, or the difference between solid and dashed lines, etc., which are not limited in this embodiment of the application.

[0104] If the camera wall is a square (a collection of multiple line segments), the terminal can configure each of the multiple line segments (edges) in the camera wall separately. The terminal can select some of the multiple line segments from the camera wall for configuration, while the remaining line segments are disabled and do not perform the restriction function. For any of the multiple line segments in the camera wall, the terminal can configure a wall direction for that line segment. The wall direction refers to the direction in which the camera wall pushes the virtual camera's framing frame. The wall direction includes two directions: inside and outside. The inside and outside refers to the inside and outside of the camera wall. An outward wall direction pushes the virtual camera's framing frame toward the outside of the camera wall. An inward wall direction pushes the virtual camera's framing frame toward the inside of the camera wall.

[0105] For example, Figure 6This is a schematic diagram of a wall direction provided according to an embodiment of the present application. Figure 6 , the camera wall 601 on the left only turns on the restriction function of the line segment on the right. The wall direction is outside. In this case, the camera wall 601 can push the virtual camera's framing frame 602 outside the camera wall (to the right), so that the virtual camera moves to the left. The camera wall 603 on the right only turns on the restriction function of the two line segments at the top and on the right. The wall directions are both inside. In this case, the camera wall 603 can push the virtual camera's framing frame 602 inside the camera wall (downward and left), so that the virtual camera moves to the upper right corner. The wall direction is opposite to the blocking direction. In actual configuration, the line segments with the restriction function turned on and the wall directions of the line segments can be flexibly combined and used. In the case where the blocking object of the camera wall is a virtual character, the terminal restricts the movement of the virtual character according to the principle of the above method, which will not be repeated here.

[0106] When the camera wall is a square (a collection of multiple line segments), each line segment in the camera wall is a one-way wall. That is, the virtual camera's framing frame can only cross from one side of the line segment to the other, but not the other way around. Figure 7 Schematic diagram of a framing frame passing through a camera wall according to an embodiment of the present application. Figure 7 , Figure 7 (a) in the figure shows that the virtual camera's framing frame 701 is on the left side of the camera wall 702. The camera wall 702 has enabled the restriction function for the right line segment. The wall direction is outside. Since each line segment in the camera wall is a one-way wall, the virtual camera's framing frame can only cross from the left side of the right line segment to the right side, but not from the right side to the left side. In other words, the virtual camera can move to the right and cross the camera wall. See Figure 7 (b) in Figure 7 (b) in the figure shows an example of the process of the virtual camera's framing frame 701 passing through the camera wall 702. During the process of passing through, the virtual camera can move to the right or to the left. Once the virtual camera's framing frame 701 has completely passed through the camera wall 702 and is completely on the right side of the camera wall 702, the virtual camera cannot move to the left. Figure 7 In (c), the camera wall 702 pushes the virtual camera's framing frame 701 to the right, preventing the virtual camera from moving to the left.

[0107] If the camera wall has a push force, the camera wall can automatically push the blocking object to move. In other words, even if no user operation occurs, the blocking object will move under the push of the camera wall. Figure 8 Schematic diagram of a camera wall pushing a blocked object to move according to an embodiment of the present application. Figure 8, camera wall 801 has a thrust attribute. This thrust attribute instructs camera wall 801 to push the virtual camera's framing frame in the direction of the wall. In this case, even if the left edge of the framing frame has not yet crossed the camera wall to the right, the camera frame cannot move left. Furthermore, even if the avatar does not move right, the virtual camera will move smoothly rightward under the push of the camera wall until the left edge of the framing frame reaches the right side of the camera wall.

[0108] If the camera wall is a square (a collection of multiple line segments) and all boundaries (line segments) of the camera wall have the restriction function enabled, and all boundaries of the camera wall are outward-facing, when the virtual camera's framing frame overlaps the camera wall, the virtual camera's framing frame can be smoothly squeezed out of the camera wall (i.e., it always has the "push camera" property). Figure 9 This is a schematic diagram of a camera wall driving the viewfinder frame to move according to an embodiment of the present application. Figure 9 , the framing frame 901 is smoothly extruded to the right side of the camera wall 902 .

[0109] When the camera wall is a square (a collection of multiple line segments) and all boundaries (line segments) of the camera wall have the restriction function turned on, if all boundaries of the camera wall are inward-facing camera walls, when the center point of the framing frame is inside the camera wall, the camera wall will drag the framing frame of the virtual camera into the wall (the center point of the framing frame is always inside the camera wall), achieving the effect of a battle box. Figure 10 This is a schematic diagram of a camera wall driving the viewfinder frame to move according to an embodiment of the present application. Figure 10 , Figure 10 (a) in the figure shows an example of the camera wall 1001 pushing the viewfinder frame 1002 toward the center. If the size of the camera wall 1001 is smaller than the viewfinder frame, a jamming situation will occur. In the restricted direction, the viewfinder frame will be fixed in the center, while the camera can still move in the other direction to a limited extent. Figure 10 (b) in the. Figure 10 (b) in the figure exemplarily shows that the framing frame 1002 is stuck in the middle and cannot move left or right, but can only move up and down.

[0110] The configuration information of the camera wall can be regarded as the attribute information of the camera wall. The terminal can provide the user with a configuration interface of the camera wall. The user can configure various attribute information through the configuration interface. Figure 11 This is a schematic diagram of a configuration interface provided according to an embodiment of the present application. Figure 11 The configuration interface can configure attribute information such as the name of the camera wall, the blocking object, the line segment for opening the restriction function, the wall direction, and the camera wall size. This embodiment of the application does not limit this.

[0111] 303. The terminal determines the position of the framing frame of the virtual camera at the next moment based on the attribute information of the camera wall and the camera parameters.

[0112] In an embodiment of the present application, the terminal determines the position of the framing frame of the virtual camera at the next moment based on the attribute information of the camera wall and the camera parameters, so as to adjust the camera parameters of the virtual camera according to the position of the framing frame of the virtual camera at the next moment.

[0113] In some embodiments, the process of determining the position of the virtual camera's framing frame at a next moment based on the camera wall's attribute information and camera parameters includes: the terminal obtaining a blocking direction of the camera wall based on the camera wall's attribute information. The blocking direction indicates a direction in which the virtual camera cannot move. Then, the terminal determines the position of the virtual camera's framing frame at a next moment based on the camera parameters and the blocking direction.

[0114] In some embodiments, the camera wall is a one-way wall. The virtual camera's framing frame can pass through the camera wall in the direction opposite to the blocking direction. Accordingly, if the virtual camera's framing frame does not pass through the camera wall, the terminal determines the next position of the virtual camera's framing frame based on the camera parameters and the movement of the tracking target. Following the target refers to the virtual camera following a moving target. Then, if the virtual camera's framing frame passes through the camera wall, the terminal determines the next position of the virtual camera's framing frame based on the camera parameters and the blocking direction.

[0115] In some embodiments, if the virtual camera's framing frame does not pass through the camera wall and the camera wall's attribute information does not include a thrust direction, the terminal determines the position of the virtual camera's framing frame at the next moment based on the camera parameters and the movement of the tracking target. The thrust direction indicates the direction in which the camera wall pushes the virtual camera's framing frame. The thrust direction of the camera wall is opposite to the blocking direction of the camera wall.

[0116] Among them, when the framing frame of the virtual camera does not pass through the camera wall, if the attribute information of the camera wall includes the thrust direction, the terminal determines the position of the framing frame of the virtual camera at the next moment based on the thrust direction and camera parameters.

[0117] In some embodiments, if the virtual camera is constrained by any camera wall at the next moment, the terminal corrects the framing position of the virtual camera's frame at the next moment based on the camera wall. Specifically, after being constrained by the camera wall, some of the virtual camera's motion components may be deducted, leaving a portion of the motion components that meet the constraints. Furthermore, the new motion components generated by the camera wall need to be superimposed on the virtual camera's motion vector to obtain a corrected motion vector. The terminal then reverse-calculates the corrected virtual camera focus position based on the corrected motion vector; this results in the final position of the virtual camera at the next moment.

[0118] 304. When the virtual camera is not restricted by any camera wall during its movement, the terminal determines a position of a framing frame of the virtual camera at a next moment in response to a movement operation on the virtual character.

[0119] In an embodiment of the present application, when the movement of the virtual camera is not restricted by any camera wall, the terminal determines the position of the framing frame of the virtual camera at the next moment according to the operation triggered by the user.

[0120] In some embodiments, when the virtual camera's movement is not restricted by any camera wall, in response to a move operation on the avatar, the terminal determines the next virtual camera focus position based on the camera parameters and the position indicated by the move operation. Then, based on the focus position and the camera parameters, the terminal determines the next virtual camera position and rotation information. The rotation information indicates the rotation angle of the virtual camera. Then, based on the next virtual camera position and rotation information, the terminal determines the next virtual camera framing frame position.

[0121] In some embodiments, when the movement of the virtual camera is to follow a moving line, the terminal corrects the focus position of the virtual camera based on the position of the virtual camera's following target on the moving line. The following target refers to the target that the virtual camera follows.

[0122] In some embodiments, the terminal corrects the position of the virtual camera based on the prohibited movement direction in the camera parameters, where the prohibited movement direction indicates the direction in which the virtual camera is prohibited from moving. The terminal then corrects the focus position of the virtual camera at the next moment based on the corrected virtual camera position.

[0123] In order to more clearly describe the camera parameter configuration method provided in the embodiment of the present application, the method is further described below with reference to the accompanying drawings. Figure 12 This is a flowchart of another camera parameter configuration method provided in accordance with an embodiment of the present application. Figure 12Certain level events can trigger changes in camera parameters (called camera command parameter triggers). The game's lock, unlock, or camera switch triggers can enable and disable camera parameter triggers. When a camera command parameter trigger fires, or when a character enters the area corresponding to a camera parameter trigger, the camera parameters configured for that trigger are applied to the camera's target parameters. The camera's target parameters do not directly affect the camera's properties. The camera's current parameters gradually and smoothly change to the camera's target parameters over time, while the current parameters directly affect the camera's properties. Each time the camera's target parameter configuration changes, a copy is stored in the camera parameter history to facilitate the recall of historical camera parameter configurations by other functions. The camera's current parameters directly affect the camera's entity properties, and the camera history is stored on the camera entity. If the camera is currently constrained by a camera wall (e.g., it intersects with and is pushed by the camera wall), the wall's push result (the position of the viewfinder at the next moment) is calculated based on the camera wall's properties. If the virtual camera is not constrained by a camera wall at the current moment, it is considered free. The terminal reads the camera's current parameters, such as "Follow Mode," "Camera Offset," and "Character Orientation Offset," and then calculates the camera's focus position based on the camera's target's position. If "Follow Movement Line" is selected in the camera's current parameters, the terminal further adjusts the camera's focus position calculated in the previous step based on the target's current movement line position. After the focus position is calculated, the terminal pre-calculates the camera's position and rotation for the next moment based on the camera's current parameters, such as "Horizontal Deflection Angle," "Vertical Deflection Angle," "Screen Tilt Angle," "Field of View," and "Target Distance." The terminal then adjusts the virtual camera's position and rotation for the next moment based on the "Movement Prohibited Directions" parameter in the camera's current parameters. For example, if the camera is configured to prohibit leftward movement, if the camera position calculated in the previous step for the next frame has a leftward component compared to the current frame, this component should be deducted. After the camera position is adjusted, the terminal performs a reverse calculation based on the camera's current parameters. The terminal then pre-calculates the camera bounding box size based on the corrected pre-calculated camera position, camera FOV size, camera rotation parameters, and other information. Camera walls placed in the 2D virtual scene can be enabled and disabled by level mechanisms, the game's lock and unlock functions, and camera switch triggers. Once enabled, camera walls participate in constraint generation. All camera walls in the level jointly generate a set of constraints, and the pre-calculated camera bounding box position is then validated against these constraints. If there is no overlap with any camera walls, the pre-calculated camera bounding box position is valid and unconstrained by the camera walls. If there is overlap with any camera walls, the constraints are triggered, triggering a new round of position corrections.When constrained by the camera wall, some of the camera's motion components may be deducted, leaving a portion that meets the constraints. Furthermore, the wall creates a new motion component that needs to be added to the camera's motion vector to obtain a corrected motion vector. Using this corrected motion vector, the corrected camera and focus positions are calculated backwards, resulting in the final position of the virtual camera at the next moment.

[0124] Embodiments of the present application provide a method for configuring camera parameters. Corresponding camera parameters are configured for each area in a two-dimensional virtual scene. When a virtual character enters any area, the camera parameters corresponding to that area are obtained as the current camera parameters of the virtual camera. This method does not need to consider parameter changes in the virtual camera's historical movement trajectory; only the area where the character is currently located needs to be considered. Even if the camera parameters corresponding to a certain area have problems and need to be modified, the camera parameters corresponding to other areas do not need to be changed. This reduces the difficulty of configuring the camera parameters, improves the reliability of parameter configuration, and facilitates finding and modifying problematic camera parameters. Furthermore, a camera wall can exist in the two-dimensional virtual scene. The camera wall can be used to limit the movement direction of the virtual camera, thereby adjusting the camera parameters. This can prevent the framing frame of the virtual camera from exceeding the range of the two-dimensional virtual scene during movement, resulting in poor visual effects. This ensures that the user's field of view remains within the two-dimensional virtual scene, improving the visual effect. Since the controlled virtual character generally does not leave the user's field of view, limiting the movement direction of the virtual camera by the camera wall, thereby limiting the user's field of view, can, to a certain extent, guide the behavior of the virtual character and prevent the virtual character from leaving the two-dimensional virtual scene.

[0125] Figure 13 This is a block diagram of a camera parameter configuration device according to an embodiment of the present application. The camera parameter configuration device is used to execute the steps of the camera parameter configuration method described above. Figure 13 , the camera parameter configuration device includes:

[0126] An acquisition module 1301 is configured to acquire camera parameters of a virtual camera in the two-dimensional virtual scene based on the area where the virtual character is located in the two-dimensional virtual scene. The camera parameters are the camera parameters of the virtual camera at the current moment. The two-dimensional virtual scene contains at least one camera wall, which is used to limit the movement direction of the virtual camera.

[0127] Determination module 1302, configured to determine, when the virtual camera is restricted by any camera wall during its movement, the position of a framing frame of the virtual camera at a next moment based on the camera wall and camera parameters, wherein the framing frame is used to indicate the field of view of the virtual camera in the two-dimensional virtual scene;

[0128] The adjustment module 1303 is configured to adjust camera parameters based on the position of the framing frame of the virtual camera at the next moment.

[0129] In some embodiments, the acquisition module 1301 is used to obtain a camera parameter instance corresponding to the area in response to the virtual character entering the area. The two-dimensional virtual scene includes multiple areas, and the area is any area among the multiple areas. The camera parameter instance is used to indicate the initial camera parameters of the virtual camera when the virtual character is in the area.

[0130] In some embodiments, the determination module 1302 includes:

[0131] an acquisition unit, configured to acquire, for any camera wall in the two-dimensional virtual scene, attribute information of the camera wall when a framing frame of a virtual camera collides with the camera wall, wherein the collision of the framing frame of the virtual camera with the camera wall indicates that the virtual camera is restricted by the camera wall, and the attribute information indicates a restriction condition for the virtual camera;

[0132] The determination unit is used to determine the position of the framing frame of the virtual camera at the next moment based on the attribute information of the camera wall and the camera parameters.

[0133] In some embodiments, the determination unit is used to obtain the blocking direction of the camera wall based on the attribute information of the camera wall, where the blocking direction is used to indicate the direction in which the virtual camera cannot move; and determine the position of the framing frame of the virtual camera at the next moment based on the camera parameters and the blocking direction.

[0134] In some embodiments, the camera wall is a one-way wall, and the framing frame of the virtual camera can pass through the camera wall in the opposite direction of the blocking direction;

[0135] The determination module 1302 is further configured to determine the position of the frame of the virtual camera at a next moment based on the camera parameters and the movement of the follow target, when the frame of the virtual camera does not pass through the camera wall. The follow target refers to the target that the virtual camera follows.

[0136] The determination module 1302 is further configured to determine the position of the framing frame of the virtual camera at a next moment based on the camera parameters and the blocking direction when the framing frame of the virtual camera passes through the camera wall.

[0137] In some embodiments, the determination module 1302 is used to determine the position of the virtual camera's framing frame at the next moment based on the camera parameters and the movement of the tracking target, when the virtual camera's framing frame does not pass through the camera wall and the attribute information of the camera wall does not include a thrust direction. The thrust direction is used to indicate that the camera wall pushes the virtual camera's framing frame to move along the thrust direction, and the thrust direction of the camera wall is opposite to the blocking direction of the camera wall.

[0138] In some embodiments, the determination module 1302 is used to determine the position of the framing frame of the virtual camera at the next moment based on the thrust direction and camera parameters if the attribute information of the camera wall includes the thrust direction when the framing frame of the virtual camera does not pass through the camera wall.

[0139] In some embodiments, the apparatus further comprises:

[0140] The determination module 1302 is also used to determine the focus position of the virtual camera at the next moment based on the camera parameters and the position indicated by the movement operation in response to the movement operation of the virtual character when the virtual camera is not restricted by any camera wall; determine the position and rotation information of the virtual camera at the next moment based on the focus position and the camera parameters, the rotation information is used to indicate the rotation angle of the virtual camera; and determine the position of the framing frame of the virtual camera at the next moment based on the position and rotation information of the virtual camera at the next moment.

[0141] Embodiments of the present application provide a device for configuring camera parameters. Corresponding camera parameters are configured for various areas in a two-dimensional virtual scene. When a virtual character enters any area, the camera parameters corresponding to that area are obtained as the current camera parameters of the virtual camera. This eliminates the need to consider parameter changes in the virtual camera's historical movement trajectory; only the area in which the character is currently located is considered. Even if a problem with the camera parameters corresponding to a particular area requires modification, the camera parameters corresponding to other areas do not need to be changed. This reduces the difficulty of configuring the camera parameters, improves the reliability of parameter configuration, and facilitates finding and modifying problematic camera parameters. Furthermore, a camera wall can exist in the two-dimensional virtual scene. The camera wall can be used to restrict the movement direction of the virtual camera, thereby adjusting the camera parameters. This prevents the virtual camera's framing from exceeding the range of the two-dimensional virtual scene during movement, resulting in poor visual effects. This ensures that the user's field of view remains within the two-dimensional virtual scene, improving visual quality. Because the controlled virtual character generally does not leave the user's field of view, restricting the movement direction of the virtual camera by the camera wall, thereby restricting the user's field of view, can, to a certain extent, guide the virtual character's behavior and prevent the virtual character from leaving the two-dimensional virtual scene.

[0142] It should be noted that the camera parameter configuration device provided in the above embodiment is illustrated only by the division of the above functional modules when running an application. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the camera parameter configuration device provided in the above embodiment and the camera parameter configuration method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0143] In the embodiments of the present application, the computer device can be configured as a terminal or a server. When the computer device is configured as a terminal, the terminal can be used as the execution subject to implement the technical solution provided in the embodiments of the present application. When the computer device is configured as a server, the server can be used as the execution subject to implement the technical solution provided in the embodiments of the present application. The technical solution provided in the present application can also be implemented through interaction between the terminal and the server. The embodiments of the present application do not limit this.

[0144] Figure 14 The following is a block diagram of a terminal 1400 according to an embodiment of the present application. Terminal 1400 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 1400 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other similar names.

[0145] Typically, the terminal 1400 includes a processor 1401 and a memory 1402 .

[0146] The processor 1401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0147] Memory 1402 may include one or more computer-readable storage media, which may be non-transitory. Memory 1402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 1402 is used to store at least one computer program, which is executed by processor 1401 to implement the camera parameter configuration method provided in the method embodiments of the present application.

[0148] In some embodiments, terminal 1400 may optionally include a peripheral device interface 1403 and at least one peripheral device. Processor 1401, memory 1402, and peripheral device interface 1403 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1403 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1404, a display screen 1405, a camera assembly 1406, an audio circuit 1407, and a power supply 1408.

[0149] The peripheral device interface 1403 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1401 and the memory 1402. In some embodiments, the processor 1401, the memory 1402, and the peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, the memory 1402, and the peripheral device interface 1403 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0150] RF circuit 1404 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. RF circuit 1404 communicates with communication networks and other communication devices via electromagnetic signals. RF circuit 1404 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. In some embodiments, RF circuit 1404 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. RF circuit 1404 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, RF circuit 1404 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0151] The display screen 1405 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1405 is a touch screen display, the display screen 1405 also has the ability to collect touch signals on the surface or above the surface of the display screen 1405. The touch signal can be input as a control signal to the processor 1401 for processing. At this time, the display screen 1405 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, there can be one display screen 1405, which is set on the front panel of the terminal 1400; in other embodiments, there can be at least two display screens 1405, which are respectively set on different surfaces of the terminal 1400 or in a folding design; in other embodiments, the display screen 1405 can be a flexible display screen, which is set on the curved surface or folding surface of the terminal 1400. Even more, the display screen 1405 can be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1405 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0152] The camera assembly 1406 is used to capture images or videos. In some embodiments, the camera assembly 1406 includes a front camera and a rear camera. Typically, the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1406 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0153] The audio circuit 1407 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1401 for processing, or input into the radio frequency circuit 1404 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 1400. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1401 or the radio frequency circuit 1404 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1407 may also include a headphone jack.

[0154] Power supply 1408 is used to power various components in terminal 1400. Power supply 1408 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1408 includes a rechargeable battery, the rechargeable battery can be wired or wirelessly rechargeable. A wired rechargeable battery is charged via a wired line, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery can also support fast charging technology.

[0155] In some embodiments, the terminal 1400 further includes one or more sensors 1409 , including but not limited to: an acceleration sensor 1410 , a gyroscope sensor 1411 , a pressure sensor 1412 , an optical sensor 1413 , and a proximity sensor 1414 .

[0156] Accelerometer 1410 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by terminal 1400. For example, accelerometer 1410 can be used to detect the components of gravity acceleration along the three coordinate axes. Processor 1401 can control display screen 1405 to display the user interface in either a landscape or portrait view based on the gravity acceleration signal collected by accelerometer 1410. Accelerometer 1410 can also be used to collect game or user motion data.

[0157] The gyroscope sensor 1411 can detect the orientation and rotation angle of the terminal 1400. It can also work with the accelerometer 1410 to collect the user's 3D movements on the terminal 1400. Based on the data collected by the gyroscope sensor 1411, the processor 1401 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0158] The pressure sensor 1412 can be provided on the side frame of the terminal 1400 and / or below the display screen 1405. When the pressure sensor 1412 is provided on the side frame of the terminal 1400, it can detect the user's gripping signal of the terminal 1400, and the processor 1401 can perform left-hand or right-hand recognition or shortcut operations based on the gripping signal collected by the pressure sensor 1412. When the pressure sensor 1412 is provided below the display screen 1405, the processor 1401 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 1405. Operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0159] Optical sensor 1413 is used to detect ambient light intensity. In one embodiment, processor 1401 can control the display brightness of display screen 1405 based on the ambient light intensity detected by optical sensor 1413. Specifically, when the ambient light intensity is high, the display brightness of display screen 1405 is increased; when the ambient light intensity is low, the display brightness of display screen 1405 is decreased. In another embodiment, processor 1401 can also dynamically adjust the shooting parameters of camera assembly 1406 based on the ambient light intensity detected by optical sensor 1413.

[0160] Proximity sensor 1414, also known as a distance sensor, is typically located on the front panel of terminal 1400. Proximity sensor 1414 is used to detect the distance between the user and the front of terminal 1400. In one embodiment, when proximity sensor 1414 detects that the distance between the user and the front of terminal 1400 is gradually decreasing, processor 1401 controls display screen 1405 to switch from the screen-on state to the screen-off state. When proximity sensor 1414 detects that the distance between the user and the front of terminal 1400 is gradually increasing, processor 1401 controls display screen 1405 to switch from the screen-off state to the screen-on state.

[0161] Those skilled in the art will understand that Figure 14 The structure shown in the figure does not constitute a limitation on the terminal 1400, and the terminal 1400 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0162] The present application also provides a computer-readable storage medium that stores at least one computer program. The at least one computer program is loaded and executed by a processor of a terminal to implement the operations performed by the terminal in the camera parameter configuration method of the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0163] Embodiments of the present application also provide a computer program product or computer program, which includes computer program code stored in a computer-readable storage medium. A processor of a terminal reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the terminal to perform the camera parameter configuration methods provided in the various optional implementations described above.

[0164] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0165] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for configuring camera parameters, characterized in that: The method comprises: Obtaining, based on an area where the virtual character is located in a two-dimensional virtual scene, camera parameters of a virtual camera in the two-dimensional virtual scene, where the camera parameters are camera parameters of the virtual camera at a current moment, and where at least one camera wall exists in the two-dimensional virtual scene, and the camera wall is used to limit a movement direction of the virtual camera; In the event that the movement of the virtual camera is restricted by any camera wall, determining, based on the camera wall and the camera parameters, a position of a framing frame of the virtual camera at a next moment, the framing frame being used to indicate a field of view of the virtual camera in the two-dimensional virtual scene; The camera parameters are adjusted based on the position of the framing frame of the virtual camera at the next moment.

2. The method according to claim 1, characterized in that The acquiring, based on the area where the virtual character is located in the two-dimensional virtual scene, camera parameters of a virtual camera in the two-dimensional virtual scene includes: In response to the virtual character entering the area, a camera parameter instance corresponding to the area is obtained, the two-dimensional virtual scene includes multiple areas, the area is any area of ​​the multiple areas, and the camera parameter instance is used to indicate the initial camera parameters of the virtual camera when the virtual character is in the area.

3. The method according to claim 1, characterized in that In a case where the movement of the virtual camera is restricted by any camera wall, determining a position of a framing frame of the virtual camera at a next moment based on the camera wall and the camera parameters includes: For any camera wall in the two-dimensional virtual scene, when the framing frame of the virtual camera collides with the camera wall, obtaining attribute information of the camera wall, wherein the collision of the framing frame of the virtual camera with the camera wall indicates that the virtual camera is restricted by the camera wall, and the attribute information indicates a restriction condition on the virtual camera; Based on the attribute information of the camera wall and the camera parameters, the position of the framing frame of the virtual camera at the next moment is determined.

4. The method according to claim 3, characterized in that The determining, based on the attribute information of the camera wall and the camera parameters, a position of the framing frame of the virtual camera at a next moment, includes: Based on the attribute information of the camera wall, obtaining a blocking direction of the camera wall, where the blocking direction is used to indicate a direction in which the virtual camera cannot move; Based on the camera parameters and the blocking direction, a position of the framing frame of the virtual camera at a next moment is determined.

5. The method according to claim 4, characterized in that The camera wall is a one-way wall, and the framing frame of the virtual camera can pass through the camera wall in the opposite direction of the blocking direction; The method further comprises: If the frame of the virtual camera does not pass through the camera wall, determining a position of the frame of the virtual camera at a next moment based on the camera parameters and the movement of a follow target, where the follow target refers to a target that the virtual camera follows; In the case where the framing frame of the virtual camera passes through the camera wall, a position of the framing frame of the virtual camera at a next moment is determined based on the camera parameters and the blocking direction.

6. The method according to claim 5, characterized in that The method further comprises: determining a position of the frame of the virtual camera at a next moment based on the camera parameters and the movement of the tracking target when the frame of the virtual camera does not pass through the camera wall, comprising: In the case that the framing frame of the virtual camera does not pass through the camera wall, if the attribute information of the camera wall does not include a thrust direction, the position of the framing frame of the virtual camera at the next moment is determined based on the camera parameters and the movement of the follow target. The thrust direction is used to indicate that the camera wall pushes the framing frame of the virtual camera to move along the thrust direction, and the thrust direction of the camera wall is opposite to the blocking direction of the camera wall.

7. The method according to claim 6, characterized in that The method also includes: When the framing frame of the virtual camera does not pass through the camera wall, if the attribute information of the camera wall includes a thrust direction, the position of the framing frame of the virtual camera at the next moment is determined based on the thrust direction and the camera parameters.

8. The method according to claim 1, characterized in that The method further comprises: In a case where the movement of the virtual camera is not restricted by any camera wall, in response to a movement operation on the virtual character, determining a focus position of the virtual camera at a next moment based on the camera parameters and a position indicated by the movement operation; Determining the position and rotation information of the virtual camera at a next moment based on the focus position and the camera parameters, wherein the rotation information is used to indicate the rotation angle of the virtual camera; Based on the position of the virtual camera at the next moment and the rotation information, the position of the framing frame of the virtual camera at the next moment is determined.

9. The method according to claim 8, characterized in that The method further comprises: When the movement mode of the virtual camera is to follow a moving line, the focus position of the virtual camera is corrected based on the position of a following target of the virtual camera on the moving line, where the following target refers to a target followed by the virtual camera.

10. The method according to claim 8, characterized in that The method further comprises: Correcting the position of the virtual camera based on a prohibited movement direction in the camera parameters, wherein the prohibited movement direction indicates a direction in which the virtual camera is prohibited from moving; Based on the corrected position of the virtual camera, the focus position of the virtual camera at the next moment is corrected.

11. The method according to claim 1, wherein The method further comprises: When the virtual camera is restricted by any camera wall at the next moment, the framing position of the frame of the virtual camera at the next moment is corrected based on the camera wall.

12. A camera parameter configuration device, characterized in that: The device comprises: an acquisition module, configured to acquire camera parameters of a virtual camera in a two-dimensional virtual scene based on an area where the virtual character is located in the two-dimensional virtual scene, wherein the camera parameters are the camera parameters of the virtual camera at a current moment, and wherein at least one camera wall exists in the two-dimensional virtual scene, and the camera wall is used to limit the movement direction of the virtual camera; a determination module, configured to determine, when the movement of the virtual camera is restricted by any camera wall, a position of a framing frame of the virtual camera at a next moment based on the camera wall and the camera parameters, the framing frame being used to indicate a field of view of the virtual camera in the two-dimensional virtual scene; The adjustment module is used to adjust the camera parameters based on the position of the framing frame of the virtual camera at the next moment.

13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory is used to store at least one computer program, and the at least one computer program is loaded by the processor and executes the camera parameter configuration method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store at least one computer program, and the at least one computer program is used to execute the camera parameter configuration method according to any one of claims 1 to 11.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for configuring camera parameters according to any one of claims 1 to 11 is implemented.