Method, device and electronic terminal for controlling visual field in virtual scene

By controlling the coordinated movement of virtual characters and camera perspectives, the problem of view beyond the boundaries in three-dimensional virtual scenes is solved, achieving a clearer boundary display and a more immersive gaming experience.

CN116020119BActive Publication Date: 2025-08-15NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211702497.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2025-08-15
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

In the prior art, the view control method of a three-dimensional virtual scene cannot effectively avoid the appearance of content outside the prescribed boundary in the field of view, resulting in a low degree of realism of the boundary display and affecting the gaming experience.

Method used

By controlling the virtual character to move on the scene plane, the virtual camera's viewing range follows the character's orientation and stops following the character's orientation when it reaches the edge area of the specified range boundary, limiting the content within the field of view.

Benefits of technology

It effectively avoids content outside the specified range boundary in the field of view, improves the display authenticity of virtual scene boundaries, and enhances the immersion and visual effects of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116020119B_ABST
    Figure CN116020119B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, and electronic terminal for controlling the field of view in a virtual scene, relating to the field of virtual scene technology, and alleviating the technical problem of low realism in the display of boundaries of game scenes. The method comprises: responding to a movement instruction for a virtual character, controlling the virtual character to move on a scene plane according to the movement instruction; controlling the movement of a virtual camera so that the viewing angle range follows the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the virtual camera's field of view on the scene plane; and, in response to the virtual character moving to the edge of the specified range boundary, controlling the viewing angle range to stop following the direction of the virtual character.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of scene display, and in particular to a method, device, and electronic terminal for controlling a field of view in a virtual scene. Background Art

[0002] For many three-dimensional virtual scenes, due to the characteristics of art production or scene design limitations, it is often necessary to limit the virtual scene content that users can view to prevent the scene map boundaries or undesigned parts of the scene from appearing on the screen.

[0003] At present, for virtual cameras that capture and display images, content outside the specified range boundaries often appears in their field of view, such as undesigned parts of the scene. Especially for three-dimensional virtual scenes with rotating viewing angles, the realism of the display of the virtual scene boundaries is low, affecting the sense of immersion in the gaming experience. Summary of the Invention

[0004] The present disclosure aims to provide a method, device and electronic terminal for controlling the field of view in a virtual scene, so as to alleviate the technical problem of low realism of the boundary display of the virtual scene.

[0005] In a first aspect, embodiments of the present disclosure provide a method for controlling a field of view in a virtual scene, wherein a terminal device provides a graphical user interface (GUI), wherein the virtual scene includes a virtual camera, a scene plane, and a virtual character controlled by the terminal device; content displayed by the GUI includes content captured by the virtual camera in the virtual scene; and the scene plane corresponds to a specified range boundary. The method comprises:

[0006] In response to a movement instruction for the virtual character, controlling the virtual character to move on the scene plane;

[0007] Controlling the movement of the virtual camera so that the viewing angle range moves along with the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the field of view of the virtual camera on the scene plane;

[0008] In response to the virtual character moving to an edge area of the designated range boundary, the viewing angle range is controlled to stop following the direction movement of the virtual character.

[0009] In a second aspect, a device for controlling a field of view in a virtual scene is provided. The device provides a graphical user interface (GUI) via a terminal device. The virtual scene includes a virtual camera, a scene plane, and a virtual character controlled by the terminal device. Content displayed by the GUI includes content captured by the virtual camera in the virtual scene. The scene plane corresponds to a specified range boundary. The device includes:

[0010] a first control module, configured to control the virtual character to move on the scene plane in response to a movement instruction for the virtual character;

[0011] A second control module is configured to control the movement of the virtual camera so that the viewing angle range moves along with the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the field of view of the virtual camera on the scene plane;

[0012] The third control module is configured to control the viewing angle range to stop following the direction of the virtual character in response to the virtual character moving to an edge area of the designated range boundary.

[0013] In a third aspect, an embodiment of the present disclosure provides an electronic terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0014] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method described in the first aspect above.

[0015] The embodiments of the present disclosure bring the following beneficial effects:

[0016] The embodiments of the present disclosure provide a method, device and electronic terminal for controlling the field of view in a virtual scene, which can respond to movement instructions for a virtual character, control the virtual character to move on the scene plane according to the movement instructions, and control the movement of a virtual camera so that the field of view of the virtual camera corresponding to the projected viewing angle range on the scene plane moves along the direction of the virtual character, and in response to the virtual character moving to the edge area of the specified range boundary, control the viewing angle range to stop following the direction of the virtual character. In this solution, by controlling the viewing angle range to stop following the direction of the virtual character when the virtual character moves to the edge area of the specified range boundary, even 3D games with rotating viewing angles can limit the camera's field of view from appearing outside the specified range boundary. The lens limitation effect of the virtual camera can also more clearly express the concept of scene boundaries, avoid the production of a large amount of art materials to fill the edge of the field of view, and provide a more immersive game scene experience for top-down perspective games.

[0017] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure is shown;

[0020] Figure 2 A schematic structural diagram of a terminal device provided by an embodiment of the present disclosure is shown;

[0021] Figure 3 A flowchart of a method for controlling the field of view in a virtual scene provided by an embodiment of the present disclosure;

[0022] Figure 4 An example of the viewing angle range in the method for controlling the field of view in a virtual scene provided by an embodiment of the present disclosure;

[0023] Figure 5 Another schematic flow chart of a method for controlling the field of view in a virtual scene provided by an embodiment of the present disclosure;

[0024] Figure 6 A schematic structural diagram of a device for controlling visual field in a virtual scene provided by an embodiment of the present disclosure;

[0025] Figure 7 A structural schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0027] The terms "including," "having," and any variations thereof, as used in the embodiments of the present disclosure, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.

[0028] Currently, for 3D games, due to the characteristics of art production or limitations of scene design, it is often necessary to control what players can view to prevent map boundaries or undesigned parts of the scene from appearing on the screen.

[0029] For 3D top-down perspective games, there's currently no flexible and effective way to control the content within the viewport. This problem is typically addressed by limiting the character's movement range and filling in empty areas. This approach is suitable for games with expansive maps, where large areas can be filled with scene art to cover the field of view.

[0030] For conventional 3D action games, the camera is usually close, so the camera can be used to collide with the wall and roof to retract the camera arm to solve the problem of the camera passing through the wall. However, this method is not flexible and applicable to 3D top-down perspective games, because top-down perspective games usually have no roof and the camera arm is too long to be shortened.

[0031] A common method for this type of game is not to display outdoor scenes, or to display all outdoor scenes in black screen. This method will affect the sense of immersion. Especially for 3D virtual games that can rotate the perspective

[0032] In the scene, the field of view of the virtual camera that captures the display image often contains content outside the specified range, such as undesigned parts of the scene, which makes the reality of the boundary display of the virtual scene low.

[0033] Based on this, the embodiments of the present disclosure provide a method, device, and electronic terminal for controlling the field of view in a virtual scene, by which the technical problem of low realism of the boundary display of the virtual scene can be alleviated.

[0034] In one embodiment of the present disclosure, the method for controlling the field of view in a virtual scene can be executed on a local terminal device or a server. When the method for controlling the field of view in a virtual scene is executed on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0035] 5 In an optional embodiment, various cloud applications can be run under the cloud interaction system, such as:

[0036] Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming mode, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the control method of the field of view in the virtual scene are completed on the cloud gaming server, and the client device

