CN111135556B - Virtual camera control method and device, electronic equipment and storage medium - Google Patents

Virtual camera control method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111135556B
CN111135556B CN201911419674.4A CN201911419674A CN111135556B CN 111135556 B CN111135556 B CN 111135556B CN 201911419674 A CN201911419674 A CN 201911419674A CN 111135556 B CN111135556 B CN 111135556B
Authority
CN
China
Prior art keywords
camera
virtual
virtual camera
length
adjusting
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
CN201911419674.4A
Other languages
Chinese (zh)
Other versions
CN111135556A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201911419674.4A priority Critical patent/CN111135556B/en
Publication of CN111135556A publication Critical patent/CN111135556A/en
Application granted granted Critical
Publication of CN111135556B publication Critical patent/CN111135556B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/23Input arrangements for video game devices for interfacing with the game device, e.g. specific interfaces between game controller and console
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/214Input arrangements for video game devices characterised by their sensors, purposes or types for locating contacts on a surface, e.g. floor mats or touch pads
    • A63F13/2145Input arrangements for video game devices characterised by their sensors, purposes or types for locating contacts on a surface, e.g. floor mats or touch pads the surface being also a display device, e.g. touch screens
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/822Strategy games; Role-playing games
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/695Control of camera direction for changing a field of view, e.g. pan, tilt or based on tracking of objects

Abstract

The embodiment of the invention provides a method and a device for controlling a virtual camera, electronic equipment and a storage medium, wherein the method comprises the following steps: responding to sliding operation acted on the touch display, and adjusting the length of a camera force arm of the virtual camera, wherein the length of the camera force arm is the distance between the virtual camera and a camera control assembly; adjusting the size of a safety area in the game picture according to the current camera force arm length of the virtual camera; when the virtual object is detected not to be in the range of the safe area, the position of the virtual camera is adjusted, smooth transition between the third person's view angle and the global view angle is achieved through simple sliding operation, the problems that memory occupation rises and games collapse caused by instant loading of excessive game scene resources are avoided, switching of the view angles is vivid and natural, any observation angle can be adjusted through sliding operation, and the freedom degree of selection of the view angle position is improved.

Description

