CN111530078B - Method and device for displaying insert vegetation in game, storage medium and electronic equipment - Google Patents

Method and device for displaying insert vegetation in game, storage medium and electronic equipment Download PDF

Info

Publication number
CN111530078B
CN111530078B CN202010439983.4A CN202010439983A CN111530078B CN 111530078 B CN111530078 B CN 111530078B CN 202010439983 A CN202010439983 A CN 202010439983A CN 111530078 B CN111530078 B CN 111530078B
Authority
CN
China
Prior art keywords
vegetation
virtual camera
inserting sheet
angle
vertex
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
CN202010439983.4A
Other languages
Chinese (zh)
Other versions
CN111530078A (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 CN202010439983.4A priority Critical patent/CN111530078B/en
Publication of CN111530078A publication Critical patent/CN111530078A/en
Application granted granted Critical
Publication of CN111530078B publication Critical patent/CN111530078B/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/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • A63F13/525Changing parameters of virtual cameras
    • A63F13/5258Changing parameters of virtual cameras by dynamically adapting the position of the virtual camera to keep a game object or game character in its viewing frustum, e.g. for tracking a character or a ball

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The disclosure relates to the technical field of computers, and provides a method and a device for displaying inserted sheet vegetation in a game, a computer readable storage medium and electronic equipment. Wherein, the method comprises the following steps: acquiring a pitching angle of the virtual camera, wherein the pitching angle of the virtual camera is a deflection angle of the virtual camera when the virtual camera observes in the vertical direction in a world coordinate system; determining a target angle to be inclined of the inserting sheet vegetation according to the pitching angle of the virtual camera; inclining the inserting sheet vegetation according to the target angle; and displaying the inclined inserting sheet vegetation. This scheme inclines to the inserted sheet vegetation based on virtual camera's angle of pitch to make the inserted sheet vegetation can follow the observation visual angle of player and incline, and then reduce the group sense of wearing of the inserted sheet position of inserted sheet vegetation, with the sense of reality that promotes the recreation picture, and then improve user's gaming experience.

Description

Method and device for displaying insert vegetation in game, storage medium and electronic equipment
Technical Field
The disclosure relates to the technical field of computers, in particular to a method and a device for displaying inserting sheet vegetation in a game, a computer readable storage medium and electronic equipment.
Background
At present, in most outdoor games with nature as the main, vegetation is used, such as grass, flowers and the like, to create an outdoor vivid game scene.
Taking grass vegetation as an example, in the prior art, the grass vegetation is generally made by using a plug-in model, as shown in fig. 1, in a game scene, the plug-in model of the grass vegetation is perpendicular to the ground in a fixed plug-in mode, so that a ground scene of an outdoor game is formed.
However, in the conventional grass cover model manufactured by the fixed inserting method, when a player looks down in a game from a first person perspective, the inserting feeling of the grass cover is very strong, as shown in fig. 1, which further affects the reality of a game picture and deteriorates the quality of the game picture and the game experience of the player.
It is noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure and therefore may include information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a method and an apparatus for displaying slice vegetation in a game, a computer-readable storage medium, and an electronic device, so as to overcome the problem of unreal game images caused by slice feeling of slice vegetation at least to a certain extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, a method for displaying a tab vegetation in a game is provided, in which a graphical user interface is provided through a terminal device, the graphical user interface includes a game scene image captured by a virtual camera, and the game scene image includes the tab vegetation, and the method includes:
acquiring a pitching angle of the virtual camera, wherein the pitching angle of the virtual camera is a deflection angle of the virtual camera when the virtual camera observes in the vertical direction in a world coordinate system;
determining a target angle of the inserting sheet vegetation to be inclined according to the pitching angle of the virtual camera;
inclining the inserting sheet vegetation according to the target angle;
and displaying the inclined inserting sheet vegetation.
In an exemplary embodiment of the disclosure, based on the foregoing solution, the determining the target angle to be inclined of the sheet vegetation according to the tilt angle of the virtual camera includes:
acquiring the weight corresponding to the vertex color of the inserting sheet vegetation;
determining a target angle to be inclined of each vertex of the inserting sheet vegetation according to the inner product of the pitching angle of the virtual camera and the weight corresponding to the vertex color of the inserting sheet vegetation;
the inclining the inserting sheet vegetation according to the target angle comprises:
and according to the target angle to be inclined of each vertex of the inserting sheet vegetation, inclining each vertex of the inserting sheet vegetation.
In an exemplary embodiment of the disclosure, based on the foregoing, before tilting the plug vegetation according to the target angle, the method further comprises:
acquiring the observation direction of the virtual camera;
determining the target direction of the inserted sheet vegetation to be inclined according to the observation direction of the virtual camera;
the inclination of the inserting sheet vegetation according to the target angle comprises the following steps:
and inclining the inserting sheet vegetation according to the target angle and the target direction.
In an exemplary embodiment of the disclosure, based on the foregoing solution, the observing direction of the virtual camera is a direction corresponding to a direction vector of the virtual camera in a world coordinate system, and determining the target direction to be tilted of the sheet vegetation according to the observing direction of the virtual camera includes:
and acquiring the direction vector of the virtual camera in a world coordinate system, and determining that the direction corresponding to the direction vector of the virtual camera in the world coordinate system is the target direction of the inserting sheet vegetation to be inclined.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the tilting each vertex of the tab vegetation according to a target angle to be tilted for each vertex of the tab vegetation includes:
acquiring a current view matrix of the virtual camera to convert each vertex of the inserting sheet vegetation from a world coordinate system to a camera coordinate system where the virtual camera is located;
determining the position information of each vertex of the inserting sheet vegetation in a camera coordinate system;
and inclining each vertex of the inserting sheet vegetation according to the position information of each vertex of the inserting sheet vegetation in a camera coordinate system and the target angle to be inclined of each vertex of the inserting sheet vegetation.
In an exemplary embodiment of the present disclosure, based on the above scheme, the displaying the pitcher vegetation after tilting includes:
acquiring the direction of the three-dimensional model of the inserting sheet vegetation in the world coordinate system, which is vertical to the ground, and determining the positions of all vertexes of the inserting sheet vegetation after the vertexes of the inserting sheet vegetation incline according to the direction of the three-dimensional model of the inserting sheet vegetation in the world coordinate system, which is vertical to the ground, and the target angle of all vertexes of the inserting sheet vegetation to be inclined;
and displaying the inclined inserting sheet vegetation according to the inclined positions of all vertexes of the inserting sheet vegetation.
In an exemplary embodiment of the present disclosure, based on the foregoing, before the tipping the tab vegetation according to the target angle, the method further comprises:
and acquiring the position and configuration parameter information of the virtual camera, and determining the visual field range of the virtual camera according to the position and configuration parameter information of the virtual camera so as to incline the plug vegetation in the visual field range.
According to a second aspect of the present disclosure, there is provided an apparatus for displaying tab vegetation in a game, wherein a graphical user interface is provided through a terminal device, the graphical user interface includes a game scene image captured by a virtual camera, the game scene image includes the tab vegetation, the apparatus includes:
a pitch angle acquisition module configured to acquire a pitch angle of the virtual camera, wherein the pitch angle of the virtual camera is an angle of the virtual camera when viewed in an up-down direction in a world coordinate system;
the target angle to be inclined determining module is configured to determine a target angle to be inclined of the inserting sheet vegetation according to the pitching angle of the virtual camera;
a tab vegetation tilt module configured to tilt the tab vegetation according to the target angle;
a tab vegetation display module configured to display the tipped tab vegetation.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of displaying patchy vegetation in a game as described in the first aspect of the embodiments above.
According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including: a processor; and a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of displaying patchy vegetation in a game as described in the first aspect of the embodiment above.
According to the technical scheme, the method for displaying the tab vegetation in the game, the device for displaying the tab vegetation in the game and the computer-readable storage medium and the electronic equipment for realizing the method for displaying the tab vegetation in the game in the exemplary embodiment of the disclosure have at least the following advantages and positive effects:
in the technical scheme provided by some embodiments of the present disclosure, firstly, the pitch angle of the virtual camera is obtained, secondly, the target angle to be inclined of the sheet-type vegetation is determined according to the pitch angle of the virtual camera, then the sheet-type vegetation is inclined according to the determined target angle, and finally the inclined sheet-type vegetation is displayed. Compared with the existing mode of manufacturing the insert vegetation in a fixed insert mode, the technical scheme of the invention can flexibly incline the insert vegetation according to the pitching angle of the virtual camera corresponding to a player, so that the player can effectively shield the position of the insert vegetation when observing downwards, the sense of reality of a game picture is improved, the quality of the game picture is enhanced, and the game experience of a user is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 shows a schematic view of a prior art made patchwork vegetation;
FIG. 2 illustrates a flow diagram of a method of displaying a patched vegetation in a game in an exemplary embodiment of the present disclosure;
FIG. 3 illustrates a schematic view of the tilt angle of a virtual camera in an exemplary embodiment of the present disclosure;
FIG. 4 illustrates a sub-flow diagram of a method of determining a target angle at which each vertex of a tuck-in vegetation is to be tipped in an exemplary embodiment of the present disclosure;
FIG. 5 illustrates a sub-flow diagram of a method of determining a target direction to be tilted for a patched vegetation in an exemplary embodiment of the present disclosure;
FIG. 6 is a schematic view showing the azimuthal relationship between the target direction to which the interleaf vegetation is to be tilted and the viewing direction of the virtual camera in an exemplary embodiment of the disclosure;
FIG. 7 is a graph showing the effect of an exemplary embodiment of the present disclosure before and after tilting a plug of vegetation;
FIG. 8 is a schematic diagram showing the structure of a device for displaying patched vegetation in a game according to an exemplary embodiment of the present disclosure;
FIG. 9 shows a schematic diagram of a computer readable storage medium in an exemplary embodiment of the disclosure; and the number of the first and second groups,
fig. 10 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the embodiments of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/parts/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
In the related art, a model of a grass vegetation mat is perpendicular to the ground in the form of a fixed mat. However, in the conventional slip sheet vegetation manufactured by fixing the slip sheet, when a player looks down in a game of a first person's perspective, the slip sheet feeling of the grass vegetation is very strong, as shown in fig. 1, which further affects the reality of a game screen, and deteriorates the quality of the game screen and the game experience of the player.
In an embodiment of the present disclosure, there is provided a method for displaying patchwork vegetation in a game, which overcomes, at least to some extent, the above-mentioned deficiencies of the prior art.
FIG. 2 illustrates a flow diagram of a method of displaying a patched vegetation in a game in an exemplary embodiment of the present disclosure. The method comprises the steps that a terminal device is used for providing a graphical user interface, the graphical user interface comprises a game scene image captured through a virtual camera, and the game scene image comprises inserting sheet vegetation. Referring to fig. 2, the method includes:
step S210, acquiring the pitching angle of the virtual camera, wherein the pitching angle of the virtual camera is the deflection angle of the virtual camera when the virtual camera observes in the vertical direction in a world coordinate system;
step S220, determining a target angle to be inclined of the inserting sheet vegetation according to the pitching angle of the virtual camera;
step S230, inclining the inserting sheet vegetation according to the target angle;
and S240, displaying the inclined inserting sheet vegetation.
In the technical scheme provided by the embodiment shown in fig. 2, firstly, the pitching angle of the virtual camera is obtained, secondly, the target angle of the inserted sheet vegetation to be inclined is determined according to the pitching angle of the virtual camera, then the inserted sheet vegetation is inclined according to the determined target angle, and finally the inclined inserted sheet vegetation is displayed. Compared with the existing mode of manufacturing the insert vegetation in a fixed insert mode, the technical scheme of the invention can flexibly incline the insert vegetation according to the pitching angle of the virtual camera corresponding to a player, so that the player can effectively shield the position of the insert vegetation when observing downwards, the sense of reality of a game picture is improved, the quality of the game picture is enhanced, and the game experience of a user is further improved.
The following is a detailed description of the various steps in the example shown in fig. 2:
in step S210, the tilt angle of the virtual camera is acquired, where the tilt angle of the virtual camera is a yaw angle of the virtual camera when viewed in the vertical direction in the world coordinate system.
In an exemplary embodiment, the virtual camera may include a virtual camera corresponding to a virtual game character of a game player in any game, wherein any game may include a stand-alone game, a virtual reality game, an augmented reality game, and the like.
For example, when a virtual game character corresponding to a game player observes in a vertical direction in a game scene, a virtual camera corresponding to the virtual game character correspondingly deflects in the vertical direction, so as to generate a pitch angle.
Specifically, a schematic diagram of the tilt angle of the virtual camera may be as shown in fig. 3. In fig. 3, 31 may be a virtual camera, 32 may be an upward direction perpendicular to the ground in the world coordinate system, 33 may be a viewing direction of the virtual camera in the world coordinate system, 34 may be a pitch angle of the virtual camera, and 35 may be a yaw direction of the virtual camera when viewed in an up-down direction in the world coordinate system.
After the pitch angle of the virtual camera is obtained, in step S220, a target angle at which the slip sheet vegetation is to be tilted is determined according to the pitch angle of the virtual camera.
The inserting sheet vegetation can be any vegetation made in the form of inserting sheets in a game scene, including but not limited to various inserting sheet grass vegetation, various inserting sheet flower vegetation and the like.
For example, a model of the shingle may be created in three-dimensional software before determining the target angle at which the shingle is to be tilted based on the tilt angle of the camera. Wherein, the model of inserted sheet vegetation can constitute by the summit, and every summit can have corresponding summit colour, and different summit colours can correspond different weights
The specific implementation of the step S220 may be that a target angle to be inclined at each vertex of the sheet vegetation is determined according to the pitch angle of the virtual camera. The method for determining the target angle to be inclined of each vertex of the sheet vegetation can be as shown in fig. 4, and the method can include steps S410 to S420.
In step S410, the weight corresponding to the vertex color of the filling sheet vegetation is obtained.
For example, before obtaining the weights corresponding to the colors of the vertexes of the tab vegetation, the weights corresponding to the colors of the vertexes of the tab vegetation may be determined in three-dimensional software, such as 3DMAX (3D Studio Max, often referred to as 3D Max or 3ds Max for short, a computer system-based three-dimensional animation rendering and production software), maya (Autodesk Maya, three-dimensional modeling and animation software).
Specifically, taking the grass vegetation as an example, first, a channel of vertex colors, which may be any one of three color channels of R (red), G (green), and B (blue), may be determined, and then, the color of each vertex may be determined, for example, the vertex colors may be determined as white and black, that is, the color of the vertex at the top of the grass vegetation model is white, the color of the vertex at the bottom is black, and the color of the vertex of the grass vegetation model transitions from top to bottom according to the color of white to black. Different vertex colors have different pixels, for example, the pixel of the black vertex is 0, the pixel of the white vertex is 255, and the pixel of each vertex of the transition color between black and white has a corresponding value between 0 and 255, and the pixel corresponding to each vertex color can be taken as the weight of each vertex, that is, the weight of the white vertex is the largest, and the weight of the black vertex is the smallest.
Of course, the color of each vertex may be any other color as long as the weight of each vertex can be distinguished, and this exemplary embodiment is not particularly limited to this.
After the weight corresponding to the vertex color of the inserted sheet vegetation is obtained, in step S420, a target angle to be inclined at each vertex of the inserted sheet vegetation is determined according to an inner product of the pitching angle of the virtual camera and the weight corresponding to the vertex color of the inserted sheet vegetation.
In an exemplary embodiment, the weight corresponding to the vertex color of the interleaf vegetation may include a weight matrix of the vertex color, and the tilt angle of the virtual camera may include a tilt angle matrix of the virtual camera.
For example, the specific implementation of step S420 may be to determine the target angle to be inclined for each vertex of the tab vegetation according to an inner product of the pitch angle matrix of the virtual camera and the weight matrix of the vertex color of the vertex of the tab vegetation. The inner product can be calculated in a shader (shader) of the inserted sheet vegetation.
In step S410, the weight corresponding to the color from the uppermost vertex to the lowermost vertex of the sheet vegetation model is gradually decreased, and thus the target angle at which each vertex of the sheet vegetation model is to be tilted is also gradually decreased from the uppermost vertex to the lowermost vertex.
The mode of determining the size of the target angle to be inclined of each vertex of the inserting sheet vegetation according to the weight corresponding to each vertex color of the inserting sheet vegetation can ensure that the inserting sheet vegetation is inclined more naturally and truly, and the reality and the quality of a game picture are improved more.
After the target angle at which each vertex of the sheet vegetation is to be tilted is determined, in step S230, the sheet vegetation is tilted according to the target angle.
In an exemplary embodiment, the target angle may include a target angle at which each apex of the slip sheet vegetation described above is to be tilted.
For example, the specific implementation of step S230 may be to tilt the vegetation insert according to a target angle to be tilted at each vertex of the vegetation insert.
Specifically, a current view matrix of the virtual camera can be obtained to convert each vertex of the sheet vegetation from a world coordinate system to a camera coordinate system where the virtual camera is located; then, determining the position information of each vertex of the inserting sheet vegetation in a camera coordinate system; and inclining each vertex of the inserting sheet vegetation according to the position information of each vertex of the inserting sheet vegetation in the camera coordinate system and the target angle to be inclined of each vertex of the inserting sheet vegetation.
The current view MATRIX of the virtual camera may be a MATRIX that converts the world coordinate system to the camera coordinate system, and may include, for example, the MATRIX UNITY _ MATRIX _ V in UNITY 3D (a fully integrated professional game engine).
For example, before the inserting sheet vegetation is inclined according to the position information of each vertex of the inserting sheet vegetation in the camera coordinate system and the target angle to be inclined of each vertex of the inserting sheet vegetation, the target direction to be inclined of the inserting sheet vegetation can be determined. For an exemplary method of determining a target direction to which the tuck blade vegetation is to be pitched, reference may be made to fig. 5. The method may comprise steps S510-S520.
In step S510, the viewing direction of the virtual camera is acquired.
The viewing direction of the virtual camera may include a direction corresponding to a direction vector of the virtual camera in the world coordinate system.
For example, a specific implementation manner of step S510 may be to acquire a direction vector of the virtual camera in the world coordinate system, so as to determine the viewing direction of the virtual camera according to the direction vector.
After the observing direction of the virtual camera is obtained, in step S520, the target direction to be tilted of the sheet vegetation is determined according to the observing direction of the virtual camera. The target direction may include a target direction to be inclined at each vertex of the insert vegetation.
For example, a specific implementation manner of step S520 may be to determine a viewing direction of the virtual camera as a target direction in which each vertex of the sheet vegetation is to be tilted, where the viewing direction of the virtual camera may be a direction corresponding to a direction vector of the virtual camera in the world coordinate system.
Through the steps S510 to S520, it can be determined that the observation direction of the virtual camera is the target direction of the inserted sheet vegetation to be tilted, as shown in fig. 6, 62 is the observation direction of the virtual camera, and 64 is the tilted inserted sheet vegetation, that is, the target direction of the inserted sheet vegetation to be tilted is consistent with the observation direction of the virtual camera, so that the threading feeling caused by the position of the inserted sheet can be effectively and quickly shielded.
After the target direction to be inclined of the tab vegetation is determined, the specific implementation of step S230 may be to incline the tab vegetation according to the target angle to be inclined at each vertex of the tab vegetation and the target direction to be inclined at each vertex.
For example, before the tab vegetation is tilted according to the target angle to be tilted at each vertex of the tab vegetation and the target direction to be tilted at each vertex, the position and configuration parameter information of the virtual camera can be acquired, and the visual field range of the virtual camera is determined according to the position and configuration parameter information of the virtual camera, for example, the area between 61 and 63 in fig. 6 can be the visual field range of the virtual camera, so as to tilt the tab vegetation within the visual field range.
After the field of view of the virtual camera is determined, in step S240, the tilted patched vegetation is displayed.
Wherein, before the inclined sheet vegetation is displayed, the direction of the three-dimensional model of the sheet vegetation perpendicular to the ground in the world coordinate system can be determined. In the three-dimensional software, 3 axial directions, namely three axial directions of X, Y and Z are provided, and when the three-dimensional model of the inserting sheet vegetation is manufactured, the direction of any one axial direction which is perpendicular to the ground in a world coordinate system can be determined from the three axial directions of X, Y and Z. For example, the Z-axis in the three-dimensional software may be selected as the direction in which the interleaf vegetation is perpendicular to the ground in the world coordinate system.
After the direction of the three-dimensional model of the inserting sheet vegetation in the world coordinate system, which is perpendicular to the ground, is determined, the inclined position of the inserting sheet vegetation can be determined according to the target angle and the target direction of the inserting sheet vegetation to be inclined.
For example, in the step S240, a direction of the three-dimensional model of the sheet vegetation perpendicular to the ground in the world coordinate system may be obtained, so as to determine an inclined position of each vertex of the sheet vegetation according to the direction of the three-dimensional model of the sheet vegetation perpendicular to the ground in the world coordinate system and the target angle at which each vertex of the sheet vegetation is to be inclined, and then display the inclined sheet vegetation according to the inclined position of each vertex of the sheet vegetation.
By the method for displaying the insert vegetation in the game, provided by the exemplary embodiment, when the virtual game role corresponding to the game player downwards observes in the game, the insert vegetation in the game scene can be inclined according to the pitching angle of the virtual camera corresponding to the virtual game role, so that the lasting feeling caused by the insert position of the insert vegetation can be effectively shielded, the reality and quality of the game picture are enhanced, and the game experience of the game player is improved.
For example, fig. 7 (a) is a game screen view in which the blade vegetation is not tilted in accordance with the tilt angle of the virtual camera when the virtual game character is viewed downward, and fig. 7 (b) is a game screen view in which the blade vegetation is tilted in accordance with the tilt angle of the virtual camera when the virtual game character is viewed downward. It is apparent that, in fig. 7 (b), the inserting sheet vegetation appears more naturally and more realistically when the virtual game character looks downward.
Those skilled in the art will appreciate that all or part of the steps to implement the above embodiments are implemented as a computer program executed by a CPU. The computer program, when executed by the CPU, performs the functions defined by the method provided by the present invention. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Further, fig. 8 shows a schematic structural diagram of a device 800 for displaying the sheet vegetation in a game in an exemplary embodiment of the disclosure. The apparatus 800 provides a graphical user interface through the terminal device, the graphical user interface including a game scene image captured by the virtual camera, the game scene image including the slip sheet vegetation. Referring to fig. 8, an apparatus 800 for displaying a patchwork vegetation in a game may include a pitch angle acquisition module 810, a target angle to be tilted determination module 820, a patchwork vegetation tilt module 830, and a patchwork vegetation display module 840. Wherein:
a pitch angle acquisition module 810 configured to acquire a pitch angle of the virtual camera, wherein the pitch angle of the virtual camera is an angle of the virtual camera when viewed in an up-down direction in a world coordinate system;
a target angle to tilt determination module 820 configured to determine a target angle to tilt of the tuck tab vegetation according to the pitch angle of the virtual camera;
a tab vegetation tilt module 830 configured to tilt the tab vegetation according to the target angle;
a patched vegetation display module 840 configured to display the patched vegetation after tilting.
In an exemplary embodiment of the disclosure, based on the foregoing embodiment, the target angle to be tilted determining module 820 is further specifically configured to:
acquiring the weight corresponding to the vertex color of the inserting sheet vegetation;
and determining the target angle of each vertex of the inserting sheet vegetation to be inclined according to the inner product of the pitching angle of the virtual camera and the weight corresponding to the vertex color of the inserting sheet vegetation.
In an exemplary embodiment of the present disclosure, based on the foregoing embodiments, the above-mentioned tab vegetation tilt module 830 is further specifically configured to:
acquiring the observation direction of the virtual camera;
determining the target direction of the inserted sheet vegetation to be inclined according to the observation direction of the virtual camera;
and inclining the inserting sheet vegetation according to the target angle and the target direction.
In an exemplary embodiment of the present disclosure, based on the foregoing embodiment, the above-mentioned tab vegetation inclination module 830 includes a coordinate system conversion unit specifically configured to:
acquiring a current view matrix of the virtual camera to convert each vertex of the inserting sheet vegetation from a world coordinate system to a camera coordinate system where the virtual camera is located;
determining the position information of each vertex of the inserting sheet vegetation in a camera coordinate system;
and inclining each vertex of the inserting sheet vegetation according to the position information of each vertex of the inserting sheet vegetation in the camera coordinate system and the target angle to be inclined of each vertex of the inserting sheet vegetation.
In an exemplary embodiment of the present disclosure, based on the foregoing embodiments, the above-mentioned sheet vegetation display module 840 is further specifically configured to:
acquiring the direction of the three-dimensional model of the inserting sheet vegetation in the world coordinate system, which is vertical to the ground, and determining the positions of all vertexes of the inserting sheet vegetation after inclination according to the direction of the three-dimensional model of the inserting sheet vegetation in the world coordinate system, which is vertical to the ground, and the target angle of all vertexes of the inserting sheet vegetation to be inclined;
and displaying the inclined inserting sheet vegetation according to the inclined positions of all vertexes of the inserting sheet vegetation.
In an exemplary embodiment of the present disclosure, based on the foregoing embodiment, the apparatus 800 further includes a tilt range determining module specifically configured to:
and acquiring the position and configuration parameter information of the virtual camera, and determining the visual field range of the virtual camera according to the position and configuration parameter information of the virtual camera so as to incline the inserting sheet vegetation in the visual field range.
The specific details of each unit in the device for displaying the inserting sheet vegetation in the game are described in detail in the method for displaying the inserting sheet vegetation in the corresponding game, and therefore, the details are not repeated herein.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer storage medium capable of implementing the above method. On which a program product capable of implementing the method described above in this specification is stored. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure as described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
Referring to fig. 9, a program product 900 for implementing the above method according to an embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1000 according to this embodiment of the disclosure is described below with reference to fig. 10. The electronic device 1000 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 is in the form of a general purpose computing device. The components of the electronic device 1000 may include, but are not limited to: the at least one processing unit 1010, the at least one memory unit 1020, a bus 1030 connecting different system components (including the memory unit 1020 and the processing unit 1010), and a display unit 1040.
Wherein the storage unit stores program code that can be executed by the processing unit 1010 to cause the processing unit 1010 to perform the steps according to various exemplary embodiments of the present disclosure described in the above section "exemplary method" of this specification.
For example, the processing unit 1010 may perform the following as shown in fig. 2: step S210, acquiring the pitching angle of the virtual camera, wherein the pitching angle of the virtual camera is the deflection angle of the virtual camera when the virtual camera observes in the up-and-down direction in a world coordinate system; s220, determining a target angle to be inclined of the inserting sheet vegetation according to the pitching angle of the virtual camera; step S230, inclining the inserting sheet vegetation according to the target angle; and step S240, displaying the inclined inserting sheet vegetation.
As another example, the processing unit 1010 may perform various steps as shown in fig. 4 and 5.
The storage unit 1020 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM) 10201 and/or a cache memory unit 10202, and may further include a read-only memory unit (ROM) 10203.
The memory unit 1020 may also include a program/utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1030 may be any bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1000, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1000 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interfaces 1050. Also, the electronic device 1000 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1060. As shown, the network adapter 1060 communicates with the other modules of the electronic device 1000 over the bus 1030. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Furthermore, the above-described drawings are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed, for example, synchronously or asynchronously in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method for displaying tab vegetation in a game is characterized in that a graphical user interface is provided through terminal equipment, the graphical user interface comprises a game scene image captured through a virtual camera, the game scene image comprises the tab vegetation, and the method comprises the following steps:
acquiring a pitching angle of the virtual camera, wherein the pitching angle of the virtual camera is a deflection angle of the virtual camera when the virtual camera observes in the vertical direction in a world coordinate system;
determining a target angle to be inclined of the inserting sheet vegetation according to the pitching angle of the virtual camera;
inclining the inserting sheet vegetation according to the target angle;
and displaying the inclined inserting sheet vegetation.
2. The method of displaying a patchwork vegetation in a game of claim 1, wherein said determining a target angle at which the patchwork vegetation is to be tilted from the pitch angle of the virtual camera comprises:
acquiring the weight corresponding to the vertex color of the inserting sheet vegetation;
determining a target angle to be inclined of each vertex of the inserting sheet vegetation according to the inner product of the pitching angle of the virtual camera and the weight corresponding to the vertex color of the inserting sheet vegetation;
the inclining the inserting sheet vegetation according to the target angle comprises:
and inclining each vertex of the inserting sheet vegetation according to the target angle to be inclined of each vertex of the inserting sheet vegetation.
3. The method of displaying a patchwork vegetation in a game of claim 1, wherein prior to tilting the patchwork vegetation according to the target angle, the method further comprises:
acquiring the observation direction of the virtual camera;
determining the target direction of the inserting sheet vegetation to be inclined according to the observation direction of the virtual camera;
the slope is carried out to the inserted sheet vegetation according to the target angle, include:
and inclining the inserting sheet vegetation according to the target angle and the target direction.
4. The method for displaying the sheet vegetation in the game according to claim 3, wherein the viewing direction of the virtual camera is a direction corresponding to a direction vector of the virtual camera in a world coordinate system, and the determining the target direction to be tilted of the sheet vegetation according to the viewing direction of the virtual camera comprises:
and acquiring the direction vector of the virtual camera in a world coordinate system, and determining that the direction corresponding to the direction vector of the virtual camera in the world coordinate system is the target direction of the inserting sheet vegetation to be inclined.
5. The method of displaying a patchwork vegetation in a game of claim 2, wherein tilting each vertex of the patchwork vegetation according to a target angle at which the vertex is to be tilted comprises:
acquiring a current view matrix of the virtual camera to convert each vertex of the inserting sheet vegetation from a world coordinate system to a camera coordinate system where the virtual camera is located;
determining the position information of each vertex of the inserting sheet vegetation in a camera coordinate system;
and inclining each vertex of the inserting sheet vegetation according to the position information of each vertex of the inserting sheet vegetation in a camera coordinate system and the target angle to be inclined of each vertex of the inserting sheet vegetation.
6. The method of displaying claim 2, wherein displaying the tilted claim comprises:
acquiring the direction of the three-dimensional model of the inserting sheet vegetation in a world coordinate system, which is vertical to the ground, and determining the positions of all vertexes of the inserting sheet vegetation after inclination according to the direction of the three-dimensional model of the inserting sheet vegetation in the world coordinate system, which is vertical to the ground, and the target angles of all vertexes of the inserting sheet vegetation to be inclined;
and displaying the inclined inserting sheet vegetation according to the inclined positions of all the vertexes of the inserting sheet vegetation.
7. The method of displaying a patchwork vegetation in a game according to any one of claims 1 to 6, wherein prior to tilting the patchwork vegetation according to the target angle, the method further comprises:
and acquiring the position and configuration parameter information of the virtual camera, and determining the visual field range of the virtual camera according to the position and configuration parameter information of the virtual camera so as to incline the plug vegetation in the visual field range.
8. The utility model provides a device that shows inserted sheet vegetation in recreation, its characterized in that provides graphical user interface through terminal equipment, including the game scene image through virtual camera capture in the graphical user interface, include in the game scene image the inserted sheet vegetation, the device includes:
a pitch angle acquisition module configured to acquire a pitch angle of the virtual camera, wherein the pitch angle of the virtual camera is an angle of the virtual camera when viewed in an up-down direction in a world coordinate system;
the target angle to be inclined determining module is configured to determine a target angle to be inclined of the inserting sheet vegetation according to the pitching angle of the virtual camera;
a tab vegetation tilt module configured to tilt the tab vegetation according to the target angle;
a tab vegetation display module configured to display the tab vegetation after tilting.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of displaying patchy vegetation in a game according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
a storage device to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of displaying a patched vegetation in a game of any of claims 1 to 7.
CN202010439983.4A 2020-05-22 2020-05-22 Method and device for displaying insert vegetation in game, storage medium and electronic equipment Active CN111530078B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010439983.4A CN111530078B (en) 2020-05-22 2020-05-22 Method and device for displaying insert vegetation in game, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010439983.4A CN111530078B (en) 2020-05-22 2020-05-22 Method and device for displaying insert vegetation in game, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111530078A CN111530078A (en) 2020-08-14
CN111530078B true CN111530078B (en) 2023-03-07

