CN111467799B - Coordinate conversion method and device, electronic equipment and storage medium - Google Patents

Coordinate conversion method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111467799B
CN111467799B CN202010324227.7A CN202010324227A CN111467799B CN 111467799 B CN111467799 B CN 111467799B CN 202010324227 A CN202010324227 A CN 202010324227A CN 111467799 B CN111467799 B CN 111467799B
Authority
CN
China
Prior art keywords
coordinate
height value
intersection point
determining
information
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
CN202010324227.7A
Other languages
Chinese (zh)
Other versions
CN111467799A (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 CN202010324227.7A priority Critical patent/CN111467799B/en
Publication of CN111467799A publication Critical patent/CN111467799A/en
Application granted granted Critical
Publication of CN111467799B publication Critical patent/CN111467799B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Pure & Applied Mathematics (AREA)
  • Multimedia (AREA)
  • Computational Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Algebra (AREA)
  • Computer Graphics (AREA)
  • Databases & Information Systems (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a coordinate conversion method, a coordinate conversion device, electronic equipment and a storage medium, wherein a graphical user interface is provided through first terminal equipment, and the content displayed by the graphical user interface comprises a virtual scene; the method comprises the following steps: acquiring a first coordinate; the first coordinate is a position point located on the display component; determining vector information based on the first coordinates; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene; determining intersection point information corresponding to a plurality of reference planes and a first height value corresponding to the intersection point information; determining a second coordinate according to the intersection point information and a first height value corresponding to the intersection point information; the second coordinate is a position point located in the virtual scene. The embodiment of the invention can improve the accuracy of converting the first coordinate into the second coordinate.

Description

Coordinate conversion method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of game technologies, and in particular, to a coordinate transformation method and apparatus, an electronic device, and a storage medium.
Background
The intelligent terminal can be configured with game programs, applications and the like, and a user can play games through the intelligent terminal.
During the game, a user can determine a screen coordinate at a terminal display component (e.g., a display screen) through an instruction input component (e.g., a keyboard, a mouse, a touch screen, etc.), so as to determine a scene coordinate corresponding to the screen coordinate in the game (e.g., to control a character to move to a position corresponding to the scene coordinate).
Currently, there are schemes that can determine the scene coordinates to which the screen coordinates are relative.
The first scheme is as follows: bounding box or bounding ball detection, that is, during the generation of an object in a game, a corresponding bounding box or bounding ball is generated according to the shape of the object in a 3D (3-Dimension) space. And returning a rough coordinate according to the bounding box, wherein the coordinate is the scene coordinate.
Scheme II: and (4) detecting the method one by one. According to the objects in the game, firstly, the objects are filtered through bounding box or bounding ball detection, and then, the coordinates of the intersection points of the mapping ray and the surface patches are calculated by adopting a surface patch detection method aiming at the objects, wherein the coordinates are scene coordinates.
However, the scene coordinates determined by the first scheme have low accuracy, and the calculation resource overhead in the process of determining the scene coordinates by the second scheme is large.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed in order to provide a coordinate conversion method and a corresponding coordinate conversion apparatus, electronic device, storage medium that overcome or at least partially solve the above problems.
In order to solve the above problems, an embodiment of the present invention discloses a coordinate transformation method, in which a first terminal device provides a graphical user interface, and the content displayed by the graphical user interface includes a virtual scene; the method comprises the following steps:
acquiring a first coordinate; the first coordinate is a position point located on the display component;
determining vector information based on the first coordinates; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene;
determining intersection point information corresponding to a plurality of reference planes and a first height value corresponding to the intersection point information; wherein the reference plane is parallel to a ground plane of the virtual scene; the intersection point information is the intersection point of the reference plane and the vector information; the first height value is an actual height value of a position corresponding to the intersection point information in the virtual scene;
determining a second coordinate according to the intersection point information and the corresponding first height value; the second coordinate is a position point located in the virtual scene.
Optionally, the step of determining a second coordinate according to the intersection information and the corresponding first height value includes:
determining height differences corresponding to the plurality of reference planes in a specified order; the height difference is a difference value between a first height value and a second height value, and the second height value is a height value of the reference plane in the virtual scene;
and determining a position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences as a second coordinate.
Optionally, the step of determining intersection information corresponding to a plurality of reference planes and a first height value corresponding to the intersection information includes:
determining a target reference plane among the plurality of reference planes in the specified order;
determining target intersection point information matched with the vector information by the target reference plane and a target first height value corresponding to the target intersection point information;
the step of determining the height differences corresponding to the plurality of reference planes in the specified order includes:
judging whether the target first height value is smaller than the second height value or not according to the designated sequence;
if yes, determining a difference value between the first height value and the second height value of the target, and returning to the step of determining a target reference plane in the plurality of reference planes according to the designated sequence;
and if not, executing the step of determining that the position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences is a second coordinate.
Optionally, the specified order is an order of the second height values from large to small.
Optionally, the method further comprises:
acquiring stepping information;
and determining a plurality of reference planes parallel to the surface plane according to the stepping information.
Optionally, the virtual scene includes: one or both of the convex model and the concave model;
in the bump model, a first height value corresponding to the intersection point information is larger than a height value corresponding to the ground plane; in the depression model, a first height value corresponding to the intersection point information is smaller than a height value corresponding to the ground plane.
The embodiment of the invention also discloses a coordinate conversion device, which provides a graphical user interface through the first terminal equipment, wherein the content displayed by the graphical user interface comprises a virtual scene; the device comprises:
the first coordinate module is used for acquiring a first coordinate; the first coordinate is a position point located on the display component;
a vector determination module to determine vector information based on the first coordinates; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene;
the intersection point module is used for determining intersection point information corresponding to a plurality of reference planes and a first height value corresponding to the intersection point information; wherein the reference plane is parallel to a ground plane of the virtual scene; the intersection point information is the intersection point of the reference plane and the vector information; the first height value is an actual height value of a position corresponding to the intersection point information in the virtual scene;
the second coordinate module is used for determining a second coordinate according to the intersection point information and the corresponding first height value; the second coordinate is a location point located in the virtual scene.
Optionally, the second coordinate module includes:
a height difference sub-module for determining height differences corresponding to the plurality of reference planes in a specified order; the height difference is a difference value between a first height value and a second height value, and the second height value is a height value of the reference plane in the virtual scene;
and the height difference screening submodule is used for determining a position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences as a second coordinate.
Optionally, the intersection module comprises:
a target reference submodule for determining a target reference plane among the plurality of reference planes in the specified order;
the target intersection point submodule is used for determining target intersection point information matched with the vector information by the target reference plane and a target first height value corresponding to the target intersection point information;
the height difference submodule:
the height comparison module is used for judging whether the target first height value is smaller than the second height value according to the specified sequence;
a first comparison module, configured to determine a difference between the target first height value and the second height value if the target first height value is smaller than the second height value, and recall the target reference sub-module and the target intersection sub-module;
and the second comparison module is used for calling the height difference screening submodule if the first target height value is not smaller than the second height value.
Optionally, the specified order is an order of the second height values from large to small.
Optionally, the apparatus further comprises:
the stepping information module is used for acquiring stepping information;
and the reference plane module is used for determining a plurality of reference planes parallel to the ground surface plane according to the stepping information.
Optionally, the virtual scene includes: one or both of the convex model and the concave model;
in the convex model, a first height value corresponding to the intersection point information is larger than a height value corresponding to the ground plane; in the depression model, a first height value corresponding to the intersection point information is smaller than a height value corresponding to the ground plane.
The embodiment of the invention also discloses an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the coordinate conversion method are realized.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the coordinate conversion method are realized.
The embodiment of the invention has the following advantages:
vector information matched with the virtual scene is determined based on the first coordinate corresponding to the display component, and intersection point information is determined according to the intersection point of the ray where the direction of the vector information is located and the reference plane. The difference between the height value of the reference plane corresponding to the intersection information and the first height value corresponding to the intersection information can be determined, and the second coordinate is determined according to the intersection information with the minimum difference. Because the second coordinate is compared with the first height value according to the intersection point information, the intersection point information with the minimum difference is screened out, and the second coordinate is determined according to the intersection point information, so that the accuracy of converting the first coordinate to the second coordinate is improved.
Drawings
FIG. 1 is a flowchart illustrating the steps of a first embodiment of a coordinate transformation method according to the present invention;
FIG. 2 is a schematic diagram of a virtual scene in an embodiment of a coordinate transformation method according to the present invention;
FIG. 3 is a flowchart illustrating the steps of a second embodiment of a coordinate transformation method according to the present invention;
fig. 4 is a block diagram of a coordinate transformation apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The coordinate conversion method in the embodiment of the invention can be operated on terminal equipment or a server. The terminal device may be a local terminal device. When the coordinate transformation method is executed on a server, the coordinate transformation method may be implemented and executed based on a cloud interactive system, where the cloud interactive system includes the server and a client device.
In an optional embodiment, various cloud applications may be run under the cloud interaction system, for example: and (6) cloud games. Taking a cloud game as an example, a cloud game refers to a game mode based on cloud computing. In the cloud game operation mode, the game program operation main body and the game picture presentation main body are separated, the storage and the operation of the coordinate conversion method are completed on the cloud game server, and the client device is used for receiving and sending data and presenting the game picture, for example, the client device can be a display device with a data transmission function close to a user side, such as a mobile terminal, a television, a computer, a palm computer and the like; however, the terminal device performing the coordinate conversion is a cloud game server in the cloud. When a game is played, a player operates the client device to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, data such as game pictures and the like are coded and compressed, the data are returned to the client device through a network, and finally, the data are decoded through the client device and the game pictures are output.
In an alternative embodiment, the terminal device may be a local terminal device. The local terminal device stores a game program and is used for presenting a game screen. The local terminal device is used for interacting with the player through a graphical user interface, namely, a game program is downloaded and installed and operated through the electronic device conventionally. The manner in which the local terminal device provides the graphical user interface to the player may include a variety of ways, for example, it may be rendered for display on a display screen of the terminal or provided to the player through holographic projection. For example, the local terminal device may include a display screen for presenting a graphical user interface including a game screen and a processor for running the game, generating the graphical user interface, and controlling display of the graphical user interface on the display screen.
Referring to fig. 1, a flowchart illustrating a first step of a coordinate transformation method according to an embodiment of the present invention is shown, where the embodiment of the present invention may be applied to a first terminal device, and a graphical user interface is provided by the first terminal device, where content displayed on the graphical user interface includes a virtual scene;
the embodiment of the invention can comprise the following steps:
step 101, acquiring a first coordinate; the first coordinate is a position point located on the display component;
the first coordinates may be determined based on a position of a display component of the terminal.
In particular implementations, the first coordinate may be determined by a user touching a touch-enabled display element or by an instruction input element (e.g., mouse, keyboard) moving a cursor displayed in the display element.
Step 102, determining vector information based on the first coordinate; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene;
based on a coordinate area included in the virtual scene displayed by the display component and the display angle, a first coordinate corresponding to the virtual scene currently displayed by the display component can be determined.
The starting point of the vector information is a first coordinate, and the direction of the vector information is the direction from the first coordinate to the virtual scene. And determining the vector information according to the first coordinate and the vector direction.
103, determining intersection point information corresponding to a plurality of reference planes and a first height value corresponding to the intersection point information; wherein the reference plane is parallel to a ground plane of the virtual scene; the intersection point information is the intersection point of the reference plane and the vector information; the first height value is an actual height value of a position corresponding to the intersection point information in the virtual scene;
the ground plane may refer to a ground plane model in the virtual scene. The height value corresponding to the ground plane is zero.
The reference plane is a plane parallel to the ground plane, and is not specifically shown in the virtual scene. And determining the intersection point of the ray in which the direction of the vector is positioned and the reference plane as intersection point information and a first height value corresponding to the intersection point information.
Specifically, the intersection information is used to determine a first height value corresponding to the intersection information, where the first height value may be an actual height value of a position point corresponding to the intersection information in the virtual scene in a direction perpendicular to the ground plane.
The intersection point information comprises intersection point position information of a ray where the direction of the vector is located and the reference plane. The position information corresponds to a second coordinate system, which is a coordinate system that describes a specific position in the virtual scene.
The intersection information may include a first axial coordinate and a second axial coordinate in a second coordinate system, the first coordinate being a component of the intersection information with respect to a first direction, the second coordinate being a component of the intersection information with respect to a second direction, a plane formed by the first direction and the second direction being parallel to the reference plane. The actual height value corresponding to the intersection information, i.e., the first height value, can be determined according to the first axial coordinate and the second axial coordinate. For example: the position information is an abscissa and an ordinate in the second coordinate system.
104, determining a second coordinate according to the intersection point information and the corresponding first height value; the second coordinate is a position point located in the virtual scene.
The difference between the height value of the reference plane corresponding to the intersection information and the first height value corresponding to the intersection information can be determined, and the second coordinate is determined according to the intersection information with the minimum difference, so that the conversion between the first coordinate and the second coordinate is realized.
In the embodiment of the invention, the vector information matched with the virtual scene is determined based on the first coordinate corresponding to the display component, and the intersection point information is determined according to the intersection point of the ray in which the direction of the vector information is located and the reference plane. The difference between the height value of the reference plane corresponding to the intersection information and the first height value corresponding to the intersection information can be determined, and the second coordinate is determined according to the intersection information with the minimum difference. Because the second coordinate is compared with the first height value according to the intersection point information, the intersection point information with the minimum difference is screened out, and the second coordinate is determined according to the intersection point information, so that the accuracy of converting the first coordinate to the second coordinate is improved.
In an alternative embodiment of the invention
Step 104 may include: determining height differences corresponding to the plurality of reference planes in a specified order; the height difference is a difference value between a first height value and a second height value, and the second height value is a height value of the reference plane in the virtual scene; and determining a position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences as a second coordinate.
The second height value may be a height of the reference plane relative to the ground plane. When the reference plane is above the ground plane, the second height value is positive; when the reference plane is located below the ground plane, the second height value is negative.
The difference between the second height value of the reference plane where the intersection information is located and the first height value corresponding to the intersection information in each reference plane may be determined in sequence according to a specified order.
And taking the position point of the virtual scene corresponding to the intersection point information corresponding to the reference plane with the minimum difference between the height value and the actual height value as a second coordinate.
In an alternative embodiment of the present invention, the designated sequence may refer to the sequence of the second height values from large to small, i.e. starting from the reference plane at the top of the ground plane and going to the reference plane at the bottom of the ground plane.
In an optional embodiment of the present invention, the step 103 may specifically include: determining a target reference plane among the plurality of reference planes in the specified order; and determining target intersection point information matched with the vector information and a target first height value corresponding to the target intersection point information. And according to the designated sequence, sequentially determining a target reference plane in the plurality of reference planes, determining target intersection point information corresponding to the target reference plane, and determining a target first height value corresponding to the target intersection point information.
In this optional embodiment, the step of determining the height differences corresponding to the multiple reference planes according to the designated order may specifically include: judging whether the target first height value is smaller than the second height value or not according to the designated sequence; if so, determining a difference value between the first height value of the target and the second height value, and returning to the step of determining a target reference plane in the plurality of reference planes according to the designated sequence; and if not, determining that the position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences is a second coordinate.
In order to satisfy the iterative consistency, when the height difference is determined, intersection point information corresponding to the reference plane of which the second height value is greater than or equal to the actual height value is calculated according to a specified sequence. When the target first height value is greater than or equal to the second height value, the target first height values are determined again according to the designated sequence, and the difference value between the target first height values and the second height values is calculated, so that the height difference corresponding to the target reference plane is determined. And when the first target height value is smaller than the second height value, stopping determining the height difference corresponding to the target reference plane, and determining the second coordinate based on the obtained height difference corresponding to each reference plane.
Referring to fig. 2, a partial schematic diagram of a virtual scene in an embodiment of a coordinate transformation method according to the present invention is shown.
As shown in fig. 2, a plurality of planes y = hi (i.e., reference planes, corresponding to the dotted line portions in the figure) may be determined from the top to the bottom of the virtual scene, and the planes y = hi are iterated from the top to the bottom in terms of height, a first coordinate point O is determined toward a plane whose first coordinate corresponds to a position in the virtual scene (the ray OS does not appear in the virtual scene) and an intersection point Pi (e.g., point a) of the plane, and the coordinates of a position point in the virtual scene (e.g., point B2) corresponding to intersection point information (e.g., point A2) whose delta _ i is the smallest are determined as a second coordinate by comparing an absolute value delta _ i of a true height real _ hi (first height value) and a hi difference (e.g., a height difference between point A1 and point B1, and a height difference between point A2 and point B2) of the intersection point Pi scene.
Wherein Pi may be determined as follows:
Figure BDA0002462585950000091
where hi is the second height value corresponding to the reference plane, o.y is the coordinate of point O in the direction perpendicular to the reference plane, and os.y refers to the component of vector OS in the direction perpendicular to the reference plane.
It will be appreciated that if delta _ i is determined for all reference planes, the value of delta _ i will be increased from large to small, and then increased again, and for consistency in the iteration, only the delta _ i corresponding to the reference plane having the second height value greater than or equal to the first height value is determined to reduce the computational overhead in the execution of step 104.
In an optional embodiment of the present invention, the virtual scene includes: one or both of the convex model and the concave model; in the convex model, a first height value corresponding to the intersection point information is larger than a height value corresponding to the ground plane; in the depression model, a first height value corresponding to the intersection point information is smaller than a height value corresponding to the ground plane.
A convex model may refer to a three-dimensional model in a virtual scene that exhibits a convex shape, such as: building models, hill models, and the like. A recessed model may refer to a three-dimensional model in a virtual scene that exhibits a recessed shape, such as: a gully model, a basin model, etc.
Referring to fig. 3, a flowchart illustrating steps of a second embodiment of a coordinate transformation method according to the present invention is shown, where the embodiment of the present invention may be applied to a first terminal device, and a graphical user interface is provided by the first terminal device, where content displayed on the graphical user interface includes a virtual scene; the method may comprise the steps of:
step 301, acquiring stepping information;
the step information may be a height difference.
Step 302, determining a plurality of virtual planes parallel to the ground plane according to the step information;
the reference planes determined according to the stepping information are distributed in equal height, the distribution intervals are matched with the stepping information, and the number of the reference planes can be determined according to the preset number of the planes.
Step 303, acquiring a first coordinate; the first coordinate is a position point located on the display component;
step 304, determining vector information based on the first coordinate; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene;
step 305, determining intersection point information corresponding to a plurality of reference planes and a first height value corresponding to the intersection point information; wherein the reference plane is parallel to a ground plane of the virtual scene; the intersection point information is the intersection point of the reference plane and the vector information; the first height value is an actual height value of a position corresponding to the intersection point information in the virtual scene;
step 306, determining a second coordinate according to the intersection point information and the corresponding first height value; the second coordinate is a location point located in the virtual scene.
In the embodiment of the invention, a plurality of virtual planes parallel to the ground plane in the virtual scene are determined according to the step information, and after the first coordinate is obtained and the vector information is determined, the second coordinate is determined according to different intersection point information matched with the vector information and the actual height value corresponding to the intersection point information of different virtual planes, so that the precision of converting the first coordinate into the second coordinate is improved.
It should be noted that for simplicity of description, the method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those of skill in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the embodiments of the invention.
Referring to fig. 4, a block diagram of a coordinate transformation apparatus according to an embodiment of the present invention is shown, in which a graphical user interface is provided by a first terminal device, and content displayed by the graphical user interface includes a virtual scene; the embodiment of the invention specifically comprises the following steps:
a first coordinate module 401, configured to obtain a first coordinate; the first coordinate is a position point located on the display component;
a vector determination module 402 configured to determine vector information based on the first coordinate; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene;
an intersection module 403, configured to determine intersection information corresponding to multiple reference planes and a first height value corresponding to the intersection information; wherein the reference plane is parallel to a ground plane of the virtual scene; the intersection point information is the intersection point of the reference plane and the vector information; the first height value is an actual height value of a position corresponding to the intersection point information in the virtual scene;
a second coordinate module 404, configured to determine a second coordinate according to the intersection information and the corresponding first height value; the second coordinate is a position point located in the virtual scene.
In an optional embodiment of the present invention, the second coordinate module 404 comprises:
a height difference sub-module for determining height differences corresponding to the plurality of reference planes in a specified order; the height difference is a difference value between a first height value and a second height value, and the second height value is a height value of the reference plane in the virtual scene;
and the height difference screening submodule is used for determining the position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences as a second coordinate.
In an alternative embodiment of the present invention, the intersection module 403 includes:
a target reference submodule for determining a target reference plane among the plurality of reference planes in the specified order;
the target intersection point submodule is used for determining target intersection point information matched with the vector information and a target first height value corresponding to the target intersection point information;
the height difference submodule:
the height comparison module is used for judging whether the target first height value is smaller than the second height value according to the specified sequence;
a first comparison module, configured to determine a difference between the target first height value and the second height value if the target first height value is smaller than the second height value, and recall the target reference sub-module and the target intersection sub-module;
and the second comparison module is used for calling the height difference screening submodule if the first target height value is not smaller than the second height value.
In an alternative embodiment of the present invention, the specified order is an order from large to small of the second height values.
In an optional embodiment of the invention, the apparatus further comprises:
the stepping information module is used for acquiring stepping information;
and the reference plane module is used for determining a plurality of reference planes parallel to the ground surface plane according to the stepping information.
In an optional embodiment of the present invention, the virtual scene includes: one or both of the convex model and the concave model;
in the bump model, a first height value corresponding to the intersection point information is larger than a height value corresponding to the ground plane; in the depression model, a first height value corresponding to the intersection point information is smaller than a height value corresponding to the ground plane.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiment of the invention also discloses an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the coordinate conversion method are realized.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the coordinate conversion method are realized.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrases "comprising one of \ 8230; \8230;" does not exclude the presence of additional like elements in a process, method, article, or terminal device that comprises the element.
The coordinate transformation method, the coordinate transformation device, the electronic device and the storage medium provided by the invention are described in detail, and the principle and the implementation mode of the invention are explained by applying specific examples, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A coordinate conversion method is characterized in that a graphical user interface is provided through a first terminal device, and the content displayed by the graphical user interface comprises a virtual scene; characterized in that the method comprises:
acquiring a first coordinate; the first coordinate is a position point located on the display component;
determining vector information based on the first coordinates; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene;
determining intersection point information corresponding to a plurality of reference planes and a first height value corresponding to the intersection point information; wherein the reference plane is parallel to a ground plane of the virtual scene; the intersection point information is the intersection point of the reference plane and the vector information; the first height value is an actual height value of a position corresponding to the intersection point information in the virtual scene;
determining a second coordinate according to the intersection point information and a first height value corresponding to the intersection point information; the second coordinate is a position point located in the virtual scene.
2. The method of claim 1, wherein the step of determining a second coordinate based on the intersection information and the corresponding first height value comprises:
determining height differences corresponding to the plurality of reference planes in a specified order; the height difference is a difference value between a first height value and a second height value, and the second height value is a height value of the reference plane in the virtual scene;
and determining a position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences as a second coordinate.
3. The method of claim 2, wherein the step of determining intersection information corresponding to a plurality of reference planes and a first height value corresponding to the intersection information comprises:
determining a target reference plane among the plurality of reference planes in the specified order;
determining target intersection point information matched with the vector information by the target reference plane and a target first height value corresponding to the target intersection point information;
the step of determining the height differences corresponding to the plurality of reference planes in the specified order includes:
judging whether the target first height value is smaller than the second height value or not according to the designated sequence;
if yes, determining a difference value between the first height value and the second height value of the target, and returning to the step of determining a target reference plane in the plurality of reference planes according to the designated sequence;
and if not, executing the step of determining that the position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences is a second coordinate.
4. The method of claim 3,
the specified order is the order of the second height values from large to small.
5. The method of claim 1 or 2 or 3 or 4, further comprising:
acquiring stepping information;
and determining a plurality of reference planes parallel to the ground plane according to the stepping information.
6. The method of claim 1 or 2 or 3 or 4, wherein the virtual scene comprises: one or both of the convex model and the concave model;
in the convex model, a first height value corresponding to the intersection point information is larger than a height value corresponding to the ground plane; in the depression model, a first height value corresponding to the intersection point information is smaller than a height value corresponding to the ground plane.
7. A coordinate conversion device provides a graphical user interface through a first terminal device, and the content displayed by the graphical user interface comprises a virtual scene; characterized in that the device comprises:
the first coordinate module is used for acquiring a first coordinate; the first coordinate is a position point located on the display component;
a vector determination module to determine vector information based on the first coordinates; the vector information comprises a vector direction, and the vector direction is the direction from the first coordinate to the virtual scene;
the intersection point module is used for determining intersection point information corresponding to a plurality of reference planes and a first height value corresponding to the intersection point information; wherein the reference plane is parallel to a ground plane of the virtual scene; the intersection point information is the intersection point of the reference plane and the vector information; the first height value is an actual height value of a position corresponding to the intersection point information in the virtual scene;
the second coordinate module is used for determining a second coordinate according to the intersection point information and the corresponding first height value; the second coordinate is a position point located in the virtual scene.
8. The apparatus of claim 7, wherein the second coordinate module comprises:
a height difference sub-module for determining height differences corresponding to the plurality of reference planes in a specified order; the height difference is a difference value between a first height value and a second height value, and the second height value is a height value of the reference plane in the virtual scene;
and the height difference screening submodule is used for determining the position point of the virtual scene corresponding to the intersection point information corresponding to the minimum value in the height differences as a second coordinate.
9. An electronic device, comprising a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the coordinate conversion method according to any one of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the coordinate conversion method according to any one of claims 1 to 6.
CN202010324227.7A 2020-04-22 2020-04-22 Coordinate conversion method and device, electronic equipment and storage medium Active CN111467799B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010324227.7A CN111467799B (en) 2020-04-22 2020-04-22 Coordinate conversion method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010324227.7A CN111467799B (en) 2020-04-22 2020-04-22 Coordinate conversion method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111467799A CN111467799A (en) 2020-07-31
CN111467799B true CN111467799B (en) 2023-04-07

Family

ID=71760655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010324227.7A Active CN111467799B (en) 2020-04-22 2020-04-22 Coordinate conversion method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111467799B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162559B (en) * 2020-09-30 2021-10-15 杭州海康机器人技术有限公司 Method, device and storage medium for multi-robot mixing
CN114820979B (en) * 2022-04-22 2023-03-24 如你所视(北京)科技有限公司 Processing method and device of three-dimensional grid model and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107390875A (en) * 2017-07-28 2017-11-24 腾讯科技(上海)有限公司 Information processing method, device, terminal device and computer-readable recording medium
CN109782901A (en) * 2018-12-06 2019-05-21 网易(杭州)网络有限公司 Augmented reality exchange method, device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107390875A (en) * 2017-07-28 2017-11-24 腾讯科技(上海)有限公司 Information processing method, device, terminal device and computer-readable recording medium
CN109782901A (en) * 2018-12-06 2019-05-21 网易(杭州)网络有限公司 Augmented reality exchange method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111467799A (en) 2020-07-31

Similar Documents

Publication Publication Date Title
CN103198516B (en) Dynamic graphics interface shade
CN109771951B (en) Game map generation method, device, storage medium and electronic equipment
CN109636919B (en) Holographic technology-based virtual exhibition hall construction method, system and storage medium
JP4916548B2 (en) Establish and use dominant lines of images
US8988435B1 (en) Deforming a skin representation using muscle geometries
WO2014158928A2 (en) Mapping augmented reality experience to various environments
CN111467799B (en) Coordinate conversion method and device, electronic equipment and storage medium
AU2017272304B2 (en) Auto vr: an assistant system for virtual reality painting
JP2023171435A (en) Device and method for generating dynamic virtual content in mixed reality
CN111298431B (en) Construction method and device in game
CN111773707A (en) Rendering processing method and device, electronic equipment and storage medium
CN112184873A (en) Fractal graph creating method and device, electronic equipment and storage medium
CN108829248B (en) Moving target selection method and system based on user performance model correction
CN107545597B (en) Rendering digital images on a substrate
CN107688426B (en) Method and device for selecting target object
CN110378948B (en) 3D model reconstruction method and device and electronic equipment
US20230196673A1 (en) Method and system for providing automated 3d modeling for xr online platform
CN111494948B (en) Editing method of game lens, electronic equipment and storage medium
CN110363860B (en) 3D model reconstruction method and device and electronic equipment
CN116129085B (en) Virtual object processing method, device, storage medium, and program product
US11875445B2 (en) Seamless image processing of a tiled image region
CN117406867B (en) Webpage-based augmented reality interaction method and device
KR102257442B1 (en) Augmented reality service providing method for providing user interaction and the system thereof
CN116721376A (en) Scene display guiding method, device and storage medium
CN116764213A (en) Sound programming generation method, device, equipment, storage medium and program product

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