[0037] The function of the client device 0 is to receive and send data and present the game screen. For example, the client device 0 can be a display device with data transmission function close to the user, such as a mobile terminal, TV, computer, PDA, etc.; however, the cloud game server in the cloud performs information processing. When playing the game, the player operates the client device to send operation instructions to the cloud game server. The cloud game server runs the game according to the operation instructions, encodes and compresses the game screen and other data, and returns it to the client device via the network. Finally, the client device decodes and outputs the game screen.

[0038] In an optional embodiment, taking games as an example, the local terminal device stores the game program and

[0039] Used to present the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally downloading and installing the game program through an electronic device and running it. The local terminal device can provide the graphical user interface to the player in a variety of ways, for example, it can be rendered and displayed on the terminal's display screen, or provided to the player through holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present the graphical user interface, the graphical user interface includes the game screen, and the processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.

[0040] In one possible implementation, an embodiment of the present disclosure provides a method for controlling the field of view in a virtual scene, providing a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or the client device in the cloud interaction system mentioned above.

[0041] For example, Figure 1 As shown, Figure 1 Schematic diagram of an application scenario provided by an embodiment of the present disclosure. This application scenario may include a touch terminal (e.g., mobile phone 102) and a server 101. The touch terminal may communicate with the server 101 via a wired or wireless network. The touch terminal is used to run a virtual desktop, which can interact with the server 101 through the virtual desktop to control the content on the server 101.

[0042] The touch terminal of this embodiment is described by taking a mobile phone 102 as an example. The mobile phone 102 includes components such as a radio frequency (RF) circuit 110, a memory 120, a touch screen 130, and a processor 140. Those skilled in the art will understand that Figure 2The mobile phone structure shown in the figure does not constitute a limitation of the mobile phone, and may include more or fewer components than shown in the figure, or combine or separate some components, or arrange the components differently. Those skilled in the art will understand that the touch screen 130 is a user interface (UI), and the mobile phone 102 may include more or fewer user interfaces than shown in the figure.

[0043] The RF circuit 110 can also communicate with a network and other devices via wireless communications. The wireless communications can use any communication standard or protocol, including but not limited to Global System of Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0044] The memory 120 can be used to store software programs and modules. The processor 140 executes the various functional applications and data processing of the mobile phone 102 by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function, etc.; the data storage area may store data generated based on the use of the mobile phone 102, etc. In addition, the memory 120 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state memory device.

[0045] The processor 140 is the control center of the mobile phone 102. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the mobile phone 102 and processes data, thereby monitoring the mobile phone as a whole.

[0046] The embodiments of the present disclosure are further described below with reference to the accompanying drawings.

[0047] Figure 3This is a flow chart of a method for controlling the field of view in a virtual scene provided by an embodiment of the present disclosure. The method can be applied to a terminal device capable of presenting a graphical user interface, wherein the graphical user interface is provided by the terminal device, the virtual scene includes a virtual camera, a scene plane, and a virtual character controlled by the terminal device, the content displayed by the graphical user interface includes the content captured by the virtual camera in the virtual scene, and the scene plane corresponds to a specified range boundary. Figure 3 As shown, the method includes:

[0048] Step S310 , in response to a movement instruction for the virtual character, controlling the virtual character to move on the scene plane.

[0049] In actual applications, players can control the movement of the virtual character by performing movement operations on the virtual character.

[0050] In the embodiment of the present disclosure, the scene plane may be any virtual surface on which the virtual character can move, such as the ground, the bottom surface of a ship, the scene plane in the cabin, etc.

[0051] The designated range boundary may be the boundary of the movable range of the avatar on the scene plane. For example, if the scene plane is the floor of a room, the designated range boundary may be the wall of the room.

[0052] Step S320: Control the movement of the virtual camera so that the viewing angle moves along with the direction of the virtual character.

[0053] The viewing angle range is the range of the virtual camera's field of view corresponding to the projection on the scene plane. Figure 4 As shown, the field of view angle ∠β of the virtual camera that provides the game screen for the player forms a rectangular area corresponding to the projection range on the scene plane. At the current position P of the virtual character character When moving, the virtual camera also moves and rotates so that the rectangular area follows the current position P of the virtual character. character Movement, that is, the current position P of the rectangular area relative to the virtual character character still.

[0054] It should be noted that, in the embodiment of the present disclosure, the response to the triggering event and the control of the virtual camera movement are performed in each frame of the program execution, that is, the virtual camera is controlled in real time.

[0055] In step S330 , in response to the virtual character moving to an edge area of a designated range boundary, the viewing angle range is controlled to stop following the direction of the virtual character.

[0056] The edge region of the designated range boundary may be the collective region of the target location corresponding to the avatar when the viewing range intersects the designated range boundary. For example, the edge region of the designated range boundary may be a region extending a certain distance from the edge of the designated range boundary toward the center of the scene plane. In this step, when the avatar moves into this region, the viewing range no longer follows the avatar's direction.

[0057] It should be noted that the projection of the virtual camera field of view on the scene plane of the ground plane in the embodiment of the present disclosure, that is, the viewing angle range can be square, rectangular, frame-shaped, or other shapes, such as circle, ellipse, etc.

[0058] Optionally, when the virtual character moves to the edge area of the specified range boundary, while controlling the viewing angle range to stop following the direction of the virtual character, the virtual character can also be controlled to continue moving on the scene plane, so that the stopping of the viewing angle range will not affect the continued movement of the virtual character, thereby avoiding the stopping of the viewing angle range affecting the player's control over the movement of the virtual character.

[0059] By controlling the viewing angle to stop following the direction of the virtual character when it moves to the edge of the specified range, even in 3D games that can rotate the viewing angle, the camera's field of view can be restricted from appearing in content outside the specified range. The lens restriction effect of the virtual camera can also more clearly express the concept of scene boundaries, avoiding the production of a large amount of art materials to fill the edge of the field of view. It can also provide a more immersive game scene experience for top-down perspective games.

[0060] The above steps are described in detail below.

[0061] In some embodiments, the edge area of the designated range boundary may be a collection area of target positions corresponding to the virtual character when the viewing angle range intersects with the designated range boundary. As an example, the method may further include the following steps:

[0062] detecting whether the viewing angle range intersects with the boundary of the designated range; determining the current target position of the virtual character when the viewing angle range intersects with the boundary of the designated range; and traversing all the cases where the viewing angle range intersects with the boundary of the designated range to determine the multiple target positions corresponding to the virtual character;

[0063] A collective area formed by the plurality of target positions is determined as an edge area of the boundary of the designated range.

[0064] In actual applications, there is more than one location where the viewing angle range intersects with the boundary of the specified range. After traversing all the situations where the viewing angle range intersects with the boundary of the specified range, the target positions of the virtual character at these moments can correspond to multiple ones. All corresponding target positions can form a collection area, and this collection area can be used as the edge area of the boundary of the specified range.

[0065] Optionally, the edge area of the specified range boundary may be of various shapes. For example, the edge area of the specified range boundary may be a region band along the edge of the specified range boundary and extending a certain distance toward the center of the scene plane.

[0066] In the disclosed embodiment, when the virtual character moves to the collective area of the target position corresponding to the virtual character where the viewing angle range intersects with the specified range boundary, the viewing angle range will no longer follow the direction of the virtual character, thereby effectively avoiding the appearance of content outside the specified range boundary in the camera's field of view.

[0067] In some embodiments, the viewing angle range may stop following the virtual character's direction only within a certain range of directions. As an example, there may be multiple boundary points corresponding to the boundaries of the viewing angle range; the above step S330 may include the following steps:

[0068] Step S332 : In response to the virtual character moving to the edge area of the designated range boundary, controlling the viewing angle range to stop following the virtual character moving toward the first direction range.

[0069] Among them, the first direction range includes multiple directions with an angle less than 90 degrees with the first direction, the first direction is the direction of the first boundary point relative to the central position of the viewing angle range, and the first boundary point is the boundary point among the multiple boundary points that touches the boundary of the specified range.

[0070] It can also be understood that the first direction range includes all directions that can generate vectors in the first direction. In this step, once the boundary of the viewing angle range touches the specified range boundary, the virtual camera is controlled to stop the viewing angle range and then move towards the contact point.

[0071] In the embodiment of the present disclosure, when the virtual character moves to the edge area of the specified range boundary, the virtual camera is controlled to stop moving the viewing angle range in the direction range pointing to the boundary point. Even in a 3D game that can rotate the viewing angle, the camera's field of view can be restricted so that content outside the specified range boundary does not appear. The lens restriction effect of the virtual camera can also more clearly express the concept of the scene boundary. Furthermore, by stopping the viewing angle range only in a certain direction range without restricting the viewing angle range from continuing to follow the movement of the virtual character in other directions, this method of limiting the virtual camera lens provides smooth and continuous lens changes, which can make the virtual camera movement more continuous and smooth, and will not be completely stuck when touching the plane boundary. When returning to the viewing angle range from the plane boundary, the virtual camera can also keep up with the movement of the virtual character in time, thereby realizing flexible configuration of the viewing angle range, and being able to more flexibly control the movement range of the virtual camera, avoiding the production of a large amount of art materials to fill the edge of the field of view, and providing a more immersive indoor scene experience for top-down perspective games.

[0072] In some embodiments, determining whether a boundary point of the viewing angle range touches a specified range boundary can be achieved by calculating the position of the boundary point, so as to accurately and quickly determine whether the current viewing angle range is about to exceed the boundary. As an example, before step S330, the method may further include the following steps:

[0073] Step a), determining a plurality of boundary points of the viewing angle range according to the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane;

[0074] Step b) determines whether at least one boundary point touches the boundary of a specified range.

[0075] For example, Figure 4 As shown, assuming that the field of view angle FOV of the virtual camera providing the player with the picture is ∠β, the distance between the virtual camera and the center of the camera field of view projection (viewing range) is d, and the current position coordinates of the virtual character are P character , using the above ∠β, d and P character The viewing angle range can be calculated Figure 4 The coordinates of any boundary point in the rectangular area.

[0076] For example, Figure 5 As shown, the spatial coordinates of two spatial markers, P1 and P2, on the boundary of the rectangular area are calculated. Of course, there can be more than just these two spatial markers; you can freely select and use them as boundary points as needed. If the viewing angle is a circular area, the spatial markers are located on the circle that defines the boundary.

[0077] like Figure 5As shown, after calculating the position coordinates of the boundary points of the viewing angle range, it is possible to determine whether the current viewing angle range is about to exceed the specified range boundary based on the position coordinates of these spatial marking points.

[0078] The position coordinates of the boundary point of the viewing angle range are determined by the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, and whether this boundary point touches the boundary of the specified range is used to judge whether the viewing angle range is about to exceed the boundary. This can more accurately and timely determine whether the current viewing angle range is about to exceed the boundary, thereby avoiding the viewing angle range exceeding the boundary and affecting the display effect of the scene boundary.

[0079] As another example, linear interpolation can be used to ensure that the camera is within the bounds of the boundary. For example, for a circular or square area, the space can be expressed as a set of continuous regions (coordinate ranges), and interpolation can be used to control the camera coordinates to always be within these regions. For example, the x-coordinate is limited to (0, 1000); the y-coordinate input value (0, 1000) is interpolated within this range. However, the actual room or game level area may not be continuous.

[0080] Based on the above steps a) and b), it is possible to determine whether the viewing angle range is about to exceed the bounds by means of a coordinate set, so as to accurately and quickly determine the situation of being about to exceed the bounds. As an example, the above step b) may include the following steps:

[0081] Step c) determining whether the coordinate sets of all boundary points are within the coordinate set of the specified range boundary; if so, executing step d); if not, executing step e);

[0082] Step d), determining that none of the boundary points touches the boundary of the specified range;

[0083] Step e) determining whether at least one boundary point touches a boundary of a specified range.

[0084] In practical applications, the coordinates in the embodiments of the present disclosure can be expressed in the form of P(x, y, z), and the set of coordinates can also be a set of x, y, and z values, respectively, so as to further determine whether the boundary point touches the boundary of the specified range, and whether a subsequent coordinate Pn is out of bounds on a certain coordinate axis.

[0085] For example, the specified range boundary corresponding to the scene plane, that is, the scene plane boundary of the character's activity range, is represented in the form of a coordinate set. When the current coordinates of the boundary points of the viewing range such as P1, P2, P3, P4... (the above-mentioned spatial marking points) are all within the coordinate set corresponding to the specified range boundary, they are not out of bounds, otherwise they are out of bounds.

[0086] It should be noted that the coordinate set of the designated range boundary corresponding to the scene plane, that is, the scene plane boundary of the character's activity range, such as the wall between the interior and the outside world, can be set according to needs.

[0087] By judging whether the current coordinates of the view range boundary points are all within the coordinate set of the specified range boundary, it is determined whether the view range is about to exceed the boundary, thereby accurately and quickly determining the situation of being about to exceed the boundary.

[0088] Based on the above steps c), d), and e), the X-axis and Y-axis can be used to control the direction of movement of the virtual camera's perspective, so as to more accurately control the direction of the virtual camera. As an example, the above step S330 may include the following steps:

[0089] Step f), in response to the coordinates of the first boundary point of the viewing angle range not being within the coordinate set of the specified range boundary, determining, from the coordinates of the first boundary point, whether a sub-coordinate of the coordinate set that exceeds the specified range boundary belongs to the X-coordinate axis and / or the Y-coordinate axis; if the sub-coordinate belongs only to the X-coordinate axis, executing step g); if the sub-coordinate belongs only to the Y-coordinate axis, executing step h); if the sub-coordinate belongs to both the X-coordinate axis and the Y-coordinate axis, executing step i);

[0090] Step g), controlling the virtual camera so that the viewing angle stops following the direction of the virtual character on the X-axis;

[0091] Step h), controlling the virtual camera so that the viewing angle stops following the direction of the virtual character on the Y coordinate axis;

[0092] Step i) controls the virtual camera so that the viewing angle stops following the direction of the virtual character.

[0093] In practical applications, the coordinates (X, Y) are used to determine whether a certain coordinate Pn is out of bounds on a certain coordinate axis. For example, Figure 5 As shown in the figure, when any boundary point, that is, the spatial marker point is about to go out of bounds, a judgment is made: if all the spatial marker points go out of bounds only on the X axis, the virtual camera no longer follows the movement of the virtual character on the X axis; if all the spatial marker points go out of bounds only on the Y axis, the virtual camera no longer follows the movement of the virtual character on the Y axis; if all the spatial marker points go out of bounds on both the X and Y axes, the virtual camera no longer follows the movement of the virtual character and remains stationary at the position of the previous frame.

[0094] In the disclosed embodiment, the moving direction of the virtual camera's viewing angle is controlled by means of coordinates (X, Y), thereby enabling more precise control of the direction of the virtual camera.

[0095] In some embodiments, the virtual camera is controlled so that the viewing angle stops following the movement of the virtual character in a first direction, while continuing to follow the movement of the virtual character in directions other than the first direction, thereby achieving more flexible control of the viewing angle. As an example, the above step S330 may include the following steps:

[0096] Step j): in response to the virtual character moving to the edge area of the specified range boundary, controlling the virtual camera to stop the viewing angle range from following the virtual character moving in the first direction range, and continue to follow the direction of the virtual character in directions other than the first direction range.

[0097] For example, when any boundary point, i.e., a space marker point, is about to go out of bounds, Figure 5 As shown, a judgment is made: if all the spatial markers are beyond the boundary only on the X axis, the virtual camera no longer follows the movement of the virtual character on the X axis, and the Y axis coordinate is still the same as the Y axis coordinate value of the virtual character's movement; if all the spatial markers are beyond the boundary only on the Y axis, the virtual camera no longer follows the movement of the virtual character on the Y axis, and the X axis coordinate is still the same as the X axis coordinate value of the virtual character's movement; if all the spatial markers are beyond the boundary on both the X and Y axes, the virtual camera no longer follows the movement of the virtual character and remains stationary at the position of the previous frame.

[0098] While stopping following the virtual character's movement in the first direction range through the field of view range, it continues to follow the virtual character's direction in directions other than the first direction range, providing smooth and continuous lens changes, which can make the virtual camera movement more continuous and smooth, and will not be completely stuck when touching the plane boundary. When returning to the field of view range from the plane boundary, the virtual camera can also keep up with the movement of the virtual character in time, realizing flexible configuration of the field of view range and more flexible control of the movement range of the virtual camera.

[0099] Based on the above step j), whether the viewing angle range follows the direction of movement of the virtual character can be controlled by the X-coordinate axis and the Y-coordinate axis, so as to more accurately control the moving direction of the viewing angle range.

[0100] As an example, the above step j) may include the following steps:

[0101] Step k): In response to the fact that the sub-coordinates of the coordinate set that exceed the specified range in the coordinates of the first boundary point belong only to the X-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis and continues to follow the direction of the virtual character on the Y-coordinate axis.

[0102] For example, Figure 5As shown in FIG, if all the space markers are beyond the boundary only on the X axis, the virtual camera no longer follows the movement of the virtual character on the X axis, and the Y axis coordinate remains the same as the Y axis coordinate value of the virtual character movement.

[0103] As another example, the above step j) may include the following steps:

[0104] In step 1), in response to the fact that the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belong only to the Y coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the Y coordinate axis and continues to follow the direction of the virtual character on the X coordinate axis.

[0105] For example, Figure 5 As shown in the figure, if all the space markers are beyond the boundary only on the Y axis, the virtual camera no longer follows the movement of the virtual character on the Y axis, and the X axis coordinate remains the same as the X axis coordinate value of the virtual character movement.

[0106] In the embodiment of the present disclosure, the X-coordinate axis and the Y-coordinate axis are used to control whether the viewing angle range follows the direction of movement of the virtual character, so that the moving direction of the viewing angle range can be controlled more accurately.

[0107] In some embodiments, controlling the virtual camera can keep the virtual character at a fixed position within the viewing angle range, so that the player can quickly view the virtual character.

[0108] As an example, the above step S320 may include the following steps:

[0109] Step m): controlling the movement of the virtual camera according to the moving position of the virtual character, so that the virtual character is always in a relatively static position within the viewing angle range.

[0110] In actual applications, when the virtual character moves, the boundary points of the viewing angle range, that is, the above-mentioned spatial marker points P1, P2, P3, P4, etc. can also move with the movement of the virtual character, such as displacement, rotation, etc., that is, the boundary points of the viewing angle range and the virtual character are relatively stationary.

[0111] As another example, after step b), the method may further include the following steps:

[0112] In step n), if all boundary points do not touch the boundary of the specified range, the virtual camera is controlled so that the viewing angle range continues to follow the direction of the virtual character and the virtual character is always in a relatively static position in the viewing angle range.

[0113] When all boundary points of the viewing angle range, i.e., the above-mentioned spatial marker points P1, P2, P3, P4, etc., are within the bounds, the virtual camera is controlled so that the viewing angle range continues to follow the movement of the virtual character and the virtual character is always in a relatively static position within the viewing angle range, i.e., the vector difference between the virtual camera position coordinate value and the virtual character coordinate value does not change.

[0114] By controlling the virtual camera so that the virtual character is always in a fixed position within the viewing angle of the virtual camera, it is possible for the player to quickly view the virtual character.

[0115] Based on the above steps a) and b), the position coordinates of the boundary points of the viewing angle range can be calculated using a variety of algorithms to accurately calculate the current position of the boundary points. As an example, the above step a) may include the following steps:

[0116] Step o) determines the boundary points of the viewing angle range by using a trigonometric function algorithm or a space vector algorithm according to the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane.

[0117] For example, Figure 4 As shown, assuming that the field of view angle FOV of the virtual camera providing the player with the picture is ∠β, the distance between the virtual camera and the center of the camera field of view projection (viewing range) is d, and the current position coordinates of the virtual character are P character , using the above ∠β, d and P character , the viewing angle range can be calculated through trigonometric functions or space vectors, that is, Figure 4 The current position coordinates of any boundary point in the rectangular area.

[0118] By calculating the position coordinates of the boundary points of the viewing angle range through various algorithms, the current position of the boundary points of the viewing angle range can be calculated more accurately.

[0119] Based on step o) above, the current position of the boundary point of the viewing range can be calculated using a formula to quickly and accurately calculate the coordinates of the current position of the boundary point. As an example, the viewing range is a rectangle, and there is a target boundary point on one side of the rectangle; step o) above may include the following steps:

[0120] The target boundary point P1 (x, y, z) is determined by the following formula:

[0121] x=x c -d*tan(β / 2)*Sin(∠Z c );

[0122] y=y c +d*tan(β / 2)*cos(∠Z c );

[0123] z=z c ;

[0124] Among them, β represents the preset field of view angle of the virtual camera, d represents the distance between the virtual camera and the center of the field of view, (x c ,y c ,y c ) represents the current position coordinates of the virtual character, ∠Z c Indicates the angle of the virtual character's current position vector point relative to the origin in the virtual scene coordinate system.

[0125] Take trigonometric function algorithm as an example, Figure 4 As shown, the spatial coordinates of two points on the horizontal boundary are obtained and recorded as spatial marker points P1 and P2. character The coordinates are (x c ,y c , z c ), P character The angle parameter of the vector point relative to the origin in the world coordinate system is (∠X c ,∠Y c , ∠Z c ), then: P1(x,y,z); x=x c -d*tan(β / 2)*Sin(∠Z c ); y = y c +d*tan(β / 2)*cos(∠Z c ); z=z c Similarly, the position coordinates of any other marking points P3 and P4 on the projection surface can be obtained as needed.

[0126] The current position of the boundary point of the viewing angle range is calculated by using the trigonometric function algorithm through the formula, which can quickly and accurately calculate the current position coordinates of the boundary point.

[0127] Figure 6 A schematic diagram of a device for controlling the field of view in a virtual scene is provided. A graphical user interface is provided through a terminal device. The virtual scene includes a virtual camera, a scene plane, and a virtual character controlled by the terminal device. The content displayed by the graphical user interface includes the content captured by the virtual camera in the virtual scene. The scene plane corresponds to a specified range boundary. Figure 6 As shown, the control device 600 for the field of view in the virtual scene includes:

[0128] A first control module 601 is configured to control the virtual character to move on the scene plane in response to a movement instruction for the virtual character;

[0129] A second control module 602 is configured to control the movement of the virtual camera so that the viewing angle range moves along with the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the field of view of the virtual camera on the scene plane;

