CN114082184A - Method and apparatus for creating a plane grid, computer storage medium, and electronic device - Google Patents
Method and apparatus for creating a plane grid, computer storage medium, and electronic device Download PDFInfo
- Publication number
- CN114082184A CN114082184A CN202110069776.9A CN202110069776A CN114082184A CN 114082184 A CN114082184 A CN 114082184A CN 202110069776 A CN202110069776 A CN 202110069776A CN 114082184 A CN114082184 A CN 114082184A
- Authority
- CN
- China
- Prior art keywords
- information
- position information
- planar
- grid
- creating
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 83
- 238000004364 calculation method Methods 0.000 claims abstract description 92
- 238000004590 computer program Methods 0.000 claims description 2
- 230000000694 effects Effects 0.000 abstract description 20
- 238000010586 diagram Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 3
- 238000005562 fading Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008092 positive effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/20—Drawing from basic elements, e.g. lines or circles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/40—Filling a planar surface by adding surface attributes, e.g. colour or texture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Processing Or Creating Images (AREA)
Abstract
The disclosure belongs to the technical field of computers, and relates to a method and a device for creating a planar grid, a computer storage medium and electronic equipment. The method comprises the following steps: acquiring size information of a virtual object in a virtual scene, and determining a plurality of calculation relations of the size information; and obtaining grid appearance information corresponding to the virtual object according to the size information and the plurality of calculation relations, and creating a plane grid according to the grid appearance information, wherein the plane grid is used for indicating the position of the virtual object in the virtual scene. In the method, on one hand, the creation of the plane grid is realized, the effect of indicating the position of the virtual object in the virtual scene is improved, and the experience degree of a user is further improved; on the other hand, different grid appearance information can be flexibly created according to the size information of different virtual objects, so that grids with different appearances can be obtained, the flexibility of the method for creating the plane grid is improved, and the application scene of creating the plane grid is enlarged.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for creating a planar mesh, a computer-readable storage medium, and an electronic device.
Background
With the development of computer technology, the AR (Augmented Reality) technology has been popularized and applied comprehensively, there is an application scene for detecting a plane in a real environment in the AR technology, and specifically, a virtual model needs to be placed in the detected plane for subsequent interaction with the virtual model.
In the related art, when the virtual model is hidden by other virtual models in the virtual scene, the virtual model and other virtual models hiding the virtual model are still rendered completely, and the relative position relationship between the virtual model and other virtual models cannot be shown.
In view of the above, there is a need in the art to develop a new method and apparatus for creating a planar mesh.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a method for creating a planar mesh, an apparatus for creating a planar mesh, a computer-readable storage medium, and an electronic device, thereby overcoming, at least to some extent, the problem of relative positions between a virtual object that cannot embody the virtual object and other virtual objects that occlude the virtual object due to limitations of the related art.
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 embodiments of the present invention, there is provided a method of creating a planar mesh, the method comprising: acquiring size information of a virtual object in a virtual scene, and determining a plurality of calculation relations of the size information; and obtaining grid appearance information corresponding to the virtual object according to the size information and the plurality of calculation relations, and creating a planar grid according to the grid appearance information, wherein the planar grid is used for indicating the position of the virtual object in the virtual scene.
In an exemplary embodiment of the present invention, the obtaining of the size information of the virtual object in the virtual scene includes: acquiring length information and width information of a virtual object; and comparing the length information with the width information to obtain a length comparison result, and determining the size information of the virtual object according to the length comparison result.
In an exemplary embodiment of the present invention, the plurality of calculation relationships includes a first calculation relationship, a second calculation relationship, and a third calculation relationship; the determining a plurality of calculated relationships for the dimensional information includes: determining the first calculation relation according to the size information and a first threshold and a second threshold corresponding to the size information; carrying out integral calculation on the size information to determine the second calculation relationship; calculating row and column information according to the first calculation relationship, and calculating according to the first threshold value and the row and column information to determine the third calculation relationship.
In an exemplary embodiment of the present invention, after the creating the planar mesh according to the mesh appearance information, the method further includes: acquiring first central position information corresponding to the virtual object and acquiring second central position information corresponding to the planar grid; and adjusting the second center position information according to the first center position information and the second center position information.
In an exemplary embodiment of the present invention, the adjusting the second center position information according to the first center position information and the second center position information includes: acquiring third central position information of the virtual object, and calculating a moving distance between the first central position information and the third central position information; and comparing the moving distance with a preset distance threshold to obtain a distance comparison result, and adjusting the second center position information according to the distance comparison result and the second center position information.
In an exemplary embodiment of the present invention, the adjusting the second center position information according to the distance comparison result and the second center position information includes: if the distance comparison result is that the moving distance is greater than the preset distance threshold, calculating the second center position information to adjust the second center position information; or if the distance comparison result shows that the moving distance is smaller than or equal to the preset distance threshold, keeping the second center position information.
In an exemplary embodiment of the invention, the calculating the second center position information to adjust the second center position information includes: acquiring the current moving direction of the virtual object, and calculating the distance between the first central position information and the moved first central position information to obtain moving distance information; and calculating the movement distance information to obtain the grid movement distance of the plane grid, and calculating the second central position information and the grid movement distance to obtain the adjusted second central position information.
In an exemplary embodiment of the present invention, after the creating the planar mesh according to the mesh appearance information, the method further includes: acquiring a plurality of color adjustment modes corresponding to the planar grid, and acquiring a plurality of priorities corresponding to the plurality of color adjustment modes; and determining one of the color adjustment modes as a target color adjustment mode according to the priorities, and updating the color information of the planar grid according to the target color adjustment mode.
In an exemplary embodiment of the present invention, the target color adjustment manner is a first color adjustment manner; the updating the color information of the planar grid according to the target color adjustment mode includes: acquiring other position information except second center position information, and calculating the second center position information and the other position information to obtain a position calculation result; determining a parameter range corresponding to the first color adjustment mode, and determining a first target parameter value in the parameter range according to the position calculation result; and updating the color information of the plane grid according to the first target parameter value.
In an exemplary embodiment of the present invention, the target color adjustment manner is a second color adjustment manner; the updating the color information of the planar grid according to the target color adjustment mode includes: determining a target node in the planar grid according to the current moving direction, and acquiring a color calculation relation corresponding to the second color adjustment mode; and updating the color information of the target node within preset time according to the color calculation relation.
In an exemplary embodiment of the present invention, the target color adjustment manner is a third color adjustment manner; the updating the color information of the planar grid according to the target color adjustment mode includes: acquiring a first angle value corresponding to the current moving direction, and acquiring node position information of the planar grid; determining a second angle value corresponding to the node position information, and calculating an angle difference between the first angle value and the second angle value; determining an angle range corresponding to the third color adjustment mode, and acquiring a second target parameter value corresponding to the angle range;
according to a second aspect of embodiments of the present invention, there is provided an apparatus for creating a planar grid, the apparatus comprising: a determination module configured to obtain size information of a virtual object in the virtual scene and determine a plurality of calculation relationships of the size information; a creating module configured to obtain mesh appearance information corresponding to the virtual object according to the size information and the plurality of calculation relationships, and create a planar mesh according to the mesh appearance information, wherein the planar mesh is used for indicating a position of the virtual object in the virtual scene.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus including: a processor and a memory; wherein the memory has stored thereon computer readable instructions which, when executed by the processor, implement the method of creating a planar grid of any of the above exemplary embodiments.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of creating a planar mesh in any of the above-described exemplary embodiments.
As can be seen from the foregoing technical solutions, the method for creating a planar grid, the apparatus for creating a planar grid, the computer storage medium and the electronic device in the exemplary embodiments of the present invention have at least the following advantages and positive effects:
in the method and the device provided by the exemplary embodiment of the disclosure, on one hand, the creation of the planar grid is realized, the effect of indicating the position of the virtual object in the virtual scene is improved, and further the experience degree of the user is improved; on the other hand, different appearance information can be flexibly created according to the size information of different virtual objects, so that grids with different appearances are obtained, the flexibility of the method for creating the plane grids is improved, and the application scene of creating the plane grids is enlarged.
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 schematically illustrates a flow diagram of a method of creating a planar mesh in an embodiment of the disclosure;
fig. 2 schematically illustrates a flowchart of acquiring size information of a virtual object in a virtual scene in an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart for determining a plurality of calculated relationships for dimensional information in an embodiment of the present disclosure;
FIG. 4 schematically illustrates a diagram of a created planar grid, in particular in an embodiment of the present disclosure;
fig. 5 schematically illustrates a flow chart of adjusting the second center position information in the embodiment of the present disclosure;
fig. 6 schematically illustrates a flow chart of adjusting the second center position information in the embodiment of the present disclosure;
fig. 7 schematically illustrates a flow chart of adjusting the second center position information in the embodiment of the present disclosure;
fig. 8 schematically illustrates a flow chart for adjusting the second center position information in the embodiment of the present disclosure;
FIG. 9 is a schematic flow chart illustrating adjustment of color information of a planar grid in an embodiment of the present disclosure;
FIG. 10 is a schematic flow chart illustrating adjustment of color information of a planar grid in an embodiment of the present disclosure;
fig. 11 schematically illustrates parameter ranges corresponding to a first color adjustment manner in an embodiment of the present disclosure;
FIG. 12 is a schematic flow chart illustrating adjustment of color information of a planar grid according to an embodiment of the present disclosure;
fig. 13 schematically illustrates a color calculation relationship corresponding to the second calculation relationship in the embodiment of the present disclosure;
fig. 14 schematically illustrates an effect diagram of adjusting color information of a target node according to the color calculation relationship illustrated in fig. 13 in the embodiment of the present disclosure;
FIG. 15 is a diagram that schematically illustrates an effect of implementing a target node fade-in and fade-out according to a current direction in an embodiment of the present disclosure;
FIG. 16 is a schematic flow chart illustrating adjustment of color information of a planar grid according to an embodiment of the present disclosure;
FIG. 17 schematically illustrates a schematic diagram of determining a first angle value and a second angle value in an embodiment of the present disclosure;
FIG. 18 schematically illustrates a calculated relationship of an angular range to a second target parameter value in an embodiment of the present disclosure;
FIG. 19 is a schematic flow chart illustrating the creation of a planar mesh in an application scenario in an embodiment of the present disclosure;
fig. 20 is a schematic structural diagram of an apparatus of a method for creating a planar grid in an embodiment of the present disclosure;
FIG. 21 schematically illustrates an electronic device for a method of creating a planar grid in an embodiment of the disclosure;
fig. 22 schematically illustrates a computer-readable storage medium for a method of creating a planar grid in an embodiment of the 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 subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. 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.; the terms "first" and "second", etc. are used merely as labels, and are not limiting on the number of their objects.
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.
To address the problems in the related art, the present disclosure proposes a method of creating a planar mesh. Fig. 1 shows a flow diagram of a method for creating a planar grid, as shown in fig. 1, the method for creating a planar grid includes at least the following steps:
step S110, size information of the virtual object in the virtual scene is obtained, and a plurality of calculation relations of the size information are determined.
And S120, obtaining grid appearance information corresponding to the virtual object according to the size information and the plurality of calculation relations, and creating a plane grid according to the grid appearance information, wherein the plane grid is used for indicating the position of the virtual object in the virtual scene.
In the method and the device provided by the exemplary embodiment of the disclosure, on one hand, the creation of the planar grid is realized, the effect of indicating the position of the virtual object in the virtual scene is improved, and further the experience degree of the user is improved; on the other hand, different appearance information can be flexibly created according to the size information of different virtual objects, so that grids with different appearances are obtained, the flexibility of the method for creating the plane grids is improved, and the application scene of creating the plane grids is enlarged.
The steps of the method of creating a planar mesh are described in detail below.
In step S110, size information of the virtual object in the virtual scene is acquired, and a plurality of calculation relationships of the size information is determined.
In an exemplary embodiment of the present disclosure, the virtual scene refers to an environment where the virtual object is located, and the virtual scene may be a virtual scene in a game, may be a virtual scene in an animation, may be a flight scene when a flight environment is simulated, and may also be a driving scene when a vehicle is driven, which is not particularly limited in this exemplary embodiment. It is worth mentioning that the virtual scene may be any scene implemented by applying AR technology.
The virtual object refers to an object in a virtual scene, which is controlled by a user through an AR technology, and the virtual object may be a game character, an airplane, an automobile, or an object that can be controlled by any user in the virtual scene.
The size information refers to one of length information and width information of the virtual object, and for example, if the length information and the width information of the virtual object are 20 and 10, respectively, the size information refers to length information corresponding to 20.
The plurality of calculation relationships refer to a plurality of calculation relationships related to the size information.
For example, if the virtual scene is a game scene and the virtual object is a game character in the game scene, the size information of the acquired virtual object may be the width information 10 of the virtual object. A plurality of calculation relationships corresponding to the width information are acquired, and the plurality of calculation relationships include the size information 10.
In an alternative embodiment, fig. 2 shows a schematic flowchart of obtaining size information of a virtual object in a virtual scene, and as shown in fig. 2, the method at least includes the following steps: in step S210, length information and width information of the virtual object are acquired.
The virtual object can be replaced by a bounding box, the bounding box can be a cube or a cuboid, the length information refers to the length value of the bounding box, and the width information refers to the width value of the bounding box.
Wherein the bounding box is a cube with a slightly larger volume and simple characteristics, and the purpose is to approximately replace a complex collection object. For example, a slightly larger cube may be used to approximate the replacement virtual object.
Or, a cube which can replace the virtual object can be calculated by a certain algorithm, the length information refers to the length value of the cube, and the width information refers to the width value of the cube.
For example, if the bounding box of the substitute virtual object is a cuboid, the length and width of the cuboid are 20 and 10, respectively. At this time, the length information of the acquired virtual object is 20, and the width information of the acquired virtual object is 10.
In step S220, the length information and the width information are compared to obtain a length comparison result, and the size information of the virtual object is determined according to the length comparison result.
And after the length information and the width information are acquired, comparing the length information and the width information to obtain a length comparison result, and determining the size information of the virtual object according to the length comparison result.
For example, the length information of the obtained virtual object is 20, the width information of the obtained virtual object is 10, and the length comparison result is obtained by comparing the length information and the width information.
In the exemplary embodiment, the size information of the virtual object is determined through the length comparison result, which is helpful for determining the grid appearance information of the planar grid according to the size information subsequently, so that the size of the planar grid is ensured to be adapted to the virtual object, and the situation that the planar grid is smaller than the virtual object is avoided.
In an alternative embodiment, fig. 3 shows a schematic flowchart of determining a plurality of calculation relations of the size information, as shown in fig. 3, the plurality of calculation relations include a first calculation relation, a second calculation relation, and a third calculation relation, and the method at least includes the following steps: in step S310, a first calculation relationship is determined based on the size information and the first and second thresholds corresponding to the size information.
The first threshold value is a minimum value that the size information can obtain, and the second threshold value is a maximum value that the size information can obtain.
The first calculation relationship refers to one calculation expression having a relationship with the size information.
For example, the size information obtained is LmaxThe first threshold corresponding to the size information is CminAnd the second threshold corresponding to the size information is CmaxThe first calculated relationship obtained may be formula (1).
Rcnt=Ccnt=count=Lmax×2+1,count∈[Cmin,Cmax] (1)
Wherein R iscntLine number information for a planar grid, CcntColumn number information of the plane grid. It should be noted that the row number information and the column number information may be equal, and the row number information and the column number information may also be unequal, which is not particularly limited in this exemplary embodiment. L ismaxAs size information, CminIs a first threshold value, CmaxIs the second threshold.
In step S320, the rounding calculation is performed on the size information to determine a second calculation relationship.
The second calculation relationship is obtained by performing an integral calculation on the size information.
For example, the second calculated relationship may be as shown in equation (2).
dint=floor(Lmax×0.1) (2)
Wherein d isintFor node spacing information of a planar grid, floor () is a floor function, e.g., floor (2.1) has a value of 2 and floor (2.7) has a value of 2. L ismaxIs the size information.
In step S330, the rank information is calculated according to the first calculation relationship, and a third calculation relationship is determined by calculation according to the first threshold and the rank information.
The row and column information refers to information of the number of rows and columns of the planar grid, and the row and column information may be an odd number value or an even number value, which is not particularly limited in this exemplary embodiment.
For example, the third calculated relationship may be as shown in equation (3).
S=(Rcnt-Cmin)/4.0+1 (3)
Wherein S isArea information of mesh nodes referring to a planar mesh, RcntLine number information for a planar grid, CminIs a first threshold of size information of the planar mesh.
In the exemplary embodiment, the determination of the plurality of calculation relationships with the size information is helpful for obtaining the mesh appearance information of the planar mesh through the plurality of calculation relationships with the size information in the following, so that the complexity of determining the planar mesh appearance information is reduced, and the speed of creating the planar mesh is further increased.
In step S120, mesh appearance information corresponding to the virtual object is obtained according to the size information and the plurality of calculation relationships, and a planar mesh is created according to the mesh appearance information, where the planar mesh is used to indicate a position of the virtual object in the virtual scene.
In this exemplary embodiment, the planar mesh refers to a mesh indicating a position of a virtual object in a virtual scene, and specifically, the planar mesh may be regarded as being formed by a plurality of mesh nodes, each mesh node has a certain size, a certain node distance is provided between the mesh nodes, and each mesh node has a cross-shaped line with a node center as an intersection. Based on this, in order to create the planar mesh, mesh node area information, mesh node pitch information, and mesh row and column information need to be acquired.
Therefore, the mesh appearance information refers to information required for creating a planar mesh, and the mesh appearance information may be row and column information of the mesh, node area information of the mesh, or node distance information of the mesh, which is not particularly limited in this exemplary embodiment.
For example, the row and column information, the node pitch information and the node area information of the planar grid obtained according to the plurality of calculation relations are 5, 2 and 1, respectively. Based on this, a five-row five-column planar grid is created with a circular node of area 1 at each row-column intersection and with a node spacing of 2.
Fig. 4 is a schematic diagram of a specific created planar grid, as shown in fig. 4, where 410 is a grid node in the planar grid, 420 is a row in the planar grid, 430 is a column in the planar grid, and d is node spacing information in the planar grid.
In an alternative embodiment, fig. 5 shows a schematic flow chart of adjusting the second center position information, and as shown in fig. 5, the method at least includes the following steps: in step S510, first center position information corresponding to the virtual object is acquired, and second center position information corresponding to the planar mesh is acquired.
The first center position information refers to a position where a center point of a bottom surface of a bounding box representing the virtual object is located, for example, the bounding box representing the virtual object is a rectangular parallelepiped, the width information of the rectangular parallelepiped is 10, and the length information of the rectangular parallelepiped is 10.
If the lower left corner of the bottom surface of the rectangular parallelepiped is the origin, the center point position information of the bottom surface of the rectangular parallelepiped may be (5, 5).
The second center position information is the position of the center point of the planar grid, for example, the length of the planar grid is 20, the width of the planar grid is 20, the left small corner of the planar grid is used as a dot, and the second center position information is (10, 10).
It is worth mentioning that the determination of the first center position information and the second center position information must be referred to the same origin.
For example, the virtual object is at the upper right corner of the planar grid, the length information of the virtual object is 20, the width information of the virtual object is 10, the length of the planar grid is 40, the width of the planar grid is 40, and with any point in the virtual scene as a dot, the first center position information of the virtual object can be determined to be (15, 5), and based on this, the second center position information of the planar grid obtained is (10, 10).
In step S520, the second center position information is adjusted according to the first center position information and the second center position information.
And adjusting the second central position information according to the first central position information and the second central position information.
For example, when the virtual object moves, the first center position information changes, and when the distance between the second center position information and the first center position information is greater than a preset distance threshold, the second center position information is adjusted.
In this exemplary embodiment, the second center position information may be adjusted according to the first center position information and the second center position information, so that the position of the planar mesh may change in real time according to the movement of the virtual object, and an effect of prompting the position of the virtual object in the virtual scene through the planar mesh is improved.
In an alternative embodiment, fig. 6 shows a schematic flow chart of adjusting the second center position information, and as shown in fig. 6, the method at least includes the following steps: in step S610, third center position information of the virtual object is acquired, and a movement distance between the first center position information and the third center position information is calculated.
The third center position information refers to a position of a center of the bottom surface of the virtual object bounding box after a section of movement, and the movement distance refers to a distance value between the first center position information and the third center position information.
For example, if the first center position information is PGoriThe third central position of the virtual object after moving a distance is PMcurThe distance between the first center position information and the third center position information, i.e., the movement distance, can be calculated by formula (4).
d(dx,dy)=PMcur-PGori (4)
Wherein d is coordinate information of the moving distance, specifically, dxA moving distance of the virtual object in comparison with the left and right directions, dyIs the moving distance of the virtual object compared with the up-down direction, PGoriFirst center position information, P, of a virtual object before movementMcurThird center position information of the moved virtual object.
In step S620, the moving distance is compared with a preset distance threshold to obtain a distance comparison result, and the second center position information is adjusted according to the distance comparison result and the second center position information.
The preset distance threshold refers to a critical value for determining whether the planar mesh needs to move, and the preset distance threshold may be half of the mesh node distance information, may also be twice of the mesh node distance information, and may also be an arbitrary value, which is not particularly limited in this exemplary embodiment.
The distance comparison result is a comparison result of the moving distance and the preset distance threshold, and obviously, there are three distance comparison results, namely, the moving distance is greater than the preset distance threshold, the moving distance is smaller than the preset distance threshold, and the moving distance is equal to the preset distance threshold.
For example, if the moving distance is 5 and the preset distance threshold is 6, it is obvious that the distance comparison result at this time is that the moving distance is smaller than the preset distance threshold, at this time, the second center position information may not be changed, that is, the position of the plane grid is unchanged.
In the exemplary embodiment, the moving distance is compared with the preset distance threshold to obtain a distance comparison result, and the second center position information is adjusted according to the distance comparison result, that is, the information of the planar mesh is changed only when the virtual object moves to a certain distance, so that the effect of prompting the position of the virtual object in the virtual scene is ensured, and the performance loss is reduced.
In an alternative embodiment, fig. 7 shows a schematic flow chart of adjusting the second center position information, and as shown in fig. 7, the method at least includes the following steps: in step S710, if the distance comparison result indicates that the moving distance is greater than the predetermined distance threshold, the second center position information is calculated to adjust the second center position information.
And when the distance comparison result is that the moving distance is greater than the preset distance threshold, calculating the second center position information to adjust the second center position information.
For example, if the moving distance is greater than the preset distance threshold, the moving distance may be first calculated according to formula (5) to obtain the number of meshes that the planar mesh needs to move.
Wherein, IxNumber of meshes to be moved for planar meshes, dxA moving distance of the virtual object with respect to the left-right direction, dintFor mesh node spacing information for a planar mesh, the floor () function is a floor function.
And then adjusts the second center position information of the planar mesh according to equation (6).
CGcur=CGori+Ix×dint (6)
Wherein, CGcurFor the adjusted second center position information, CGoriFor the second center position information before adjustment, which is the same as the first center position information before movement of the virtual object, IxNumber of meshes to be moved for planar meshes, dintMesh node spacing information for a planar mesh.
In step S720, if the distance comparison result is that the moving distance is smaller than or equal to the predetermined distance threshold, the second center position information is maintained.
And if the distance comparison result is that the moving distance is smaller than or equal to the preset distance threshold, keeping the second center position information unchanged.
For example, the moving distance is 2, the preset distance threshold is 5, and the second center position information is (10, 10), and obviously, when the moving distance is smaller than the preset distance threshold, the second center position information is still (10, 10).
In the exemplary embodiment, different second center position information is obtained according to different distance comparison results, so that the logicality of the method is improved.
In an alternative embodiment, fig. 8 shows a schematic flow chart of adjusting the second center position information, and as shown in fig. 8, the method at least includes the following steps: in step S810, the current moving direction of the virtual object is obtained, and the distance between the first center position information and the moved first center position information is calculated to obtain the moving distance information.
The moving distance information refers to a distance between the first center position information and the moved first center position information.
For example, if the first center position information is PGoriThe first center position of the virtual object after moving a distance is PMcurThe distance between the first center position information and the shifted first center position information, that is, the shift distance, can be calculated by formula (7).
d(dx,dy)=PMcur-PGori (7)
Wherein d is coordinate information of the moving distance, specifically, dxA moving distance of the virtual object in comparison with the left and right directions, dyIs the moving distance of the virtual object compared with the up-down direction, PGoriFirst center position information, P, of a virtual object before movementMcurFirst center position information of the moved virtual object.
In step S820, the movement distance information is calculated to obtain the grid movement distance of the planar grid, and the second center position information and the grid movement distance are calculated to obtain the adjusted second center position information.
And the grid moving distance is the calculated grid number of the plane grid needing to be moved.
For example, the moving distance may be calculated according to equation (8) to obtain the number of meshes that the planar mesh needs to move.
Wherein, IxNumber of meshes to be moved for planar meshes, dxA moving distance of the virtual object with respect to the left-right direction, dintFor mesh node spacing information for a planar mesh, the floor () function is a floor function.
The second center position information of the planar mesh is then adjusted according to equation (9).
CGcur=CGori+Ix×dint (9)
Wherein, CGcurFor the adjusted second center position information, CGoriFor the second center position information before adjustment, which is the same as the first center position information before movement of the virtual object, IxNumber of meshes to be moved for planar meshes, dintMesh node spacing information for a planar mesh.
In the present exemplary embodiment, the second center position information is updated by a simple calculation relationship, the complexity of updating the second center position information is reduced, and the speed of determining the position of the planar mesh is increased.
In an alternative embodiment, fig. 9 shows a flow chart of adjusting color information of a planar grid, as shown in fig. 9, the method at least includes the following steps: in step S910, a plurality of color adjustment methods corresponding to the planar mesh are acquired, and a plurality of priorities corresponding to the plurality of color adjustment methods are acquired.
The color adjustment manner refers to a manner of adjusting color information of a mesh node in a planar mesh, and the content of the adjustment may be transparency of the planar mesh node, color of the planar mesh node, or an RGB (Red Green Blue ) value of the planar mesh node, which is not particularly limited in this exemplary embodiment.
The priority refers to information corresponding to an execution order of the plurality of color adjustment modes, and specifically, when the plurality of color adjustment modes can adjust the color information of the same mesh node, a color adjustment mode with a high priority is selected as the color adjustment mode for adjusting the mesh node.
For example, there are three color adjustment modes that can adjust the mesh nodes, which are color adjustment mode a, color adjustment mode B, and color adjustment mode C. It can be obtained that the priority corresponding to the color adjustment mode a is 1, the priority corresponding to the color adjustment mode B is 2, and the priority corresponding to the color adjustment mode C is 3.
In step S920, one of the color adjustment modes is determined as a target color adjustment mode according to the priorities, and the color information of the planar mesh is updated according to the target color adjustment mode.
The target color adjustment method is one of the plurality of color adjustment methods, and the priority level corresponding to the target color adjustment method is higher than the priority level of the other color adjustment methods of the plurality of color adjustment methods.
The color information refers to information related to a color of a mesh node of the planar mesh, and the color information may be a transparency of the mesh node of the planar mesh, a color value of the mesh node of the planar mesh, or an RGB value of the mesh node of the planar mesh, which is not particularly limited in this exemplary embodiment.
For example, the color information is the transparency of the plane mesh, and there are three color adjustment modes, specifically, the adjustment mode with the highest priority is the color adjustment mode a among the multiple color adjustment modes, and at this time, the color adjustment mode a is the target color adjustment mode.
And after the target color adjusting mode is determined, adjusting the transparency of the grid nodes of the plane grid according to the target color adjusting mode.
In the present exemplary embodiment, there are a plurality of color adjustment manners that adjust the color information of the planar mesh, and the target color adjustment manner that finally adjusts the color information of the planar mesh is determined according to the priority of the color adjustment manners, increasing the flexibility in determining the color adjustment manner. In different scenes, different target color adjustment modes can be determined by changing the priority of the color adjustment modes, and the application scene of creating the planar grid is expanded.
In an alternative embodiment, fig. 10 is a schematic flow chart illustrating a process of adjusting color information of a planar grid, as shown in fig. 10, where a target color adjustment mode is a first color adjustment mode, and the method at least includes the following steps: in step S1010, position information other than the second center position information is acquired, and the second center position information and the position information are calculated to obtain a position calculation result.
The first color adjustment mode is one of a plurality of color adjustment modes.
The second central position information is the position of the central grid node in the planar grid, and the other position information refers to the position information of the other grid nodes in the planar grid except the central grid node.
The position calculation result refers to a distance value between the second center position information and other position information.
For example, if the second center position information is Pc(Pcx,Pcy) Any one of the other position information may be Pn(Pnx,Pny) The second center position information and the other position information may be calculated according to formula (10) to obtain the position calculation result.
Where d is the position calculation result, PcxInformation of abscissa as information of second center position, PcyIs ordinate information of the second center position, PnxInformation of abscissa as other position information, PnyAnd is ordinate information of other position information.
In step S1020, a parameter range corresponding to the first color adjustment mode is determined, and a first target parameter value is determined within the parameter range according to the position calculation result.
The parameter range refers to a value range of the color information corresponding to the first color adjustment mode. The first target parameter value refers to a value of color information corresponding to other position information.
For example, fig. 11 shows the parameter range corresponding to the first color adjustment mode, as shown in fig. 11, wherein the abscissa represents the position calculation result, dminFor the minimum in the position calculation result, dmaxThe maximum value in the position calculation results.
The ordinate represents the first target parameter value corresponding to the position calculation result, and thus it can be seen that the parameter range corresponding to the first color adjustment manner is [0.05, 0.8 ].
If d in FIG. 11minIs 1, dmaxAt 5, the calculation relationship between the position calculation result and the first target parameter value can be determined as equation (11) from the two points (10.8), (50.05).
y=-0.1875x+0.9875 (11)
Wherein y is a first target parameter value, x is a position calculation result, and the first target parameter value corresponding to the position calculation result can be obtained according to the formula (11). Assuming that the position calculation result is 2 at this time, the corresponding obtained first target parameter value is 0.6125.
In step S1030, the color information of the planar mesh is updated in accordance with the first target parameter value.
And updating the color information of the plane grid according to the first target parameter value.
For example, the obtained position calculation result corresponding to the other position information is 2, and the corresponding obtained first target parameter value is 0.6125. The color information is transparency information, and at this time, the transparency value of the mesh node of the planar mesh corresponding to the other position information is adjusted to 0.6125.
In the exemplary embodiment, the determined first color adjustment mode is related to the position calculation result, so that the distance between the grid node and the center point of the grid can be known according to different color information of the grid node, the effect of prompting the position of the virtual object in the virtual scene is more obvious, and the experience degree of a user is optimized.
In an alternative embodiment, fig. 12 is a schematic flow chart of adjusting color information of a planar grid, as shown in fig. 12, a target color adjustment mode is a second color adjustment mode, and the method at least includes the following steps: in step S1210, a target node is determined in the planar grid according to the current moving direction, and a color calculation relationship corresponding to the second color adjustment manner is obtained.
The second color adjustment mode is one of the color adjustment modes.
The current moving direction refers to a current moving direction of the virtual object, and the moving direction may be an angle value or may be in a text form, which is not particularly limited in this exemplary embodiment.
The target node is a grid node in the planar grid which needs to adjust the color information and is determined according to the current moving direction.
The color calculation relationship may be that the transparency of the mesh nodes is adjusted to 1 and then adjusted to 0 to achieve a flickering effect, or that the transparency of one part of the target nodes is adjusted to 1 and the transparency of the other part of the target nodes is adjusted to 0 to achieve a fade-in and fade-out effect.
For example, if the current moving direction of the virtual object is the front direction and the currently displayed grid in the planar grid is five rows and five columns, the target node acquired at this time may be a grid node on the first row in the displayed five rows and five columns.
FIG. 13 is a color calculation relationship corresponding to a second calculation relationship, as shown in FIG. 13, where t is time, a is a value of transparency, and t is a value of transparencymaxThe preset time may be any time value for the preset time, and this exemplary embodiment is not particularly limited in this respect.
For example, the created planar grid is actually a planar grid with seven rows and seven columns, but the transparency values of the grid nodes in the first row, the first column, the seventh row and the seventh column are adjusted to 0 during the display process, and the transparency values of the grid nodes in the remaining rows and columns are adjusted to 1, so that the fading effect can be realized when the planar grid moves.
If the current moving direction of the virtual object is the right front direction and the currently displayed grid in the planar grid is five rows and five columns, the target nodes acquired at this time may be a plurality of grid nodes in the first row, the seventh row, the first column and the seventh column which are not displayed.
The color adjustment manner corresponding to the second color calculation relationship may be to adjust the transparency of the grid nodes in the first row and the seventh column to 1 within a preset time, and adjust the transparency of the grid nodes in the first column and the seventh row to 0 within a preset time, so as to achieve a fade-in and fade-out effect.
In step S1220, the color information of the target node is updated within a preset time according to the color calculation relationship.
And adjusting the color information of the target node according to the color calculation relationship in the preset time.
For example, fig. 14 is an effect diagram of adjusting the color information of the target node according to the color calculation relationship shown in fig. 13, as shown in fig. 14, wherein the created planar grid is a planar grid with seven rows and seven columns, and in actual reality, the transparency of the grid nodes in the first row, the seventh row, the first column and the seventh column is adjusted to 0.
If t in FIG. 13maxFor 10s, the transparency of the target node on 1460 is slowly adjusted to 1 within 0s to 5s and the transparency of the target node on 1460 is slowly adjusted to 0 within 5s to 10s according to the color calculation relationship shown in fig. 13, so that a flicker effect of transparency once is performed by the edge node in the moving direction when the virtual object moves.
For example, fig. 15 is a diagram of an effect of implementing a fade-in and fade-out of a target node according to a current direction, as shown in fig. 15, where the created planar grid is a planar grid with seven rows and seven columns, in an actual reality, transparency of grid nodes in the first row, the seventh row, the first column, and the seventh column is adjusted to be 0, 1510 is a virtual object before movement, 1520 is the planar grid before movement, 1530 is the virtual object after movement, and an arrow 1540 is a process of displaying the fade-in and fade-out effect.
Also, in fig. 15, the current moving direction is the upper right, the value of the transparency of the 3 rd to 7 th mesh nodes in the seventh row and the 1 st to 5 th mesh nodes in the seventh column is adjusted to 1 within a preset time, and the value of the transparency of the 2 nd to 6 th mesh nodes in the sixth row and the 2 nd to 6 th mesh nodes in the second column is adjusted to 0, so as to achieve an effect of fading in and out when the virtual object moves.
In the exemplary embodiment, the color information of the grid nodes is adjusted according to the second color adjustment mode, so that not only the position of the virtual object in the virtual scene can be prompted to the user, but also the current moving direction of the virtual object can be prompted to the user, and the experience degree of the user is improved.
In an alternative embodiment, fig. 16 is a schematic flow chart of adjusting color information of a planar grid, as shown in fig. 16, a target color adjustment mode is a third color adjustment mode, and the method at least includes the following steps: in step S1610, a first angle value corresponding to the current moving direction is acquired, and node position information of the planar mesh is acquired.
The first angle value refers to an angle value of an included angle between the current moving direction and a front direction in the virtual scene. The node position information indicates information of a position where the grid node is located, and the node position information may be in a two-dimensional coordinate form or a longitude and latitude form, which is not particularly limited in this exemplary embodiment.
For example, assuming that the true south direction in the virtual scene is the front direction in the virtual scene, the current moving direction of the virtual object is obtained at this time, and the angle value between the current moving direction and the true south direction in the virtual scene is the first angle value corresponding to the current moving direction.
The position information of the grid nodes is obtained, specifically, the position of the center node in the grid nodes, that is, the second center position information, may be set as the origin of coordinates, the current moving direction of the virtual object is the X-axis direction of the coordinates, the direction perpendicular to the X-axis is the Y-coordinate direction, and if the grid spacing information of the planar grid is 2, the node position information of the grid adjacent to the second center position is (2, 0), (-2, 0), (0, 2) and (0, -2), and similarly, the node position information of other planar grids is analogized.
In step S1620, a second angle value corresponding to the node position information is determined, and an angle difference value between the first angle value and the second angle value is calculated.
The second angle value refers to an angle value of a connecting line of the second center position information and the node position information compared with a front direction in the virtual scene, and the angle difference value refers to an absolute value of a difference value between the first angle and the second angle.
For example, fig. 17 is a schematic diagram of determining a first angle value and a second angle value, as shown in fig. 17, wherein an arrow 1710 is a current moving direction of a virtual object, a-Z axis is a front direction in a virtual scene, and a + X axis is a direction perpendicular to the-Z axis, so that the determined first angle value is 0 °.
If the second angle value is an angle value corresponding to a grid node in the fourth column of the second row in fig. 17, the angle a is the second angle value, and the second angle value is 45 °. Since the first angle value is 0, the angle difference and the second angle value are equal to 45 ° at this time.
In step S1630, an angle range corresponding to the third color adjustment manner is determined, and a second target parameter value corresponding to the angle range is acquired.
The third color adjustment mode is one of a plurality of color adjustment modes, and the angle range refers to a value range of an angle difference value in the third color adjustment mode. The second target parameter is a color information value corresponding to any one of the angle difference values within the angle difference value range.
For example, fig. 18 is a calculation relationship between the angle range and the second target parameter value, as shown in fig. 18, wherein the abscissa represents the angle difference value, and the ordinate represents the second target parameter value, and the specific second target parameter value may be a transparency value of a mesh node in the planar mesh.
Specifically, when the angle range is 0 ° to 30 °, the value range of the transparency of the grid node is 1 to 0.5; when the angle range is 30-90 degrees, the value range of the transparency of the grid nodes is 0.5-0.1; when the angle range is 90-150 degrees, the value range of the transparency of the grid nodes is 0.2-0; when the angle range is 150 degrees to 180 degrees, the transparency of the grid node takes a value of 0.
In step S1640, the color information of the planar mesh is updated according to the second target parameter value.
And updating the position information of the plane grid according to the obtained second target parameter value.
For example, as shown in fig. 18, if the angle difference is 30 °, the second target parameter value corresponding to the angle difference is 0.5, that is, the transparency value is 0.5, and at this time, the transparency value of the mesh node corresponding to the angle difference of 30 ° is updated to 0.5.
In the exemplary embodiment, the color information of the grid nodes is updated according to the angle difference, so that not only the position of the virtual object in the virtual scene is prompted to the user, but also the effect of prompting the current moving direction of the virtual object is increased, and the experience degree of the user is improved.
Fig. 19 is a flowchart showing a process of creating a planar mesh in an application scenario, in which step 1910 is a process of creating a planar mesh, step 1920 is a process of calculating a position of a planar mesh, step 1930 is a process of calculating color information of a mesh node according to a first color adjustment manner, step 1940 is a process of calculating color information of a mesh node according to a second color adjustment manner, step 1950 is a process of calculating color information of a mesh node according to a third color adjustment manner, step 1960 is a process of determining a target color adjustment manner according to priorities of a plurality of color adjustment manners, and step 1970 is a process of updating a position and color information of a planar mesh according to steps 1920 and 1970.
Specifically, in step 1910, size information of the virtual object is obtained, a plurality of calculation relationships corresponding to the size information are determined, appearance information of the planar mesh is obtained according to the plurality of calculation relationships based on the size information, and the planar mesh is framed according to the appearance information.
When the virtual object starts to move, the planar mesh appears, and when the distance that the virtual object moves reaches a preset distance threshold, the second center position information of the planar mesh is adjusted according to formula (12), formula (13), and formula (14).
d(dx,dy)=PMcur-PGori (12)
CGcur=CGori+Ix×dint (14)
Where d is coordinate information of the moving distance, specifically, dx is the moving distance of the virtual object in the left-right direction, dx is the moving distance of the virtual object in the up-down direction, PGoriInformation on the center position of the virtual object before movement, PMcurIs the center position information of the moved virtual object.
Ix is the number of grids that the planar grid needs to move, dxA moving distance of the virtual object with respect to the left-right direction, dintFor node spacing information of a planar grid, the floor () function is a downward integer.
CGcurFor the adjusted second center position information, CGoriFor the second center position information before adjustment, which is the same as the first center position information before movement of the virtual object, IxNumber of meshes to be moved for planar meshes, dimMesh node spacing information for a planar mesh.
Meanwhile, after the color information of the mesh node is calculated through the steps S1930, S1940, and S1950, and three pieces of color information are calculated, respectively, the priority corresponding to each color adjustment manner is acquired, the target color adjustment manner is determined according to the priority, and the corresponding color information is calculated according to the target color adjustment manner in the step S1960.
After the position of the planar mesh and the color information of the planar mesh are determined through steps S1920 and S1960, the position of the planar mesh and the color information are updated.
In the application scene, on one hand, the creation of the plane grid is realized, the effect of indicating the position of the virtual object in the virtual scene is improved, and the experience degree of a user is further improved; on the other hand, different appearance information can be flexibly created according to the size information of different virtual objects, so that grids with different appearances are obtained, the flexibility of the method for creating the plane grids is improved, and the application scene of creating the plane grids is enlarged.
Further, in an exemplary embodiment of the present disclosure, an apparatus for creating a planar mesh is also provided. Fig. 20 is a schematic structural diagram of an apparatus for creating a planar grid, and as shown in fig. 20, an apparatus 2000 for creating a planar grid may include: a determination module 2010 and a creation module 2020. Wherein:
the determining module 2010 is configured to obtain size information of a virtual object in the virtual scene and determine a plurality of calculation relationships of the size information; a creating module 2020 configured to obtain mesh appearance information corresponding to the virtual object according to the size information and the plurality of calculation relationships, and create a planar mesh according to the mesh appearance information, where the planar mesh is used to indicate a position of the virtual object in the virtual scene.
The details of the above-mentioned device 2000 for creating a planar mesh have been described in detail in the corresponding method for creating a planar mesh, and therefore are not described herein again.
It should be noted that although in the above detailed description reference is made to several modules or units of the apparatus 2000 creating a planar grid, such 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.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
An electronic device 2100 according to such an embodiment of the invention is described below with reference to fig. 21. The electronic device 2100 illustrated in fig. 21 is only an example and should not limit the functionality or scope of use of embodiments of the present invention.
As shown in fig. 21, the electronic device 2100 is in the form of a general purpose computing device. The components of the electronic device 2100 may include, but are not limited to: the at least one processing unit 2110, the at least one memory unit 2120, the bus 2130 connecting the various system components (including the memory unit 2120 and the processing unit 2110), the display unit 2140.
Wherein the storage unit stores program code, which may be executed by the processing unit 2110 for causing the processing unit 2110 to perform steps according to various exemplary embodiments of the present invention as described in the "exemplary methods" section above in this specification.
The memory unit 2120 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)2121 and/or a cache memory unit 2122, and may further include a read only memory unit (ROM) 2123.
The electronic device 2100 may also communicate with one or more external devices 2170 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 2100, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 2100 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 2150. Also, the electronic device 2100 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 2160. As shown, the network adapter 2160 communicates with other modules of the electronic device 2100 via the bus 2130. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 2100, 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.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when said program product is run on the terminal device.
Referring to fig. 22, a program product 2200 for implementing the above method according to an embodiment of the present invention 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 invention is not limited in this regard and, in the present 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 disk, 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 aspects of the present invention 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).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure 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 within 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 (14)
1. A method of creating a planar mesh, the method comprising:
acquiring size information of a virtual object in a virtual scene, and determining a plurality of calculation relations of the size information;
and obtaining grid appearance information corresponding to the virtual object according to the size information and the plurality of calculation relations, and creating a planar grid according to the grid appearance information, wherein the planar grid is used for indicating the position of the virtual object in the virtual scene.
2. The method for creating a planar mesh according to claim 1, wherein said obtaining size information of a virtual object in the virtual scene comprises:
acquiring length information and width information of a virtual object;
and comparing the length information with the width information to obtain a length comparison result, and determining the size information of the virtual object according to the length comparison result.
3. The method of creating a planar grid according to claim 1, wherein the plurality of computational relationships includes a first computational relationship, a second computational relationship, and a third computational relationship;
the determining a plurality of calculated relationships for the dimensional information includes:
determining the first calculation relation according to the size information and a first threshold and a second threshold corresponding to the size information;
carrying out integral calculation on the size information to determine the second calculation relationship;
calculating row and column information according to the first calculation relationship, and calculating according to the first threshold value and the row and column information to determine the third calculation relationship.
4. The method of creating a planar mesh according to claim 1, wherein after creating a planar mesh according to the mesh appearance information, the method further comprises:
acquiring first central position information corresponding to the virtual object and acquiring second central position information corresponding to the planar grid;
and adjusting the second center position information according to the first center position information and the second center position information.
5. The method of creating a planar grid according to claim 4, wherein said adjusting the second center position information according to the first center position information and the second center position information comprises:
acquiring third central position information of the virtual object, and calculating a moving distance between the first central position information and the third central position information;
and comparing the moving distance with a preset distance threshold to obtain a distance comparison result, and adjusting the second center position information according to the distance comparison result and the second center position information.
6. The method of creating a planar grid according to claim 5, wherein said adjusting the second center position information according to the distance comparison result and the second center position information comprises:
if the distance comparison result is that the moving distance is greater than the preset distance threshold, calculating the second center position information to adjust the second center position information; or
And if the distance comparison result shows that the moving distance is smaller than or equal to the preset distance threshold, maintaining the second center position information.
7. The method of creating a planar grid according to claim 6, wherein said calculating the second centering information to adjust the second centering information comprises:
acquiring the current moving direction of the virtual object, and calculating the distance between the first central position information and the moved first central position information to obtain moving distance information;
and calculating the movement distance information to obtain the grid movement distance of the plane grid, and calculating the second central position information and the grid movement distance to obtain the adjusted second central position information.
8. The method of creating a planar mesh according to claim 1, wherein after creating a planar mesh according to the mesh appearance information, the method further comprises:
acquiring a plurality of color adjustment modes corresponding to the planar grid, and acquiring a plurality of priorities corresponding to the plurality of color adjustment modes;
and determining one of the color adjustment modes as a target color adjustment mode according to the priorities, and updating the color information of the planar grid according to the target color adjustment mode.
9. The method of creating a planar grid according to claim 4, wherein the target color adjustment is a first color adjustment;
the updating the color information of the planar grid according to the target color adjustment mode includes:
acquiring other position information except second center position information, and calculating the second center position information and the other position information to obtain a position calculation result;
determining a parameter range corresponding to the first color adjustment mode, and determining a first target parameter value in the parameter range according to the position calculation result;
and updating the color information of the plane grid according to the first target parameter value.
10. The method of creating a planar grid according to claim 7, wherein the target color adjustment is a second color adjustment;
the updating the color information of the planar grid according to the target color adjustment mode includes:
determining a target node in the planar grid according to the current moving direction, and acquiring a color calculation relation corresponding to the second color adjustment mode;
and updating the color information of the target node within preset time according to the color calculation relation.
11. The method of creating a planar grid according to claim 7, wherein the target color adjustment is a third color adjustment;
the updating the color information of the planar grid according to the target color adjustment mode includes:
acquiring a first angle value corresponding to the current moving direction, and acquiring node position information of the planar grid;
determining a second angle value corresponding to the node position information, and calculating an angle difference between the first angle value and the second angle value;
determining an angle range corresponding to the third color adjustment mode, and acquiring a second target parameter value corresponding to the angle range;
and updating the color information of the plane grid according to the second target parameter value.
12. An apparatus for creating a planar mesh, comprising:
a determination module configured to obtain size information of a virtual object in the virtual scene and determine a plurality of calculation relationships of the size information;
a creating module configured to obtain mesh appearance information corresponding to the virtual object according to the size information and the plurality of calculation relationships, and create a planar mesh according to the mesh appearance information, wherein the planar mesh is used for indicating a position of the virtual object in the virtual scene.
13. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of creating a planar grid of any of claims 1-11 via execution of the executable instructions.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of creating a planar mesh of any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110069776.9A CN114082184A (en) | 2021-01-19 | 2021-01-19 | Method and apparatus for creating a plane grid, computer storage medium, and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110069776.9A CN114082184A (en) | 2021-01-19 | 2021-01-19 | Method and apparatus for creating a plane grid, computer storage medium, and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114082184A true CN114082184A (en) | 2022-02-25 |
Family
ID=80295932
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110069776.9A Pending CN114082184A (en) | 2021-01-19 | 2021-01-19 | Method and apparatus for creating a plane grid, computer storage medium, and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114082184A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114693514A (en) * | 2022-03-28 | 2022-07-01 | 北京达佳互联信息技术有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
CN114782642A (en) * | 2022-04-08 | 2022-07-22 | 珠海金山数字网络科技有限公司 | Virtual model placing method and device |
CN119536520A (en) * | 2024-11-08 | 2025-02-28 | 北京沃东天骏信息技术有限公司 | Internal structure display method, device and display equipment of virtual controlled object |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108171797A (en) * | 2017-12-05 | 2018-06-15 | 北京像素软件科技股份有限公司 | Mesh generation method and device |
CN108211354A (en) * | 2017-12-29 | 2018-06-29 | 网易(杭州)网络有限公司 | The generation method and device of virtual resource in 3D scene of game |
CN109791442A (en) * | 2016-10-05 | 2019-05-21 | 奇跃公司 | Surface model building system and method |
CN110349267A (en) * | 2019-06-06 | 2019-10-18 | 阿里巴巴集团控股有限公司 | The construction method and device of three-dimensional temperature model |
CN111552374A (en) * | 2019-02-08 | 2020-08-18 | 达索系统三维软件公司 | System and method for pairing virtual objects with real-world environments |
-
2021
- 2021-01-19 CN CN202110069776.9A patent/CN114082184A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109791442A (en) * | 2016-10-05 | 2019-05-21 | 奇跃公司 | Surface model building system and method |
CN108171797A (en) * | 2017-12-05 | 2018-06-15 | 北京像素软件科技股份有限公司 | Mesh generation method and device |
CN108211354A (en) * | 2017-12-29 | 2018-06-29 | 网易(杭州)网络有限公司 | The generation method and device of virtual resource in 3D scene of game |
CN111552374A (en) * | 2019-02-08 | 2020-08-18 | 达索系统三维软件公司 | System and method for pairing virtual objects with real-world environments |
CN110349267A (en) * | 2019-06-06 | 2019-10-18 | 阿里巴巴集团控股有限公司 | The construction method and device of three-dimensional temperature model |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114693514A (en) * | 2022-03-28 | 2022-07-01 | 北京达佳互联信息技术有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
CN114782642A (en) * | 2022-04-08 | 2022-07-22 | 珠海金山数字网络科技有限公司 | Virtual model placing method and device |
CN119536520A (en) * | 2024-11-08 | 2025-02-28 | 北京沃东天骏信息技术有限公司 | Internal structure display method, device and display equipment of virtual controlled object |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114082184A (en) | Method and apparatus for creating a plane grid, computer storage medium, and electronic device | |
CN109771951B (en) | Game map generation method, device, storage medium and electronic equipment | |
CN113034662B (en) | Virtual scene rendering method and device, storage medium and electronic equipment | |
CN111481929B (en) | Virtual character information display method and device, electronic equipment and computer medium | |
WO2023173728A1 (en) | Graphic rendering method and apparatus, and storage medium | |
CN111127607A (en) | Animation generation method, device, equipment and medium | |
US9754423B2 (en) | System and method for rendering virtual contaminants | |
US12148095B2 (en) | Methods for a rasterization-based differentiable renderer for translucent objects | |
KR20160143936A (en) | Method for increasing 3D rendering performance and system thereof | |
CN116541110A (en) | Information presentation method, information presentation device, storage medium, and electronic apparatus | |
CN116193050A (en) | Image processing method, device, equipment and storage medium | |
JP2019121237A (en) | Program, image processing method and image processing device | |
CN111768480B (en) | Flame animation generation method and device, computer storage medium and electronic equipment | |
CN115619904A (en) | Image processing method, device and equipment | |
US9754408B2 (en) | System and method for modeling virtual contaminants | |
US20250245871A1 (en) | Method and System for Generating Images | |
EP3779865B1 (en) | Filling empty pixels | |
US11321889B1 (en) | Multi-layer lighting source with textured lighting gel layer | |
CN116310022A (en) | Flame special effect manufacturing method and device, storage medium and electronic equipment | |
CN116808577A (en) | Game map processing method and device, computer readable medium and electronic equipment | |
CN118365783A (en) | Eyeball high light generation method and device, computer storage medium and electronic equipment | |
CN119579763A (en) | Planetary atmosphere realization method, device and electronic equipment | |
CN117541704A (en) | Model map processing method and device, storage medium and electronic equipment | |
CN118115635A (en) | Scene model processing method and device, readable storage medium and electronic equipment | |
CN116912379A (en) | Scene picture rendering method and device, storage medium and electronic equipment |
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 |