Virtual camera control method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for controlling a virtual camera, an electronic device, and a storage medium.
Background
With the maturity of mobile terminal technology and the opening of mobile game market, more and more game products use mobile phones as main publishing platforms.
In the prior art, virtual keys or preset options can be set in a scene role playing mobile phone game, when switching between a global view angle or a third person view angle is required, a game player can click the virtual keys or the preset options, and a game camera can move along with the movement of a game role at the third person view angle.
However, the following problems exist in this method: because the mobile phones all adopt touch screens without keys, the mobile phone game cannot generate various equipment input parameters through the matching of a keyboard and a mouse like a host game, a game player can only select a preset visual angle by simple click operation, cannot select an observation position at will, and the game freedom degree is lost; and providing too many buttons would result in an excessively complicated viewing angle switching operation.
Moreover, when the vision is directly switched to the global view angle from the third person, the excessive scene resources are easily loaded instantly, so that the use amount of the memory of the mobile phone rises suddenly, and the probability of game collapse is increased.
Disclosure of Invention
In view of the above, it is proposed to provide a method and apparatus, an electronic device, a storage medium for virtual camera control that overcome or at least partially solve the above problems, including:
a method for virtual camera control, providing a graphical user interface through a touch display of a terminal device, the graphical user interface including a game screen captured by the virtual camera, wherein the game screen includes at least a virtual object, the method comprising:
responding to sliding operation acted on the touch display, and adjusting the length of a camera force arm of the virtual camera, wherein the length of the camera force arm is the distance between the virtual camera and a camera control assembly;
adjusting the size of a safety area in the game picture according to the current camera force arm length of the virtual camera;
adjusting a position of the virtual camera upon detecting that the virtual object is not within the range of the safe area.
Optionally, the adjusting the position of the virtual camera when detecting that the virtual object is not within the range of the safe area includes:
when the virtual object is detected not to be within the range of the safe area, acquiring the current position information of the virtual object;
adjusting the position of the camera control assembly according to the current position information of the virtual object;
and acquiring the current position information of the camera control assembly, and adjusting the position of the virtual camera according to the current position information of the camera control assembly.
Optionally, the adjusting the position of the camera control assembly according to the current position information of the virtual object includes:
determining distance information between the virtual object and the camera control component;
determining a damping coefficient corresponding to the distance information;
and adjusting the position of the camera control assembly according to the current position information of the virtual object, the distance information and the damping coefficient.
Optionally, the adjusting, according to the current camera moment arm length of the virtual camera, the size of the safety area in the game screen includes:
acquiring a camera moment arm coefficient aiming at the current camera moment arm length of the virtual camera;
and adjusting the size of the safety area in the game picture according to the force arm coefficient of the camera.
Optionally, the sliding operation includes a two-finger closing operation and a two-finger opening operation.
Optionally, the adjusting the length of the camera moment arm of the virtual camera in response to a sliding operation applied to the touch display includes:
and responding to the double-finger folding operation acted on the touch display, and performing height adjustment processing on the camera moment arm length of the virtual camera.
Optionally, the adjusting the length of the camera moment arm of the virtual camera in response to a sliding operation applied to the touch display includes:
and responding to the double-finger separation operation acted on the touch display, and shortening the length of the camera force arm of the virtual camera.
Optionally, the adjusting the length of the camera moment arm of the virtual camera includes:
determining a distance that the sliding operation moves on the touch display;
determining a distance adjustment value corresponding to the distance;
and adjusting the length of the camera force arm of the virtual camera according to the distance adjustment value.
Optionally, the adjusting the length of the camera moment arm of the virtual camera according to the distance adjustment value includes:
determining a target length of a camera moment arm for the virtual camera using the distance adjustment value;
updating the force arm coefficient of the camera by combining the target length and a preset force arm length range;
and adjusting the position of the camera control assembly by adopting the camera moment arm coefficient so as to set the current camera moment arm length of the virtual camera to be the target length.
Optionally, the camera moment arm of the virtual camera is used to determine the view angle range of the virtual camera, and the view angle range of the virtual camera is positively correlated to the length of the camera moment arm, and the size of the safety area is positively correlated to the length of the camera moment arm.
Optionally, the method further comprises:
and adjusting the angle of the virtual camera according to the rotation information of the camera control assembly.
Optionally, the camera control component comprises a first component and a second component, the first component and the second component being in the same position;
the adjusting the angle of the virtual camera according to the rotation information of the camera control assembly includes:
controlling the virtual camera to rotate in the yaw angle direction according to the angle of the first assembly moving in the yaw angle direction;
and controlling the virtual camera to rotate in the pitch angle direction according to the moving angle of the second assembly in the pitch angle direction.
Optionally, the camera control assembly is located in the center of the camera field of view.
An apparatus controlled by a virtual camera, applied to a terminal device, for providing a graphical user interface through a touch display of the terminal device, the graphical user interface including a game screen captured by the virtual camera, wherein the game screen includes at least a virtual object, the apparatus comprising:
the sliding operation response module is used for responding to the sliding operation acted on the touch display and adjusting the length of a camera force arm of the virtual camera, wherein the length of the camera force arm is the distance between the virtual camera and a camera control assembly;
a safety region size adjusting module, configured to adjust a size of a safety region in the game screen according to a current camera moment arm length of the virtual camera;
and the virtual camera position adjusting module is used for adjusting the position of the virtual camera when the virtual object is detected not to be in the range of the safe area.
An electronic device comprising a processor, a memory and a computer program stored on the memory and being executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of virtual camera control as described above.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a method of virtual camera control as described above.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the length of the camera arm of force of the virtual camera is adjusted by responding to the sliding operation acted on the touch display, the size of the safe area in the game picture is adjusted according to the current length of the camera arm of force of the virtual camera, and the position of the virtual camera is adjusted when the virtual object is detected not to be in the range of the safe area, so that the smooth transition between the third person-named visual angle and the global visual angle is realized by simple sliding operation, the problems of memory occupation rise and game collapse caused by instant loading of excessive game scene resources are avoided, the switching of the visual angles is vivid and natural, any observation angle can be adjusted by sliding operation, and the selection freedom degree of the visual angle position is improved.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the description of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating steps of a method for controlling a virtual camera according to an embodiment of the present invention;
FIG. 2a is a schematic view of a game according to an embodiment of the present invention;
FIG. 2b is a schematic view of another game perspective provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of an interpolation position provided by an embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps of another method for controlling a virtual camera according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of adjusting a security area according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a virtual camera follower according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an apparatus controlled by a virtual camera according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all 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 invention.
Referring to fig. 1, a flowchart illustrating steps of a method for controlling a virtual camera according to an embodiment of the present invention is provided, where a graphical user interface is provided through a touch display of a terminal device, the graphical user interface includes a game screen captured by the virtual camera, and the game screen includes at least a virtual object.
The virtual object may be a game virtual Character that a game player controls through a terminal device, or may also be a Non-player Character (NPC) that a game developer sets in advance in a specific game scene, and the virtual object is presented through a graphical user interface, where the presented content may include all of the virtual object or a part of the virtual object.
Step 101, responding to a sliding operation acted on the touch display, and adjusting the length of a camera force arm of the virtual camera, wherein the length of the camera force arm is the distance between the virtual camera and a camera control assembly;
as an example, the camera control component may be located at the center of the virtual camera field of view, and the distance between the camera control component and the virtual camera is the camera moment arm length, which may also be referred to as the standoff. Because the camera control assembly can be located at the center of the game scene, such as the world center or the virtual object center, the distance between the virtual camera and the game center can be adjusted by adjusting the length of the camera moment arm of the virtual camera, and then the visual angle range of the virtual camera can be determined by the length of the camera moment arm, and the visual angle range can be positively correlated with the length of the camera moment arm.
When a game player needs to adjust the viewing angle range in the game, a sliding operation can be performed on the touch display of the terminal device through an operation medium, such as a finger, a touch pen, or the like. The camera moment arm length of the virtual camera may be adjusted in response to a sliding operation on the touch display. After the length of the camera force arm is adjusted, the visual angle range in the game picture can be adjusted by combining the current length of the camera force arm.
In practical application, although the third person perspective view and the global view can be directly switched by clicking a button, the view range of the third person perspective view is smaller, the view range of the global view is far larger than that of the third person perspective view, the loaded game scene resources are far larger than those under the third person perspective view, and when the third person perspective view is directly switched to the global view, not only is the view conversion process rigid, but also excessive resources are easily and instantly loaded.
In the embodiment of the invention, the length of the force arm of the camera can be slowly adjusted through sliding operation, and the visual angle range of the virtual camera is gradually adjusted, so that excessive game resources can be prevented from being instantly loaded, and a more natural visual angle switching effect is provided.
In an embodiment of the present invention, the sliding operation includes a two-finger closing operation and a two-finger opening operation, for example, two fingers of a player can touch the touch display, and the two fingers slide in opposite directions on the touch display.
In an embodiment of the present invention, the step of adjusting the length of the camera moment arm of the virtual camera in response to the sliding operation acting on the touch display may include the following sub-steps:
and responding to the double-finger folding operation acted on the touch display, and performing height adjustment processing on the camera arm of force of the virtual camera.
In practical application, when the player touches and slides the double-finger touch display, the operation type of the sliding operation can be determined, and when the sliding operation is detected to be the closing operation of the double fingers, the length of the camera arm of the virtual camera can be increased in response to the operation.
In another embodiment of the present invention, the step of adjusting the length of the camera moment arm of the virtual camera in response to the sliding operation acting on the touch display may include the following sub-steps:
and responding to the double-finger separation operation acted on the touch display, and shortening the length of the camera force arm of the virtual camera.
When the sliding operation is detected to be the two-finger separating operation, the arm length of the virtual camera can be shortened in response to the operation.
As shown in fig. 2a and 2b, when the two fingers are closed, the arm length of the camera is increased, and the view angle range can be the view angle range in fig. 2a, and when the two fingers are opened, the arm length of the camera is shortened, and the view angle range can be the view angle range in fig. 2 b.
In an embodiment of the present invention, the following sub-steps may be adopted to adjust the length of the camera moment arm of the virtual camera, that is, the adjusting the length of the camera moment arm of the virtual camera includes:
a substep 11 of determining a distance that the sliding operation moves on the touch display;
specifically, when the operation medium is in contact with the touch display, initial screen coordinates of a contact position of the operation medium and the touch display at this time may be recorded, and in a sliding process of the operation medium, real-time screen coordinates of the contact position of the current operation medium and the touch display are continuously obtained, a distance of a change in the screen coordinates is calculated, and the changed distance is determined as a distance of a sliding operation moving on the touch display.
For example, when the two fingers of a game player slide, when the touch of the two fingers on the touch control display is monitored, initial screen coordinates corresponding to the two fingers are recorded, when the two fingers are closed, real-time screen coordinates of the two fingers are obtained, and the moving distance is calculated by combining the initial screen coordinates.
A substep 12 of determining a distance adjustment value corresponding to said distance;
in practical applications, the mapping relationship between the moving distance and the distance adjustment value may be preset, for example, a correspondence list may be set or a function may be used to determine the mapping relationship. After the distance that the sliding operation moves on the touch display is acquired, a distance adjustment value corresponding to the distance may be determined.
And a substep 13 of adjusting the length of the camera arm of force of the virtual camera according to the distance adjustment value.
After the distance adjustment value is obtained, the length of the camera moment arm of the virtual camera can be adjusted by the distance adjustment value.
In an embodiment of the present invention, the substep 13 may comprise the substeps of:
a substep 131 of determining a target length of a camera moment arm for the virtual camera using the distance adjustment value;
after the distance adjustment value is obtained, the distance adjustment value can be used to determine the target length of the camera moment arm of the virtual camera.
A substep 132, combining the target length and a preset moment arm length range, and updating a camera moment arm coefficient;
after the target length is determined, the moment arm coefficient of the camera can be updated by combining the target length and the preset moment arm length range.
Specifically, a moment arm length range can be preset, the moment arm length of the camera or the target length can be changed within the moment arm length range, and when the moment arm length of the camera is larger than the maximum value in the moment arm length range, the maximum value is used as the moment arm length of the camera. The camera moment arm coefficient may be a ratio of the target length to a range of moment arm lengths.
For example, the preset moment arm length range is (m, n), wherein the camera moment arm length is x, and let m < x < n, when the target length is x, the camera moment arm coefficient k = (x-m)/(n-m).
And a substep 133 of adjusting the position of the camera control component by using the camera moment arm coefficient to set the current camera moment arm length of the virtual camera to the target length.
After determining the camera moment arm coefficient, the camera moment arm coefficient can be used to determine the position of the camera control assembly and set the current camera moment arm length of the virtual camera to the target length.
Specifically, when determining the position of the camera control assembly, a preset calculation formula may be used to interpolate between the virtual object and the camera control assembly to obtain one or more interpolated positions (e.g., a plurality of points on the dashed line 301 in fig. 3), and then, the current camera moment arm length may be updated by adjusting the position of the camera control assembly to the interpolated positions.
For example, the current position (x) of the camera control component may be obtained 1 ,y 1 ,z 1 ) And the current position (x) of the virtual object 2 ,y 2 ,z 2 ) And calculating the distance (x) between the two 2 -x 1 ,y 2 -y 1 ,z 2 -z 1 ) After obtaining the distance between the two, can adopt (x) 1 ,y 1 ,z 1 )+k*(x 2 -x 1 ,y 2 -y 1 ,z 2 -z 1 ) And determining the camera control assembly position obtained by combining the camera moment arm coefficient, and adjusting the current camera moment arm length of the virtual camera to the length corresponding to the current camera control assembly position, wherein k is the camera moment arm coefficient. Of course, those skilled in the art can also obtain different interpolation positions by adding and multiplying different coefficients to obtain different linear functions.
Step 102, adjusting the size of a safety area in the game picture according to the current camera arm length of the virtual camera;
as an example, a safety area, such as a rectangular area 201 in the center of fig. 2b, may be set in the game, and the rectangular area 201 may be referred to as a safety area, and the size of the safety area may be in positive correlation with the length of the arm of the camera.
After the current arm length of the camera of the virtual camera is obtained, the size of the safe area in the game picture can be adjusted according to the current arm length information, and a specific adjustment method will be described below, which is not described herein again.
And 103, when the virtual object is detected not to be in the range of the safe area, adjusting the position of the virtual camera.
After adjusting the size of the safety area, it may be further detected whether the virtual object is within the range of the safety area, the position of the virtual camera may be adjusted when it is detected that the virtual object is not within the range of the safety area, and the position of the virtual camera may not be adjusted when it is detected that the virtual object is within the range of the safety area.
In the embodiment of the present invention, the center of the safety region in the game screen coincides with the center of the game screen, and the safety region is used only to assist in determining the position of the virtual object and is not displayed in the game screen.
In an embodiment of the present invention, in a process of changing a length of a force arm of a camera, when a blocking object exists between a virtual camera and a virtual object, the blocking object may be hidden or semi-transparent, so that a player may not be blocked by a large object when observing the virtual object at any angle or distance, for example, a straight line determined by the virtual camera and the virtual object may be obtained, the blocking object on the straight line may be determined, and after the blocking object is determined, a transparency of the blocking object may be adjusted.
In the embodiment of the invention, the length of the camera force arm of the virtual camera is adjusted by responding to the sliding operation acted on the touch display, the size of a safe area in a game picture is adjusted according to the current length of the camera force arm of the virtual camera, and the position of the virtual camera is adjusted when the virtual object is detected not to be in the range of the safe area, so that the smooth transition between a third person-named angle of view and a global angle of view is realized by simple sliding operation, the problems of memory occupation rise and game collapse caused by instant loading of excessive game scene resources are avoided, the switching of the angles of view is vivid and natural, any observation angle can be adjusted by sliding operation, and the freedom degree of selection of the angle of view position is improved.
Referring to fig. 4, which is a flowchart illustrating steps of a method for controlling a virtual camera according to an embodiment of the present invention, a graphical user interface is provided through a touch display of a terminal device, the graphical user interface includes a game screen captured by the virtual camera, and the game screen includes at least a virtual object.
The virtual object may be a game virtual character controlled by a game player through a terminal device, or a non-player character preset in a specific game scene by a game developer, and the virtual object is presented through a graphical user interface, and the presented content may include all of the virtual object, or may be a part of the virtual object.
In the embodiment of the invention, the adjusting of the size of the safety area in the game picture according to the current camera arm length of the virtual camera comprises the following steps:
acquiring a camera moment arm coefficient aiming at the current camera moment arm length of the virtual camera;
and adjusting the size of the safety area in the game picture according to the force arm coefficient of the camera.
In the embodiment of the present invention, when it is detected that the virtual object is not within the range of the safety area, adjusting the position of the virtual camera includes:
when the virtual object is detected not to be in the range of the safe area, acquiring the current position information of the virtual object; adjusting the position of the camera control assembly according to the current position information of the virtual object; and acquiring the current position information of the camera control assembly, and adjusting the position of the virtual camera according to the current position information of the camera control assembly.
Further, in the embodiment of the present invention, adjusting the position of the camera control assembly according to the current position information of the virtual object includes:
determining distance information between the virtual object and the camera control component; determining a damping coefficient corresponding to the distance information; and adjusting the position of the camera control assembly according to the current position information of the virtual object, the distance information and the obtained damping coefficient.
Specifically, the embodiment of the present invention may include:
step 401, adjusting a length of a camera arm of force of the virtual camera in response to a sliding operation acting on the touch display, wherein the length of the camera arm of force is a distance between the virtual camera and a camera control assembly;
step 402, acquiring a camera moment arm coefficient aiming at the current camera moment arm length of the virtual camera;
after the length of the virtual camera moment arm is adjusted, a camera moment arm coefficient aiming at the current camera moment arm length can be acquired, and the camera moment arm coefficient can be a ratio of the camera moment arm length to a preset camera moment arm range.
Step 403, adjusting the size of the safety area in the game picture according to the force arm coefficient of the camera;
as an example, a security area may be set in the game, the security area may be an area obtained by dividing the game screen, the area may not be displayed in the game screen, and the security area in the game screen may be mapped to a rectangular area in the touch display. The size of the safety area can be positively correlated with the length of the moment arm of the camera, and the larger the length of the moment arm of the camera is, the larger the moment arm coefficient is, and the larger the size of the safety area is.
After the force arm coefficient of the camera is obtained, the size of the safe area in the game picture can be adjusted according to the force arm coefficient of the camera.
In practical applications, when the secure area in the game is mapped to the touch display, the aspect ratio of the secure area may be the same as the aspect ratio of the touch display. Specifically, an x-y coordinate system may be constructed with one vertex of the touch display, and assuming that a length and a width of the screen are respectively an x-axis and a y-axis that are perpendicular to each other, and the lengths of the x-axis and the y-axis are 1 length unit (the length units of the x-axis and the y-axis may be different), a coordinate axis quadrant corresponding to the display area of the touch display may be determined by coordinates (0, 0), (1, 0), (0, 1) and (1, 1) of the four vertices, and when the coordinates of a point are greater than 1 or less than 0, the point may be determined to be outside the display area.
After determining the screen coordinates of the touch display, a safety region can be constructed in the quadrant of the coordinate axis, and the safety region can be constructed in the display region of the determined screen coordinates, and the screen coordinates are independent of the resolution and the size of the touch display of the mobile terminal, so that the safety region can be adapted to any display.
After the force arm coefficient of the camera is obtained, the x axis and the y axis of the display area can be zoomed by adopting the force arm coefficient of the camera, the length and the width of the safety area are calculated, and then the size of the safety area is adjusted.
For example, if the current camera moment arm length is 2858.39 and the preset moment arm range is (700, 4000), the camera moment arm coefficient can be calculated to be 0.65406= (2858.39-700)/(4000-700). Since the length and width of the display area are respectively 1 unit of length, the arm coefficient of force of the camera can be multiplied by the length and width respectively to obtain the length of the safety area, which is 0.65406 unit of length, as shown in fig. 5.
In one example, one skilled in the art can also perform function fitting on the moment arm coefficient to obtain a new camera moment arm coefficient k ', and use the new camera moment arm coefficient k' to calculate the length and width of the security region, so as to avoid the area of the security region being greater than the maximum area threshold or smaller than the minimum area threshold, for example:
k' = a camera moment arm coefficient + b
In the above calculation formula, a and b may be set according to actual needs, the minimum size of the safety region may be positively correlated with b, specifically, when the moment arm coefficient is 0, the new coefficient k' is equal to b, and the size of the safety region depends on the size of b. Of course, the aspect ratio and the position of the security zone may be adjusted by those skilled in the art according to the game type or game play.
Step 404, when detecting that the virtual object is not in the range of the safe area, acquiring the current position information of the virtual object;
after adjusting the size of the safety area, it may be further detected whether the virtual object is within the range of the safety area, and when it is detected that the virtual object is not within the range of the safety area, current position information of the virtual object may be acquired.
Specifically, the current position information of the virtual object may be a position of the game character in the game scene, and the position information of the virtual object may be determined by setting a detection point on the virtual object.
The detection points can be key judgment factors for judging whether the virtual object is in the safety area, the detection result can be more accurate by reasonably setting the positions and the number of the detection points, and the detection points can move along with the movement of the game role by setting the detection points on the virtual object when the detection points are set. Of course, the detection point can be dynamically adjusted according to the arm length of the camera force.
In practical application, because the size of the safety region can be changed along with the change of the arm length of the camera, when the size of the safety region in a game is minimum, all the detection points mapped in the coordinates of the touch display screen (namely the first physical position information of the detection points) are included in the minimum safety region, the situation that the virtual camera continuously moves because the detection points are always outside the safety region can be avoided, and the performance consumption of hardware equipment is reduced.
When detecting whether the virtual object is in the safe area, it may be determined whether the two-dimensional coordinates mapped by the virtual object are in the safe area in the touch display.
Since the safety area in the touch display is an area described by two-dimensional coordinates, and the current position information of the virtual object is position information described by three-dimensional coordinates, after the current position information of the virtual object is obtained, the corresponding first physical position information in the touch display can be determined by a preset algorithm, and the position information of the virtual object, which is mapped in the touch display, is determined.
After the first physical position information is acquired, whether the first physical position information is physical position information contained in a safe area in the touch display can be judged, and if the first physical position information is not the physical position information contained in the safe area of the touch display, it can be judged that the virtual object is detected not to be in the range of the safe area; if the first physical position information is physical position information included in the safety area, it can be determined that the virtual object is detected within the range of the safety area.
Step 405, adjusting the position of the camera control assembly according to the current position information of the virtual object;
after the current position information of the virtual object is obtained, the position of the camera control assembly can be adjusted according to the current position information of the virtual object.
In an embodiment of the present invention, step 405 may include the following sub-steps:
a substep 21 of determining distance information between the virtual object and the camera control component;
in practical application, the distance information between the virtual object and the camera control assembly may be determined, and specifically, the distance information may be obtained by calculating a difference between the virtual object coordinate and the camera control assembly coordinate after obtaining the virtual object coordinate and the camera control assembly coordinate.
A substep 22, determining a damping coefficient corresponding to the distance information;
in a specific implementation, a relation list between the distance information and the damping coefficient may be generated in advance, for example, when the distance corresponding to the distance information is smaller than a first preset threshold, a first damping coefficient may be set, and when the distance corresponding to the distance information is greater than a second preset threshold, a second damping coefficient may be set, where the first damping coefficient may be greater than the second damping coefficient.
After the distance information is acquired, a damping coefficient corresponding to the distance information may be determined.
And a substep 23 of adjusting the position of the camera control assembly according to the current position information of the virtual object, the distance information and the damping coefficient.
After the damping coefficient is obtained, the position of the camera control assembly can be adjusted by combining the current position information and the damping coefficient of the virtual object.
In particular, different damping coefficients may correspond to different movement speeds of the camera control assembly, and the damping coefficient may be inversely related to the movement speed. After the damping coefficient is obtained, the position of the camera control assembly may be adjusted using the moving speed corresponding to the damping coefficient.
Through setting up damping coefficient for the removal of virtual camera has the delay nature, and when virtual object left the safe zone, the virtual camera can not follow immediately, but along with virtual object's keeping away from, the moving speed of first virtual camera increases gradually, when preventing the game player maloperation, can let the player possess more comfortable, more natural visual angle change process.
In a specific implementation, the virtual object may further be provided with a camera proximity point, and when the camera control assembly is adjusted, a position of the camera proximity point may be used as current position information of the virtual object to control the camera control assembly to move to the camera proximity point.
When the camera close point is set, the position of the camera close point may be determined from the positions of the detection points, for example, coordinates of a plurality of detection points may be acquired and a weighted center of the coordinates may be calculated, and the weighted center may be determined as the camera close point. Since the camera approach point is a central point corresponding to the plurality of detection points, when the camera control assembly moves to the camera approach point, all the detection points can still be in the safety area.
For example, as shown in fig. 6, a detection point 601 and a detection point 604 are provided at each of the head and the leg of the game character, and a camera close point 602 is provided at the middle position between the detection points. During the game, when the game character moves so that the check point 601 and the check point 604 are not physical position information contained in the security area 605, the camera control component 603 in the center of the security area 605 may move toward the camera near the point 602. During the movement of the camera control component 603, the security zones mapped in the game scene may move accordingly with the movement of the character until the detection points 601 and 604 are encapsulated in the security zone 605.
Step 406, acquiring current position information of the camera control assembly, and adjusting the position of the virtual camera according to the current position information of the camera control assembly;
after the position of the camera control component is adjusted, the current position information of the camera control component can be acquired, and the position of the virtual camera is adjusted according to the current position information of the camera control component.
In practical applications, the virtual camera may continuously change with the real-time movement of the virtual object, for example, in order to keep the game character located at the center of the visual field of the virtual camera in the third person's perspective, when the game character walks, the virtual camera may move along with the game character even if the movement distance of the game character is small (e.g., does not exceed the preset threshold).
However, this approach tends to cause the virtual camera to move frequently, resulting in a continuous consumption of hardware performance of the terminal device; further, when the moving width of the virtual object is small, the continuous movement of the virtual camera does not follow the actual observation habit of the game player.
In the embodiment of the invention, a safety region can be set in a game scene and mapped to the touch display, whether the virtual object is in the safety region can be detected in the moving process of the virtual object, and when the virtual object is in the safety region, the position of the virtual camera can not be adjusted, so that the game visual angle can be kept stable and unchanged when the virtual object is small in moving amplitude and does not move out of the safety region, the instant following of the virtual camera is avoided when a game role moves, the performance number of the terminal equipment is reduced, and a more comfortable visual angle effect is provided for a player.
Specifically, when the force arm coefficient of the camera is increased, the view angle range of the virtual camera is increased, so that a game player can observe in a high view field range, meanwhile, because the size of the safety area is increased along with the increase of the force arm coefficient of the camera, the probability that the virtual object is positioned in the safety area is increased, the virtual camera does not need to move, when the safety area is increased to a full screen (such as a full picture in fig. 2 a), the virtual camera does not move, and the game view angle is switched to the global view angle.
When a game player plans to observe a virtual object at a close distance, the length of the arm of force of the camera can be shortened through a very simple sliding operation, so that the coefficient of the arm of force of the camera is reduced, the visual angle range of the virtual camera is reduced, the game player can observe the virtual object at the close distance, meanwhile, as the size of the safety area is reduced along with the reduction of the coefficient of the arm of force of the camera (as shown in a safety area 201 in fig. 2 b), the probability that the virtual object is outside the safety area is increased, when a detection point of the virtual object is outside the safety area 201, the virtual camera moves along with the virtual object and moves towards a point close to the camera of the virtual object, and at the moment, the game visual angle is switched to a third named visual angle.
Step 407, adjusting the angle of the virtual camera according to the rotation information of the camera control assembly;
as an example, the rotation information may include a rotation angle and a rotation direction.
In particular implementations, a game player may control the camera control assembly through a single-finger sliding operation on the touch-sensitive display, such as a bottom-to-top or left-to-right single-finger slide.
In response to the operation of the player, the sliding direction and the sliding amplitude of the single finger can be acquired, the rotating direction and the rotating angle of the corresponding camera control assembly are obtained according to the preset mapping relation, then, the rotating information can be generated by adopting the rotating direction and the rotating angle, and the angle of the virtual camera is adjusted according to the rotating information.
In an embodiment of the present invention, the camera control component may include a first component and a second component, and the first component and the second component may have the same position, and step 407 may include the following sub-steps:
controlling the virtual camera to rotate in the yaw angle direction according to the angle of the first assembly moving in the yaw angle direction; and controlling the virtual camera to rotate in the pitch angle direction according to the moving angle of the second assembly in the pitch angle direction.
Specifically, when creating the camera control assembly, a first assembly, which may be referred to as an object a, and a second assembly, which may be referred to as an object B, may be created, and the object a and the object B may be used to adjust the rotation angle of the virtual camera.
When the player is detected to operate through the single finger, the angle of movement of the first assembly in the yaw angle direction can be determined, and the virtual camera is controlled to rotate in the yaw angle direction according to the angle of movement of the first assembly in the yaw angle direction; meanwhile, the angle of the second assembly moving in the pitch angle direction may be determined, and the virtual camera may be controlled to rotate in the pitch angle direction according to the angle.
For example, the rotation angle of the yaw angle of the object a can be adjusted by sliding the single finger left and right on the touch display, and the rotation angle of the pitch angle of the object B can be adjusted by sliding the single finger up and down.
In practical applications, the object B may be set as a sub-object of the object a, and then in the world coordinate system, the object B may have the same coordinates as the object a, and the relative coordinates of the object B with respect to the object a are (0, 0).
Before creating the object a and the object B, an initial position of the virtual camera may be acquired, which may be acquired according to a position and an angle of a world camera (godcamra) set by game art personnel.
The absolute coordinates and the rotation angle of the initial position of the virtual camera may be as shown in the following table:
Figure BDA0002352015310000161
Figure BDA0002352015310000171
TABLE 1
Where r is the roll angle (roll) of rotation about the x-axis, p is the pitch angle (pitch) of rotation about the y-axis, and y is the yaw angle (yaw) of rotation about the z-axis.
In setting the rotation angles of the object a and the object B, since the yaw angle (yaw) of the rotation around the z-axis can be adjusted using the object a, and the pitch angle (pitch) of the rotation around the y-axis can be adjusted using the object B, the initial value of the yaw angle of the object a can be set to the same value as the yaw angle of the virtual camera, and the initial value of the pitch angle of the object B can be set to the same value as the pitch angle of the virtual camera. When a player slides on the touch display screen through a single finger, the yaw angle of the object A or the pitch angle of the object B can be adjusted, and the yaw angle and the pitch angle of the virtual camera are set by adopting the adjusted angles of the object A and the object B.
Since the roll angle of rotation about the x-axis is ground-based rotation and the sliding of the game player on the touch display may be used to adjust the pitch angle or yaw angle, no adjustment of the roll angle may be involved during the game, and thus, the roll angles of the object a and the object B may be set to 0. By setting the object B as a child of the object a, the object B can move with the movement of the object a, and when the pitch angle changes, the object B can rotate around the object a. Of course, the position of the camera control assembly is determined by the object a, and by the fact that the object a can perform the adjustment of the distance and the camera moves following the virtual object, a person skilled in the art can determine whether to create the object B according to actual needs, and in the case of deleting the object B, the object a can still operate.
The initial information for object a and object B may be as shown in the following table:
Figure BDA0002352015310000172
Figure BDA0002352015310000181
TABLE 2
After the object A and the object B are created, the virtual camera can be hung on the object B, and at the moment, when the object A moves, the virtual camera also correspondingly moves, so that the effect of camera following can be achieved; and the yaw angle and the pitch angle of the virtual camera can be controlled by the object a and the object B, the roll angle can be set to 0 by default, the rotation angle of the virtual camera relative to the object B is (0, 0), and the relative coordinate of the virtual camera relative to the object B is set to (x, 0), wherein the x value is the actual distance from the initial position of the virtual camera to the current position of the object a, and the distance is the length of the arm of force of the camera, that is, the distance.
The virtual camera information attached to the object B is shown in the following table:
Figure BDA0002352015310000182
TABLE 3
In the embodiment of the invention, the size of a safety area in a game picture is adjusted according to the camera moment arm coefficient by acquiring the camera moment arm coefficient aiming at the current camera moment arm length of the virtual camera; when the virtual object is detected not to be in the range of the safety area, the current position information of the virtual object is obtained, the position of the camera control assembly is adjusted according to the current position information of the virtual object, the current position information of the camera control assembly is obtained, and the position of the virtual camera is adjusted according to the current position information of the camera control assembly, so that the size of the safety area is dynamically adjusted according to the moment arm coefficient of the camera, when the virtual object is not in the safety area, the position of the virtual camera can be adjusted according to the position of the camera control assembly, and the camera following effect is achieved.
Referring to fig. 7, a schematic structural diagram of an apparatus controlled by a virtual camera according to an embodiment of the present invention is shown, and may be applied to a terminal device, where a touch display of the terminal device provides a graphical user interface, where the graphical user interface includes a game screen captured by the virtual camera, where the game screen at least includes a virtual object, and specifically may include the following modules:
a sliding operation response module 701, configured to adjust a length of a camera arm of the virtual camera in response to a sliding operation acting on the touch display, where the length of the camera arm is a distance between the virtual camera and a camera control component;
a safety area size adjusting module 702, configured to adjust the size of the safety area in the game screen according to the current camera moment arm length of the virtual camera;
a virtual camera position adjusting module 703, configured to adjust the position of the virtual camera when it is detected that the virtual object is not within the range of the safety area.
In an embodiment of the present invention, the virtual camera position adjusting module 703 includes:
the first position information acquisition sub-module is used for acquiring the current position information of the virtual object when the virtual object is detected not to be within the range of the safe area;
the camera control assembly position adjusting submodule is used for adjusting the position of the camera control assembly according to the current position information of the virtual object;
and the virtual camera position information acquisition sub-module is used for acquiring the current position information of the camera control assembly and adjusting the position of the virtual camera according to the current position information of the camera control assembly.
In an embodiment of the present invention, the camera control assembly position adjustment sub-module includes:
a distance information determining unit for determining distance information between the virtual object and the camera control component;
the damping coefficient determining unit is used for determining a damping coefficient corresponding to the distance information;
and the camera control assembly position determining unit is used for adjusting the position of the camera control assembly according to the current position information of the virtual object, the distance information and the damping coefficient.
In an embodiment of the present invention, the secure area resizing module 702 includes:
the camera moment arm coefficient acquisition sub-module is used for acquiring a camera moment arm coefficient aiming at the current camera moment arm length of the virtual camera;
and the safety region size calculation submodule is used for adjusting the size of the safety region in the game picture according to the camera moment arm coefficient.
In one embodiment of the present invention, the sliding operation includes a double-finger closing operation and a double-finger opening operation.
In an embodiment of the present invention, the sliding operation response module 701 includes:
and the double-finger folding operation response submodule is used for responding to double-finger folding operation acting on the touch display and carrying out height adjustment processing on the length of the camera force arm of the virtual camera.
In an embodiment of the present invention, the sliding operation response module 701 further includes:
and the double-finger separating operation response sub-module is used for responding to double-finger separating operation acted on the touch display and shortening the length of the camera force arm of the virtual camera.
In an embodiment of the present invention, the sliding operation response module 701 includes:
a moving distance determining submodule, configured to determine a distance that the sliding operation moves on a display screen of the terminal device; the distance adjustment value determining submodule is used for determining a distance adjustment value corresponding to the distance;
and the camera arm length adjusting submodule is used for adjusting the camera arm length of the virtual camera according to the distance adjusting value.
In an embodiment of the invention, the sub-module for adjusting the length of the arm of the camera arm comprises:
a target length determination unit for determining a target length for a camera moment arm of the virtual camera using the distance adjustment value;
the camera moment arm coefficient updating unit is used for updating the camera moment arm coefficient by combining the target length and a preset moment arm length range;
and the target length setting unit is used for adjusting the position of the camera control assembly by adopting the camera moment arm coefficient so as to set the current camera moment arm length of the virtual camera to be the target length.
In an embodiment of the present invention, the camera moment arm of the virtual camera is used to determine the view angle range of the virtual camera, the view angle range of the virtual camera is positively correlated to the length of the camera moment arm, and the size of the safety area is positively correlated to the length of the camera moment arm.
In an embodiment of the present invention, the apparatus further includes:
and the angle adjusting module is used for adjusting the angle of the virtual camera according to the rotation information of the camera control assembly.
In one embodiment of the invention, the camera control component comprises a first component and a second component, and the positions of the first component and the second component are the same;
the angle adjustment module includes:
the yaw angle determining submodule is used for controlling the virtual camera to rotate in the yaw angle direction according to the moving angle of the first assembly in the yaw angle direction;
and the pitch angle determining submodule is used for controlling the virtual camera to rotate in the pitch angle direction according to the moving angle of the second assembly in the pitch angle direction.
In an embodiment of the invention, the camera control assembly is located in the center of the camera field of view.
In the embodiment of the invention, the length of the camera arm of force of the virtual camera is adjusted by responding to the sliding operation acted on the touch display, the size of the safe area in the game picture is adjusted according to the current length of the camera arm of force of the virtual camera, and the position of the virtual camera is adjusted when the virtual object is detected not to be in the range of the safe area, so that the smooth transition between the third person-named visual angle and the global visual angle is realized by simple sliding operation, the problems of memory occupation rise and game collapse caused by instant loading of excessive game scene resources are avoided, the switching of the visual angles is vivid and natural, any observation angle can be adjusted by sliding operation, and the selection freedom degree of the visual angle position is improved.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention also provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the method for virtual camera control as described above are implemented.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the above virtual camera control method.
The embodiments in the present specification are all described in a progressive manner, and each embodiment focuses on differences from other embodiments, and portions that are the same and similar between the embodiments may be referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrases "comprising one of \ 8230; \8230;" does not exclude the presence of additional like elements in a process, method, article, or terminal device that comprises the element.
The method and apparatus for controlling a virtual camera, the electronic device, and the storage medium provided above are introduced in detail, and specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (16)