[0130] The third control module 603 is configured to control the viewing angle range to stop following the direction of the virtual character in response to the virtual character moving to an edge area of the designated range boundary.

[0131] In one feasible embodiment, the device further comprises:

[0132] a detection module, configured to detect whether the viewing angle range intersects with the boundary of the specified range, and when detecting that the viewing angle range intersects with the boundary of the specified range, determine the current target position of the virtual character, and traverse all instances where the viewing angle range intersects with the boundary of the specified range to determine a plurality of target positions corresponding to the virtual character;

[0133] A determination module is used to determine a collective area formed by multiple target positions as an edge area of the boundary of the specified range.

[0134] In a feasible embodiment, there are multiple boundary points corresponding to the boundary of the viewing angle range; the third control module is specifically used to: in response to the virtual character moving to the edge area of the boundary of the specified range, control the viewing angle range to stop following the virtual character to move toward the first direction range; wherein, the first direction range includes multiple directions with an angle less than 90 degrees with the first direction, the first direction is the direction of the first boundary point relative to the central position of the viewing angle range, and the first boundary point is the boundary point among the multiple boundary points that touches the boundary of the specified range.

[0135] Through the above method, when a certain boundary point of the viewing range touches the specified range boundary corresponding to the scene plane, the virtual camera is controlled to stop moving in the direction range pointing to the boundary point. Even for 3D games that can rotate the viewing angle, the camera's field of view can be restricted from appearing content outside the specified range boundary. The lens restriction effect of the virtual camera can also more clearly express the concept of the scene boundary. Furthermore, by stopping the viewing range only in a certain direction range without restricting the viewing range from continuing to follow the movement of the virtual character in other directions, this method of limiting the virtual camera lens provides smooth and continuous lens changes, which can make the virtual camera movement more continuous and smooth, and will not be completely stuck when touching the plane boundary. When returning to the viewing range from the plane boundary, the virtual camera can also keep up with the movement of the virtual character in time, realizing flexible configuration of the viewing range, and being able to more flexibly control the movement range of the virtual camera, avoiding the production of a large amount of art materials to fill the edge of the field of view, and providing a more immersive game scene experience for top-down perspective games.

[0136] In a feasible implementation scheme, the third control module is specifically configured to:

[0137] In response to the virtual character moving to the edge area of the designated range boundary, the virtual camera is controlled to stop the viewing angle range from following the virtual character moving in the first direction range, and continue to follow the direction of the virtual character in directions other than the first direction range.

[0138] In one feasible implementation, the third control module is further configured to:

[0139] In response to the virtual character moving to an edge area of the designated range boundary, the viewing angle range is controlled to stop following the virtual character moving in the first direction range, and the virtual character is controlled to continue moving on the scene plane.

[0140] In one feasible embodiment, the device further comprises:

[0141] a determination module, configured to determine a plurality of boundary points of the viewing angle range according to the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane;

[0142] The judging module is configured to judge whether at least one of the boundary points touches the boundary of the designated range.

[0143] In a feasible implementation scheme, the judgment module is specifically used to:

[0144] Determine whether the coordinate sets of all the boundary points are within the coordinate set of the boundary of the specified range;

[0145] If all of the boundary points are within the coordinate set of the specified range boundary, it is determined that none of the boundary points touches the specified range boundary;

[0146] If not all of the boundary points are within the coordinate set of the designated range boundary, it is determined that at least one boundary point touches the designated range boundary.

[0147] In a feasible implementation scheme, the third control module is specifically configured to:

[0148] In response to the coordinates of the first boundary point of the viewing angle range not being within the coordinate set of the specified range boundary, determining, from the coordinates of the first boundary point, that sub-coordinates of the coordinate set that are beyond the specified range boundary belong to the X-coordinate axis and / or the Y-coordinate axis;

[0149] If the sub-coordinate only belongs to the X-coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis;

[0150] If the sub-coordinate only belongs to the Y coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction movement of the virtual character on the Y coordinate axis;

[0151] If the sub-coordinate belongs to the X-coordinate axis and the Y-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character.

[0152] In one feasible implementation, the third control module is further configured to:

[0153] In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the X-coordinate axis, controlling the virtual camera so that the viewing angle range stops following the movement of the virtual character on the X-coordinate axis and continues to follow the movement of the virtual character on the Y-coordinate axis.

[0154] In one feasible implementation, the third control module is further configured to:

[0155] In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the Y coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the Y coordinate axis and continues to follow the direction of the virtual character on the X coordinate axis.

[0156] In one feasible embodiment, the device further comprises:

[0157] The fourth control module is configured to control the virtual camera so that the viewing angle range continues to follow the direction of the virtual character and the virtual character is always in a relatively static position in the viewing angle range if all the boundary points do not touch the boundary of the specified range.

[0158] In a feasible implementation scheme, the determination module is specifically configured to:

[0159] According to the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, a plurality of boundary points of the viewing angle range are determined by a trigonometric function algorithm or a space vector algorithm.

[0160] In a feasible implementation manner, the viewing angle range is a rectangle, and a target boundary point exists on one side of the rectangle; the determination module is further configured to:

[0161] The target boundary point P1 (x, y, z) is determined by the following formula:

[0162] x=x c -d*tan(β / 2)*Sin(∠Z c );

[0163] y=y c +d*tan(β / 2)*cos(∠Z c );

[0164] z=z c ;

[0165] Wherein, β represents the preset field of view angle of the virtual camera, d represents the distance between the virtual camera and the center position of the field of view range, (x c ,y c ,y c ) represents the current position coordinates of the virtual character, ∠Z c Indicates the angle of the current position vector point of the virtual character relative to the origin in the virtual scene coordinate system.

[0166] In a feasible implementation scheme, the second control module is specifically configured to:

[0167] The movement of the virtual camera is controlled according to the moving position of the virtual character, so that the virtual character is always in a relatively static position within the viewing angle range.

[0168] The device for controlling the field of view in a virtual scene provided by the embodiment of the present disclosure has the same technical features as the method for controlling the field of view in a virtual scene provided by the above embodiment, and therefore can solve the same technical problems and achieve the same technical effects.

[0169] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown, including: a processor 701, a storage medium 702, and a bus 703. The storage medium 702 stores machine-readable instructions executable by the processor 701. When the electronic device executes a method for controlling the field of view in a virtual scene in the embodiment, the processor 701 communicates with the storage medium 702 via the bus 703. The processor 701 executes the machine-readable instructions. The processor 701 performs the preamble of the method item to perform the following steps:

[0170] In response to a movement instruction for the virtual character, controlling the virtual character to move on the scene plane according to the movement instruction;

[0171] Controlling the movement of the virtual camera so that the viewing angle range moves along with the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the field of view of the virtual camera on the scene plane;

[0172] In response to the virtual character moving to an edge area of the designated range boundary, the viewing angle range is controlled to stop following the direction movement of the virtual character.

[0173] In a feasible embodiment, the processor is also used to: detect whether the viewing angle range and the boundary of the specified range have an intersection; when it is detected that the viewing angle range and the boundary of the specified range have an intersection, determine the current target position of the virtual character, and traverse all the situations where the viewing angle range and the boundary of the specified range have intersections to determine the multiple target positions corresponding to the virtual character; and determine the collective area formed by the multiple target positions as the edge area of the boundary of the specified range.

[0174] In one feasible embodiment, the processor 701 has a plurality of boundary points corresponding to the boundaries of the execution viewing angle range; in response to the virtual character moving to the edge area of the specified range boundary, controlling the viewing angle range to stop following the direction of the virtual character is specifically configured to:

[0175] In response to the virtual character moving to the edge area of the boundary of the specified range, the viewing angle range is controlled to stop following the virtual character to move toward a first direction range; wherein, the first direction range includes multiple directions with an angle less than 90 degrees with the first direction, the first direction is the direction of the first boundary point relative to the central position of the viewing angle range, and the first boundary point is a boundary point among the multiple boundary points that touches the boundary of the specified range.

[0176] Through the above method, when a certain boundary point of the viewing range touches the specified range boundary corresponding to the scene plane, the virtual camera is controlled to stop moving in the direction range pointing to the boundary point. Even for 3D games that can rotate the viewing angle, the camera's field of view can be restricted from appearing content outside the specified range boundary. The lens restriction effect of the virtual camera can also more clearly express the concept of the scene boundary. Furthermore, by stopping the viewing range only in a certain direction range without restricting the viewing range from continuing to follow the movement of the virtual character in other directions, this method of limiting the virtual camera lens provides smooth and continuous lens changes, which can make the virtual camera movement more continuous and smooth, and will not be completely stuck when touching the plane boundary. When returning to the viewing range from the plane boundary, the virtual camera can also keep up with the movement of the virtual character in time, realizing flexible configuration of the viewing range, and being able to more flexibly control the movement range of the virtual camera, avoiding the production of a large amount of art materials to fill the edge of the field of view, and providing a more immersive game scene experience for top-down perspective games.

[0177] In a feasible embodiment, when the processor 701 controls the viewing angle range to stop following the virtual character moving toward the first direction range in response to the virtual character moving to the edge area of the designated range boundary, the processor 701 is specifically configured to:

[0178] In response to the virtual character moving to the edge area of the designated range boundary, the virtual camera is controlled to stop the viewing angle range from following the virtual character moving in the first direction range, and continue to follow the direction of the virtual character in directions other than the first direction range.

[0179] In a feasible embodiment, the processor is further used to: in response to the virtual character moving to the edge area of the specified range boundary, control the viewing angle range to stop following the virtual character moving in the first direction range, and control the virtual character to continue moving on the scene plane.

[0180] In a feasible embodiment, in response to the virtual character moving to the edge area of the designated range boundary, before controlling the viewing angle range to stop following the virtual character moving in the first direction range, the processor is further configured to:

[0181] Determining a plurality of boundary points of the viewing angle range according to the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane;

[0182] Determine whether at least one of the boundary points touches the designated range boundary.

[0183] In a feasible implementation manner, when determining whether at least one boundary point touches the boundary of the specified range, the processor 701 is specifically configured to:

[0184] Determining whether the coordinate sets of all the boundary points are within the coordinate set of the boundary of the specified range;

[0185] If all of the boundary points are within the coordinate set of the specified range boundary, it is determined that none of the boundary points touches the specified range boundary;

[0186] If not all of the boundary points are within the coordinate set of the designated range boundary, it is determined that at least one boundary point touches the designated range boundary.

[0187] In a feasible embodiment, when the processor 701 controls the viewing angle range to stop following the virtual character moving toward the first direction range in response to the virtual character moving to the edge area of the designated range boundary, the processor 701 is specifically configured to:

[0188] In response to the coordinates of the first boundary point of the viewing angle range not being within the coordinate set of the specified range boundary, determining, from the coordinates of the first boundary point, that sub-coordinates of the coordinate set that are beyond the specified range boundary belong to the X-coordinate axis and / or the Y-coordinate axis;

[0189] If the sub-coordinate only belongs to the X-coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis;

[0190] If the sub-coordinate only belongs to the Y coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction movement of the virtual character on the Y coordinate axis;

[0191] If the sub-coordinate belongs to the X-coordinate axis and the Y-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character.

[0192] In a feasible embodiment, when the processor 701 controls the virtual camera to stop following the movement of the virtual character in the first direction range in response to the virtual character moving to the edge area of the designated range boundary, and continues to follow the direction of the virtual character in directions other than the first direction range, the processor 701 is specifically configured to:

[0193] In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the X-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis and continues to follow the direction of the virtual character on the Y-coordinate axis.

[0194] In a feasible embodiment, when the processor 701 controls the virtual camera to stop following the movement of the virtual character in the first direction range in response to the virtual character moving to the edge area of the designated range boundary, and continues to follow the direction of the virtual character in directions other than the first direction range, the processor 701 is further configured to:

[0195] In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the Y coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the Y coordinate axis and continues to follow the direction of the virtual character on the X coordinate axis.

[0196] In a feasible implementation manner, after determining whether at least one boundary point touches the boundary of the specified range, the processor is further configured to:

[0197] If all the boundary points do not touch the designated range boundary, the virtual camera is controlled to make the viewing angle range continue to follow the movement of the virtual character and to make the orientation of the virtual character always remain at a relatively static position in the viewing angle range.

[0198] In a feasible implementation manner, the processor 701, when determining the multiple boundary points of the viewing angle range based on the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, is specifically configured to:

[0199] According to the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, a plurality of boundary points of the viewing angle range are determined by a trigonometric function algorithm or a space vector algorithm.

[0200] In one feasible embodiment, the viewing angle range is a rectangle, and there is a target boundary point on one side of the rectangle; when the processor 701 determines the multiple boundary points of the viewing angle range through a trigonometric function algorithm based on the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, it is specifically configured to:

[0201] The target boundary point P1 (x, y, z) is determined by the following formula:

[0202] x=x c -d*tan(β / 2)*Sin(∠Z c );

[0203] y=y c+d*tan(β / 2)*cos(∠Z c );

[0204] z=z c ;

[0205] Wherein, β represents the preset field of view angle of the virtual camera, d represents the distance between the virtual camera and the center position of the field of view range, (x c ,y c ,y c ) represents the current position coordinates of the virtual character, ∠Z c Indicates the angle of the current position vector point of the virtual character relative to the origin in the virtual scene coordinate system.

[0206] In a feasible implementation manner, when the processor 701 controls the movement of the virtual camera so that the viewing angle moves along with the direction of the virtual character, the processor 701 is specifically configured to:

[0207] The movement of the virtual camera is controlled according to the moving position of the virtual character, so that the virtual character is always in a relatively static position within the viewing angle range.

[0208] In practical applications, the memory 701 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage. The system network element communicates with at least one other network element via at least one communication interface 704 (which may be wired or wireless), and may utilize the Internet, a wide area network, a local area network, a metropolitan area network, or the like.

[0209] The bus 703 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0210] Among them, the memory 701 is used to store programs, and the processor 702 executes the program after receiving the execution instruction. The method executed by the device defined by the process disclosed in any embodiment of the present disclosure can be applied to the processor 702 or implemented by the processor 702.

[0211] The processor 702 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 702 or by instructions in the form of software. The above-mentioned processor 702 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 701, and processor 702 reads the information in memory 701 and, in conjunction with its hardware, completes the steps of the above method.

[0212] The present disclosure also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium. The computer program is executed by a processor when the processor is running, and the processor performs the following steps:

[0213] In response to a movement instruction for the virtual character, controlling the virtual character to move on the scene plane;

[0214] Controlling the movement of the virtual camera so that the viewing angle range moves along with the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the field of view of the virtual camera on the scene plane;

[0215] In response to the virtual character moving to an edge area of the designated range boundary, the viewing angle range is controlled to stop following the direction movement of the virtual character.

