CN109976533B - Display control method and device - Google Patents

Display control method and device Download PDF

Info

Publication number
CN109976533B
CN109976533B CN201910298451.0A CN201910298451A CN109976533B CN 109976533 B CN109976533 B CN 109976533B CN 201910298451 A CN201910298451 A CN 201910298451A CN 109976533 B CN109976533 B CN 109976533B
Authority
CN
China
Prior art keywords
preset area
minimum
maximum
preset
area
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910298451.0A
Other languages
Chinese (zh)
Other versions
CN109976533A (en
Inventor
李俊
李涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Apas Technology Co ltd
Original Assignee
Zhuhai Tianyan Technology Co ltd
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 Zhuhai Tianyan Technology Co ltd filed Critical Zhuhai Tianyan Technology Co ltd
Priority to CN201910298451.0A priority Critical patent/CN109976533B/en
Publication of CN109976533A publication Critical patent/CN109976533A/en
Application granted granted Critical
Publication of CN109976533B publication Critical patent/CN109976533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/006Mixed reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/01Indexing scheme relating to G06F3/01
    • G06F2203/012Walk-in-place systems for allowing a user to walk in a virtual environment while constraining him to a given position in the physical environment

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Architecture (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application provides a display control method and a display control device, wherein the method comprises the following steps: setting a first preset area and a second preset area in the two-dimensional display area, wherein the second preset area is in the first preset area; setting a first direction and a second direction based on the first preset area and the second preset area; determining the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction; and judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, if not, adjusting the shooting angle and/or the shooting position of the virtual camera. According to the embodiment of the application, the target role is ensured to be not moved out of the two-dimensional display area, a larger motion space is provided for the target role, the control over the target role is more flexible, the expansibility is strong, and the user experience is improved.

Description

Display control method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a display control method and apparatus.
Background
With the rapid development of three-dimensional technology, products based on the three-dimensional technology (such as 3D games, 3D dynamic wallpaper and the like) are increasingly abundant, and the interaction between a user and a virtual three-dimensional world is increasingly frequent. Generally, a virtual three-dimensional world is displayed to a user through a virtual camera, and how to select a proper shooting angle and shooting position enables the user to better observe the virtual three-dimensional world, so that the virtual three-dimensional world becomes one of key elements for improving user experience.
Currently, when a virtual camera shoots a target character in a virtual three-dimensional world, the most commonly used shooting angle and shooting position are that the target character is placed at the center position of the shooting angle of the virtual camera and kept at a fixed distance from the target character, that is, the target character is located at the center position of a two-dimensional display area mapped in a display screen by the virtual camera according to the screen occupation ratio of the display screen of a user terminal. When the target character deviates from the central position of the shooting angle of the virtual camera, the virtual camera automatically adjusts the shooting angle to enable the target character to return to the central position of the shooting angle of the virtual camera, namely, the target character is controlled to be always positioned at the central position of the two-dimensional display area, so that the target character is prevented from moving out of the two-dimensional display area. When the distance between the target character and the virtual camera is changed, the virtual camera is controlled to automatically adjust the distance between the target character and the virtual camera, so that the distance between the target character and the virtual camera is kept unchanged, namely the size of the target character in the two-dimensional display area is kept unchanged.
Obviously, in the above manner, since the control target character is always at the center position of the shooting angle of the virtual camera and maintains a fixed position with the virtual camera, the control on the target character is too rigid, and the user experience is poor.
Disclosure of Invention
The embodiment of the application aims to provide a display control method and device so as to solve the problems that control of a target role is too rigid and user experience is poor.
To achieve the above purpose, the embodiments of the present application are implemented as follows:
the embodiment of the application provides a display control method, which is applied to control of a virtual camera in a three-dimensional virtual world, wherein the virtual camera maps a two-dimensional display area in a display screen according to the screen duty ratio of the display screen in a user terminal, the virtual camera maps a virtual scene shot in the three-dimensional virtual world in the two-dimensional display area, the virtual scene comprises a target character, and the method comprises the following steps:
setting a first preset area and a second preset area in the two-dimensional display area, wherein the second preset area is in the first preset area;
setting a first direction and a second direction based on the first preset area and the second preset area;
determining the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction;
and judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, if not, adjusting the shooting angle and/or the shooting position of the virtual camera.
The embodiment of the present application further provides a display control apparatus, which is applied to control of a virtual camera in a three-dimensional virtual world, where the virtual camera maps a two-dimensional display area in a display screen according to a screen duty ratio of the display screen in a user terminal, the virtual camera maps a virtual scene shot in the three-dimensional virtual world in the two-dimensional display area, the virtual scene includes a target character, and the display control apparatus includes:
the device comprises a first setting module, a second setting module and a display module, wherein the first setting module is used for setting a first preset area and a second preset area in the two-dimensional display area, and the second preset area is in the first preset area;
a second setting module configured to set a first direction and a second direction based on the first preset region and the second preset region;
a determining module, configured to determine a maximum end and a minimum end of the target role in the first direction and a maximum end and a minimum end in the second direction;
and the judgment and adjustment module is used for judging whether the target role is superposed with the second preset area, judging whether the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, and if not, adjusting the shooting angle and/or the shooting position of the virtual camera.
In the embodiment of the application, a first preset area and a second preset area are set in a two-dimensional display area, the second preset area is located in the first preset area, whether a target role is overlapped with the second preset area or not is judged, the minimum end and the maximum end of the target role in a first direction and the maximum end and the minimum end of the target role in a second direction are located between the first preset area and the second preset area, and if not, the shooting angle and/or the shooting position of the virtual camera are/is adjusted. On one hand, whether the target role is coincided with the second preset area or not and the minimum end and the maximum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are between the first preset area and the second preset area or not are judged, if not, the shooting angle and/or the shooting position of the virtual camera are adjusted, in other words, under the premise that the target role is coincided with the second preset area, as long as the minimum end and the maximum end of the target role in the first direction and the minimum end and the maximum end of the target role in the second direction are between the first preset area and the second preset area, the shooting angle and/or the shooting position of the virtual camera are not adjusted, namely under the premise that the target role is not moved out of the two-dimensional display area, a larger motion space is provided for the target role, so that the control of the target role is more flexible and has strong expansibility, user experience is improved, and the virtual camera does not need to move in real time according to the movement of the target role; on the other hand, since the first preset region and the second preset region may be disposed in any region of the two-dimensional display region, the flexibility of controlling the target character is further increased.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a display control method according to an embodiment of the present application;
FIG. 2 is a schematic view of a view frustum of a virtual camera provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of a first predetermined area and a second predetermined area in a two-dimensional display area according to an embodiment of the present disclosure;
FIG. 4 is a diagram illustrating a determination of the maximum and minimum ends of a target character in a first direction and the maximum and minimum ends in a second direction according to an embodiment of the present application;
fig. 5 is a schematic flowchart of adjusting a shooting angle and/or a shooting position of the virtual camera according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram illustrating that a target character provided in an embodiment of the present application is overlapped with a second preset area, and a minimum end of the target character in a first direction is outside the first preset area;
fig. 7 is a schematic diagram illustrating that a target character provided in an embodiment of the present application is overlapped with a second preset area, and a minimum end of the target character in a first direction and a maximum end of the target character in the second direction are outside the first preset area;
fig. 8 is a schematic diagram of a target character overlapping a second preset area and a minimum end and a maximum end of the target character in a first direction being outside the first preset area according to an embodiment of the present application;
fig. 9 is a schematic diagram of a target character overlapping a second preset area and a minimum end and a maximum end of the target character in a second direction being outside the first preset area according to an embodiment of the present application;
fig. 10 is a schematic diagram of a target character overlapping a second preset area, and a minimum end of the target character in a first direction and a minimum end and a maximum end of the target character in the second direction being outside the first preset area according to an embodiment of the present application;
fig. 11 is a schematic diagram of a target character overlapping a second predetermined area and a minimum end of the target character in the first direction being within the second predetermined area according to an embodiment of the present application;
fig. 12 is a schematic diagram of a target character overlapping a second preset area, where a minimum end of the target character in a first direction and a maximum end of the target character in the second direction are within the second preset area according to an embodiment of the present application;
fig. 13 is a schematic diagram of a target character overlapping a second preset area, and a minimum end and a maximum end of the target character in a first direction being within the second preset area according to an embodiment of the present application;
fig. 14 is a schematic diagram of a target character overlapping a second preset area and a minimum end and a maximum end of the target character in a second direction being within the second preset area according to an embodiment of the present application;
fig. 15 is a schematic diagram of a target character overlapping a second preset area, where a maximum end and a minimum end of the target character in a first direction and a maximum end and a minimum end of the target character in the second direction are in the second preset area according to an embodiment of the present application;
fig. 16 is a schematic diagram illustrating a rotation angle for calculating a shooting angle of a virtual camera according to an embodiment of the present application;
FIG. 17 is a schematic view of a virtual camera provided in an embodiment of the present application;
fig. 18 is a schematic structural diagram of a display control apparatus according to an embodiment of the present application;
fig. 19 is a schematic structural diagram of a display control device according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of a display control method according to an embodiment of the present application, where the method is applied to control a virtual camera in a three-dimensional virtual world, where the virtual camera maps a two-dimensional display area in a display screen according to a screen duty ratio of the display screen in a user terminal, and the virtual camera maps a virtual scene shot in the three-dimensional virtual world in the two-dimensional display area, where the virtual scene includes a target character. The user terminal may be, for example, a mobile phone, a tablet computer, a notebook computer, etc., and this exemplary embodiment is not particularly limited thereto. Fig. 2 is a schematic view of a view cone of a virtual camera according to an embodiment of the present disclosure. The view volume 202 of the virtual camera 201 is a view of the virtual camera 201 in a three-dimensional virtual world, i.e., a viewing range, the view volume 202 includes a proximal plane 203 and a distal plane 304, and the proximal plane 203 and the distal plane 204 in the view volume 202 define the viewing range of the virtual camera 201. Specifically, if the character is located at a distance from the virtual camera 201 that is greater than the far plane 204 or less than the near plane 203, the character will not be captured by the virtual camera 201 and will not be displayed on the display screen, in other words, the character located between the near plane 203 and the far plane 204 of the view volume 202 will be captured by the virtual camera 201 and will be displayed on the display screen. Based on this, the two-dimensional display area is an area in which the virtual camera 201 maps the visible range between its near plane 203 and far plane 204 to the display screen according to the screen occupation ratio of the display screen in the user terminal, and the two-dimensional display area is a rectangular area due to the shape of the view frustum 202 itself. As shown in fig. 1, the method may include steps S110 to S140, in which:
step S110, setting a first preset area and a second preset area in the two-dimensional display area, wherein the second preset area is in the first preset area;
step S120, setting a first direction and a second direction based on the first preset area and the second preset area;
step S130, determining the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction;
step S140, determining whether the target role coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region, if not, adjusting the shooting angle and/or the shooting position of the virtual camera.
In the embodiment of the application, on one hand, whether the target character is overlapped with the second preset area and the minimum end and the maximum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are between the first preset area and the second preset area is judged, and if not, the shooting angle and/or the shooting position of the virtual camera are adjusted, in other words, on the premise that the target character is overlapped with the second preset area, as long as the minimum end and the maximum end of the target character in the first direction and the minimum end and the maximum end of the target character in the second direction are between the first preset area and the second preset area, the shooting angle and/or the shooting position of the virtual camera are not adjusted, that is, on the premise that the target character is not moved out of the two-dimensional display area, a larger movement space is provided for the target character, so that the control of the target character is more flexible, the expansibility is strong, the user experience is improved, and the virtual camera does not need to move in real time according to the movement of the target role; on the other hand, since the first preset region and the second preset region may be disposed in any region of the two-dimensional display region, the flexibility of controlling the target character is further increased.
Next, the display control method provided in the embodiment of the present application will be further described with reference to fig. 1.
In step S110, a first preset area and a second preset area are set in the two-dimensional display area, where the second preset area is within the first preset area.
In the embodiment of the present application, the shape of the first preset area and the second preset area may be, for example, a rectangle, a circle, a triangle, and the like, which is not particularly limited in this exemplary embodiment. The first preset area and the second preset area may be the same in shape or different in shape, and this is not particularly limited in this exemplary embodiment. The first preset area and the second preset area may be disposed at any position in the two-dimensional display area, for example, at a middle position of the two-dimensional display area, for example, at a position at an upper left corner of the two-dimensional display area, and the like, which is not particularly limited in this exemplary embodiment.
Since the two-dimensional display area is an area in which the virtual camera maps the visible range between the near plane and the far plane of the display screen in the user terminal to the display screen according to the screen occupation ratio of the display screen, a first preset area and a second preset area can be set in the two-dimensional display area in a manner that two nested areas are set between the near plane and the far plane of the visual cone of the virtual camera, wherein the two nested areas can be a first detection area and a second detection area, the second detection area is in the first detection area, the area in which the first detection area is mapped to the two-dimensional display area is determined as the first preset area, and the area in which the second detection area is mapped to the two-dimensional display area is determined as the second preset area. It should be noted that the shapes of the first preset region and the second preset region may be set by setting the shapes of the first detection region and the second detection region, and the positions of the first preset region and the second preset region in the two-dimensional display region may be set by setting the positions of the first detection region and the second detection region between the near plane and the far plane in the view cone.
For example, fig. 3 is a schematic diagram of a first preset region and a second preset region in a two-dimensional display region according to an embodiment of the present disclosure, and as can be seen from fig. 3, the two-dimensional display region 301, the first preset region 302, and the second preset region 303 are all rectangular, and the second preset region 303 is disposed in the first preset region 302.
In step S120, a first direction and a second direction are set based on the first preset region and the second preset region.
In this embodiment of the application, the first direction and the second direction may be set with the central positions of the first preset area and the second preset area as reference points, and the first direction and the second direction may also be set with other points in the first preset area and the second preset area as reference points, which is not particularly limited in this exemplary embodiment. It should be noted that the first direction and the second direction may be perpendicular, and the first direction and the second direction may also not be perpendicular, which is not particularly limited in this exemplary embodiment.
In step S130, the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end in the second direction are determined.
In this embodiment of the present application, the determining process of the maximum end and the minimum end of the target role in the first direction may include: and determining a maximum projection point in the positive direction of the first direction and a minimum projection point in the negative direction of the first direction from projection points of all boundary points of the target character in the first direction, determining the maximum projection point in the positive direction of the first direction as the maximum end of the target character in the first direction, and determining the minimum projection point in the negative direction of the first direction as the minimum end of the target character in the first direction. Similarly, the process of determining the maximum end and the minimum end of the target character in the second direction may include: and determining the maximum projection point in the positive direction of the second direction and the minimum projection point in the negative direction of the second direction from the projection points of all boundary points of the target character in the second direction, determining the maximum projection point in the positive direction of the second direction as the maximum end of the target character in the second direction, and determining the minimum projection point in the negative direction of the second direction as the minimum end of the target character in the second direction.
For example, fig. 4 is a schematic diagram of determining the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end in the second direction according to an embodiment of the present application. As shown in fig. 4, the target character 304 is a five-pointed star, the two-dimensional display area 301, the first predetermined area 302 and the second predetermined area 303 are all rectangles, and the first direction 305 and the second direction 306 are perpendicular. The direction of the arrow in the first direction 305 is a positive direction of the first direction 305, the reverse direction of the arrow in the first direction 305 is a negative direction of the first direction 305, the direction of the arrow in the second direction 306 is a positive direction of the second direction 306, and the reverse direction of the arrow in the second direction 306 is a negative direction of the second direction 306. As shown in fig. 4, the projection point 307 is the maximum end of the target character 304 in the first direction 305, the projection point 308 is the minimum end of the target character 304 in the first direction 305, the projection point 309 is the maximum end of the target character 304 in the second direction 306, and the projection point 310 is the minimum end of the target character 304 in the second direction 306.
In step S140, it is determined whether the target character coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, and if not, the shooting angle and/or the shooting position of the virtual camera are adjusted to make the target character coincide with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
In this embodiment of the present application, fig. 5 is a schematic flowchart of a process of adjusting a shooting angle and/or a shooting position of the virtual camera according to an embodiment of the present application. As shown in fig. 5, the following steps may be included:
step S510, determining whether the target role coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset region.
In this embodiment of the application, the coincidence of the target role and the second preset area may refer to at least partial coincidence of the target role and the second preset area, based on which, if there is a coincident portion between the target role and the second preset area, the target role coincides with the second preset area, and if the target role and the second preset area are not coincident at all, the target role does not coincide with the second preset area.
The process of determining whether the target character coincides with the second preset region may include: establishing a rectangular coordinate system based on the two-dimensional display area; acquiring the coordinates of each point of the target role in a rectangular coordinate system; acquiring the coordinates of each point in a second preset area in a rectangular coordinate system; comparing the coordinates of each point in the target role with the coordinates of each point in the second preset area respectively, and judging whether the target role and the second preset area have points with the same coordinates or not according to the comparison result; if the target role exists, the target role is overlapped with the second preset area, and if the target role does not exist, the target role is not overlapped with the second preset area.
The process of determining whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction are within the first preset area may include: acquiring a coordinate of a maximum end in a first direction, a coordinate of a minimum end in the first direction, a coordinate of a maximum end in a second direction and a coordinate of a minimum end in the second direction in a rectangular coordinate system; acquiring a coordinate range of a first preset area in a rectangular coordinate system; judging whether the coordinate of the maximum end in the first direction is in the coordinate range of a first preset area, if so, determining that the maximum end in the first direction is in the first preset area, and if not, determining that the maximum end in the first direction is outside the first preset area; since the principle of determining whether the minimum end in the first direction, the maximum end in the second direction, and the minimum end in the second direction are in the first preset region is the same as the above-mentioned principle of determining whether the maximum end in the first direction is in the first preset region, details thereof are omitted here.
For example, as shown in fig. 4, in combination with the above determination process, the target character 304 coincides with the second preset region 303, and the maximum end 307 and the minimum end 308 of the target character 304 in the first direction 305 and the maximum end 309 and the minimum end 310 of the target character 304 in the second direction 306 are within the first preset region 302.
It should be noted that, the process of obtaining the coordinates of each point of the target character may further be: constructing a three-dimensional vertical coordinate system in a visual cone of the virtual camera, wherein a Z axis is vertical to a near plane and a far plane of the visual cone, and a plane formed by an X axis and a Y axis is parallel to the near plane and the far plane; acquiring the coordinates of each point in the target role in a three-dimensional vertical coordinate system; and carrying out projection transformation and matrix algorithm on the coordinates of each point in the target character in the three-dimensional vertical coordinate system so as to calculate the coordinates of each point in the target character in the two-dimensional display area which is to be set from the virtual three-dimensional scene. It should be noted that the coordinates of each point required in the above can also be obtained according to the above principle.
Step S520, if not, adjusting a shooting angle and/or a shooting position of the virtual camera so that the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset region.
In the embodiment of the present application, a process of adjusting the photographing angle and/or the photographing position of the virtual camera will be described in detail according to the following different situations.
First, if the target character coincides with the second preset region and one of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction is outside the first preset region, the virtual camera is controlled to rotate towards the direction of the end outside the first preset region by a shooting angle, so that the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are both within the first preset region.
In an embodiment of the present application, for example, fig. 6 is a schematic diagram of a target character provided in an embodiment of the present application being overlapped with a second preset area, and a minimum end of the target character in a first direction being outside of a first preset area. As can be seen from fig. 6, since the target character 304 coincides with the second preset area 303 and only the minimum end 308 of the target character 304 in the first direction 305 is outside the first preset area 302, the virtual camera is controlled to rotate the shooting angle in the direction of the minimum end 308 in the first direction 305 so that the minimum end 308 in the first direction 305 enters the first preset area 302, so that the target character 304 coincides with the second preset area 303, and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are both within the first preset area 302.
Similarly, if the target character is overlapped with the second preset area and only the maximum end of the target character in the first direction is outside the first preset area, the virtual camera is controlled to rotate towards the direction of the maximum end in the first direction to shoot the image. And if the target role is overlapped with the second preset area and only the maximum end of the target role in the second direction is outside the first preset area, controlling the virtual camera to rotate towards the direction of the maximum end in the second direction for shooting by an angle. And if the target character is overlapped with the second preset area and only the minimum end of the target character in the second direction is outside the first preset area, controlling the virtual camera to rotate towards the direction of the minimum end in the second direction by a shooting angle.
It should be noted that, when the shooting angle of the virtual camera is rotated, the first preset area and the second preset area are also rotated, so that the rotation angle of the shooting angle of the virtual camera can be calculated according to the current position of the first preset area and the position of the critical edge which enables the end outside the first preset area to just enter the first preset area; the rotation angle of the shooting angle of the virtual camera may also be calculated according to the current position of the first preset area and the position of the end outside the first preset area moving to the specified position in the first preset area, which is not particularly limited in this exemplary embodiment.
And secondly, if the target role coincides with the second preset area and one of the maximum end and the minimum end in the first direction and one of the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to rotate in the directions of the two ends outside the first preset area in sequence by a shooting angle so that the target role coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are both in the first preset area.
In this embodiment of the present application, fig. 7 is a schematic diagram that a target character provided in an embodiment of the present application is overlapped with a second preset area, and a minimum end of the target character in a first direction and a maximum end of the target character in the second direction are outside the first preset area. As can be seen from fig. 7, since the target character 304 coincides with the second preset area 303, and the minimum end 308 of the target character 304 in the first direction 305 and the maximum end 309 of the target character 304 in the second direction 306 are outside the first preset area 302, therefore, the virtual camera is controlled to rotate the photographing angle first to the minimum end 308 in the first direction 305 and then to the maximum end 309 in the second direction 306, or the virtual camera is controlled to rotate the shooting angle to the maximum end 309 in the second direction 306 and then to rotate the shooting angle to the minimum end 308 in the first direction 305, so that the smallest end in the first direction 305 and the largest end 309 in the second direction 306 enter the first predetermined area 302, such that the target character 304 coincides with the second predefined area 303 and the maximum 307 and minimum 308 ends in the first direction 305 and the maximum 309 and minimum 310 ends in the second direction 306 are within the first predefined area 302.
Similarly, if the target role is overlapped with the second preset area and the maximum end in the first direction and the maximum end in the second direction are outside the first preset area, the virtual camera is controlled to rotate the shooting angle to the maximum end in the first direction and then rotate the shooting angle to the maximum end in the second direction, or the virtual camera is controlled to rotate the shooting angle to the maximum end in the second direction and then rotate the shooting angle to the maximum end in the first direction.
If the target role is overlapped with the second preset area and the maximum end in the first direction and the minimum end in the second direction are outside the first preset area, the virtual camera is controlled to rotate the shooting angle to the maximum end in the first direction and then rotate the shooting angle to the minimum end in the second direction, or the virtual camera is controlled to rotate the shooting angle to the minimum end in the second direction and then rotate the shooting angle to the maximum end in the first direction.
If the target role is overlapped with the second preset area and the minimum end in the first direction and the minimum end in the second direction are outside the first preset area, the virtual camera is controlled to rotate the shooting angle to the minimum end in the first direction and then rotate the shooting angle to the minimum end in the second direction, or the virtual camera is controlled to rotate the shooting angle to the minimum end in the second direction and then rotate the shooting angle to the minimum end in the first direction.
It should be noted that the principle of determining the rotation angle of the shooting angle of the virtual camera is the same as that in the first case, and therefore the description is omitted here.
And thirdly, if the target role is superposed with the second preset area and the maximum end and the minimum end in the first direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role so that the target role is superposed with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are both in the first preset area.
In this embodiment of the present application, fig. 8 is a schematic diagram that a target role provided in this embodiment of the present application is overlapped with a second preset area, and a minimum end and a maximum end of the target role in a first direction are outside a first preset area. As can be seen from fig. 8, since the target character 304 coincides with the second preset area 303, and the maximum end 307 and the minimum end 308 in the first direction 305 are both outside the first preset area 302, the virtual camera is controlled to adjust the shooting position in the direction away from the target character 304, so as to reduce the area occupied by the target character 304 in the two-dimensional display area 301, so that the maximum end 307 and the minimum end 308 in the first direction 305 enter the first preset area 302, and further, the target character 304 coincides with the second preset area 303, and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are both within the first preset area 302.
It should be noted that the distance from the virtual camera to the target character may be calculated according to the current area of the target character (i.e., the area in the current state) and the area of the target character (i.e., the area in the target state) when the maximum end and the minimum end in the first direction just enter the first preset region, and the distance from the virtual camera to the target character may also be calculated according to the current area of the target character (i.e., the area in the current state) and the area of the target character (i.e., the area in the target state) when the maximum end and the minimum end in the first direction enter corresponding positions in the first preset region, and the like, which is not particularly limited in the exemplary embodiment.
And fourthly, if the target role coincides with the second preset area and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction away from the target role so that the target role coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are both in the first preset area.
In this embodiment of the present application, fig. 9 is a schematic diagram that a target character provided in this embodiment of the present application is overlapped with a second preset area, and a minimum end and a maximum end of the target character in the second direction are outside the first preset area. As can be seen from fig. 9, the target character 304 coincides with the second preset area 303, and the maximum end 309 and the minimum end 310 in the second direction 306 are both outside the first preset area 302, so that the virtual camera is controlled to adjust the shooting position in the direction away from the target character 304 to reduce the area occupied by the target character 304 in the two-dimensional display area 301, so that the maximum end 309 and the minimum end 310 in the second direction 306 move into the first preset area 302, and further the target character 304 coincides with the second preset area 303, and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are both within the first preset area 302.
It should be noted that the principle of determining the distance from the virtual camera to the target character is the same as that in the third case, and therefore, the description thereof is omitted here.
And fifthly, if the target role is superposed with the second preset area and at least three of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction away from the target role so that the target role is superposed with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are both in the first preset area.
In the embodiment of the present application, for example, fig. 10 is a schematic diagram that a target character provided in an embodiment of the present application coincides with a second preset area, and a minimum end and a maximum end of the target character in a first direction and a minimum end and a maximum end of the target character in a second direction are outside the first preset area. As shown in fig. 10, since the target character 304 is overlapped with the second preset region 303, and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are both outside the first preset region 302, the virtual camera is controlled to adjust the shooting position in the direction away from the target character 304 to reduce the area occupied by the target character 304 in the two-dimensional display region 301, so that the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 move into the first preset region 302, and further the target character 304 is overlapped with the second preset region 303, and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are both within the first preset region 302.
It should be noted that the principle of determining the distance from the virtual camera to the target character is the same as that in the third case, and therefore is not described herein again.
And sixthly, if the target character is not overlapped with the second preset area, adjusting the shooting angle of the virtual camera or adjusting the shooting angle and the shooting position of the virtual camera so that the target character is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area.
In the embodiment of the present application, when the target character does not coincide with the second preset area, the shooting angle of the virtual camera is rotated according to the position relationship between the target character and the second preset area, so that the target character coincides with the second preset area, for example, the shooting angle of the virtual camera is rotated upward when the target character is at an upper position of the second preset area; for another example, if the target character is located at the left position of the second preset area, the shooting angle of the virtual camera is rotated to the left. After the target character coincides with the second preset area, the shooting angle or the shooting position of the virtual camera may be adjusted according to the first to fifth conditions, so that the target character coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset area. It should be noted that, when the target character is not overlapped with the second preset area and is not in the two-dimensional display area, the shooting position of the virtual camera may be adjusted first to make the target character enter the two-dimensional display area, then the target character is overlapped with the second preset area according to the adjustment process, and finally the shooting angle or shooting position of the virtual camera is adjusted according to the first to fifth conditions to make the target character be overlapped with the second preset area and make the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction be in the first preset area.
Step S530, determining whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction are outside the second preset region.
In the present exemplary embodiment, in step S530, on the basis that the target role coincides with the second preset region, and the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are within the first preset region, it is determined whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are outside the second preset region. It should be noted that, since it is determined in step 520 that the target character coincides with the second preset area, it is no longer determined in this step whether the target character coincides with the second preset area.
Since the principle of determining whether the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end in the second direction are outside the second preset region is the same as the principle of determining whether the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end in the second direction are inside the first preset region in step S510, details are not repeated here.
And S540, if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
In the embodiment of the present application, a process of adjusting the photographing angle or the photographing position of the virtual camera will be described in detail according to the following different cases.
First, if one of the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end in the second direction is within the second preset region, the virtual camera is controlled to rotate in a shooting angle in a direction opposite to the end within the second preset region, so that the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region.
In an embodiment of the present application, for example, fig. 11 is a schematic diagram of a target character provided in an embodiment of the present application coinciding with a second preset area, and a minimum end of the target character in a first direction being within the second preset area. As shown in fig. 11, if the minimum end 308 of the target character 304 in the first direction 305 is within the second preset region 303, the virtual camera is controlled to rotate to a shooting angle opposite to the minimum end 308 in the first direction 305, that is, the virtual camera is controlled to rotate to a shooting angle in a direction of the maximum end 307 in the first direction 305, so that the minimum end 308 in the first direction 305 moves out of the second preset region 303, and further the target character 304 coincides with the second preset region 303, and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are between the first preset region 302 and the second preset region 303.
Similarly, if the maximum end of the target role in the first direction is in a second preset area, controlling the virtual camera to rotate towards the opposite direction of the maximum end in the first direction by a shooting angle; if the maximum end of the target role in the second direction is in a second preset area, controlling the virtual camera to rotate towards the opposite direction of the maximum end in the second direction for shooting; and if the minimum end of the target role in the second direction is in the second preset area, controlling the virtual camera to rotate towards the opposite direction of the minimum end in the second direction by a shooting angle.
It should be noted that, when the shooting angle of the virtual camera is rotated, the first preset area and the second preset area are also rotated, so the rotation angle of the shooting angle of the virtual camera can be calculated according to the current position of the second preset area and the position at which the end in the second preset area just moves out of the critical edge of the second preset area; the rotation angle of the shooting angle of the virtual camera may also be calculated according to the current position of the second preset area and the position of the end in the second preset area moving to the specified position outside the second preset area, which is not particularly limited in this exemplary embodiment.
Secondly, if one of the maximum end and the minimum end of the target character in the first direction and one of the maximum end and the minimum end of the target character in the second direction are in the second preset area, the virtual camera is controlled to rotate in opposite directions of the two ends in the second preset area in sequence by a shooting angle, so that the target character is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
In the embodiment of the present application, for example, fig. 12 is a schematic diagram that a target character provided in an embodiment of the present application coincides with a second preset area, and a minimum end of the target character in a first direction and a maximum end of the target character in a second direction are within the second preset area. As can be seen from fig. 12, the smallest end 308 of the target character 304 in the first direction 305 and the largest end 309 in the second direction 306 are within the second preset area 303, and therefore, the virtual camera can be controlled to rotate the photographing angle first in the direction opposite to the smallest end 308 in the first direction 305 and then in the direction opposite to the largest end 309 in the second direction 306, or the virtual camera is controlled to rotate the photographing angle first in the opposite direction to the maximum end 309 in the second direction 306 and then in the opposite direction to the minimum end 308 in the first direction 305, such that the smallest end 308 in the first direction 305 and the largest end 309 in the second direction 306 move out of the second predefined area 303, thereby causing the target character 304 to coincide with the second predefined area 303 with the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 between the first predefined area 302 and the second predefined area 303.
Similarly, if the maximum end of the target character in the first direction and the maximum end of the target character in the second direction are in the second preset area, the virtual camera is controlled to rotate the shooting angle in the opposite direction of the maximum end in the first direction and then rotate the shooting angle in the opposite direction of the maximum end in the second direction, or the virtual camera is controlled to rotate the shooting angle in the opposite direction of the maximum end in the second direction and then rotate the shooting angle in the opposite direction of the maximum end in the first direction; if one of the maximum end of the target role in the first direction and the minimum end of the target role in the second direction is in a second preset area, controlling the virtual camera to firstly rotate the shooting angle in the opposite direction of the maximum end in the first direction and then rotate the shooting angle in the opposite direction of the minimum end in the second direction, or controlling the virtual camera to firstly rotate the shooting angle in the opposite direction of the minimum end in the second direction and then rotate the shooting angle in the opposite direction of the maximum end in the first direction; if the minimum end of the target character in the first direction and the minimum end of the target character in the second direction are in the second preset area, the virtual camera is controlled to firstly rotate the shooting angle in the reverse direction of the minimum end in the first direction and then rotate the shooting angle in the reverse direction of the minimum end in the second direction, or the virtual camera is controlled to firstly rotate the shooting angle in the reverse direction of the minimum end in the second direction and then rotate the shooting angle in the reverse direction of the minimum end in the first direction.
It should be noted that the principle of determining the rotation angle of the shooting angle of the virtual camera is the same as that in the first case, and therefore the description thereof is omitted here.
And thirdly, if the maximum end and the minimum end of the target role in the first direction are in the second preset area, controlling the virtual camera to adjust the shooting position in the direction close to the target role so that the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
In this exemplary embodiment, fig. 13 is a schematic diagram that a target character provided in an embodiment of the present application coincides with a second preset area, and a minimum end and a maximum end of the target character in a first direction are within the second preset area. Since 13 shows that the minimum end 308 and the maximum end 307 of the target character 304 in the first direction 305 are within the second preset region 303, the virtual camera is controlled to adjust the shooting angle toward the direction close to the target character 304 to increase the area occupied by the target character 304 in the two-dimensional display region, so that the minimum end 308 and the maximum end 307 in the first direction 305 move out of the second preset region 303, and thus the target character 304 coincides with the second preset region 303, and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are between the first preset region 302 and the second preset region 303.
It should be noted that the distance from the virtual camera to the target character may be calculated according to the current area of the target character (i.e., the area in the current state) and the area of the target character when the maximum end and the minimum end in the first direction just move out of the second preset area (i.e., the area in the target state), and the distance from the virtual camera to the target character may also be calculated according to the current area of the target character (i.e., the area in the current state) and the area of the target character when the maximum end and the minimum end in the first direction move to corresponding positions outside the second preset area (i.e., the area in the target state), and the like.
The distance that the virtual camera approaches the target character may be determined according to the positions of the maximum end and the minimum end in the first direction and the position where the maximum end and the minimum end in the first direction just move out of the second preset region, and the distance that the virtual camera approaches the target character may also be determined according to the positions of the maximum end and the minimum end in the first direction and the corresponding specified position where the maximum end and the minimum end in the first direction move out of the second preset region, and the like.
And fourthly, if the maximum end and the minimum end of the target character in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position in the direction close to the target character so that the target character is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
In this exemplary embodiment, fig. 14 is a schematic diagram of the target character provided in an embodiment of the present application coinciding with the second preset area, and the minimum end and the maximum end of the target character in the second direction being within the second preset area. Since 14 can know that the minimum end 310 and the maximum end 309 of the target character 304 in the second direction 306 are within the second preset region 303, the virtual camera is controlled to adjust the shooting angle toward the direction close to the target character 304 to increase the area occupied by the target character 304 in the two-dimensional display region, so that the minimum end 310 and the maximum end 309 in the second direction 306 move out of the second preset region 303, and thus the target character 304 coincides with the second preset region 303, and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are between the first preset region 302 and the second preset region 303.
It should be noted that the principle of determining the distance from the virtual camera to the target character is the same as that in the third case, and therefore, the description thereof is omitted here.
And fifthly, if at least three of the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position in the direction close to the target character so that the target character is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
In the embodiment of the present application, for example, fig. 15 is a schematic diagram that a target character provided in an embodiment of the present application is overlapped with a second preset area, and a maximum end and a minimum end of the target character in a first direction and a maximum end and a minimum end of the target character in a second direction are within the second preset area. As can be seen from fig. 15, since the maximum end 307 and the minimum end 308 of the target character 304 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are within the second preset region 303, the virtual camera may be controlled to adjust the shooting angle toward the direction close to the target character 304 to increase the area occupied by the target character 304 in the two-dimensional display region, and further, the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 move out of the second preset region 303, so that the target character 304 is overlapped with the second preset region 303 and the maximum end 307 and the minimum end 308 in the first direction 305 and the maximum end 309 and the minimum end 310 in the second direction 306 are between the first preset region 302 and the second preset region 303.
It should be noted that the principle of determining the distance from the virtual camera to the target character is the same as that in the third case, and therefore, the description thereof is omitted here.
Step S550, if the target role coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset region, determining whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction are outside the second preset region. It should be noted that the determination in this step is not repeated here since it is already described above.
Step S560, if not, adjusting a shooting angle or a shooting position of the virtual camera so that the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region. It should be noted that, since the process has already been described above, it is not described herein again.
It should be noted that, when the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region, the shooting angle and the shooting position of the virtual camera are not adjusted.
Next, a process of calculating the rotation angle of the photographing angle of the virtual camera will be described by way of example.
If the target character is overlapped with the second preset area and only the minimum end of the target character in the first direction is outside the first preset area, controlling the virtual camera to rotate the shooting angle towards the direction of the minimum end of the target character in the first direction, so that the minimum end of the target character in the first direction just enters the boundary of the first preset area, wherein the calculation process of the rotation angle of the shooting angle of the virtual camera is as follows:
as shown in fig. 16, a three-dimensional vertical coordinate system is constructed in the view frustum of the virtual camera in the three-dimensional virtual world, wherein the X axis, the Y axis, and the Z axis are perpendicular to each other, the Z axis is perpendicular to the near plane and the far plane of the view frustum, and the plane formed by the X axis and the Y axis is parallel to the near plane and the far plane.
Determining the coordinates (nx, ny, nz) of the minimum end N1 of the target character in the first direction in a three-dimensional vertical coordinate system, and determining the coordinates (ox, oy, oz) of the virtual camera in the three-dimensional vertical coordinate system;
calculating the distance L1 between the minimum end N1 of the target character in the first direction and the virtual camera in a three-dimensional vertical coordinate system:
Figure BDA0002027408150000141
calculating an included angle a1 between a normal 601 of the visual cone of the virtual camera and a connecting line of the virtual camera and the minimum end N1 of the target character in the first direction:
Figure BDA0002027408150000142
the coordinates (tx1, ty1, tz1) of the intersection point T1 of the first preset region and the negative direction of the first direction in the three-dimensional vertical coordinate system are determined, and as can be seen from fig. 16, the intersection point T1 of the first preset region and the negative direction of the first direction is moved to a point T2(tx2, ty2, tz2), so that the minimum end N1 of the target character in the first direction can be moved to the boundary of the first preset region. Because the shooting angle of the virtual camera is in the rotating process, the first preset area and the second preset area also rotate along with the virtual camera, and because the monitoring frequency of the target role is in the millisecond level in the above, and the distance between the far plane and the virtual camera is larger, the angle of each rotation of the shooting angle of the virtual camera is very small, and therefore, the rotation of the first preset area and the second preset area can be approximately regarded as translational motion. Based on this, the coordinate value of the X axis of the point T2(tx2, ty2, tz2) is: tx2 tz1 tan (a 1);
calculating the translation amount of an intersection point T1 of the first preset region and the negative direction of the first direction along with the first preset region in the rotation process of the virtual camera to be S1, wherein S1 is tx1-tx 2;
the rotation angle a2 of the shooting angle of the virtual camera is:
Figure BDA0002027408150000143
in other cases, the principle of calculating the rotation angle of the shooting angle of the virtual camera is the same as the above principle, and therefore, the description thereof is omitted here.
Next, a process of calculating the distance at which the virtual camera moves away from or approaches the target character will be described.
Since the distance of the virtual camera from or near the target character is related to the amount of area change of the target character and the angle of view of the virtual camera (i.e., angle b in fig. 17). Based on this, the process of calculating the distance of the virtual camera far away from or close to the target character may include:
calculating the current area V1 of the target character in the current state, and calculating the target area V2 of the target character in the target state;
the distance d of the virtual camera from or close to the target character is as follows:
Figure BDA0002027408150000144
it should be noted that, since the detection of the state of the target character is real-time, the state of the target character is detected in real time regardless of whether the virtual camera is in the process of adjustment, if the target character is not yet adjusted to the target state in the process of adjustment of the virtual camera, and if the state of the target character before adjustment and the state of the target character during adjustment are changed, the current adjustment of the virtual camera is suspended, a new adjustment mode of the virtual camera is determined again according to the state of the target character during adjustment, and the virtual camera is adjusted according to the new adjustment mode based on the state of the virtual camera before suspension. For example, if the target character coincides with the second preset area, and only the minimum end in the first direction is within the second preset area, and the maximum end in the first direction and the maximum end and the minimum end in the second direction are both between the second preset area and the first preset area, the virtual camera is controlled to rotate a shooting angle in a direction opposite to the minimum end in the first direction, if it is detected that the minimum end in the first direction has not moved out of the second preset area in the process of rotating the shooting angle, the maximum end in the first direction has moved into the second preset area, and the maximum end and the minimum end in the second direction are both between the second preset area and the first preset area, the shooting angle of the virtual camera is stopped from rotating, and the virtual camera is controlled to move in a direction close to the target character, so that the target character coincides with the second preset area, and the minimum end and the maximum end in the first direction and the minimum end in the second direction, and the maximum end and the minimum end in the second direction are within the first preset area and the second preset area Between the domains.
In summary, it is determined whether the target character coincides with the second preset region, and the minimum end and the maximum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are between the first preset region and the second preset region, if not, the shooting angle and/or the shooting position of the virtual camera are adjusted, in other words, on the premise that the target character coincides with the second preset region, as long as the minimum end and the maximum end of the target character in the first direction and the minimum end and the maximum end of the target character in the second direction are between the first preset region and the second preset region, the shooting angle and/or the shooting position of the virtual camera are not adjusted, that is, on the premise that the target character does not move out of the two-dimensional display region, a larger motion space is provided for the target character, so that the control of the target character is more flexible and the expansibility is strong, user experience is improved, and the virtual camera does not need to move in real time according to the movement of the target role; in addition, the first preset area and the second preset area can be arranged in any area of the two-dimensional display area, so that the flexibility of controlling the target character is further increased.
Corresponding to the above display control method, an embodiment of the present application further provides a display control device, which is applied to control a virtual camera in a three-dimensional virtual world, where the virtual camera maps a two-dimensional display area in a display screen according to a screen duty ratio of the display screen in a user terminal, and the virtual camera maps a virtual scene shot in the three-dimensional virtual world in the two-dimensional display area, where the virtual scene includes a target character, and fig. 18 is a schematic structural diagram of the display control device provided in an embodiment of the present application. As shown in fig. 18, the apparatus 1800 may include: a first setting module 1801, a second setting module 1802, a determining module 1803, and a determining and adjusting module 1804, wherein:
a first setting module 1801, configured to set a first preset area and a second preset area in the two-dimensional display area, where the second preset area is in the first preset area;
a second setting module 1802, which may be configured to set a first direction and a second direction based on the first preset area and the second preset area;
a determining module 1803, configured to determine a maximum end and a minimum end of the target role in the first direction and a maximum end and a minimum end in the second direction;
the judgment adjustment module 1804 may be configured to judge whether the target role coincides with the second preset region, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region, if not, adjust the shooting angle and/or the shooting position of the virtual camera.
Optionally, the determining and adjusting module 1804 may include:
a first determining unit, configured to determine whether the target role coincides with the second preset region and a maximum end and a minimum end in the first direction and a maximum end and a minimum end in the second direction are within the first preset region;
a first adjusting unit, configured to adjust a shooting angle and/or a shooting position of the virtual camera if the target role is not in the first preset area, so that the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the second preset area;
a second determining unit, configured to determine whether a maximum end and a minimum end of the target role in the first direction and a maximum end and a minimum end in a second direction are outside the second preset region;
and if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target character coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
Optionally, the apparatus 1800 may further include:
a third determining unit, configured to determine whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are outside the second preset region if the target role is overlapped with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset region;
and if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
Optionally, the first adjusting unit may include:
the first adjusting subunit may be configured to, if the target character coincides with the second preset region and one of a maximum end and a minimum end in the first direction and a maximum end and a minimum end in the second direction is outside the first preset region, control the virtual camera to rotate by a shooting angle in a direction toward an end outside the first preset region;
a second adjusting subunit, configured to control the virtual camera to sequentially rotate a shooting angle in directions of two ends outside the first preset region if the target role coincides with the second preset region and one of a maximum end and a minimum end in the first direction and one of a maximum end and a minimum end in the second direction are outside the first preset region;
a third adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction away from the target character if the target character coincides with the second preset area and the maximum end and the minimum end in the first direction are outside the first preset area;
a fourth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction away from the target character if the target character coincides with the second preset area and a maximum end and a minimum end in the second direction are outside the first preset area;
a fifth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction away from the target character if the target character coincides with the second preset region and at least three of a maximum end and a minimum end in the first direction and a maximum end and a minimum end in the second direction are outside the first preset region;
a sixth adjusting subunit, configured to adjust a shooting angle of the virtual camera or adjust a shooting angle and a shooting position of the virtual camera if the target character does not coincide with the second preset region, so that the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset region.
Optionally, the second adjusting unit and the third adjusting unit may each include:
a seventh adjusting subunit, configured to control the virtual camera to rotate by a shooting angle in a direction opposite to an end in the second preset area if one of a maximum end and a minimum end of the target character in the first direction and a maximum end and a minimum end of the target character in the second direction is in the second preset area;
an eighth adjusting subunit, configured to control the virtual camera to sequentially rotate a shooting angle in opposite directions of two ends in the second preset area if one of a maximum end and a minimum end of the target character in the first direction and one of a maximum end and a minimum end of the target character in the second direction are in the second preset area;
a ninth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction close to the target character if the maximum end and the minimum end of the target character in the first direction are within the second preset area;
a tenth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction close to the target character if the maximum end and the minimum end of the target character in the second direction are within the second preset area;
an eleventh adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction approaching the target character if at least three of a maximum end and a minimum end of the target character in the first direction and a maximum end and a minimum end of the target character in the second direction are within the second preset area.
Optionally, the first direction and the second direction are perpendicular.
In the embodiment of the present application, it is determined whether the target character coincides with the second preset region, and the minimum end and the maximum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are between the first preset region and the second preset region, if not, the shooting angle and/or the shooting position of the virtual camera are adjusted, in other words, on the premise that the target character coincides with the second preset region, as long as the minimum end and the maximum end of the target character in the first direction and the minimum end and the maximum end of the target character in the second direction are between the first preset region and the second preset region, the shooting angle and/or the shooting position of the virtual camera are not adjusted, that is, on the premise that the target character is not moved out of the two-dimensional display region, a larger movement space is provided for the target character, so that the control of the target character is more flexible, the expansibility is strong, the user experience is improved, and the virtual camera does not need to move in real time according to the movement of the target role; in addition, the first preset area and the second preset area can be arranged in any area of the two-dimensional display area, so that the flexibility of controlling the target character is further increased.
An embodiment of the present application further provides a display control device, and fig. 19 is a schematic structural diagram of the display control device provided in the embodiment of the present application. As shown in fig. 19, the display control apparatus may have a relatively large difference due to different configurations or performances, and may include one or more processors 1901 and a memory 1902, where one or more stored applications or data may be stored in the memory 1902. Memory 1902 may be, for example, transient storage or persistent storage. The application programs stored in the memory 1902 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for the display control device. Still further, the processor 1901 may be configured to communicate with the memory 1902 to execute a series of computer-executable instructions in the memory 1902 on a display control device. The display control apparatus may also include one or more power supplies 1903, one or more wired or wireless network interfaces 1904, one or more input-output interfaces 1905, one or more keyboards 1906, and the like.
In a specific embodiment, the display control apparatus is a server, and includes a memory, a processor, and computer-executable instructions stored on the memory and executable on the processor, and when executed by the processor, the computer-executable instructions implement the following processes:
setting a first preset area and a second preset area in the two-dimensional display area, wherein the second preset area is in the first preset area;
setting a first direction and a second direction based on the first preset area and the second preset area;
determining the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction;
and judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, if not, adjusting the shooting angle and/or the shooting position of the virtual camera.
Optionally, when the computer executable instruction is executed by the processor, the determining whether the target role coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region, and if not, adjusting the shooting angle and/or the shooting position of the virtual camera includes:
judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area;
if not, adjusting the shooting angle and/or the shooting position of the virtual camera so that the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area;
judging whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are outside the second preset area or not;
if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
Optionally, the computer executable instructions, when executed by the processor, further include:
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area, judging whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction are out of the second preset area or not;
if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
Optionally, when the computer executable instruction is executed by the processor, if not, adjusting a shooting angle and/or a shooting position of the virtual camera so that the target character coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction in the first preset area include:
if the target role is overlapped with the second preset area and one of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction is outside the first preset area, controlling the virtual camera to rotate towards the direction of the end outside the first preset area by a shooting angle;
if the target role is overlapped with the second preset area and one of the maximum end and the minimum end in the first direction and one of the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to rotate in sequence towards the directions of the two ends outside the first preset area for shooting angles;
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is overlapped with the second preset area and at least three of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is not overlapped with the second preset area, adjusting the shooting angle of the virtual camera or adjusting the shooting angle and the shooting position of the virtual camera so that the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area.
Optionally, when the computer executable instruction is executed by the processor, if the virtual camera is not in the first preset area, adjusting a shooting angle or a shooting position of the virtual camera so that the target character coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area includes:
if one of the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction is in the second preset area, controlling the virtual camera to rotate towards the opposite direction of the end in the second preset area for shooting;
if one of the maximum end and the minimum end of the target role in the first direction and one of the maximum end and the minimum end of the target role in the second direction are in the second preset area, controlling the virtual camera to rotate in opposite directions of the two ends in the second preset area in sequence for shooting angles;
if the maximum end and the minimum end of the target role in the first direction are in the second preset area, controlling the virtual camera to adjust the shooting position towards the direction close to the target role;
if the maximum end and the minimum end of the target role in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position towards the direction close to the target role;
and if at least three of the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position in the direction close to the target role.
Optionally, the computer executable instructions, when executed by the processor, cause the first direction and the second direction to be perpendicular.
In the embodiment of the present application, it is determined whether the target character coincides with the second preset region, and the minimum end and the maximum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are between the first preset region and the second preset region, if not, the shooting angle and/or the shooting position of the virtual camera are adjusted, in other words, on the premise that the target character coincides with the second preset region, as long as the minimum end and the maximum end of the target character in the first direction and the minimum end and the maximum end of the target character in the second direction are between the first preset region and the second preset region, the shooting angle and/or the shooting position of the virtual camera are not adjusted, that is, on the premise that the target character is not moved out of the two-dimensional display region, a larger movement space is provided for the target character, so that the control of the target character is more flexible, the expansibility is strong, the user experience is improved, and the virtual camera does not need to move in real time according to the movement of the target role; in addition, the first preset area and the second preset area can be arranged in any area of the two-dimensional display area, so that the flexibility of controlling the target character is further increased.
Further, an embodiment of the present application also provides a computer-readable storage medium for storing computer-executable instructions, which when executed by a processor implement the following process:
setting a first preset area and a second preset area in the two-dimensional display area, wherein the second preset area is in the first preset area;
setting a first direction and a second direction based on the first preset area and the second preset area;
determining the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction;
and judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, if not, adjusting the shooting angle and/or the shooting position of the virtual camera.
Optionally, when the computer executable instruction is executed by a processor, the determining whether the target role coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region, and if not, adjusting the shooting angle and/or the shooting position of the virtual camera includes:
judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area;
if not, adjusting the shooting angle and/or the shooting position of the virtual camera so that the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area;
judging whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are outside the second preset area or not;
if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
Optionally, when executed by the processor, the computer-executable instructions further include:
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area, judging whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction are out of the second preset area or not;
if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
Optionally, when the computer executable instruction is executed by the processor, if not, adjusting a shooting angle and/or a shooting position of the virtual camera so that the target role coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction in the first preset area include:
if the target role is overlapped with the second preset area and one of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction is outside the first preset area, controlling the virtual camera to rotate towards the direction of the end outside the first preset area by a shooting angle;
if the target role is overlapped with the second preset area and one of the maximum end and the minimum end in the first direction and one of the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to rotate in the directions of the two ends outside the first preset area in sequence by a shooting angle;
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is overlapped with the second preset area and at least three of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction away from the target role;
if the target role is not overlapped with the second preset area, adjusting the shooting angle of the virtual camera or adjusting the shooting angle and the shooting position of the virtual camera so as to enable the target role to be overlapped with the second preset area and enable the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction to be in the first preset area.
Optionally, when the computer executable instruction is executed by the processor, if the virtual camera is not in the first preset area, adjusting a shooting angle or a shooting position of the virtual camera so that the target role coincides with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area includes:
if one of the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction is in the second preset area, controlling the virtual camera to rotate towards the opposite direction of the end in the second preset area for shooting;
if one of the maximum end and the minimum end of the target role in the first direction and one of the maximum end and the minimum end of the target role in the second direction are in the second preset area, controlling the virtual camera to rotate in opposite directions of the two ends in the second preset area in sequence for shooting angles;
if the maximum end and the minimum end of the target role in the first direction are in the second preset area, controlling the virtual camera to adjust the shooting position towards the direction close to the target role;
if the maximum end and the minimum end of the target role in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position towards the direction close to the target role;
and if at least three of the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position in the direction close to the target character.
Optionally, the computer-executable instructions, when executed by the processor, are perpendicular to the first direction and the second direction.
In the embodiment of the present application, it is determined whether the target character coincides with the second preset region, and the minimum end and the maximum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are between the first preset region and the second preset region, if not, the shooting angle and/or the shooting position of the virtual camera are adjusted, in other words, on the premise that the target character coincides with the second preset region, as long as the minimum end and the maximum end of the target character in the first direction and the minimum end and the maximum end of the target character in the second direction are between the first preset region and the second preset region, the shooting angle and/or the shooting position of the virtual camera are not adjusted, that is, on the premise that the target character is not moved out of the two-dimensional display region, a larger movement space is provided for the target character, so that the control of the target character is more flexible, the expansibility is strong, the user experience is improved, and the virtual camera does not need to move in real time according to the movement of the target role; in addition, the first preset area and the second preset area can be arranged in any area of the two-dimensional display area, so that the flexibility of controlling the target character is further increased.
The computer-readable storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (12)

1. A display control method applied to control of a virtual camera in a three-dimensional virtual world, the virtual camera mapping a two-dimensional display area in a display screen according to a screen duty ratio of the display screen in a user terminal, the virtual camera mapping a virtual scene photographed in the three-dimensional virtual world in the two-dimensional display area, the virtual scene including a target character, the method comprising:
setting a first preset area and a second preset area in the two-dimensional display area, wherein the second preset area is in the first preset area; the setting of a first preset area and a second preset area in the two-dimensional display area comprises: setting a first preset area and a second preset area in a two-dimensional display area by setting two nested areas between a near plane and a far plane of a visual cone of a virtual camera, wherein the two nested areas are a first detection area and a second detection area, the second detection area is in the first detection area, the area of the two-dimensional display area mapped to the first detection area is determined as the first preset area, and the area of the two-dimensional display area mapped to the second detection area is determined as the second preset area;
setting a first direction and a second direction based on the first preset area and the second preset area;
determining the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction;
and judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, if not, adjusting the shooting angle and/or the shooting position of the virtual camera.
2. The display control method according to claim 1, wherein the determining whether the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region, and if not, adjusting the shooting angle and/or the shooting position of the virtual camera includes:
judging whether the target role is overlapped with the second preset area or not, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area;
if not, adjusting the shooting angle and/or the shooting position of the virtual camera so that the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area;
judging whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are outside the second preset area or not;
if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
3. The display control method according to claim 2, characterized in that the method further comprises:
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area, judging whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end in the second direction are out of the second preset area or not;
if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
4. The method according to claim 2, wherein if not, adjusting the shooting angle and/or the shooting position of the virtual camera so that the target character coincides with the second preset region and the maximum and minimum ends in the first direction and the maximum and minimum ends in the second direction are within the first preset region comprises:
if the target role is overlapped with the second preset area and one of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction is outside the first preset area, controlling the virtual camera to rotate towards the direction of the end outside the first preset area by a shooting angle;
if the target role is overlapped with the second preset area and one of the maximum end and the minimum end in the first direction and one of the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to rotate in sequence towards the directions of the two ends outside the first preset area for shooting angles;
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is overlapped with the second preset area and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is overlapped with the second preset area and at least three of the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are outside the first preset area, controlling the virtual camera to adjust the shooting position in the direction far away from the target role;
if the target role is not overlapped with the second preset area, adjusting the shooting angle of the virtual camera or adjusting the shooting angle and the shooting position of the virtual camera so that the target role is overlapped with the second preset area and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are in the first preset area.
5. The method according to claim 2 or 3, wherein if not, adjusting a shooting angle or a shooting position of the virtual camera so that the target character coincides with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset region and the second preset region comprises:
if one of the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction is in the second preset area, controlling the virtual camera to rotate towards the opposite direction of the end in the second preset area for shooting;
if one of the maximum end and the minimum end of the target role in the first direction and one of the maximum end and the minimum end of the target role in the second direction are in the second preset area, controlling the virtual camera to rotate in opposite directions of the two ends in the second preset area in sequence for shooting angles;
if the maximum end and the minimum end of the target role in the first direction are in the second preset area, controlling the virtual camera to adjust the shooting position towards the direction close to the target role;
if the maximum end and the minimum end of the target role in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position towards the direction close to the target role;
and if at least three of the maximum end and the minimum end of the target character in the first direction and the maximum end and the minimum end of the target character in the second direction are in the second preset area, controlling the virtual camera to adjust the shooting position in the direction close to the target character.
6. The display control method according to any one of claims 1 to 4, wherein the first direction and the second direction are perpendicular.
7. A display control apparatus applied to control of a virtual camera in a three-dimensional virtual world, the virtual camera mapping a two-dimensional display area in a display screen in accordance with a screen duty of the display screen in a user terminal, the virtual camera mapping a virtual scene photographed in the three-dimensional virtual world in the two-dimensional display area, the virtual scene including a target character, comprising:
the device comprises a first setting module, a second setting module and a display module, wherein the first setting module is used for setting a first preset area and a second preset area in the two-dimensional display area, and the second preset area is in the first preset area; the first setting module is configured to: setting a first preset area and a second preset area in a two-dimensional display area by setting two nested areas between a near plane and a far plane of a visual cone of a virtual camera, wherein the two nested areas are a first detection area and a second detection area, the second detection area is in the first detection area, the area of the two-dimensional display area mapped to the first detection area is determined as the first preset area, and the area of the two-dimensional display area mapped to the second detection area is determined as the second preset area;
a second setting module configured to set a first direction and a second direction based on the first preset region and the second preset region;
a determining module, configured to determine a maximum end and a minimum end of the target role in the first direction and a maximum end and a minimum end in the second direction;
and the judgment and adjustment module is used for judging whether the target role is superposed with the second preset area, judging whether the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area, and if not, adjusting the shooting angle and/or the shooting position of the virtual camera.
8. The display control apparatus according to claim 7, wherein the judgment adjustment module comprises:
a first judging unit, configured to judge whether the target role coincides with the second preset region and a maximum end and a minimum end in the first direction and a maximum end and a minimum end in the second direction are within the first preset region;
a first adjusting unit, configured to adjust a shooting angle and/or a shooting position of the virtual camera if the target role is not in the first preset area, so that the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the second preset area;
a second determining unit, configured to determine whether a maximum end and a minimum end of the target role in the first direction and a maximum end and a minimum end in a second direction are outside the second preset region;
and if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
9. The display control apparatus according to claim 8, characterized in that the apparatus further comprises:
a third determining unit, configured to determine whether the maximum end and the minimum end of the target role in the first direction and the maximum end and the minimum end of the target role in the second direction are outside the second preset region if the target role is overlapped with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset region;
and if not, adjusting the shooting angle or the shooting position of the virtual camera so that the target role is overlapped with the second preset area, and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are between the first preset area and the second preset area.
10. The display control apparatus according to claim 8, wherein the first adjusting unit includes:
a first adjusting subunit, configured to control the virtual camera to rotate a shooting angle in a direction of an end outside the first preset region if the target role coincides with the second preset region and one of a maximum end and a minimum end in the first direction and a maximum end and a minimum end in the second direction is outside the first preset region;
a second adjusting subunit, configured to control the virtual camera to sequentially rotate a shooting angle in directions of two ends outside the first preset region if the target role coincides with the second preset region and one of a maximum end and a minimum end in the first direction and one of a maximum end and a minimum end in the second direction are outside the first preset region;
a third adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction away from the target character if the target character coincides with the second preset area and the maximum end and the minimum end in the first direction are outside the first preset area;
a fourth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction away from the target character if the target character coincides with the second preset area and the maximum end and the minimum end in the second direction are outside the first preset area;
a fifth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction away from the target character if the target character coincides with the second preset area and at least three of a maximum end and a minimum end in the first direction and a maximum end and a minimum end in the second direction are outside the first preset area;
a sixth adjusting subunit, configured to adjust a shooting angle of the virtual camera or adjust a shooting angle and a shooting position of the virtual camera if the target role is not overlapped with the second preset region, so that the target role is overlapped with the second preset region and the maximum end and the minimum end in the first direction and the maximum end and the minimum end in the second direction are within the first preset region.
11. The display control apparatus according to claim 8 or 9, wherein the second adjusting unit and the third adjusting unit each include:
a seventh adjusting subunit, configured to control the virtual camera to rotate to a shooting angle in a direction opposite to an end in the second preset area if one of a maximum end and a minimum end of the target character in the first direction and a maximum end and a minimum end of the target character in the second direction is in the second preset area;
an eighth adjusting subunit, configured to control the virtual camera to sequentially rotate a shooting angle in opposite directions of two ends in the second preset area if one of a maximum end and a minimum end of the target character in the first direction and one of a maximum end and a minimum end of the target character in the second direction are in the second preset area;
a ninth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction close to the target character if the maximum end and the minimum end of the target character in the first direction are within the second preset area;
a tenth adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction close to the target character if the maximum end and the minimum end of the target character in the second direction are within the second preset area;
an eleventh adjusting subunit, configured to control the virtual camera to adjust a shooting position in a direction approaching the target character if at least three of a maximum end and a minimum end of the target character in the first direction and a maximum end and a minimum end of the target character in the second direction are within the second preset area.
12. The display control device according to any one of claims 7 to 10, wherein the first direction and the second direction are perpendicular.
CN201910298451.0A 2019-04-15 2019-04-15 Display control method and device Active CN109976533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910298451.0A CN109976533B (en) 2019-04-15 2019-04-15 Display control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910298451.0A CN109976533B (en) 2019-04-15 2019-04-15 Display control method and device

Publications (2)

Publication Number Publication Date
CN109976533A CN109976533A (en) 2019-07-05
CN109976533B true CN109976533B (en) 2022-06-03

Family

ID=67084576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910298451.0A Active CN109976533B (en) 2019-04-15 2019-04-15 Display control method and device

Country Status (1)

Country Link
CN (1) CN109976533B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115999150B (en) * 2023-03-20 2023-06-16 北京云庐科技有限公司 Interaction method, device and medium containing visual angle control in 3D virtual scene

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW594453B (en) * 2002-07-26 2004-06-21 Gwo-Jen Jan Method for presenting fisheye-camera images
CN101040518A (en) * 2004-10-20 2007-09-19 夏普株式会社 Image projecting method, projector, and computer program
EP2471583A2 (en) * 2010-12-29 2012-07-04 Nintendo Co., Ltd. Display control program, display control method, and display control system
CN104732560A (en) * 2015-02-03 2015-06-24 长春理工大学 Virtual camera shooting method based on motion capture system
CN104994293A (en) * 2015-06-30 2015-10-21 广东欧珀移动通信有限公司 Control method of wide angle camera and electronic terminal
CN105005970A (en) * 2015-06-26 2015-10-28 广东欧珀移动通信有限公司 Augmented reality implementation method and apparatus
CN107147841A (en) * 2017-04-25 2017-09-08 北京小鸟看看科技有限公司 A kind of binocular camera method of adjustment, device and system
CN107710283A (en) * 2016-12-02 2018-02-16 深圳市大疆创新科技有限公司 A kind of filming control method, device and control device
CN108476288A (en) * 2017-05-24 2018-08-31 深圳市大疆创新科技有限公司 Filming control method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW594453B (en) * 2002-07-26 2004-06-21 Gwo-Jen Jan Method for presenting fisheye-camera images
CN101040518A (en) * 2004-10-20 2007-09-19 夏普株式会社 Image projecting method, projector, and computer program
EP2471583A2 (en) * 2010-12-29 2012-07-04 Nintendo Co., Ltd. Display control program, display control method, and display control system
CN104732560A (en) * 2015-02-03 2015-06-24 长春理工大学 Virtual camera shooting method based on motion capture system
CN105005970A (en) * 2015-06-26 2015-10-28 广东欧珀移动通信有限公司 Augmented reality implementation method and apparatus
CN104994293A (en) * 2015-06-30 2015-10-21 广东欧珀移动通信有限公司 Control method of wide angle camera and electronic terminal
CN107710283A (en) * 2016-12-02 2018-02-16 深圳市大疆创新科技有限公司 A kind of filming control method, device and control device
CN107147841A (en) * 2017-04-25 2017-09-08 北京小鸟看看科技有限公司 A kind of binocular camera method of adjustment, device and system
CN108476288A (en) * 2017-05-24 2018-08-31 深圳市大疆创新科技有限公司 Filming control method and device

Also Published As

Publication number Publication date
CN109976533A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
US11703993B2 (en) Method, apparatus and device for view switching of virtual environment, and storage medium
CN110148178B (en) Camera positioning method, device, terminal and storage medium
CN110559647B (en) Control method and device for sight display in virtual shooting game, medium and equipment
CN108573530B (en) Augmented reality AR interaction method and system
CN108594996B (en) Method and device for automatically adjusting visual angle in virtual roaming
AU2017370476B2 (en) Virtual reality-based viewing method, device, and system
US11845007B2 (en) Perspective rotation method and apparatus, device, and storage medium
KR102693824B1 (en) Methods, devices and storage media for observing virtual environments
US11087545B2 (en) Augmented reality method for displaying virtual object and terminal device therefor
JPWO2012120799A1 (en) Display device and display direction switching method
WO2022116397A1 (en) Virtual viewpoint depth map processing method, device, and apparatus, and storage medium
CN113194263B (en) Gun and ball linkage control method and device, computer equipment and storage medium
CN108553895B (en) Method and device for associating user interface element with three-dimensional space model
CN110613933A (en) Skill release control method and device in game, storage medium and processor
EP3961571A1 (en) Virtual paintbrush implementing method and apparatus, and computer readable storage medium
US20190103075A1 (en) Reformatting image data using device sensing
CN109544458A (en) Fisheye image correcting method, device and its storage medium
CN109976533B (en) Display control method and device
CN104378576B (en) Information processing method and electronic equipment
CN113010057B (en) Pose control method, electronic device and computer readable storage medium
CN117133029A (en) Mirror adjustment method and device, intelligent equipment and storage medium
CN112837375B (en) Method and system for camera positioning inside real space
CN115348438B (en) Control method and related device for three-dimensional display equipment
CN115174879B (en) Projection screen correction method, apparatus, computer device and storage medium
US20240212199A1 (en) Method and device for drawing spatial map, camera equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220726

Address after: No.16 and 17, unit 1, North District, Kailin center, No.51 Jinshui East Road, Zhengzhou area (Zhengdong), Henan pilot Free Trade Zone, Zhengzhou City, Henan Province, 450000

Patentee after: Zhengzhou Apas Technology Co.,Ltd.

Address before: E301-27, building 1, No.1, hagongda Road, Tangjiawan Town, Zhuhai City, Guangdong Province

Patentee before: ZHUHAI TIANYAN TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right