1. A method for controlling a virtual camera, wherein a graphical user interface is provided through a touch display of a terminal device, the graphical user interface includes a game screen captured by the virtual camera, wherein the game screen includes at least one virtual object, the method comprising:
responding to sliding operation acted on the touch display, and adjusting the length of a camera force arm of the virtual camera, wherein the length of the camera force arm is the distance between the virtual camera and a camera control assembly;
adjusting the size of a safety area in the game picture according to the current camera force arm length of the virtual camera;
adjusting a position of the virtual camera upon detecting that the virtual object is not within the range of the safe area.
2. The method of claim 1, wherein the adjusting the position of the virtual camera upon detecting that the virtual object is not within the range of the safe area comprises:
when the virtual object is detected not to be within the range of the safe area, acquiring the current position information of the virtual object;
adjusting the position of the camera control assembly according to the current position information of the virtual object;
and acquiring the current position information of the camera control assembly, and adjusting the position of the virtual camera according to the current position information of the camera control assembly.
3. The method of claim 2, wherein the adjusting the position of the camera control assembly according to the current position information of the virtual object comprises:
determining distance information between the virtual object and the camera control component;
determining a damping coefficient corresponding to the distance information;
and adjusting the position of the camera control assembly according to the current position information of the virtual object, the distance information and the damping coefficient.
4. The method of claim 1, wherein the adjusting the size of the security area in the game screen according to the current camera moment arm length of the virtual camera comprises:
acquiring a camera moment arm coefficient aiming at the current camera moment arm length of the virtual camera;
and adjusting the size of the safety area in the game picture according to the force arm coefficient of the camera.
5. The method of claim 1, wherein the sliding operation comprises a two-finger closing operation and a two-finger opening operation.
6. The method of claim 5, wherein adjusting the camera moment arm length of the virtual camera in response to a sliding operation acting on the touch display comprises:
and responding to the double-finger folding operation acted on the touch display, and performing height adjustment processing on the camera moment arm length of the virtual camera.
7. The method of claim 5, wherein adjusting the length of the camera moment arm of the virtual camera in response to a sliding operation acting on the touch display comprises:
and responding to the double-finger separation operation acted on the touch display, and shortening the length of a camera force arm of the virtual camera.
8. The method of claim 1, wherein the adjusting the camera moment arm length of the virtual camera comprises:
determining a distance that the sliding operation moves on the touch display;
determining a distance adjustment value corresponding to the distance;
and adjusting the length of the camera force arm of the virtual camera according to the distance adjustment value.
9. The method of claim 8, wherein the adjusting the camera moment arm length of the virtual camera according to the distance adjustment value comprises:
determining a target length for a camera moment arm of the virtual camera using the distance adjustment value;
updating the force arm coefficient of the camera by combining the target length and a preset force arm length range;
and adjusting the position of the camera control assembly by adopting the camera moment arm coefficient so as to set the current camera moment arm length of the virtual camera to be the target length.
10. The method of claim 1, wherein a camera moment arm of the virtual camera is used to determine a view angle range of the virtual camera, and the view angle range of the virtual camera is positively correlated with a length of the camera moment arm, and the size of the safety area is positively correlated with the camera moment arm length.
11. The method of claim 2, further comprising:
and adjusting the angle of the virtual camera according to the rotation information of the camera control assembly.
12. The method of claim 10, wherein the camera control assembly comprises a first assembly and a second assembly, the first assembly and the second assembly being located in the same position;
the adjusting the angle of the virtual camera according to the rotation information of the camera control assembly includes:
controlling the virtual camera to rotate in the yaw angle direction according to the moving angle of the first assembly in the yaw angle direction;
and controlling the virtual camera to rotate in the pitch angle direction according to the moving angle of the second assembly in the pitch angle direction.
13. The method of claim 1, wherein the camera control assembly is located in a center of a camera field of view.
14. An apparatus controlled by a virtual camera, applied to a terminal device, for providing a graphical user interface through a touch display of the terminal device, the graphical user interface including a game screen captured by the virtual camera, wherein the game screen includes at least a virtual object, the apparatus comprising:
the sliding operation response module is used for responding to the sliding operation acted on the touch display and adjusting the length of a camera force arm of the virtual camera, wherein the length of the camera force arm is the distance between the virtual camera and a camera control assembly;
the safety area size adjusting module is used for adjusting the size of the safety area in the game picture according to the current camera force arm length of the virtual camera;
and the virtual camera position adjusting module is used for adjusting the position of the virtual camera when the virtual object is detected not to be in the range of the safety area.
15. An electronic device, comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the method of virtual camera control as claimed in any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that a computer program is stored thereon which, when being executed by a processor, carries out the steps of a method of virtual camera control according to any one of claims 1 to 13.
CN201911419674.4A 2019-12-31 2019-12-31 Virtual camera control method and device, electronic equipment and storage medium Active CN111135556B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911419674.4A CN111135556B (en) 2019-12-31 2019-12-31 Virtual camera control method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911419674.4A CN111135556B (en) 2019-12-31 2019-12-31 Virtual camera control method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111135556A CN111135556A (en) 2020-05-12
CN111135556B true CN111135556B (en) 2023-03-28