[0216] In a feasible embodiment, the processor is also used to: detect whether the viewing angle range and the boundary of the specified range have an intersection; when it is detected that the viewing angle range and the boundary of the specified range have an intersection, determine the current target position of the virtual character, and traverse all the situations where the viewing angle range and the boundary of the specified range have intersections to determine the multiple target positions corresponding to the virtual character; and determine the collective area formed by the multiple target positions as the edge area of the boundary of the specified range.

[0217] In one feasible embodiment, the processor has a plurality of boundary points corresponding to the boundaries of the execution viewing angle range; and in response to the virtual character moving to the edge area of the specified range boundary, controlling the viewing angle range to stop following the direction of the virtual character is specifically configured to:

[0218] In response to the virtual character moving to the edge area of the boundary of the specified range, the viewing angle range is controlled to stop following the virtual character to move toward a first direction range; wherein, the first direction range includes multiple directions with an angle less than 90 degrees with the first direction, the first direction is the direction of the first boundary point relative to the central position of the viewing angle range, and the first boundary point is a boundary point among the multiple boundary points that touches the boundary of the specified range.

[0219] Through the above method, when a certain boundary point of the viewing range touches the specified range boundary corresponding to the scene plane, the virtual camera is controlled to stop moving in the direction range pointing to the boundary point. Even for 3D games that can rotate the viewing angle, the camera's field of view can be restricted from appearing content outside the specified range boundary. The lens restriction effect of the virtual camera can also more clearly express the concept of the scene boundary. Furthermore, by stopping the viewing range only in a certain direction range without restricting the viewing range from continuing to follow the movement of the virtual character in other directions, this method of limiting the virtual camera lens provides smooth and continuous lens changes, which can make the virtual camera movement more continuous and smooth, and will not be completely stuck when touching the plane boundary. When returning to the viewing range from the plane boundary, the virtual camera can also keep up with the movement of the virtual character in time, realizing flexible configuration of the viewing range, and being able to more flexibly control the movement range of the virtual camera, avoiding the production of a large amount of art materials to fill the edge of the field of view, and providing a more immersive game scene experience for top-down perspective games.

[0220] In a feasible embodiment, when the processor controls the viewing angle range to stop following the virtual character moving toward the first direction range in response to the virtual character moving to the edge area of the designated range boundary, the processor is specifically configured to:

[0221] In response to the virtual character moving to the edge area of the designated range boundary, the virtual camera is controlled to stop the viewing angle range from following the virtual character moving in the first direction range, and continue to follow the direction of the virtual character in directions other than the first direction range.

[0222] In a feasible embodiment, the processor is further used to: in response to the virtual character moving to the edge area of the specified range boundary, control the viewing angle range to stop following the virtual character moving in the first direction range, and control the virtual character to continue moving on the scene plane.

[0223] In a feasible embodiment, in response to the virtual character moving to the edge area of the designated range boundary, before controlling the viewing angle range to stop following the virtual character moving in the first direction range, the processor is further configured to:

[0224] Determining a plurality of boundary points of the viewing angle range according to the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane;

[0225] Determine whether at least one of the boundary points touches the designated range boundary.

[0226] In a feasible implementation manner, when the processor determines whether at least one boundary point touches the boundary of the specified range, the processor is specifically configured to:

[0227] Determine whether the coordinate sets of all the boundary points are within the coordinate set of the boundary of the specified range;

[0228] If all of the boundary points are within the coordinate set of the specified range boundary, it is determined that none of the boundary points touches the specified range boundary;

[0229] If not all of the boundary points are within the coordinate set of the designated range boundary, it is determined that at least one boundary point touches the designated range boundary.

[0230] In a feasible embodiment, when the processor controls the viewing angle range to stop following the virtual character moving toward the first direction range in response to the virtual character moving to the edge area of the designated range boundary, the processor is specifically configured to:

[0231] In response to the coordinates of the first boundary point of the viewing angle range not being within the coordinate set of the specified range boundary, determining, from the coordinates of the first boundary point, that sub-coordinates of the coordinate set that are beyond the specified range boundary belong to the X-coordinate axis and / or the Y-coordinate axis;

[0232] If the sub-coordinate only belongs to the X-coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis;

[0233] If the sub-coordinate only belongs to the Y coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction movement of the virtual character on the Y coordinate axis;

[0234] If the sub-coordinate belongs to the X-coordinate axis and the Y-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character.

[0235] In a feasible embodiment, the processor, in response to the virtual character moving to the edge area of the designated range boundary, controls the virtual camera so that the viewing angle range stops following the virtual character moving in the first direction range, and continues to follow the direction of the virtual character in directions other than the first direction range, specifically for:

[0236] In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the X-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis and continues to follow the direction of the virtual character on the Y-coordinate axis.

[0237] In a feasible embodiment, when the processor controls the virtual camera to stop following the movement of the virtual character in the first direction range in response to the virtual character moving to the edge area of the designated range boundary, and to continue following the direction of the virtual character in directions other than the first direction range, the processor is further configured to:

[0238] In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the Y coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the Y coordinate axis and continues to follow the direction of the virtual character on the X coordinate axis.

[0239] In a feasible implementation manner, after determining whether at least one boundary point touches the boundary of the specified range, the processor is further configured to:

[0240] If all the boundary points do not touch the designated range boundary, the virtual camera is controlled to make the viewing angle range continue to follow the movement of the virtual character and to make the orientation of the virtual character always remain at a relatively static position in the viewing angle range.

[0241] In a feasible embodiment, when the processor determines the multiple boundary points of the viewing angle range based on the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, the processor is specifically configured to:

[0242] According to the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, a plurality of boundary points of the viewing angle range are determined by a trigonometric function algorithm or a space vector algorithm.

[0243] In one feasible embodiment, the viewing angle range is a rectangle, and there is a target boundary point on one side of the rectangle; when the processor determines the multiple boundary points of the viewing angle range through a trigonometric function algorithm based on the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, it is specifically configured to:

[0244] The target boundary point P1 (x, y, z) is determined by the following formula:

[0245] x=x c -d*tan(β / 2)*Sin(∠Z c );

[0246] y=y c +d*tan(β / 2)*cos(∠Z c );

[0247] z=z c ;

[0248] Wherein, β represents the preset field of view angle of the virtual camera, d represents the distance between the virtual camera and the center position of the field of view range, (x c ,y c ,y c ) represents the current position coordinates of the virtual character, ∠Z c Indicates the angle of the current position vector point of the virtual character relative to the origin in the virtual scene coordinate system.

[0249] In a feasible implementation manner, when the processor controls the movement of the virtual camera so that the viewing angle moves along with the direction of the virtual character, the processor is specifically configured to:

[0250] The movement of the virtual camera is controlled according to the moving position of the virtual character, so that the virtual character is always in a relatively static position within the viewing angle range.

[0251] In the embodiments of the present disclosure, the computer program can also execute other machine-readable instructions when run by the processor to execute methods as described in other embodiments. For the specific execution method steps and principles, please refer to the description of the embodiments and will not be repeated here.

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

[0253] For another example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

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

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

[0256] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method for controlling the field of view in the virtual scene described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

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

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

Claims