Family

ID=71978069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010439983.4A Active CN111530078B (en) 2020-05-22 2020-05-22 Method and device for displaying insert vegetation in game, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111530078B (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110384924A (en) * 2019-08-21 2019-10-29 网易(杭州)网络有限公司 The display control method of virtual objects, device, medium and equipment in scene of game
CN110465097B (en) * 2019-09-09 2023-06-27 网易(杭州)网络有限公司 Character vertical drawing display method and device in game, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111530078A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
CN107358643B (en) Image processing method, image processing device, electronic equipment and storage medium
CN111508052B (en) Rendering method and device of three-dimensional grid body
JP4698893B2 (en) Method, graphics system, and program for providing improved fog effects
CN111068312A (en) Game picture rendering method and device, storage medium and electronic equipment
WO2023231537A1 (en) Topographic image rendering method and apparatus, device, computer readable storage medium and computer program product
CN109985384B (en) Method and device for dynamically adjusting map
CN108043027B (en) Storage medium, electronic device, game screen display method and device
US20230230311A1 (en) Rendering Method and Apparatus, and Device
CN113487717B (en) Picture processing method and device, computer readable storage medium and electronic equipment
CN112734896A (en) Environment shielding rendering method and device, storage medium and electronic equipment
CN114756937A (en) Visualization system and method based on UE4 engine and Cesium framework
CN111798554A (en) Rendering parameter determination method, device, equipment and storage medium
US20240087219A1 (en) Method and apparatus for generating lighting image, device, and medium
CN113546410B (en) Terrain model rendering method, apparatus, electronic device and storage medium
CN114297546A (en) Method for loading 3D model to realize automatic thumbnail generation based on WebGL
CN111530078B (en) Method and device for displaying insert vegetation in game, storage medium and electronic equipment
CN116681854A (en) Virtual city generation method and device based on target detection and building reconstruction
CN114037811B (en) 3D temperature field graph rendering method, apparatus, medium, and device based on directed distance field
CN114419219A (en) Rendering device and method based on three-dimensional virtual scene
CN113436307A (en) Mapping algorithm based on osgEarth image data to UE4 scene
JP3501479B2 (en) Image processing device
CN113093903A (en) Image display method and display equipment
JP3749373B2 (en) Two-dimensional display method of three-dimensional structure
JP2002298158A (en) Game information, information storage medium, and game system
US20240153159A1 (en) Method, apparatus, electronic device and storage medium for controlling based on extended reality

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