Family

ID=70522932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911419674.4A Active CN111135556B (en) 2019-12-31 2019-12-31 Virtual camera control method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111135556B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111888762A (en) * 2020-08-13 2020-11-06 网易(杭州)网络有限公司 Method for adjusting visual angle of lens in game and electronic equipment
CN112121423B (en) * 2020-09-24 2021-08-24 苏州幻塔网络科技有限公司 Control method, device and equipment of virtual camera
CN112465901B (en) * 2020-12-11 2022-03-08 北京城市网邻信息技术有限公司 Information processing method and device
CN112843687B (en) * 2020-12-31 2022-10-21 上海米哈游天命科技有限公司 Shooting method, shooting device, electronic equipment and storage medium
CN113318441A (en) * 2021-05-26 2021-08-31 网易(杭州)网络有限公司 Game scene display control method and device, electronic equipment and storage medium
CN113332712B (en) * 2021-06-23 2024-02-02 网易(杭州)网络有限公司 Game scene picture moving method and device and electronic equipment
CN113546407A (en) * 2021-07-30 2021-10-26 网易(杭州)网络有限公司 Game picture processing method and device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107890664A (en) * 2017-10-23 2018-04-10 网易(杭州)网络有限公司 Information processing method and device, storage medium, electronic equipment
CN108920069B (en) * 2018-06-13 2020-10-23 网易(杭州)网络有限公司 Touch operation method and device, mobile terminal and storage medium

