WO2023246313A1 - 游戏画面控制方法、装置和电子设备 - Google Patents

游戏画面控制方法、装置和电子设备 Download PDF

Info

Publication number
WO2023246313A1
WO2023246313A1 PCT/CN2023/091539 CN2023091539W WO2023246313A1 WO 2023246313 A1 WO2023246313 A1 WO 2023246313A1 CN 2023091539 W CN2023091539 W CN 2023091539W WO 2023246313 A1 WO2023246313 A1 WO 2023246313A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual
point
scene
controlled
virtual camera
Prior art date
Application number
PCT/CN2023/091539
Other languages
English (en)
French (fr)
Inventor
李伟楠
Original Assignee
网易(杭州)网络有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 网易(杭州)网络有限公司 filed Critical 网易(杭州)网络有限公司
Publication of WO2023246313A1 publication Critical patent/WO2023246313A1/zh

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • A63F13/525Changing parameters of virtual cameras
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding

Definitions

  • the present disclosure relates to the field of game technology, and in particular, to a game screen control method, device and electronic device.
  • virtual cameras In games with a 3D perspective, virtual cameras usually use a wide viewing angle to shoot game scenes, so that when players participate in the game, they can not only see the virtual character controlled by the player, but also observe the terrain, environment and other global information of the game scene, which is convenient for Players make decisions.
  • the virtual camera needs to keep a long distance from the virtual character; when the virtual character is blocked by the model in the scene, the virtual camera will move to the other side of the model to shoot the virtual character from a close shot. When the virtual character is not blocked, the virtual camera will return to a farther position. This method will lead to frequent switching of far and near lenses, causing instability in the game screen displayed on the terminal device and giving players a negative visual experience.
  • the purpose of the present disclosure is to provide a game screen control method, device and electronic device to achieve relatively smooth adjustment of the shooting lens, so that the player can continue to observe the controlled virtual object and at the same time observe the global information of the scene.
  • Improve the player's gaming experience improve the stability of the game screen displayed on the terminal device, reduce the running time of the terminal device, and save the power consumption of the terminal device.
  • embodiments of the present disclosure provide a game screen control method, which provides a graphical user interface through a terminal device; the graphical user interface displays: the first scene screen captured by the virtual camera in the game in the virtual scene;
  • the method includes: in response to the controlled virtual object in the first scene picture being blocked by the first obstacle, determining a target position point from the first scene picture; wherein the controlled virtual object is controlled by the terminal device; based on the target position point in The mapping point in the virtual scene and the position of the virtual camera in the virtual scene generate a virtual straight line; determine the intersection point of the virtual straight line and the plane where the controlled virtual object is located, and determine the intersection point as the designated position point on the plane where the controlled virtual object is located; where , the connection between the position of the virtual camera in the virtual scene and the position of the controlled virtual object is at a preset angle with the plane where the controlled virtual object is located; determine whether there is a second obstacle between the virtual camera and the specified position point; if There is no second obstacle, and the virtual camera is controlled to
  • embodiments of the present disclosure provide a game screen control device that provides a graphics screen through a terminal device.
  • User interface the graphical user interface displays: the first scene picture captured by the virtual camera in the game in the virtual scene; the device includes: a first determination module configured to execute the controlled virtualization in response to the first scene picture.
  • the object is blocked by the first obstacle, and the target position point is determined from the first scene picture; wherein the controlled virtual object is controlled through the terminal device; the generation module is configured to perform mapping points based on the target position point in the virtual scene and The position of the virtual camera in the virtual scene generates a virtual straight line; the second determination module is configured to determine the intersection point of the virtual straight line and the plane where the controlled virtual object is located, and determine the intersection point as a designated position point on the plane where the controlled virtual object is located. ; Wherein, the connection between the position of the virtual camera in the virtual scene and the position of the controlled virtual object forms a preset angle with the plane where the controlled virtual object is located; the control module is configured to determine the relationship between the virtual camera and the designated position point.
  • the second obstacle includes the first obstacle, or obstacles other than the first obstacle.
  • embodiments of the present disclosure provide an electronic device, including a processor and a memory.
  • the memory stores machine-executable instructions that can be executed by the processor.
  • the processor executes the machine-executable instructions to implement the above game screen control method.
  • embodiments of the present disclosure provide a machine-readable storage medium.
  • the machine-readable storage medium stores machine-executable instructions.
  • the machine-executable instructions When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to Implement the above game screen control method.
  • the above game screen control method, device and electronic device in response to the controlled virtual object in the first scene screen being blocked by the first obstacle, determine the target position point from the first scene screen; wherein the controlled virtual object passes through the terminal device Perform control; generate a virtual straight line based on the mapping point of the target position point in the virtual scene and the position of the virtual camera in the virtual scene; determine the intersection point of the virtual straight line and the plane where the controlled virtual object is located, and determine the intersection point as where the controlled virtual object is located A designated position point on the plane; where the connection between the position of the virtual camera in the virtual scene and the position of the controlled virtual object is at a preset angle with the plane where the controlled virtual object is located; determine the distance between the virtual camera and the designated position point Whether there is a second obstacle; if there is no second obstacle, control the movement of the virtual camera based on the mapping point so that the controlled virtual object in the second scene captured by the moved virtual camera is not blocked; where, the first The second obstacle includes the first obstacle, or obstacles other than the first obstacle.
  • a target position point is first determined from the scene picture, and the mapping point of the target position point in the virtual scene is obtained. Then the designated position point is determined based on the mapping point on the plane where the controlled virtual object is located. When the virtual camera and the designated position When there are no obstacles between the points, the virtual camera movement is controlled based on the mapping points.
  • This method can prevent the controlled virtual objects in the scene captured by the virtual camera from being blocked; when the controlled virtual objects are blocked, the movement is relatively smooth.
  • the adjustment of the shooting lens allows players to continue to observe controlled virtual objects and at the same time observe the global information of the scene, which improves the player's gaming experience, improves the stability of the game screen displayed on the terminal device, and reduces the running time of the terminal device. Saves the power consumption of terminal equipment.
  • Figure 1 is a schematic diagram of a scene image obtained by shooting a controlled virtual object from a long distance by a virtual camera provided by one embodiment of the present disclosure
  • Figure 2 is a schematic diagram of a scene captured by a virtual camera provided by one embodiment of the present disclosure when it is very close to a controlled virtual object;
  • Figure 3 is a flow chart of a game screen control method provided by one embodiment of the present disclosure.
  • Figure 4 is a schematic diagram of an observation point provided by one embodiment of the present disclosure.
  • Figure 5 is a schematic diagram of a target position point in a first scene picture provided by one embodiment of the present disclosure
  • Figure 6 is a schematic diagram of a designated position point on a plane where a controlled virtual object is located according to one embodiment of the present disclosure
  • Figure 7 is a schematic diagram of another target position point in the first scene picture provided by one embodiment of the present disclosure.
  • Figure 8 is a schematic diagram of a designated position point on the plane where another controlled virtual object is located according to one embodiment of the present disclosure
  • Figure 10 is a schematic diagram of a virtual camera moving to a preset position according to one embodiment of the present disclosure
  • virtual cameras are often set up with a wide angle of view to shoot virtual scenes. That is, the virtual camera needs to be far away from the player model and shoot scenes with a larger field of view in order to have a better combat and gameplay experience.
  • the virtual camera usually moves according to the virtual character controlled by the player (also called a controlled virtual object), and the player observes the virtual character through the scene screen.
  • the usual approach is to directly move the virtual camera to the edge of the wall model so that the virtual camera and the controlled virtual object are located on the same side of the wall model.
  • the controlled virtual object appears in the captured scene screen, and the player can find the location of the controlled virtual object through the scene screen.
  • the virtual camera When a controlled virtual object moves near an obstacle, the virtual camera will frequently switch near and far positions depending on whether the controlled virtual object is blocked by the obstacle, causing the scene to switch frequently, giving players a negative visual experience.
  • Figure 1 is a scene image obtained by a virtual camera shooting a controlled virtual object from a long distance.
  • the controlled virtual object is close to the low wall model, the controlled virtual object is blocked by the low wall model; the virtual camera will quickly move to the vicinity of the low wall. , the position shown by the circle in Figure 1, and the virtual camera and the controlled virtual object are located on the same side of the low wall model. Since the virtual camera is very close to the controlled virtual object, the captured scene picture is usually the picture shown in Figure 2.
  • the controlled virtual object occupies most of the display area of the scene picture, and even the controlled virtual object cannot be completely displayed in the scene picture. It is difficult for players to observe the global information of the virtual scene through the scene screen.
  • embodiments of the present disclosure provide a game screen control method, device and electronic device. This technology can be applied in the shooting process of game scenes or other virtual scenes.
  • the game screen control method in one embodiment of the present disclosure can be run on a local terminal device or a server.
  • the method can be implemented and executed based on a cloud interaction system, where the cloud interaction system includes a server and a client device.
  • cloud gaming refers to a gaming method based on cloud computing.
  • the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a television, a computer, a handheld computer, etc.; however, the information processing is done in the cloud.
  • Cloud gaming server When playing a game, the player operates the client device to send operating instructions to the cloud game server.
  • the cloud game server runs the game according to the operating instructions, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the cloud game server performs operations through the client device. Decode and output game screen.
  • the local terminal device stores the game program and is used to present the game screen.
  • the local terminal device is used to interact with players through a graphical user interface, that is, conventionally downloading, installing and running game programs through electronic devices.
  • the local terminal device may provide the graphical user interface to the player in a variety of ways. For example, it may be rendered and displayed on the display screen of the terminal, or provided to the player through holographic projection.
  • the local terminal device may include a display screen and a processor.
  • the display screen is used to present a graphical user interface.
  • the graphical user interface includes a game screen.
  • the processor is used to run the game, generate the graphical user interface, and control the graphical user interface. displayed on the display screen.
  • Step S302 in response to the controlled virtual object in the first scene being blocked by the first obstacle, determining the target position point from the first scene; wherein the controlled virtual object is controlled by the terminal device;
  • the controlled virtual object is always moving in the virtual scene, and the environment in which the controlled virtual object is located is also changing, it is possible to detect whether the above-mentioned straight line is cut off for each frame of the first scene captured by the virtual camera, thereby real-time Determine whether there is a first obstacle between the virtual camera and the controlled virtual object, that is, whether the controlled virtual object is blocked.
  • This embodiment aims to find a suitable moving path or a suitable moving position point for the virtual camera, so that the controlled virtual object continues to appear in the scene picture, while maintaining a large shooting angle of the scene picture, and avoiding the sudden close range of the virtual camera.
  • the target position point is determined from the first scene picture.
  • the first scene picture is a two-dimensional picture, corresponding to a two-dimensional coordinate system; in actual implementation, the coordinates of one or more alternative location points can be determined in advance, and the target location point can be selected from the alternative location points, or
  • the target position point is determined according to the picture content of the first scene picture.
  • the controlled virtual object can pass through many planes in the three-dimensional space. In this embodiment, it is necessary to determine the plane where the controlled virtual object is located.
  • the plane where the controlled virtual object is located needs to be determined based on the position of the virtual camera. For example, in the virtual space, the virtual camera and the controlled virtual object form a straight line, and the plane where the controlled virtual object is located needs to be at a certain angle with the straight line, or the plane where the controlled virtual object is located needs to be at a certain angle with the straight line in a specific direction. Angle; for another example, according to the position and orientation of the virtual camera, a straight line is formed. The plane where the controlled virtual object is located needs to be at a certain angle with the straight line, or the plane where the controlled virtual object is located needs to be at a certain angle with the straight line in a specific direction. Angle.
  • the straight line formed by the virtual camera and the controlled virtual object is perpendicular to the plane where the controlled virtual object is located.
  • the plane where the controlled virtual object is located can be uniquely determined in the three-dimensional space of the virtual scene.
  • point B in Figure 5 is the target position point in the first scene screen.
  • the mapping point of the target position point in the virtual scene forms a straight line with the virtual camera. This straight line is shown as the dotted line in Figure 6.
  • This straight line Pass through the virtual camera and point B'; point B' is the intersection point of the straight line and the plane where the controlled virtual object is located.
  • Point A is the observation point located on the controlled virtual object, and the dotted line formed by point A and point B’ represents the plane where the controlled virtual object is located.
  • the captured second scene picture contains the controlled virtual object that is not blocked, and the virtual camera and the controlled virtual object satisfy the specified distance.
  • the specified distance can be a minimum distance value, virtual The distance between the virtual camera and the controlled virtual object is greater than or equal to the minimum distance value.
  • the specified distance can also be a distance range, and the distance between the virtual camera and the controlled virtual object is within the distance range.
  • the specified distance can be the same as the distance between the virtual camera and the controlled virtual object before moving, or it can also be based on the distance between the virtual camera and the controlled virtual object before moving.
  • the distance of the controlled virtual object sets a distance range and uses this distance range as the specified distance.
  • the above game screen control method in response to the controlled virtual object in the first scene screen being blocked by the first obstacle, determines the target position point from the first scene screen; wherein the controlled virtual object is controlled through the terminal device; based on the target
  • the mapping point of the position point in the virtual scene and the position of the virtual camera in the virtual scene generate a virtual straight line; determine the intersection point of the virtual straight line and the plane where the controlled virtual object is located, and determine the intersection point as the designated position on the plane where the controlled virtual object is located point; wherein, the connection between the position of the virtual camera in the virtual scene and the position of the controlled virtual object forms a preset angle with the plane where the controlled virtual object is located; determine whether there is a second obstacle between the virtual camera and the designated position point object; if there is no second obstacle, control the movement of the virtual camera based on the mapping point so that the controlled virtual object in the second scene captured by the moved virtual camera is not blocked; where the second obstacle includes the An obstacle, or an obstacle other than the first obstacle.
  • a target position point is first determined from the scene picture, and the mapping point of the target position point in the virtual scene is obtained. Then the designated position point is determined based on the mapping point on the plane where the controlled virtual object is located. When the virtual camera and the designated position When there are no obstacles between the points, the virtual camera movement is controlled based on the mapping points.
  • This method can prevent the controlled virtual objects in the scene captured by the virtual camera from being blocked; when the controlled virtual objects are blocked, the movement is relatively smooth.
  • the adjustment of the shooting lens allows players to continue to observe controlled virtual objects and at the same time observe the global information of the scene, which improves the player's gaming experience, improves the stability of the game screen displayed on the terminal device, and reduces the running time of the terminal device. Saves the power consumption of terminal equipment.
  • the scene images captured by the virtual camera have the same size. Based on this, in the above location point selection information, the two-dimensional coordinates of at least one alternative location point can be recorded, and an alternative location point is selected from the location point selection information.
  • the point corresponding to the two-dimensional coordinates of the candidate position point is determined as the above-mentioned target position point. For example, if the length of the scene captured by the virtual camera is 1920px and the width is 1080px, and the lower left corner of the scene is used as the origin of the two-dimensional coordinate system, the position point information of the alternative position point that can be recorded in the position point selection information is ( 960px, 1000px), this position point is the upper middle point in the scene screen.
  • the above-mentioned alternative position points include: a first position point located above the controlled virtual object, a second position point located between the controlled virtual object and the first position point, a second position point located above the controlled virtual object, The third position point on the left and the fourth position point on the right side of the controlled virtual object; in order of priority determined as the target position point, the first position point, the second position point, the third position point and the fourth position point are The position points are arranged from high to low; in response to the controlled virtual object in the first scene being blocked by the first obstacle, the first position point with the highest priority is determined as the target position point.
  • the target plane area corresponding to the first scene picture in the virtual scene that is, the shooting picture captured by the virtual camera under depth information.
  • the virtual visual frustum corresponding to the virtual camera is determined; wherein the virtual camera is located at the first vertex of the virtual visual frustum; based on the depth information of the first scene picture, it is determined that the first scene picture is in the virtual scene.
  • the corresponding target plane wherein, the target plane is perpendicular to the direction of the virtual camera, and the vertical distance between the target plane and the virtual camera is determined based on the depth information of the first scene; the area in the target plane that intersects with the virtual visual frustum is determined as target plane area.
  • the following embodiments continue to describe the specific implementation of controlling virtual camera movement based on mapping points.
  • the virtual camera should be moved to a position that captures the controlled virtual object without being occluded. Specifically, if there is no second obstacle, a moving path of the virtual camera is generated based on the mapping point and the current position of the virtual camera; where the moving path has a specified shape, and the distance between any point in the moving path and the controlled virtual object is Greater than or equal to the specified distance; controls the virtual camera to move along the movement path from the current position.
  • the first distance value between the current position of the virtual camera and the controlled virtual object is D1
  • the second distance value between the mapping point position and the controlled virtual object is D2
  • D1 is greater than D2
  • D1 is greater than D2
  • the distance between the point in the moving path and the controlled virtual object can also be implemented in other ways. For example, the average of the above-mentioned first distance value and the above-mentioned second distance value is obtained, and a distance range is determined based on the average value, so that the distance on the moving path The distance between the point and the controlled virtual object is within this distance range.
  • the virtual camera can move to the end of the movement path at a very fast speed. In this case, what the player sees in the scene is usually the effect of scene switching.
  • the virtual ray machine can also move to the end of the movement path at a relatively slow speed. In this case, the content of the scene screen gradually changes, and what the player sees from the scene screen is the change of the scene screen with a long lens effect.
  • the three-dimensional coordinates of the controlled virtual object in the three-dimensional space of the virtual scene can be obtained in advance, and the virtual camera adjusts the virtual camera in real time according to the three-dimensional coordinates of the controlled virtual object while moving along the movement path.
  • the shooting angle and shooting posture of the camera it can also be understood that the virtual camera always shoots towards the position of the controlled virtual object during the movement; when the second scene captured by the virtual camera, an unoccluded controlled virtual object appears.
  • the virtual camera is controlled to stop moving. At this time, the virtual camera may not have reached the end of the movement path, or it may have reached the end of the movement path.
  • the virtual camera stops moving and shoots at that position, thereby minimizing changes in the scene's perspective and improving the stability of the visual effects of the scene.
  • a graphical user interface is provided through the terminal device; the graphical user interface displays: the virtual camera in the game shoots in the virtual scene The first scene picture; the device includes:
  • the first determination module 130 is configured to determine the target position point from the first scene picture in response to the controlled virtual object in the first scene picture being blocked by the first obstacle; wherein the controlled virtual object is performed through the terminal device control;
  • the generation module 132 is configured to generate a virtual straight line based on the mapping point of the target position point in the virtual scene and the position of the virtual camera in the virtual scene;
  • the control module 136 is configured to determine whether there is a second obstacle between the virtual camera and the designated position point; if there is no second obstacle, control the movement of the virtual camera based on the mapping point, so that the moved virtual camera captures The controlled virtual object in the second scene is not blocked; the second obstacle includes the first obstacle, or obstacles other than the first obstacle.
  • the above game screen control device determines the target position point from the first scene screen in response to the controlled virtual object in the first scene screen being blocked by the first obstacle; wherein the controlled virtual object is controlled through the terminal device; based on the target
  • the mapping point of the position point in the virtual scene and the position of the virtual camera in the virtual scene generate a virtual straight line; determine the intersection point of the virtual straight line and the plane where the controlled virtual object is located, and determine the intersection point as the designated position on the plane where the controlled virtual object is located point; wherein, the connection between the position of the virtual camera in the virtual scene and the position of the controlled virtual object forms a preset angle with the plane where the controlled virtual object is located; determine whether there is a second obstacle between the virtual camera and the designated position point object; if there is no second obstacle, control the movement of the virtual camera based on the mapping point so that the controlled virtual object in the second scene captured by the moved virtual camera is not blocked; where the second obstacle includes the An obstacle, or an obstacle other than the first obstacle.
  • a target position point is first determined from the scene picture, and the mapping point of the target position point in the virtual scene is obtained. Then the designated position point is determined based on the mapping point on the plane where the controlled virtual object is located. When the virtual camera and the designated position When there are no obstacles between the points, the virtual camera movement is controlled based on the mapping points.
  • This method can prevent the controlled virtual objects in the scene captured by the virtual camera from being blocked; when the controlled virtual objects are blocked, relatively Smoothly adjust the shooting lens so that players can continue to observe the controlled virtual object while observing Observing the global information of the scene improves the player's gaming experience, improves the stability of the game screen displayed by the terminal device, reduces the running time of the terminal device, and saves the power consumption of the terminal device.
  • the above-mentioned first determination module is also configured to perform: in response to the controlled virtual object in the first scene picture being blocked by the first obstacle, based on the preset position point selection information, determine the target position point from the first scene picture. ; Wherein, the position point selection information records the position information of at least one candidate position point in the first occasion picture.
  • the above-mentioned alternative position points include: a first position point located above the controlled virtual object, a second position point located between the controlled virtual object and the first position point, a third position point located to the left of the controlled virtual object, and The fourth position point located on the right side of the controlled virtual object; according to the priority order determined as the target position point, the first position point, the second position point, the third position point and the fourth position point are arranged from high to low;
  • the above-mentioned first determination module is further configured to perform: in response to the controlled virtual object in the first scene being blocked by the first obstacle, determine the first position point with the highest priority as the target position point.
  • the above device also includes an update module configured to perform: if there is a second obstacle between the virtual camera and the specified position point, in order of priority, use the next position point of the target position point as the updated target position point; continue execution The step of generating a virtual straight line based on the mapping point of the target position point in the virtual scene and the position of the virtual camera in the virtual scene.
  • the above device also includes a movement control module configured to: if the target position point is updated to the fourth position point, and there is still a second obstacle between the virtual camera and the designated position point, control the virtual camera to move to block the first obstacle.
  • the preset position wherein, the preset position and the controlled virtual object are located on the same side of the first obstacle.
  • the above-mentioned first determination module is also configured to perform: in response to the controlled virtual object in the first scene screen being blocked by the first obstacle, determine the display area blocking the first obstacle in the first scene screen, from the display area Determine the target location point in the outside area.
  • the above device also includes a mapping point generation module configured to perform: based on the depth information of the first scene picture, determine the target plane area corresponding to the first scene picture in the virtual scene; determine the side length of the first scene picture and the target plane area Ratio; based on the position of the target position point in the first scene picture and the side length ratio, determine the mapping point corresponding to the target position point from the target plane area; where, the position of the target position point in the first scene picture, and the mapping The points are at the same location in the target plane area.
  • a mapping point generation module configured to perform: based on the depth information of the first scene picture, determine the target plane area corresponding to the first scene picture in the virtual scene; determine the side length of the first scene picture and the target plane area Ratio; based on the position of the target position point in the first scene picture and the side length ratio, determine the mapping point corresponding to the target position point from the target plane area; where, the position of the target position point in the first scene picture, and the mapping The points are at the same location in
  • the above-mentioned mapping point generation module is also configured to perform: determine the virtual visual frustum corresponding to the virtual camera; wherein the virtual camera is located at the first vertex of the virtual visual frustum; based on the depth information of the first scene picture, determine the first scene picture The corresponding target plane in the virtual scene; wherein, the target plane is perpendicular to the direction of the virtual camera, and the vertical distance between the target plane and the virtual camera is determined based on the depth information of the first scene; the target plane intersecting with the virtual visual frustum area, determined as the target plane area.
  • the above control module is also configured to perform: if there is no second obstacle, generate a moving path of the virtual camera based on the mapping point and the current position of the virtual camera; wherein the moving path has a specified shape, and any point in the moving path The distance to the controlled virtual object is greater than or equal to the specified distance; controls the virtual camera to move along the movement path from the current position.
  • the above control module is also configured to: control the virtual camera to move along the movement path from the current position; during the movement of the virtual camera, adjust the orientation of the virtual camera according to the position of the controlled virtual object in the virtual scene; when the virtual camera When the controlled virtual object in the second scene captured by the camera is not blocked, the virtual camera is controlled to stop moving.
  • This embodiment also provides an electronic device, including a processor and a memory.
  • the memory stores machine-executable instructions that can be executed by the processor.
  • the processor executes the machine-executable instructions to implement the above game screen control method.
  • the electronic device may be a server or a touch terminal device.
  • the electronic device includes a processor 100 and a memory 101.
  • the memory 101 stores machine-executable instructions that can be executed by the processor 100.
  • the processor 100 executes the machine-executable instructions to implement the above game screen control method. .
  • the electronic device shown in FIG. 14 also includes a bus 102 and a communication interface 103.
  • the processor 100, the communication interface 103 and the memory 101 are connected through the bus 102.
  • the memory 101 may include high-speed random access memory (RAM, Random Access Memory), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM random access memory
  • non-volatile memory non-volatile memory
  • the communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used.
  • the bus 102 may be an ISA bus, a PCI bus, an EISA bus, etc.
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one bidirectional arrow is used in Figure 14, but it does not mean that there is only one bus or one type of bus.
  • the processor 100 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 100 .
  • the above-mentioned processor 100 can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; it can also be a digital signal processor (Digital Signal Processor, referred to as DSP). ), Application Specific Integrated Circuit (ASIC for short), Field-Programmable Gate Array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a 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 implemented 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 random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 101.
  • the processor 100 reads the information in the memory 101 and completes the steps of the method in the aforementioned embodiment in combination with its hardware.
  • the graphical user interface displays: the first scene picture captured by the virtual camera in the game in the virtual scene; in response to the controlled virtual object in the first scene picture being blocked by the first obstacle, the first scene picture is determined from the first scene picture.
  • Target position point wherein, the controlled virtual object is controlled through the terminal device; based on the target position point, in the virtual scene
  • the mapping point in and the position of the virtual camera in the virtual scene generate a virtual straight line; determine the intersection point of the virtual straight line and the plane where the controlled virtual object is located, and determine the intersection point as the designated position point on the plane where the controlled virtual object is located; where, the virtual The connection between the position of the camera in the virtual scene and the position of the controlled virtual object is at a preset angle with the plane where the controlled virtual object is located; determine whether there is a second obstacle between the virtual camera and the specified position point; if not, The second obstacle controls the movement of the virtual camera based on the mapping point so that the controlled virtual object in the second scene captured by the moved virtual camera is not blocked; wherein the
  • the target position point is determined from the first scene based on the preset position point selection information; wherein the position point selection information records the first Location information of at least one candidate location point in the occasion screen.
  • the target position point is determined through the position point selection information, which is convenient and fast, and requires less calculation.
  • the next position point of the target position point is used as the updated target position point; continue to perform the mapping point and mapping point in the virtual scene based on the target position point.
  • the upper part of the controlled virtual object is most likely not occluded, so first pull the lens upward to reach the first position point. If the first position point is occluded, then Lower the lens slightly to reach the second position point in order to obtain a field of view from the middle of the upper and lower blocks. If the middle part is also blocked, consider pulling the lens to the left and right, that is, the third and fourth position points mentioned above.
  • priority sorting can avoid multiple traversals of alternative location points and effectively reduce system overhead.
  • a display area blocking the first obstacle is determined in the first scene, and a target position point is determined from an area outside the display area.
  • the virtual camera is located at the first vertex of the virtual visual frustum; based on the depth information of the first scene picture, determine the target plane corresponding to the first scene picture in the virtual scene; wherein, the target The plane is perpendicular to the direction of the virtual camera, and the vertical distance between the target plane and the virtual camera is determined based on the depth information of the first scene; the area in the target plane that intersects with the virtual viewing frustum is determined as the target plane area.
  • the distance between the virtual camera and the controlled virtual object and the distance between the mapping point and the controlled virtual object are jointly determined to determine the distance between the point on the moving path and the controlled virtual object, so that the virtual camera is in contact with the controlled virtual object when moving.
  • the distance between the objects is in a relatively stable state, which in turn makes the angle of view of the scene captured relatively stable and avoids the problem of excessive changes in the angle of view of the scene.
  • Control the virtual camera to move along the movement path from the current position until it reaches the end point of the movement path; where the end point is determined based on the mapping point.
  • the virtual camera stops moving and shoots at that position, thereby minimizing changes in the scene's perspective and improving the stability of the visual effects of the scene.
  • the most reliable lens measures can be taken to ensure that the player can still see the character, without rudely bringing the lens close to the character's body, causing confusion in the picture and causing the player to be unable to function normally.
  • Operating characters can even cause physical discomfort caused by rapid and frequent movement of the camera, such as dizziness, vomiting, etc.; thereby improving the stability of picture changes.
  • This embodiment also provides a machine-readable storage medium.
  • the machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions prompt the processor to implement the above game screen control. method.
  • the graphical user interface displays: the first scene picture captured by the virtual camera in the game in the virtual scene; in response to the controlled virtual object in the first scene picture being blocked by the first obstacle, the first scene picture is determined from the first scene picture.
  • the intersection point of the plane is determined as the specified position point on the plane where the controlled virtual object is located; where, The connection between the position of the virtual camera in the virtual scene and the position of the controlled virtual object is at a preset angle with the plane where the controlled virtual object is located; determine whether there is a second obstacle between the virtual camera and the designated position point; if not There is a second obstacle, and the movement of the virtual camera is controlled based on the mapping point so that the controlled virtual object in the second scene captured by the moved virtual camera is not blocked; where the
  • a target position point is first determined from the scene picture, and the mapping point of the target position point in the virtual scene is obtained. Then the designated position point is determined based on the mapping point on the plane where the controlled virtual object is located. When the virtual camera and the designated position When there are no obstacles between the points, the virtual camera movement is controlled based on the mapping points.
  • This method can prevent the controlled virtual objects in the scene captured by the virtual camera from being blocked; when the controlled virtual objects are blocked, the movement is relatively smooth.
  • the adjustment of the shooting lens allows players to continue to observe controlled virtual objects and at the same time observe the global information of the scene, which improves the player's gaming experience, improves the stability of the game screen displayed on the terminal device, and reduces the running time of the terminal device. Saves the power consumption of terminal equipment.
  • the target position point is determined from the first scene based on the preset position point selection information; wherein the position point selection information records the first Location information of at least one candidate location point in the occasion screen.
  • the target position point is determined through the position point selection information, which is convenient and fast, and requires less calculation.
  • the above-mentioned alternative position points include: a first position point located above the controlled virtual object, a second position point located between the controlled virtual object and the first position point, a third position point located to the left of the controlled virtual object, and The fourth position point located on the right side of the controlled virtual object; according to the priority order determined as the target position point, the first position point, the second position point, the third position point and the fourth position point are arranged from high to low; In response to the controlled virtual object in the first scene being blocked by the first obstacle, the first position point with the highest priority is determined as the target position point.
  • the next position point of the target position point is used as the updated target position point; continue to perform the mapping point and mapping point in the virtual scene based on the target position point.
  • the upper part of the controlled virtual object is most likely not occluded, so first pull the lens upward to reach the first position point. If the first position point is occluded, then Lower the lens slightly to reach the second position point in order to obtain a field of view from the middle of the upper and lower blocks. If the middle part is also blocked, consider pulling the lens to the left and right, that is, the third and fourth position points mentioned above.
  • priority sorting can avoid multiple traversals of alternative location points and effectively reduce system overhead.
  • the virtual camera is controlled to move to a preset position that blocks the first obstacle; where the preset position and the controlled position are The virtual object is located on the same side of the first obstacle.
  • a display area blocking the first obstacle is determined in the first scene, and a target position point is determined from an area outside the display area.
  • determining the target position point in an area other than the display area of the obstacle can make the determined target position point more accurate and appropriate.
  • the target plane area corresponding to the first scene picture in the virtual scene Based on the depth information of the first scene picture, determine the target plane area corresponding to the first scene picture in the virtual scene; determine the side length ratio of the first scene picture and the target plane area; based on the position of the target position point in the first scene picture , and the side length ratio, determine the mapping point corresponding to the target position point from the target plane area; where, the target position The position of the point in the first scene is the same as the position of the mapping point in the target plane area.
  • the virtual camera is located at the first vertex of the virtual visual frustum; based on the depth information of the first scene picture, determine the target plane corresponding to the first scene picture in the virtual scene; wherein, the target The plane is perpendicular to the direction of the virtual camera, and the vertical distance between the target plane and the virtual camera is determined based on the depth information of the first scene; the area in the target plane that intersects with the virtual viewing frustum is determined as the target plane area.
  • the distance between the virtual camera and the controlled virtual object and the distance between the mapping point and the controlled virtual object are jointly determined to determine the distance between the point on the moving path and the controlled virtual object, so that the virtual camera is in contact with the controlled virtual object when moving.
  • the distance between the objects is in a relatively stable state, which in turn makes the angle of view of the scene captured relatively stable and avoids the problem of excessive changes in the angle of view of the scene.
  • Control the virtual camera to move along the movement path from the current position until it reaches the end point of the movement path; where the end point is determined based on the mapping point.
  • the virtual camera stops moving and shoots at that position, thereby minimizing changes in the scene's perspective and improving the stability of the visual effects of the scene.
  • the most reliable lens measures can be taken to ensure that the player can still see the character, without rudely bringing the lens close to the character's body, causing confusion in the picture and causing the player to be unable to function normally.
  • Operating characters can even cause physical discomfort caused by rapid and frequent movement of the camera, such as dizziness, vomiting, etc.; thereby improving the stability of picture changes.
  • the game screen control method, device and computer program product of electronic equipment provided by the embodiments of the present disclosure include a computer-readable storage medium storing program code.
  • the instructions included in the program code can be used to execute the instructions described in the previous method embodiments.
  • the specific implementation of the method can be found in the method embodiments and will not be described again here.
  • connection should be understood in a broad sense.
  • it can be a fixed connection or a detachable connection. , or integrally connected; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be an internal connection between two components.
  • connection should be understood in a broad sense.
  • it can be a fixed connection or a detachable connection. , or integrally connected; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be an internal connection between two components.
  • 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.
  • the technical solution of the present disclosure is essentially The part that contributes to the relevant technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes a number of instructions to enable a computer device (which can be a personal computer, Server, or network device, etc.) performs all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. .