1. A method for controlling the field of view in a virtual scene, characterized in that: A graphical user interface is provided through a terminal device, wherein the virtual scene includes a virtual camera, a scene plane, and a virtual character controlled by the terminal device, and content displayed by the graphical user interface includes content captured by the virtual camera in the virtual scene, and the scene plane corresponds to a specified range boundary; the method includes: In response to a movement instruction for the virtual character, controlling the virtual character to move on the scene plane; Controlling the movement of the virtual camera so that the viewing angle range moves along with the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the field of view of the virtual camera on the scene plane; and the boundaries of the viewing angle range correspond to a plurality of boundary points; In response to the virtual character moving to the edge area of the boundary of the specified range, the viewing angle range is controlled to stop following the virtual character to move toward the first direction range; wherein, the first direction range includes multiple directions with an angle less than 90 degrees with the first direction, the first direction is the direction of the first boundary point relative to the central position of the viewing angle range, and the first boundary point is the boundary point of the multiple boundary points that contacts the boundary of the specified range; the edge area is the collective area of the target position corresponding to the virtual character when the viewing angle range intersects with the boundary of the specified range.

2. The method according to claim 1, characterized in that Also includes: detecting whether the viewing angle range intersects with the boundary of the designated range; determining the current target position of the virtual character when the viewing angle range intersects with the boundary of the designated range; and traversing all the cases where the viewing angle range intersects with the boundary of the designated range to determine the multiple target positions corresponding to the virtual character; A collective area formed by the plurality of target positions is determined as an edge area of the boundary of the designated range.

3. The method according to claim 1, characterized in that In response to the virtual character moving to the edge area of the designated range boundary, controlling the viewing angle range to stop following the virtual character moving toward the first direction range includes: In response to the virtual character moving to the edge area of the designated range boundary, the virtual camera is controlled to stop the viewing angle range from following the virtual character moving in the first direction range, and continue to follow the direction of the virtual character in directions other than the first direction range.

4. The method according to claim 1, wherein In response to the virtual character moving to the edge area of the designated range boundary, controlling the viewing angle range to stop following the virtual character moving toward the first direction range includes: In response to the virtual character moving to an edge area of the designated range boundary, the viewing angle range is controlled to stop following the virtual character moving in the first direction range, and the virtual character is controlled to continue moving on the scene plane.

5. The method according to claim 1, wherein Before controlling the viewing angle range to stop following the virtual character moving toward the first direction range in response to the virtual character moving to the edge area of the designated range boundary, the method further includes: Determining a plurality of boundary points of the viewing angle range according to the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane; Determine whether at least one of the boundary points touches the designated range boundary.

6. The method according to claim 5, characterized in that The determining whether at least one of the boundary points touches the boundary of the specified range includes: Determine whether the coordinate sets of all the boundary points are within the coordinate set of the boundary of the specified range; If all of the boundary points are within the coordinate set of the specified range boundary, it is determined that none of the boundary points touches the specified range boundary; If not all of the boundary points are within the coordinate set of the designated range boundary, it is determined that at least one boundary point touches the designated range boundary.

7. The method according to claim 6, characterized in that In response to the virtual character moving to the edge area of the designated range boundary, controlling the viewing angle range to stop following the virtual character moving toward the first direction range includes: In response to the coordinates of the first boundary point of the viewing angle range not being within the coordinate set of the specified range boundary, determining, from the coordinates of the first boundary point, that sub-coordinates of the coordinate set that are beyond the specified range boundary belong to the X-coordinate axis and / or the Y-coordinate axis; If the sub-coordinate only belongs to the X-coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis; If the sub-coordinate only belongs to the Y coordinate axis, controlling the virtual camera so that the viewing angle range stops following the direction movement of the virtual character on the Y coordinate axis; If the sub-coordinate belongs to the X-coordinate axis and the Y-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character.

8. The method according to claim 3, characterized in that In response to the virtual character moving to the edge area of the designated range boundary, controlling the virtual camera so that the viewing angle range stops following the virtual character moving in the first direction range and continues to follow the direction of the virtual character in directions other than the first direction range, includes: In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the X-coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the X-coordinate axis and continues to follow the direction of the virtual character on the Y-coordinate axis.

9. The method according to claim 3, characterized in that In response to the virtual character moving to the edge area of the designated range boundary, controlling the virtual camera so that the viewing angle range stops following the movement of the virtual character in the first direction range and continues to follow the direction of the virtual character in directions other than the first direction range, further comprising: In response to the sub-coordinates of the coordinate set that exceeds the specified range boundary in the coordinates of the first boundary point belonging only to the Y coordinate axis, the virtual camera is controlled so that the viewing angle range stops following the direction of the virtual character on the Y coordinate axis and continues to follow the direction of the virtual character on the X coordinate axis.

10. The method according to claim 5, characterized in that After determining whether at least one of the boundary points touches the boundary of the specified range, the method further includes: If all the boundary points do not touch the designated range boundary, the virtual camera is controlled to make the viewing angle range continue to follow the direction of the virtual character and to keep the virtual character at a relatively static position in the viewing angle range.

11. The method according to claim 5, characterized in that The step of determining the plurality of boundary points of the viewing angle range according to the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane includes: According to the current position of the virtual character, the preset field of view angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane, the multiple boundary points of the viewing angle range are determined by a trigonometric function algorithm or a space vector algorithm.

12. The method according to claim 11, characterized in that The viewing angle range is a rectangle, and there is a target boundary point on one side of the rectangle; The step of determining the plurality of boundary points of the viewing angle range by a trigonometric function algorithm based on the current position of the virtual character, the preset viewing angle of the virtual camera, and the preset height of the virtual camera relative to the scene plane comprises: The target boundary point P1 (x, y, z) is determined by the following formula: x=x c -d*tan(β / 2)*Sin(∠Z c ); y=y c +d*tan(β / 2)*cos(∠Z c ); with=with c ; Wherein, β represents the preset field of view angle of the virtual camera, d represents the distance between the virtual camera and the center position of the field of view range, (x c ,y c ,y c ) represents the current position coordinates of the virtual character, ∠Z c Indicates the angle of the current position vector point of the virtual character relative to the origin in the virtual scene coordinate system.

13. The method according to claim 1, wherein The controlling the movement of the virtual camera so that the viewing angle moves along with the direction of the virtual character includes: The movement of the virtual camera is controlled according to the moving position of the virtual character, so that the virtual character is always in a relatively static position within the viewing angle range.

14. A device for controlling the field of view in a virtual scene, characterized in that: A graphical user interface is provided through a terminal device, wherein the virtual scene includes a virtual camera, a scene plane, and a virtual character controlled by the terminal device, and content displayed by the graphical user interface includes content captured by the virtual camera in the virtual scene, and the scene plane corresponds to a specified range boundary; the apparatus comprises: a first control module, configured to control the virtual character to move on the scene plane in response to a movement instruction for the virtual character; A second control module is configured to control the movement of the virtual camera so that the viewing angle range moves along with the direction of the virtual character; wherein the viewing angle range is the range corresponding to the projection of the field of view of the virtual camera on the scene plane; The third control module is used to control the viewing angle range to stop following the direction of the virtual character in response to the virtual character moving to the edge area of the boundary of the specified range; there are multiple boundary points corresponding to the boundary of the viewing angle range; the third control module is specifically used to: in response to the virtual character moving to the edge area of the boundary of the specified range, control the viewing angle range to stop following the virtual character moving to the first direction range; wherein, the first direction range includes multiple directions with an angle less than 90 degrees with the first direction, the first direction is the direction of the first boundary point relative to the central position of the viewing angle range, and the first boundary point is the boundary point of the multiple boundary points that contacts the boundary of the specified range; the edge area is the collective area of the target position corresponding to the virtual character when the viewing angle range intersects with the boundary of the specified range.

15. An electronic terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.

16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Game control method and device, terminal equipment, medium and program product

    CN115501591A

  • Method, an apparatus and a computer program product for generating an image

    US20060258449A1