Also Published As

Publication number Publication date
CN111135556A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN111135556B (en) Virtual camera control method and device, electronic equipment and storage medium
CN106249882B (en) Gesture control method and device applied to VR equipment
CN107533373B (en) Input via context-sensitive collision of hands with objects in virtual reality
CN108355354B (en) Information processing method, device, terminal and storage medium
US20110202834A1 (en) Visual motion feedback for user interface
KR100899610B1 (en) Electronic device and a method for controlling the functions of the electronic device as well as a program product for implementing the method
US7227526B2 (en) Video-based image control system
CN109718538B (en) Method and device for frame selection of virtual object in game, electronic equipment and storage medium
KR101608423B1 (en) Full 3d interaction on mobile devices
AU2016200885B2 (en) Three-dimensional virtualization
US9535493B2 (en) Apparatus, method, computer program and user interface
CN110448904B (en) Game view angle control method and device, storage medium and electronic device
CN109107153B (en) Method and device for releasing game skill, electronic equipment and storage medium
US10528145B1 (en) Systems and methods involving gesture based user interaction, user interface and/or other features
Haro et al. Mobile camera-based user interaction
CN110575671A (en) Method and device for controlling view angle in game and electronic equipment
CN110941337A (en) Control method of avatar, terminal device and computer readable storage medium
US11574450B2 (en) Systems for augmented reality sketching
JP6018474B2 (en) Program, information processing apparatus, information processing method, and information processing system
US20150309681A1 (en) Depth-based mode switching for touchless gestural interfaces
CN111880715A (en) Method and device for editing virtual control in interface, mobile terminal and storage medium
JP7409770B2 (en) Game systems, programs and terminal devices
JP6548956B2 (en) SYSTEM, METHOD, AND PROGRAM
CN113440835A (en) Control method and device of virtual unit, processor and electronic device
Gope et al. Interaction with Large Screen Display using Fingertip & Virtual Touch Screen

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