Abstract

本公开提供了一种游戏画面控制方法、装置和电子设备;其中,该方法包括:响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡。该方式可以相对平稳的调整拍摄镜头,使玩家可以继续观察到受控虚拟对象,同时可以观察场景的全局信息,提高了玩家的游戏体验。 (图3)

Description

游戏画面控制方法、装置和电子设备
相关申请的交叉引用
本公开要求于2022年06月21日提交的申请号为202210706916.3、名称为“游戏画面控制方法、装置和电子设备”的中国专利申请的优先权,该中国专利申请的全部内容通过引用全部并入本文。
技术领域
本公开涉及游戏技术领域,尤其是涉及一种游戏画面控制方法、装置和电子设备。
背景技术
在3D视角的游戏中,虚拟摄像机通常使用广视角拍摄游戏场景,以使玩家在参与游戏时,不仅可以看到玩家控制的虚拟角色,还可以观察到游戏场景的地形、环境等全局信息,便于玩家进行决策。在广视角拍摄游戏场景时,虚拟摄像机需要与虚拟角色保持较远的距离;当虚拟角色被场景内的模型遮挡,虚拟摄像机会移动至模型的另一侧,以近镜头的方式拍摄虚拟角色,当虚拟角色不被遮挡时,虚拟摄像机又会回到较远的位置,该方式会导致远近镜头的频繁切换,造成终端设备所显示的游戏画面的不稳定,给玩家带来负面的视觉体验,另外,当镜头突然拉近时,玩家难以实时观察游戏场景的全局信息,影响玩家进行游戏决策,玩家的游戏体验较差,并延长了终端设备的运行时长,耗费终端设备的电量。
需要说明的是,上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的相关技术的信息。
发明内容
有鉴于此,本公开的目的在于提供一种游戏画面控制方法、装置和电子设备,以实现相对平稳的调整拍摄镜头,使玩家可以继续观察到受控虚拟对象,同时可以观察场景的全局信息,提高玩家的游戏体验,提升终端设备所显示的游戏画面的稳定性,降低终端设备的运行时长,节省了终端设备的电量消耗。
第一方面,本公开实施例提供了一种游戏画面控制方法,通过终端设备提供一图形用户界面;图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;方法包括:响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
第二方面,本公开实施例提供了一种游戏画面控制装置,通过终端设备提供一图形 用户界面;图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;装置包括:第一确定模块,被配置为执行响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;生成模块,被配置为执行基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;第二确定模块,被配置为执行确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;控制模块,被配置为执行确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
第三方面,本公开实施例提供了一种电子设备,包括处理器和存储器,存储器存储有能够被处理器执行的机器可执行指令,处理器执行机器可执行指令以实现上述游戏画面控制方法。
第四方面,本公开实施例提供了一种机器可读存储介质,机器可读存储介质存储有机器可执行指令,机器可执行指令在被处理器调用和执行时,机器可执行指令促使处理器实现上述游戏画面控制方法。
本公开实施例带来了以下有益效果:
上述游戏画面控制方法、装置和电子设备,响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
该方式中,首先从场景画面中确定一个目标位置点,得到该目标位置点位于虚拟场景中的映射点,进而基于映射点在受控虚拟对象所在平面确定指定位置点,当虚拟摄像机与指定位置点之间不存在障碍物时,基于映射点控制虚拟摄像机移动,该方式可以使虚拟摄像机拍摄得到的场景画面中受控虚拟对象不被遮挡;在受控虚拟对象被遮挡的情况下,相对平稳的调整拍摄镜头,使玩家可以继续观察到受控虚拟对象,同时可以观察场景的全局信息,提高了玩家的游戏体验,提升终端设备所显示的游戏画面的稳定性,降低终端设备的运行时长,节省了终端设备的电量消耗。
附图说明
为了更清楚地说明本公开具体实施方式或相关技术中的技术方案,下面将对具体实施方式或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施方式,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本公开其中之一实施例提供的虚拟摄像头远距离拍摄受控虚拟对象得到的场景画面的示意图;
图2为本公开其中之一实施例提供的虚拟摄像头距离受控虚拟对象很近时,拍摄得到的场景画面的示意图;
图3为本公开其中之一实施例提供的一种游戏画面控制方法的流程图;
图4为本公开其中之一实施例提供的一种观测点的示意图;
图5为本公开其中之一实施例提供的一种第一场景画面中的目标位置点的示意图;
图6为本公开其中之一实施例提供的一种受控虚拟对象所在平面上的指定位置点的示意图;
图7为本公开其中之一实施例提供的另一种第一场景画面中的目标位置点的示意图;
图8为本公开其中之一实施例提供的另一种受控虚拟对象所在平面上的指定位置点的示意图;
图9为本公开其中之一实施例提供的位置点选择信息中备选位置点的示意图;
图10为本公开其中之一实施例提供的虚拟摄像机移动至预设位置的示意图;
图11为本公开其中之一实施例提供的映射点的确定方式示意图;
图12为本公开其中之一实施例提供的虚拟直线的确定方式示意图;
图13为本公开其中之一实施例提供的一种游戏画面控制装置的结构示意图;
图14为本公开其中之一实施例提供的一种电子设备的结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合附图对本公开的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
在3D视角的游戏中,虚拟摄像机往往设置广视角拍摄虚拟场景,即,虚拟摄像机需要远离玩家模型,拍摄较大视野的场景画面,才能有更好的战斗和玩法体验。同时,虚拟摄像机通常根据玩家控制的虚拟角色(也称受控虚拟对象)移动,玩家通过场景画面观察到虚拟角色。
当受控虚拟对象被虚拟场景中的其他模型遮挡后,如墙体模型,通常的做法是直接把虚拟摄像头移动至墙体模型的边沿,使虚拟摄像头与受控虚拟对象位于墙体模型的同一侧,确保拍摄的场景画面中出现受控虚拟对象,玩家通过场景画面能够找到受控虚拟对象所在的位置。
但是,对一些非常重要的副本关卡游戏,由于关卡会设计复杂的地形,存在很多低矮的墙体模型、石头模型,受控虚拟对象经常为了躲避敌人的技能而迫不得已靠近障碍物,此时,障碍物遮挡受控虚拟对象,导致通过场景画面观察不到受控虚拟对象,该情况下,通常将虚拟摄像头移动至受控虚拟对象附近,以避免障碍物对受控虚拟对象的遮挡。虚拟摄像头近距离拍摄受控虚拟对象,导致玩家无法通过场景画面观察到关卡全局,影响玩家进行游戏决策,玩家的游戏体验较差。
受控虚拟对象在障碍物附近移动时,根据受控虚拟对象是否被障碍物遮挡的状态,虚拟摄像机会频繁切换远近位置,导致场景画面也频繁切换,给玩家带来负面的视觉体验。
作为示例,图1是虚拟摄像头远距离拍摄受控虚拟对象得到的场景画面,当受控虚拟对象靠近矮墙模型时,受控虚拟对象被矮墙模型遮挡;虚拟摄像头会快速移动至矮墙附近,如图1中圆圈所示的位置,且虚拟摄像头与受控虚拟对象位于矮墙模型的同一侧。由于虚拟摄像头距离受控虚拟对象很近,拍摄得到的场景画面通常为图2所示的画面,受控虚拟对象占据场景画面的大部分显示区域,甚至场景画面中不能完整显示受控虚拟对象,玩家难以通过场景画面观察虚拟场景的全局信息。
基于上述,本公开实施例提供一种游戏画面控制方法、装置和电子设备,该技术可以应用于游戏场景或其他虚拟场景的拍摄过程中。
在本公开其中一种实施例中的游戏画面控制方法可以运行于本地终端设备或者是服务器。当游戏画面控制方法运行于服务器时,该方法则可以基于云交互系统来实现与执行,其中,云交互系统包括服务器和客户端设备。
在一可选的实施方式中,云交互系统下可以运行各种云应用,例如:云游戏。以云游戏为例,云游戏是指以云计算为基础的游戏方式。在云游戏的运行模式下,游戏程序的运行主体和游戏画面呈现主体是分离的,游戏画面控制方法的储存与运行是在云游戏服务器上完成的,客户端设备的作用用于数据的接收、发送以及游戏画面的呈现,举例而言,客户端设备可以是靠近用户侧的具有数据传输功能的显示设备,如,移动终端、电视机、计算机、掌上电脑等;但是进行信息处理的为云端的云游戏服务器。在进行游戏时,玩家操作客户端设备向云游戏服务器发送操作指令,云游戏服务器根据操作指令运行游戏,将游戏画面等数据进行编码压缩,通过网络返回客户端设备,最后,通过客户端设备进行解码并输出游戏画面。
在一可选的实施方式中,以游戏为例,本地终端设备存储有游戏程序并用于呈现游戏画面。本地终端设备用于通过图形用户界面与玩家进行交互,即,常规的通过电子设备下载安装游戏程序并运行。该本地终端设备将图形用户界面提供给玩家的方式可以包括多种,例如,可以渲染显示在终端的显示屏上,或者,通过全息投影提供给玩家。举例而言,本地终端设备可以包括显示屏和处理器,该显示屏用于呈现图形用户界面,该图形用户界面包括游戏画面,该处理器用于运行该游戏、生成图形用户界面以及控制图形用户界面在显示屏上的显示。
在一种可能的实施方式中,本公开实施例提供了一种游戏画面控制方法,通过终端设备提供图形用户界面,其中,终端设备可以是前述提到的本地终端设备,也可以是前述提到的云交互系统中的客户端设备。
通过终端设备提供一图形用户界面,该图形用户界面上可以根据启动的应用程序的类型,显示界面内容,例如,游戏场景画面、通信交互窗口等等。在本实施例中,图形用户界面中显示有游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;虚拟场景为三维虚拟场景,虚拟摄像机在虚拟场景中进行拍摄,得到上述第一场景画面;在游戏过程中,虚拟摄像机通常跟随玩家控制的受控虚拟对象的移动而发生位置、姿态的变化,使拍摄得到的第一场景画面中包含受控虚拟对象,以便于玩家可以实时观察到受控 虚拟对象的位置和所处的环境。另外,玩家还可以通过相关操作条件虚拟摄像机的位置和姿态,从而改变第一场景画面的画面内容。
为便于对本实施例进行理解,首先对本公开实施例所公开的一种游戏画面控制方法进行详细介绍,如图3所示,该游戏画面控制方法,通过终端设备提供图形用户界面,图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;本方法包括如下步骤:
步骤S302,响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;
玩家通过终端设备发出特定的操作或指令,从而控制受控虚拟对象移动或执行其他动作。上述第一障碍物可以为虚拟场景中的墙体、树丛、建筑物、石头、山脉、植被等模型。
在虚拟场景中,除了受控虚拟对象以外,还可能具有墙体、树丛、建筑物、石头、山脉、植被等模型,这些模型均有可能对受控虚拟对象产生遮挡,当受控虚拟对象靠近这些模型时,且该模型位于受控虚拟对象和虚拟摄像机之间,则模型对受控虚拟对象产生遮挡,该模型即上述第一障碍物,第一场景画面中就不包含受控虚拟对象了。在实际实现时,可以在受控虚拟对象的模型上确定一个观测点,该观测点可以位于受控虚拟对象的头部、胸部等,也可以为受控虚拟对象的模型的正中心的点。虚拟摄像机与观测点形成一条直线,可以实时监测该直线是否被截断,如果该直线被截断,则可以确定受控虚拟对象被遮挡。图4作为一个示例,观测点A位于受控虚拟对象的胸部位置,虚拟摄像机与观测点A形成的直线被矮墙模型截断,此时可以认为受控虚拟对象被遮挡,矮墙即第一障碍物。观测点的位置,还可以根据受控虚拟对象的模型形状、大小进行调整。
考虑到受控虚拟对象在虚拟场景中一直在移动,且受控虚拟对象所处的环境也一直在变化,可以针对虚拟摄像机拍摄的每帧第一场景画面,检测上述直线是否被截断,从而实时判断虚拟摄像机与受控虚拟对象之间是否存在第一障碍物,即受控虚拟对象是否被遮挡。
本实施例旨在为虚拟摄像机找到一条合适的移动路径或一个合适的移动位置点,使得场景画面中继续出现受控虚拟对象,同时使得场景画面保持较大的拍摄视角,避免虚拟摄像机突然近距离拍摄受控虚拟对象的方式。基于此,本实施例在检测到受控虚拟对象被第一障碍物遮挡后,从第一场景画面中确定目标位置点。该第一场景画面为二维画面,对应的是二维坐标系;在实际实现时,可以预先确定一个或多个备选位置点的坐标,从备选位置点中选择目标位置点,也可以根据第一场景画面的画面内容确定目标位置点。
步骤S304,基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;
步骤S306,确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;
基于目标位置点在虚拟场景中的映射点,确定受控虚拟对象所在平面上的指定位置点;在虚拟场景中,受控虚拟对象所在平面预先基于虚拟摄像机的位置确定;
虚拟场景是三维空间,对应的是三维坐标系;虚拟摄像机在拍摄虚拟场景时,根据虚拟神相机的相关参数,可以得到虚拟场景的三维坐标系与第一场景画面的二维坐标系之间的映射关系。基于该映射关系,可以得到目标位置点在虚拟场景中的映射点,该映射点为虚拟场景中的三维位置点。
由于受控虚拟对象处在虚拟场景的三维空间中,因而受控虚拟对象可以经过该三维空间中的很多平面,在本实施例中,需要确定一个受控虚拟对象所在平面。受控虚拟对象所在平面需要根据虚拟摄像机的位置确定。例如,在虚拟空间中,虚拟摄像机与受控虚拟对象形成一个直线,受控虚拟对象所在平面与该直线需要呈一定的角度,或者受控虚拟对象所在平面与该直线在特定的方向上呈一定的角度;再如,根据虚拟摄像机的位置和朝向,形成一个直线,受控虚拟对象所在平面与该直线需要呈一定的角度,或者受控虚拟对象所在平面与该直线在特定的方向上呈一定的角度。
受控虚拟对象所在平面确定后,基于前述映射点,在该平面上确定指定位置点,可以基于预设的对应关系,确定映射点对应的指定位置点;也可以基于映射点与受控虚拟对象所在平面的相对位置,确定指定位置点;或者,基于虚拟摄像机、映射点、以及受控虚拟对象所在平面这三者之间的相对位置,确定指定位置点。
一种具体的实现方式中,虚拟摄像机和受控虚拟对象形成的直线,与受控虚拟对象所在平面垂直,此时,可以在虚拟场景的三维空间中唯一的确定受控虚拟对象所在平面。
作为示例,图5中的点B为第一场景画面中的目标位置点,该目标位置点在虚拟场景中的映射点与虚拟摄像机形成直线,该直线如图6中的虚线所示,该直线经过虚拟摄像机和点B’;点B’为该直线与受控虚拟对象所在平面的交点。点A为位于受控虚拟对象上的观测点,点A与点B’形成的虚线代表受控虚拟对象所在平面。
当虚拟摄像机与指定位置点,即点B’,之间不存在障碍物时,由于点B’位于受控虚拟对象所在平面上,因而可以确定映射点或映射点周围的位置点,与受控虚拟对象之间不存在障碍物。基于此,在本实施例中,基于映射点控制虚拟摄像机移动。
步骤S308,确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
在实际实现时,虚拟摄像机与指定位置点之间可以生成一条直线,在虚拟场景中检测该直接是否被遮挡,如果被遮挡,则可以确定虚拟摄像机与指定位置点之间存在第二障碍物;如果该直线没有被遮挡,则可以确定虚拟摄像机与指定位置点之间不存在第二障碍物。
由于指定位置点位于受控虚拟对象所在平面上,且指定位置点时基于映射点确定的,当虚拟摄像机与指定位置点之间不存在第二障碍物时,则可以推断基于映射点控制虚拟摄像机移动时,虚拟摄像机可以拍摄到受控虚拟对象。同时,本实施例中映射点是从第一场景画面中确定的目标位置点映射到虚拟场景的三维空间中的点,并没有参考受控虚拟对象的位置,因而,映射点与受控虚拟对象通常具有一定的距离。基于此,通过映射点控制虚拟摄像机移动后,拍摄到的第二场景画面中包含不被遮挡的受控虚拟对象,且虚拟摄像机与受控虚拟对象之间满足指定距离。该指定距离可以是一个最小距离值,虚 拟摄像机与受控虚拟对象之间的距离大于或等于该最小距离值,该指定距离也可以是一个距离范围,虚拟摄像机与受控虚拟对象之间的距离位于该距离范围。
一种方式中,基于虚拟摄像机的当前位置与映射点的位置,可以生成一条移动路径,该移动路径的起始点为当前位置,该移动路径可以经过映射点,或者将映射点作为移动路径的终点;该移动路径也可以不经过映射点,只是移动路径的延伸方向与映射点的位置有关。例如,如果映射点与受控虚拟对象的距离较近,此时,可以将移动路径设置在映射点附近,且远离受控虚拟对象的位置,同时该位置也可以拍摄到受控虚拟对象。另外,上述指定距离也可以与虚拟摄像机在移动之前与受控虚拟对象的距离有关,该指定距离可以与虚拟摄像机在移动之前与受控虚拟对象的距离相同,也可以基于虚拟摄像机在移动之前与受控虚拟对象的距离设置一个距离范围,将该距离范围作为指定距离。
上述游戏画面控制方法,响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
该方式中,首先从场景画面中确定一个目标位置点,得到该目标位置点位于虚拟场景中的映射点,进而基于映射点在受控虚拟对象所在平面确定指定位置点,当虚拟摄像机与指定位置点之间不存在障碍物时,基于映射点控制虚拟摄像机移动,该方式可以使虚拟摄像机拍摄得到的场景画面中受控虚拟对象不被遮挡;在受控虚拟对象被遮挡的情况下,相对平稳的调整拍摄镜头,使玩家可以继续观察到受控虚拟对象,同时可以观察场景的全局信息,提高了玩家的游戏体验,提升终端设备所显示的游戏画面的稳定性,降低终端设备的运行时长,节省了终端设备的电量消耗。
下述实施例继续描述从第一场景画面中确定目标位置点的具体实现方式。一种方式中,响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,基于预设的位置点选择信息,从所述第一场景画面中确定目标位置点;其中,所述位置点选择信息中记录有所述第一场合画面中的至少一个备选位置点的位置信息。
通常,虚拟摄像机拍摄的场景画面的尺寸相同,基于此,在上述位置点选择信息中,可以记录至少一个备选位置点的二维坐标,从位置点选择信息中选择一个备选位置点,将第一场景画面中,该备选位置点的二维坐标对应的点,确定为上述目标位置点。例如,假如虚拟摄像机拍摄的场景画面的长度为1920px,宽度为1080px,以场景画面的左下角作为二维坐标系的原点,位置点选择信息中可以记录的备选位置点的位置点信息为(960px,1000px),该位置点为场景画面中中间靠上位置的点。
上述位置点选择信息中可以记录多个备选位置点的位置点信息,该情况下,可以对多个备选位置点进行排序,优先选择排序靠前的备选位置点作为目标位置点,如果选择的目标位置点,经过上述实施例处理得到指定位置点,该指定位置点与虚拟摄像机与之 间存在第一障碍物,此时,可以按照排序选择下一个备选位置点作为目标位置点。
上述方式中,通过位置点选择信息确定目标位置点,方便快捷,且计算量较少。
一种具体的实现方式中,上述备选位置点包括:位于受控虚拟对象上方的第一位置点、位于受控虚拟对象和第一位置点之间的第二位置点、位于受控虚拟对象左侧的第三位置点和位于受控虚拟对象右侧的第四位置点;按照被确定为目标位置点的优先级顺序,第一位置点、第二位置点、第三位置点和第四位置点由高到低排列;响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,将优先级顺序最高的第一位置点,确定为目标位置点。
需要说明的是,上述第一位置点可以为第一场景画面的一个绝对位置点,即该第一位置点具有固定的二维坐标,第一位置点位于第一场景画面靠上的一个位置;上述第一位置点也可以是相对于受控虚拟对象的相对位置点,第一位置点位于受控虚拟对象的上部,第一位置点的坐标基于受控虚拟对象的位置确定。同理,上述第三位置点和第四位置点也可以为第一场景画面的绝对位置点,也可以是相对于受控虚拟对象的相对位置点。
按照上述优先级顺序,当受控虚拟对象被第一遮挡物遮挡后,首先将第一位置点作为目标位置点,进而得到指定位置点;如果该指定位置点与虚拟摄像机之间不存在第二遮挡物,则直接控制虚拟摄像机移动即可;如果该指定位置点与虚拟摄像机之间存在第二遮挡物,然后将第二位置点作为目标位置点,重复上述步骤,依次类推,直至将第四位置点作为目标位置点。
即,如果虚拟摄像机与指定位置点之间存在第二障碍物,按照优先级顺序,将目标位置点的下一个位置点作为更新的目标位置点;继续执行基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线的步骤,进而执行确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度,确定虚拟摄像机与指定位置点之间是否存在第二障碍物的步骤,根据判断结果确定是否继续更新目标位置点。
图7作为示例,确定的第一个目标位置点为点B,通过点B确定对应的指定位置点B’,虚拟摄像机与指定位置点B’之间存在障碍物,如图8所示,该障碍物可以是前述第一障碍物或第二障碍物,也可以是其他障碍物。此时,则确定第二个目标位置点为点C,如图7中所示,通过点C确定对应的指定位置点C’,确定虚拟摄像机与指定位置点C’之间是否存在障碍物,如果不存在障碍物,则基于目标位置点为点C控制虚拟摄像机移动。
在实际实现时,前述位置点选择信息中可以记录4个备选位置点,图9作为示例,分别为点B、点C、点D和点E,分别分布在场景画面中的中部和两侧,在确定目标位置点时,按照各个备选位置点的排列顺序选择。
在上述方式中,当受控虚拟对象被遮挡时,最有可能不被遮挡的是受控虚拟对象的上部,因此首先向上拉镜头,到达第一位置点,如果第一位置点被遮挡,然后稍微下降一些镜头,到达第二位置点,以寻求从上下遮挡的中间获取视野,如果中部也被遮挡,再考虑向左右拉镜头,即上述第三位置点和第四位置点。这样的优先级排序,可以避免对备选位置点的多次遍历,有效降低系统开销。
如果目标位置点更新至第四位置点时,虚拟摄像机与指定位置点之间仍然存在第二障碍物,控制虚拟摄像机移动至遮挡第一障碍物的预设位置;其中,预设位置与受控虚拟对象位于第一障碍物的同一侧。
图10作为示例,如果多次选择目标位置点,虚拟摄像机与指定位置点之间仍然存在障碍物,此时,则直接控制虚拟摄像机移动至遮挡受控虚拟对象的第一障碍物的预设位置,如图10所示,预设位置与受控虚拟对象位于第一障碍物的同一侧,从而使拍摄得到的场景画面中出现不被遮挡的受控虚拟对象。
在上述游戏画面控制方法中,能够在受控虚拟对象被模型遮挡之后,采取最稳妥的镜头措施保证玩家依然可以看得见角色,又不至于粗暴地把镜头贴近角色身体,导致画面错乱,导致玩家无法正常操作角色,甚至导致因镜头快速频繁移动产生的生理不适,如晕眩、呕吐等;从而提高了画面变化的稳定性。
另一种实现方式中,响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,在第一场景画面中确定遮挡受控虚拟对象的第一障碍物的显示区域,从显示区域以外的区域中确定目标位置点。
在具体实现时,需要在虚拟场景中确定遮挡受控虚拟对象的第二障碍物的位置,然后,再通过虚拟摄像机的相关参数,确定第二障碍物在第一场景画面中的显示区域。由于该显示区域中的位置点,映射至虚拟场景中后,映射点位于第二障碍物上,因此,难以基于该映射点在受控虚拟对象所在平面上确定指定位置点。基于此,从第二障碍物的显示区域以外的区域中确定目标位置点。
在实际实现时,确定第二障碍物的显示区域后,可以在显示区域以外的区域随机的确定目标位置点,也可以按照预设的规则确定目标位置点,例如,从第一场景画面中间区域选择目标位置点。其他方式中,可以从前述位置点选择信息中选择一个备选位置点,然后判断该备选位置点是否位于第二障碍物的显示区域,如果位于显示区域以外的区域,则将该备选位置点作为目标位置点;如果位于显示区域以内的区域,则重新选择备选位置点进行判断。
在上述方式中,在障碍物的显示区域以外的区域确定目标位置点,可以使确定出的目标位置点更加准确、合适。
下述实施例描述目标位置点在虚拟场景中的映射点的确定过程。
为了便于理解,首先说明第一场景画面的生成过程。
如图11所示,虚拟摄像机在虚拟场景中拍摄,虚拟摄像机的视野范围可以抽象为一个虚拟视椎体,该虚拟视椎体的顶点是虚拟摄像机,在理论上虚拟视椎体可以沿着虚拟摄像机的朝向方向无线延伸,虚拟场景内的虚拟摄像机的朝向方向上所有平面产生相交,且这些平面与虚拟摄像机的朝向方向垂直;可以理解,距离虚拟摄像机越远的平面,景深越远,因此,当确定了虚拟摄像机的拍摄景深时,就可以确定虚拟摄像机的拍摄画面,该拍摄画面显示在终端设备上,就得到第一场景画面。
考虑到终端设备的显示屏尺寸大小不同,通过拍摄画面显示第一场景画面时,可能需要进行缩放操作,以使缩放后的拍摄画面与终端设备的显示屏尺寸相同,得到第一场景画面。
由上述生成第一场景画面的过程可知,第一场景画面中的任一点,可以在虚拟空间 中找到确定的映射点。
具体而言,基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面区域;确定第一场景画面和目标平面区域的边长比;基于目标位置点在第一场景画面中的位置,以及边长比,从目标平面区域中确定目标位置点对应的映射点;其中,目标位置点在第一场景画面中的位置,与映射点在目标平面区域中的位置相同。
上述边长比,具体可以为第一场景画面的横向边与目标平面区域的横向边的长度比值,也可以为第一场景画面的纵向边与目标平面区域的纵向边的长度比值;该边长比可以理解为虚拟摄像机在上述深度信息下拍摄得到的拍摄画面,与第一场景画面的缩放比。
作为示例,假如第一场景画面的长度为2000,宽度为1000,而目标平面区域的长度为3000,宽度为1500;此时边长比可以表示为2:3;然后,目标位置点在第一场景画面中的坐标为(1000,300),该坐标乘以边长比,即可得到映射点在目标平面区域中的坐标为(1500,450)。
又由于目标平面区域在虚拟场景的三维坐标系中具有确定的三维坐标表示范围,将目标平面区域的二维坐标转换为三维坐标,即可得到映射点在虚拟场景的三维坐标系下的坐标。
第一场景画面在虚拟场景中对应的目标平面区域,即,虚拟摄像机在深度信息下拍摄得到的拍摄画面。一种具体的实现方式中,确定虚拟摄像机对应的虚拟视椎体;其中,虚拟摄像机位于虚拟视椎体的第一顶点;基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面;其中,目标平面与虚拟摄像机的朝向方向垂直,目标平面与虚拟摄像机的垂直距离基于第一场景画面的深度信息确定;将目标平面中与虚拟视椎体相交的区域,确定为目标平面区域。
继续参考图11,沿着虚拟摄像机朝向的方向,有多个平面,每个平面与虚拟摄像机的朝向方向垂直,且不同平面与虚拟摄像机的距离不同,因此,基于第一场景画面的深度信息,可以得到虚拟摄像机与目标平面的距离,基于距离可以唯一的确定目标平面区域所在的目标平面,进而将目标平面中与虚拟视椎体相交的区域,确定为目标平面区域。
在图12中,C点位映射下,虚拟摄像机与C点的连线即虚线所示,该连线即前述实施例中的虚拟直线。
下述实施例继续说明基于映射点控制虚拟摄像机移动的具体实现方式。虚拟摄像机应当移动至可以拍摄到包含不被遮挡的受控虚拟对象的位置。具体的,如果不存在第二障碍物,基于映射点和虚拟摄像机的当前位置,生成虚拟摄像机的移动路径;其中,移动路径具有指定形状,且移动路径中的任一点与受控虚拟对象的距离大于或等于指定距离;控制虚拟摄像机从当前位置沿着移动路径移动。
移动路径的指定形状可以为直线,折线、弧线等。为了保证虚拟摄像机与受控虚拟对象之间满足指定距离,可以在生成移动路径的时候,检测移动路径上全部或部分点与受控虚拟对象的距离,如果移动路径上出现部分点与受控虚拟对象的距离小于上述指定距离,则可以调整该部分点对应的路径的形状、位置。
由于虚拟摄像机需要从当前位置开始移动,因而,虚拟摄像机的当前位置可以作为移动路径的起点,移动路径的终点可以基于映射点确定。一种方式中,可以将映射点作 为移动路径的终点,或者将映射点的周围点作为移动路径的终点。另一种方式中,移动路径可以经过映射点,移动路径的终点根据映射点之后的移动路径的走向确定,映射点仅对移动路径的走向和终点具有引导作用;或者,移动路径可以经过映射点的周围点。
另一种方式中,以受控虚拟对象作为球心,控制虚拟摄像机为围绕受控虚拟对象进行旋转,在旋转过程中,可以调整虚拟摄像机与受控虚拟对象的距离。
为了进一步使场景画面的视野范围相对稳定,在生成移动路径时,移动路径上的点基于虚拟摄像机与受控虚拟对象的距离,以及映射点与受控虚拟对象的距离共同确定。具体的,如果不存在第二障碍物,以虚拟摄像机的当前位置为起点,生成弧形的移动路径;其中,移动路径中任一点与受控虚拟对象的距离,基于当前位置与受控虚拟对象的第一距离值,以及映射点位置与受控虚拟对象的第二距离值确定。
作为示例,假如虚拟摄像机的当前位置与受控虚拟对象的第一距离值为D1,映射点位置与受控虚拟对象的第二距离值为D2,如果D1大于D2,则生成的移动路径中,靠近虚拟摄像机的当前位置的路径上的点,该点与受控虚拟对象的距离与D1接近,但略小于D1;靠近映射点位置的路径上的点,该点与受控虚拟对象的距离与D2接近,但略大于D2。
移动路径中的点与受控虚拟对象的距离,还可以有其他实现方式,例如,求取上述第一距离值和上述第二距离值的均值,基于该均值确定一个距离范围,使得移动路径上的点与受控虚拟对象的距离位于该距离范围。
上述方式中,基于虚拟摄像机与受控虚拟对象的距离,以及映射点与受控虚拟对象的距离共同确定移动路径上的点与受控虚拟对象的距离,使得虚拟摄像机在移动时与受控虚拟对象的距离处在相对稳定的状态,进而使拍摄得到的场景画面的视角相对稳定,避免画面视角变化过大的问题。
在控制虚拟摄像机从当前位置沿着移动路径移动时,一种方式中,控制虚拟摄像机从当前位置沿着移动路径移动,直至到达移动路径的终点;其中,终点基于映射点确定。在实际实现时,移动路径的终点为映射点,虚拟摄像机可以沿着移动路径移动,直至到达映射点。此时,虚拟摄像机在映射点上,可以调整拍摄角度,使场景画面中出现受控虚拟对象。对于某些特殊的障碍物或特殊场景,虚拟摄像机在映射点上拍摄受控虚拟对象时,可能依然拍摄不到受控虚拟对象,或者受控虚拟对象依然受障碍物遮挡,此时,可以在映射点的附近重新确定移动路径的终点,直至虚拟摄像机在终点位置可以拍摄到受控虚拟对象。
另外,虚拟摄像机可以以非常快的速度移动至移动路径的终点,在该情况下,玩家从场景画面中看到的通常是场景画面切换的效果。虚拟射线机也可以以相对较慢的速度移动至移动路径的终点,在该情况下,场景画面的画面内容逐渐变化,玩家从场景画面中看到的是长镜头效果的场景画面的变化。
另一种方式中,控制虚拟摄像机从当前位置沿着移动路径移动;在虚拟摄像机移动的过程中,根据受控虚拟对象在虚拟场景中的位置,调整虚拟摄像机的朝向;当虚拟摄像机拍摄到的第二场景画面中受控虚拟对象不被遮挡时,控制虚拟摄像机停止移动。
具体的,可以预先获取受控虚拟对象在虚拟场景的三维空间中的三维坐标,虚拟摄像机在沿着移动路径移动的过程中,根据受控虚拟对象的三维坐标,实时调整虚拟摄像 机的拍摄角度、拍摄姿势;也可以理解为,虚拟摄像机在移动过程中,始终朝向受控虚拟对象的位置进行拍摄;当虚拟摄像机拍摄到的第二场景画面中,出现不被遮挡的受控虚拟对象时,控制虚拟摄像机停止移动,此时虚拟摄像机可能还没有到达移动路径的终点,或者已经到达移动路径的终点。
如果虚拟摄像机到达移动路径的终点后,第二场景画面中没有出现不被遮挡的受控虚拟对象,此时,可以朝着移动路径的延伸方向,继续生成一段移动路径,并控制虚拟摄像机沿着新生成的移动路径移动,直至第二场景画面中出现不被遮挡的受控虚拟对象。
上述方式中,当场景画面中出现受控虚拟对象时,虚拟摄像机停止移动,在该位置进行拍摄,从而尽量少的减少场景画面视角的变化,提高了场景画面的视觉效果的稳定性。
对应于上述方法实施例,参见图13所示的一种游戏画面控制装置的结构示意图,通过终端设备提供一图形用户界面;图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;该装置包括:
第一确定模块130,被配置为执行响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;
生成模块132,被配置为执行基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;
第二确定模块134,被配置为执行确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;
控制模块136,被配置为执行确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
上述游戏画面控制装置,响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
该方式中,首先从场景画面中确定一个目标位置点,得到该目标位置点位于虚拟场景中的映射点,进而基于映射点在受控虚拟对象所在平面确定指定位置点,当虚拟摄像机与指定位置点之间不存在障碍物时,基于映射点控制虚拟摄像机移动,该方式可以使虚拟摄像机拍摄得到的场景画面中的受控虚拟对象不被遮挡;在受控虚拟对象被遮挡的情况下,相对平稳的调整拍摄镜头,使玩家可以继续观察到受控虚拟对象,同时可以观 察场景的全局信息,提高了玩家的游戏体验,提升终端设备所显示的游戏画面的稳定性,降低终端设备的运行时长,节省了终端设备的电量消耗。
上述第一确定模块,还被配置为执行:响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,基于预设的位置点选择信息,从第一场景画面中确定目标位置点;其中,位置点选择信息中记录有第一场合画面中的至少一个备选位置点的位置信息。
上述备选位置点包括:位于受控虚拟对象上方的第一位置点、位于受控虚拟对象和第一位置点之间的第二位置点、位于受控虚拟对象左侧的第三位置点和位于受控虚拟对象右侧的第四位置点;按照被确定为目标位置点的优先级顺序,第一位置点、第二位置点、第三位置点和第四位置点由高到低排列;上述第一确定模块,还被配置为执行:响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,将优先级顺序最高的第一位置点,确定为目标位置点。
上述装置还包括更新模块,被配置为执行:如果虚拟摄像机与指定位置点之间存在第二障碍物,按照优先级顺序,将目标位置点的下一个位置点作为更新的目标位置点;继续执行基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线的步骤。
上述装置还包括移动控制模块,被配置为执行:如果目标位置点更新至第四位置点时,虚拟摄像机与指定位置点之间仍然存在第二障碍物,控制虚拟摄像机移动至遮挡第一障碍物的预设位置;其中,预设位置与受控虚拟对象位于第一障碍物的同一侧。
上述第一确定模块,还被配置为执行:响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,在第一场景画面中确定遮挡第一障碍物的显示区域,从显示区域以外的区域中确定目标位置点。
上述装置还包括映射点生成模块,被配置为执行:基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面区域;确定第一场景画面和目标平面区域的边长比;基于目标位置点在第一场景画面中的位置,以及边长比,从目标平面区域中确定目标位置点对应的映射点;其中,目标位置点在第一场景画面中的位置,与映射点在目标平面区域中的位置相同。
上述映射点生成模块,还被配置为执行:确定虚拟摄像机对应的虚拟视椎体;其中,虚拟摄像机位于虚拟视椎体的第一顶点;基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面;其中,目标平面与虚拟摄像机的朝向方向垂直,目标平面与虚拟摄像机的垂直距离基于第一场景画面的深度信息确定;将目标平面中与虚拟视椎体相交的区域,确定为目标平面区域。
上述控制模块,还被配置为执行:如果不存在第二障碍物,基于映射点和虚拟摄像机的当前位置,生成虚拟摄像机的移动路径;其中,移动路径具有指定形状,且移动路径中的任一点与受控虚拟对象的距离大于或等于指定距离;控制虚拟摄像机从当前位置沿着移动路径移动。
上述控制模块,还被配置为执行:如果不存在第二障碍物,以虚拟摄像机的当前位置为起点,生成弧形的移动路径;其中,移动路径中任一点与受控虚拟对象的距离,基于当前位置与受控虚拟对象的第一距离值,以及映射点位置与受控虚拟对象的第二距离值确定。
上述控制模块,还被配置为执行:控制虚拟摄像机从当前位置沿着移动路径移动,直至到达移动路径的终点;其中,终点基于映射点确定。
上述控制模块,还被配置为执行:控制虚拟摄像机从当前位置沿着移动路径移动;在虚拟摄像机移动的过程中,根据受控虚拟对象在虚拟场景中的位置,调整虚拟摄像机的朝向;当虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡时,控制虚拟摄像机停止移动。
本实施例还提供一种电子设备,包括处理器和存储器,存储器存储有能够被处理器执行的机器可执行指令,处理器执行机器可执行指令以实现上述游戏画面控制方法。该电子设备可以是服务器,也可以是触控终端设备。
参见图14所示,该电子设备包括处理器100和存储器101,该存储器101存储有能够被处理器100执行的机器可执行指令,该处理器100执行机器可执行指令以实现上述游戏画面控制方法。
进一步地,图14所示的电子设备还包括总线102和通信接口103,处理器100、通信接口103和存储器101通过总线102连接。
其中,存储器101可能包含高速随机存取存储器(RAM,Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口103(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。总线102可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图14中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。
处理器100可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器100中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器100可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processor,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本公开实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本公开实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器101,处理器100读取存储器101中的信息,结合其硬件完成前述实施例的方法的步骤。
上述电子设备中的处理器,通过执行机器可执行指令,可以实现上述游戏画面控制方法中的下述操作:
图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;基于目标位置点在虚拟场景 中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中,虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
该方式中,首先从场景画面中确定一个目标位置点,得到该目标位置点位于虚拟场景中的映射点,进而基于映射点在受控虚拟对象所在平面确定指定位置点,当虚拟摄像机与指定位置点之间不存在障碍物时,基于映射点控制虚拟摄像机移动,该方式可以使虚拟摄像机拍摄得到的场景画面中受控虚拟对象不被遮挡;在受控虚拟对象被遮挡的情况下,相对平稳的调整拍摄镜头,使玩家可以继续观察到受控虚拟对象,同时可以观察场景的全局信息,提高了玩家的游戏体验,提升终端设备所显示的游戏画面的稳定性,降低终端设备的运行时长,节省了终端设备的电量消耗。
响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,基于预设的位置点选择信息,从第一场景画面中确定目标位置点;其中,位置点选择信息中记录有第一场合画面中的至少一个备选位置点的位置信息。
上述方式中,通过位置点选择信息确定目标位置点,方便快捷,且计算量较少。
上述备选位置点包括:位于受控虚拟对象上方的第一位置点、位于受控虚拟对象和第一位置点之间的第二位置点、位于受控虚拟对象左侧的第三位置点和位于受控虚拟对象右侧的第四位置点;按照被确定为目标位置点的优先级顺序,第一位置点、第二位置点、第三位置点和第四位置点由高到低排列;响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,将优先级顺序最高的第一位置点,确定为目标位置点。
如果虚拟摄像机与指定位置点之间存在第二障碍物,按照优先级顺序,将目标位置点的下一个位置点作为更新的目标位置点;继续执行基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线的步骤。
在上述方式中,当受控虚拟对象被遮挡时,最有可能不被遮挡的是受控虚拟对象的上部,因此首先向上拉镜头,到达第一位置点,如果第一位置点被遮挡,然后稍微下降一些镜头,到达第二位置点,以寻求从上下遮挡的中间获取视野,如果中部也被遮挡,再考虑向左右拉镜头,即上述第三位置点和第四位置点。这样的优先级排序,可以避免对备选位置点的多次遍历,有效降低系统开销。
如果目标位置点更新至第四位置点时,虚拟摄像机与指定位置点之间仍然存在第二障碍物,控制虚拟摄像机移动至遮挡第一障碍物的预设位置;其中,预设位置与受控虚拟对象位于第一障碍物的同一侧。
响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,在第一场景画面中确定遮挡第一障碍物的显示区域,从显示区域以外的区域中确定目标位置点。
在上述方式中,在障碍物的显示区域以外的区域确定目标位置点,可以使确定出的目标位置点更加准确、合适。
基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面区 域;确定第一场景画面和目标平面区域的边长比;基于目标位置点在第一场景画面中的位置,以及边长比,从目标平面区域中确定目标位置点对应的映射点;其中,目标位置点在第一场景画面中的位置,与映射点在目标平面区域中的位置相同。
确定虚拟摄像机对应的虚拟视椎体;其中,虚拟摄像机位于虚拟视椎体的第一顶点;基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面;其中,目标平面与虚拟摄像机的朝向方向垂直,目标平面与虚拟摄像机的垂直距离基于第一场景画面的深度信息确定;将目标平面中与虚拟视椎体相交的区域,确定为目标平面区域。
如果不存在第二障碍物,基于映射点和虚拟摄像机的当前位置,生成虚拟摄像机的移动路径;其中,移动路径具有指定形状,且移动路径中的任一点与受控虚拟对象的距离大于或等于指定距离;控制虚拟摄像机从当前位置沿着移动路径移动。
如果不存在第二障碍物,以虚拟摄像机的当前位置为起点,生成弧形的移动路径;其中,移动路径中任一点与受控虚拟对象的距离,基于当前位置与受控虚拟对象的第一距离值,以及映射点位置与受控虚拟对象的第二距离值确定。
上述方式中,基于虚拟摄像机与受控虚拟对象的距离,以及映射点与受控虚拟对象的距离共同确定移动路径上的点与受控虚拟对象的距离,使得虚拟摄像机在移动时与受控虚拟对象的距离处在相对稳定的状态,进而使拍摄得到的场景画面的视角相对稳定,避免画面视角变化过大的问题。
控制虚拟摄像机从当前位置沿着移动路径移动,直至到达移动路径的终点;其中,终点基于映射点确定。
控制虚拟摄像机从当前位置沿着移动路径移动;在虚拟摄像机移动的过程中,根据受控虚拟对象在虚拟场景中的位置,调整虚拟摄像机的朝向;当虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被时,控制虚拟摄像机停止移动。
上述方式中,当场景画面中出现受控虚拟对象时,虚拟摄像机停止移动,在该位置进行拍摄,从而尽量少的减少场景画面视角的变化,提高了场景画面的视觉效果的稳定性。
在上述方式中,能够在受控虚拟对象被模型遮挡之后,采取最稳妥的镜头措施保证玩家依然可以看得见角色,又不至于粗暴地把镜头贴近角色身体,导致画面错乱,导致玩家无法正常操作角色,甚至导致因镜头快速频繁移动产生的生理不适,如晕眩、呕吐等;从而提高了画面变化的稳定性。
本实施例还提供一种机器可读存储介质,机器可读存储介质存储有机器可执行指令,机器可执行指令在被处理器调用和执行时,机器可执行指令促使处理器实现上述游戏画面控制方法。
上述机器可读存储介质存储中的机器可执行指令,通过执行该机器可执行指令,可以实现上述游戏画面控制方法中的下述操作:
图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,从第一场景画面中确定目标位置点;其中,受控虚拟对象通过终端设备进行控制;基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线;确定虚拟直线与受控虚拟对象所在平面的交点,将交点确定为受控虚拟对象所在平面上的指定位置点;其中, 虚拟摄像机在虚拟场景中的位置与受控虚拟对象的位置之间的连线与受控虚拟对象所在平面呈预设角度;确定虚拟摄像机与指定位置点之间是否存在第二障碍物;如果不存在第二障碍物,基于映射点控制虚拟摄像机移动,以使移动后的虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被遮挡;其中,第二障碍物包括第一障碍物,或者第一障碍物以外的障碍物。
该方式中,首先从场景画面中确定一个目标位置点,得到该目标位置点位于虚拟场景中的映射点,进而基于映射点在受控虚拟对象所在平面确定指定位置点,当虚拟摄像机与指定位置点之间不存在障碍物时,基于映射点控制虚拟摄像机移动,该方式可以使虚拟摄像机拍摄得到的场景画面中受控虚拟对象不被遮挡;在受控虚拟对象被遮挡的情况下,相对平稳的调整拍摄镜头,使玩家可以继续观察到受控虚拟对象,同时可以观察场景的全局信息,提高了玩家的游戏体验,提升终端设备所显示的游戏画面的稳定性,降低终端设备的运行时长,节省了终端设备的电量消耗。
响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,基于预设的位置点选择信息,从第一场景画面中确定目标位置点;其中,位置点选择信息中记录有第一场合画面中的至少一个备选位置点的位置信息。
上述方式中,通过位置点选择信息确定目标位置点,方便快捷,且计算量较少。
上述备选位置点包括:位于受控虚拟对象上方的第一位置点、位于受控虚拟对象和第一位置点之间的第二位置点、位于受控虚拟对象左侧的第三位置点和位于受控虚拟对象右侧的第四位置点;按照被确定为目标位置点的优先级顺序,第一位置点、第二位置点、第三位置点和第四位置点由高到低排列;响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,将优先级顺序最高的第一位置点,确定为目标位置点。
如果虚拟摄像机与指定位置点之间存在第二障碍物,按照优先级顺序,将目标位置点的下一个位置点作为更新的目标位置点;继续执行基于目标位置点在虚拟场景中的映射点与虚拟摄像机在虚拟场景中的位置生成一虚拟直线的步骤。
在上述方式中,当受控虚拟对象被遮挡时,最有可能不被遮挡的是受控虚拟对象的上部,因此首先向上拉镜头,到达第一位置点,如果第一位置点被遮挡,然后稍微下降一些镜头,到达第二位置点,以寻求从上下遮挡的中间获取视野,如果中部也被遮挡,再考虑向左右拉镜头,即上述第三位置点和第四位置点。这样的优先级排序,可以避免对备选位置点的多次遍历,有效降低系统开销。
如果目标位置点更新至第四位置点时,虚拟摄像机与指定位置点之间仍然存在第二障碍物,控制虚拟摄像机移动至遮挡第一障碍物的预设位置;其中,预设位置与受控虚拟对象位于第一障碍物的同一侧。
响应于第一场景画面中的受控虚拟对象被第一障碍物遮挡,在第一场景画面中确定遮挡第一障碍物的显示区域,从显示区域以外的区域中确定目标位置点。
在上述方式中,在障碍物的显示区域以外的区域确定目标位置点,可以使确定出的目标位置点更加准确、合适。
基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面区域;确定第一场景画面和目标平面区域的边长比;基于目标位置点在第一场景画面中的位置,以及边长比,从目标平面区域中确定目标位置点对应的映射点;其中,目标位置 点在第一场景画面中的位置,与映射点在目标平面区域中的位置相同。
确定虚拟摄像机对应的虚拟视椎体;其中,虚拟摄像机位于虚拟视椎体的第一顶点;基于第一场景画面的深度信息,确定第一场景画面在虚拟场景中对应的目标平面;其中,目标平面与虚拟摄像机的朝向方向垂直,目标平面与虚拟摄像机的垂直距离基于第一场景画面的深度信息确定;将目标平面中与虚拟视椎体相交的区域,确定为目标平面区域。
如果不存在第二障碍物,基于映射点和虚拟摄像机的当前位置,生成虚拟摄像机的移动路径;其中,移动路径具有指定形状,且移动路径中的任一点与受控虚拟对象的距离大于或等于指定距离;控制虚拟摄像机从当前位置沿着移动路径移动。
如果不存在第二障碍物,以虚拟摄像机的当前位置为起点,生成弧形的移动路径;其中,移动路径中任一点与受控虚拟对象的距离,基于当前位置与受控虚拟对象的第一距离值,以及映射点位置与受控虚拟对象的第二距离值确定。
上述方式中,基于虚拟摄像机与受控虚拟对象的距离,以及映射点与受控虚拟对象的距离共同确定移动路径上的点与受控虚拟对象的距离,使得虚拟摄像机在移动时与受控虚拟对象的距离处在相对稳定的状态,进而使拍摄得到的场景画面的视角相对稳定,避免画面视角变化过大的问题。
控制虚拟摄像机从当前位置沿着移动路径移动,直至到达移动路径的终点;其中,终点基于映射点确定。
控制虚拟摄像机从当前位置沿着移动路径移动;在虚拟摄像机移动的过程中,根据受控虚拟对象在虚拟场景中的位置,调整虚拟摄像机的朝向;当虚拟摄像机拍摄到的第二场景画面中的受控虚拟对象不被时,控制虚拟摄像机停止移动。
上述方式中,当场景画面中出现受控虚拟对象时,虚拟摄像机停止移动,在该位置进行拍摄,从而尽量少的减少场景画面视角的变化,提高了场景画面的视觉效果的稳定性。
在上述方式中,能够在受控虚拟对象被模型遮挡之后,采取最稳妥的镜头措施保证玩家依然可以看得见角色,又不至于粗暴地把镜头贴近角色身体,导致画面错乱,导致玩家无法正常操作角色,甚至导致因镜头快速频繁移动产生的生理不适,如晕眩、呕吐等;从而提高了画面变化的稳定性。
本公开实施例所提供的游戏画面控制方法、装置和电子设备的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见方法实施例,在此不再赘述。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
另外,在本公开实施例的描述中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域技术人员而言,可以具体情况理解上述术语在本公开中的具体含义。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说 对相关技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
在本公开的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本公开和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本公开的限制。此外,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。
最后应说明的是:以上实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以权利要求的保护范围为准。

Claims (15)

  1. 一种游戏画面控制方法,通过终端设备提供一图形用户界面;所述图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;所述方法包括:
    响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,从所述第一场景画面中确定目标位置点;其中,所述受控虚拟对象通过所述终端设备进行控制;
    基于所述目标位置点在所述虚拟场景中的映射点与所述虚拟摄像机在所述虚拟场景中的位置生成一虚拟直线;
    确定所述虚拟直线与所述受控虚拟对象所在平面的交点,将所述交点确定为所述受控虚拟对象所在平面上的指定位置点;其中,所述虚拟摄像机在所述虚拟场景中的位置与所述受控虚拟对象的位置之间的连线与所述受控虚拟对象所在平面呈预设角度;
    确定所述虚拟摄像机与所述指定位置点之间是否存在第二障碍物;如果不存在所述第二障碍物,基于所述映射点控制所述虚拟摄像机移动,以使移动后的所述虚拟摄像机拍摄到的第二场景画面中的所述受控虚拟对象不被遮挡;其中,所述第二障碍物包括所述第一障碍物,或者所述第一障碍物以外的障碍物。
  2. 根据权利要求1所述的方法,其中,响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,从所述第一场景画面中确定目标位置点的步骤,包括:
    响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,基于预设的位置点选择信息,从所述第一场景画面中确定目标位置点;其中,所述位置点选择信息中记录有所述第一场合画面中的至少一个备选位置点的位置信息。
  3. 根据权利要求2所述的方法,其中,所述备选位置点包括:位于所述受控虚拟对象上方的第一位置点、位于所述受控虚拟对象和所述第一位置点之间的第二位置点、位于所述受控虚拟对象左侧的第三位置点和位于所述受控虚拟对象右侧的第四位置点;按照被确定为目标位置点的优先级顺序,所述第一位置点、所述第二位置点、所述第三位置点和所述第四位置点由高到低排列;
    所述响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,基于预设的位置点选择信息,从所述第一场景画面中确定目标位置点的步骤,包括:
    响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,将所述优先级顺序最高的所述第一位置点,确定为目标位置点。
  4. 根据权利要求3所述的方法,其中,所述方法还包括:
    如果所述虚拟摄像机与所述指定位置点之间存在所述第二障碍物,按照所述优先级顺序,将所述目标位置点的下一个位置点作为更新的目标位置点;
    继续执行基于所述目标位置点在所述虚拟场景中的映射点与所述虚拟摄像机在所述虚拟场景中的位置生成一虚拟直线的步骤。
  5. 根据权利要求3所述的方法,其中,所述方法还包括:
    如果所述目标位置点更新至所述第四位置点时,所述虚拟摄像机与所述指定位置点之间仍然存在所述第二障碍物,控制所述虚拟摄像机移动至遮挡所述第一障碍物的预设位置;其中,所述预设位置与所述受控虚拟对象位于所述第一障碍物的同一侧。
  6. 根据权利要求1所述的方法,其中,响应于所述第一场景画面中的受控虚拟对 象被第一障碍物遮挡,从所述第一场景画面中确定目标位置点的步骤,包括:
    响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,在所述第一场景画面中确定遮挡所述第一障碍物的显示区域,从所述显示区域以外的区域中确定目标位置点。
  7. 根据权利要求1所述的方法,其中,基于所述目标位置点在所述虚拟场景中的映射点与所述虚拟摄像机在所述虚拟场景中的位置生成一虚拟直线的步骤之前,所述方法还包括:
    基于所述第一场景画面的深度信息,确定所述第一场景画面在所述虚拟场景中对应的目标平面区域;
    确定所述第一场景画面和所述目标平面区域的边长比;
    基于所述目标位置点在所述第一场景画面中的位置,以及所述边长比,从所述目标平面区域中确定所述目标位置点对应的映射点;其中,所述目标位置点在所述第一场景画面中的位置,与所述映射点在所述目标平面区域中的位置相同。
  8. 根据权利要求7所述的方法,其中,基于所述第一场景画面的深度信息,确定所述第一场景画面在所述虚拟场景中对应的目标平面区域的步骤,包括:
    确定所述虚拟摄像机对应的虚拟视椎体;其中,所述虚拟摄像机位于所述虚拟视椎体的第一顶点;
    基于所述第一场景画面的深度信息,确定所述第一场景画面在所述虚拟场景中对应的目标平面;其中,所述目标平面与所述虚拟摄像机的朝向方向垂直,所述目标平面与所述虚拟摄像机的垂直距离基于所述第一场景画面的深度信息确定;
    将所述目标平面中与所述虚拟视椎体相交的区域,确定为目标平面区域。
  9. 根据权利要求1所述的方法,其中,如果不存在所述第二障碍物,基于所述映射点控制所述虚拟摄像机移动的步骤,包括:
    如果不存在所述第二障碍物,基于所述映射点和所述虚拟摄像机的当前位置,生成所述虚拟摄像机的移动路径;其中,所述移动路径具有指定形状,且所述移动路径中的任一点与所述受控虚拟对象的距离大于或等于所述指定距离;
    控制所述虚拟摄像机从所述当前位置沿着所述移动路径移动。
  10. 根据权利要求9所述的方法,其中,如果不存在所述第二障碍物,基于所述映射点和所述虚拟摄像机的当前位置,生成所述虚拟摄像机的移动路径的步骤,包括:
    如果不存在所述第二障碍物,以所述虚拟摄像机的当前位置为起点,生成弧形的移动路径;
    其中,所述移动路径中任一点与所述受控虚拟对象的距离,基于所述当前位置与所述受控虚拟对象的第一距离值,以及所述映射点位置与所述受控虚拟对象的第二距离值确定。
  11. 根据权利要求9所述的方法,其中,控制所述虚拟摄像机从所述当前位置沿着所述移动路径移动的步骤,包括:
    控制所述虚拟摄像机从所述当前位置沿着所述移动路径移动,直至到达所述移动路径的终点;其中,所述终点基于所述映射点确定。
  12. 根据权利要求9所述的方法,其中,控制所述虚拟摄像机从所述当前位置沿着 所述移动路径移动的步骤,包括:
    控制所述虚拟摄像机从所述当前位置沿着所述移动路径移动;
    在所述虚拟摄像机移动的过程中,根据所述受控虚拟对象在所述虚拟场景中的位置,调整所述虚拟摄像机的朝向;
    当所述虚拟摄像机拍摄到的第二场景画面中的所述受控虚拟对象不被遮挡时,控制所述虚拟摄像机停止移动。
  13. 一种游戏画面控制装置,通过终端设备提供一图形用户界面;所述图形用户界面中显示有:游戏内的虚拟摄像机在虚拟场景中拍摄得到的第一场景画面;所述装置包括:
    第一确定模块,被配置为执行响应于所述第一场景画面中的受控虚拟对象被第一障碍物遮挡,从所述第一场景画面中确定目标位置点;其中,所述受控虚拟对象通过所述终端设备进行控制;
    生成模块,被配置为执行基于所述目标位置点在所述虚拟场景中的映射点与所述虚拟摄像机在所述虚拟场景中的位置生成一虚拟直线;
    第二确定模块,被配置为执行确定所述虚拟直线与所述受控虚拟对象所在平面的交点,将所述交点确定为所述受控虚拟对象所在平面上的指定位置点;其中,所述虚拟摄像机在所述虚拟场景中的位置与所述受控虚拟对象的位置之间的连线与所述受控虚拟对象所在平面呈预设角度;
    控制模块,被配置为执行确定所述虚拟摄像机与所述指定位置点之间是否存在第二障碍物;如果不存在所述第二障碍物,基于所述映射点控制所述虚拟摄像机移动,以使移动后的所述虚拟摄像机拍摄到的第二场景画面中的所述受控虚拟对象不被遮挡;其中,所述第二障碍物包括所述第一障碍物,或者所述第一障碍物以外的障碍物。
  14. 一种电子设备,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器执行所述机器可执行指令以实现权利要求1-12任一项所述的游戏画面控制方法。
  15. 一种机器可读存储介质,所述机器可读存储介质存储有机器可执行指令,所述机器可执行指令在被处理器调用和执行时,所述机器可执行指令促使所述处理器实现权利要求1-12任一项所述的游戏画面控制方法。
PCT/CN2023/091539 2022-06-21 2023-04-28 游戏画面控制方法、装置和电子设备 WO2023246313A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210706916.3 2022-06-21
CN202210706916.3A CN117298576A (zh) 2022-06-21 2022-06-21 游戏画面控制方法、装置和电子设备

Publications (1)

Publication Number Publication Date
WO2023246313A1 true WO2023246313A1 (zh) 2023-12-28

Family

ID=89248574

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/091539 WO2023246313A1 (zh) 2022-06-21 2023-04-28 游戏画面控制方法、装置和电子设备

Country Status (2)

Country Link
CN (1) CN117298576A (zh)
WO (1) WO2023246313A1 (zh)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000288248A (ja) * 1999-04-05 2000-10-17 Namco Ltd ゲーム装置及び情報記憶媒体
JP2002360920A (ja) * 2001-06-05 2002-12-17 Atlus Co Ltd ゲーム画像制御装置
JP2004341572A (ja) * 2003-05-12 2004-12-02 Namco Ltd 画像生成システム、プログラム及び情報記憶媒体
JP2019000138A (ja) * 2017-06-09 2019-01-10 株式会社カプコン ゲームプログラム、ゲーム装置およびサーバ装置
JP2019000137A (ja) * 2017-06-09 2019-01-10 株式会社カプコン ゲームプログラム、ゲーム装置およびサーバ装置
CN111888762A (zh) * 2020-08-13 2020-11-06 网易(杭州)网络有限公司 游戏中镜头视角的调整方法及电子设备
CN113440846A (zh) * 2021-07-15 2021-09-28 网易(杭州)网络有限公司 游戏的显示控制方法、装置、存储介质及电子设备
CN113856200A (zh) * 2021-10-13 2021-12-31 网易(杭州)网络有限公司 一种画面显示方法、装置、电子设备及可读存储介质
WO2022048105A1 (zh) * 2020-09-07 2022-03-10 网易(杭州)网络有限公司 游戏中的信息控制方法、装置和电子设备

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000288248A (ja) * 1999-04-05 2000-10-17 Namco Ltd ゲーム装置及び情報記憶媒体
JP2002360920A (ja) * 2001-06-05 2002-12-17 Atlus Co Ltd ゲーム画像制御装置
JP2004341572A (ja) * 2003-05-12 2004-12-02 Namco Ltd 画像生成システム、プログラム及び情報記憶媒体
JP2019000138A (ja) * 2017-06-09 2019-01-10 株式会社カプコン ゲームプログラム、ゲーム装置およびサーバ装置
JP2019000137A (ja) * 2017-06-09 2019-01-10 株式会社カプコン ゲームプログラム、ゲーム装置およびサーバ装置
CN111888762A (zh) * 2020-08-13 2020-11-06 网易(杭州)网络有限公司 游戏中镜头视角的调整方法及电子设备
WO2022048105A1 (zh) * 2020-09-07 2022-03-10 网易(杭州)网络有限公司 游戏中的信息控制方法、装置和电子设备
CN113440846A (zh) * 2021-07-15 2021-09-28 网易(杭州)网络有限公司 游戏的显示控制方法、装置、存储介质及电子设备
CN113856200A (zh) * 2021-10-13 2021-12-31 网易(杭州)网络有限公司 一种画面显示方法、装置、电子设备及可读存储介质

Also Published As

Publication number Publication date
CN117298576A (zh) 2023-12-29

Similar Documents

Publication Publication Date Title
US10740951B2 (en) Foveal adaptation of particles and simulation models in a foveated rendering system
JP5597837B2 (ja) プログラム、情報記憶媒体、及び、画像生成装置
US8556716B2 (en) Image generation system, image generation method, and information storage medium
US11282264B2 (en) Virtual reality content display method and apparatus
WO2019154255A1 (zh) 视角调整方法、装置、电子装置及计算机可读存储介质
JP2022521324A (ja) ゲームキャラクター制御方法、装置、機器および記憶媒体
US8514255B2 (en) Information storage medium, image control device, and image control method
JP7361502B2 (ja) 立体視効果を調節するためのシステムおよび方法
US10755486B2 (en) Occlusion using pre-generated 3D models for augmented reality
JP2007506186A (ja) トラッキングされている頭部の動作に従って表示中のシーンのビューを調整する方法及び装置
US9022864B2 (en) Apparatus and method for controlling objects on a stereoscopic display
EP3634593B1 (en) Optimized deferred lighting and foveal adaptation of particles and simulation models in a foveated rendering system
KR20060047773A (ko) 화상 처리 프로그램, 게임 처리 프로그램 및 게임 정보처리 장치
US11117052B2 (en) Game device, control method of game device, and storage medium that can be read by computer
US11107183B2 (en) Adaptive mesh skinning in a foveated rendering system
JP2020523687A (ja) 中心窩レンダリングシステムにおけるシャドーの最適化及びメッシュスキンの適応
JP2011215886A (ja) プログラム、情報記憶媒体、及び、画像生成装置
JP2018112789A (ja) 情報処理システム、情報処理プログラム、情報処理装置、情報処理方法、ゲームシステム、ゲームプログラム、ゲーム装置、及びゲーム方法
US20140354631A1 (en) Non-transitory storage medium encoded with computer readable information processing program, information processing apparatus, information processing system, and information processing method
WO2023246313A1 (zh) 游戏画面控制方法、装置和电子设备
CN110784704B (zh) 一种监控视频的显示方法、装置及电子设备
WO2023246172A1 (zh) 技能指示器的显示控制方法、装置和电子设备
CN114307145A (zh) 画面显示方法、装置、终端、存储介质及程序产品
WO2023246310A1 (zh) 选中对象的方法、装置和电子设备
CN113332712B (zh) 游戏场景画面移动方法、装置和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23825966

Country of ref document: EP

Kind code of ref document: A1