CN114708394A - Map rendering method, electronic device and computer storage medium - Google Patents

Map rendering method, electronic device and computer storage medium Download PDF

Info

Publication number
CN114708394A
CN114708394A CN202210331707.5A CN202210331707A CN114708394A CN 114708394 A CN114708394 A CN 114708394A CN 202210331707 A CN202210331707 A CN 202210331707A CN 114708394 A CN114708394 A CN 114708394A
Authority
CN
China
Prior art keywords
bounding box
axis coordinate
building
quadrangular pyramid
pyramid
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
Application number
CN202210331707.5A
Other languages
Chinese (zh)
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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210331707.5A priority Critical patent/CN114708394A/en
Publication of CN114708394A publication Critical patent/CN114708394A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/10Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides a map rendering method, electronic equipment and a computer storage medium, wherein the map rendering method comprises the following steps: determining a visual field center of a three-dimensional electronic map to be rendered and a visual cone corresponding to the visual field center; constructing a quadrangular pyramid based on the view frustum, wherein the vertex of the quadrangular pyramid is the same as that of the view frustum, the bottom surface of the quadrangular pyramid is a rectangle parallel to the far cutting surface of the view frustum, and the center of the rectangle is the view field center; determining a building colliding with the quadrangular pyramid in the geographic elements contained in the three-dimensional electronic map as a geographic element to be hidden; and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are not visible. Through the embodiment of the application, clear presentation of the visual field center information can be effectively ensured, and the presentation effect and the user experience of the three-dimensional map are improved.

Description

Map rendering method, electronic device and computer storage medium
Technical Field
The embodiment of the application relates to the technical field of map rendering, in particular to a map rendering method, electronic equipment and a computer storage medium.
Background
With the development of terminal rendering technology, applications with a map navigation function (including but not limited to navigation applications, network appointment applications, etc.) basically support rendering an electronic map in a three-dimensional view so as to enhance the sense of reality when a user browses the electronic map.
The inventor of the present application has found, when studying an electronic map rendered in a three-dimensional view, that a geographic element such as a road surface at the center of a field of view of the electronic map is blocked by a building, and the geographic element rendered at the center of the field of view is an area of major interest when a user browses the electronic map.
Therefore, how to clearly present the geographic elements in the center of the visual field of the electronic map rendered from the three-dimensional perspective is an urgent problem to be solved.
Disclosure of Invention
In view of the above, embodiments of the present application provide a map rendering scheme to at least partially solve the above problems.
According to a first aspect of embodiments of the present application, there is provided a map rendering method, including: determining a visual field center of a three-dimensional electronic map to be rendered and a visual cone corresponding to the visual field center; constructing a quadrangular pyramid based on the view frustum, wherein the vertex of the quadrangular pyramid is the same as that of the view frustum, the bottom surface of the quadrangular pyramid is a rectangle parallel to the far cutting surface of the view frustum, and the center of the rectangle is the view field center; determining a building colliding with the quadrangular pyramid in the geographic elements contained in the three-dimensional electronic map as a geographic element to be hidden; and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are not visible.
According to a second aspect of embodiments of the present application, there is provided a map rendering apparatus including: the determining module is used for determining a visual field center of the three-dimensional electronic map to be rendered and a visual cone corresponding to the visual field center; the building module is used for building a quadrangular pyramid based on the view frustum, wherein the vertex of the quadrangular pyramid is the same as that of the view frustum, the bottom surface of the quadrangular pyramid is a rectangle parallel to the far cutting surface of the view frustum, and the center of the rectangle is the view field center; the hiding module is used for ensuring that the to-be-hidden geographic elements are invisible when buildings which collide with the quadrangular pyramids in the geographic elements contained in the three-dimensional electronic map render the to-be-rendered three-dimensional electronic map; and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are not visible.
According to a third aspect of embodiments of the present application, there is provided an electronic apparatus, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the map rendering method according to the first aspect.
According to a fourth aspect of embodiments of the present application, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the map rendering method according to the first aspect.
According to a fifth aspect of embodiments of the present application, there is provided a computer program product comprising computer instructions for instructing a computing device to perform operations corresponding to the map rendering method according to the first aspect.
According to the map rendering scheme provided by the embodiment of the application, when the information of the area where the center of the visual field is located needs to be presented in a three-dimensional mode, the building colliding with the quadrangular pyramid, namely the building affecting the current visual field, is determined through the quadrangular pyramid constructed based on the visual cone corresponding to the center of the visual field, so that the buildings are hidden and invisible when the three-dimensional image of the center of the visual field is presented. Because the quadrangular pyramid is constructed based on the viewing pyramid, the quadrangular pyramid can be regarded as the extension of the viewing pyramid, and the viewing pyramid can reflect the effective representation of the current view field, so that buildings colliding with the quadrangular pyramid can be regarded as buildings influencing the current view field, the buildings can be hidden and invisible when a three-dimensional image is presented, the clear presentation of the information of the center of the view field can be effectively ensured, and the presentation effect of the three-dimensional map and the user experience are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1A is a flowchart illustrating steps of a map rendering method according to an embodiment of the present disclosure;
FIG. 1B is a schematic view of a view frustum;
FIG. 1C is a schematic view of a cone corresponding to the center of the field of view;
FIG. 1D is a diagram illustrating a view center display interface according to the related art;
FIG. 1E is a schematic view of a center-of-view display interface processed using the method of FIG. 1A;
FIG. 2A is a flowchart illustrating steps of a map rendering method according to a second embodiment of the present application;
FIG. 2B is a diagram of an exemplary scenario in the embodiment shown in FIG. 2A;
FIG. 3 is a block diagram of a map rendering apparatus according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application shall fall within the scope of the protection of the embodiments in the present application.
The following further describes specific implementations of embodiments of the present application with reference to the drawings of the embodiments of the present application.
Example one
Referring to fig. 1A, a flowchart illustrating steps of a map rendering method according to an embodiment of the present application is shown.
The map rendering method of the embodiment includes the following steps:
step S102: determining a visual field center of a three-dimensional electronic map to be rendered and a visual cone corresponding to the visual field center.
In a three-dimensional map, the center of the field of view is generally referred to as the intersection of the line of sight of the image capture device (e.g., camera) and the ground, as shown by the dashed ellipse in fig. 1D and 1E.
While a view frustum may generally refer to the shape of the area in the rendering engine that a perspective camera may render, in the form of a pyramid with the top cut by a plane parallel to the bottom, the camera being located at the apex of the pyramid. The view cone is provided with a near cutting surface and a far cutting surface, wherein the near cutting surface is a plane of the view cone close to the camera and is parallel to the far cutting surface; the far cutting surface is a plane of the view cone far away from the camera and is parallel to the near cutting surface. An exemplary viewing cone is shown in solid line in FIG. 1B.
Accordingly, the view cone corresponding to the center of the field of view is the corresponding view cone when the clairvoyance camera is located at the position where the sight line can reach the center of the field of view, as shown by the short dashed line in fig. 1C.
In the three-dimensional electronic map, after the visual field center is determined, the visual cone corresponding to the visual field center can be determined based on the connecting line of the camera position and the visual field center. In viewing a map scene or a navigation scene, the camera sight line direction may be considered as a direction from the camera position to the center of the field of view in the three-dimensional electronic map.
For example, after the map view center is determined, the camera is placed at the view center, the right front is towards the true north, and the sight line is parallel to the ground; then determining an azimuth angle alpha, defaulting to zero degree, namely, heading to true north, and adjusting the azimuth angle of the camera to alpha; next, the pitch angle pitch is determined, which is determined by default to 90 degrees, i.e., the camera looks straight down on the ground (this is a two-dimensional field of view), and the camera pitch is adjusted to pitch. And finally, determining the distance d between the camera and the center of the visual field, wherein the value influences the size of the displayed object in the visual field, and the position and the posture of the camera are determined by enabling the camera to retreat into the air along the current direction by the distance d.
Wherein azimuth is the angle of rotation of the camera about an axis perpendicular to the ground, defaulting to 0 degrees, corresponding to heading to true north; the pitch angle is the angle the camera is oriented at from the ground, and by default 90 degrees, i.e. perpendicular to the direct view of the ground, is a two-dimensional view (when this angle is less than 90 degrees, a three-dimensional view).
Step S104: and constructing a quadrangular pyramid based on the viewing pyramid.
The vertex of the quadrangular pyramid is the same as the vertex of the viewing pyramid, the bottom surface of the quadrangular pyramid is a rectangle parallel to the far cutting surface of the viewing pyramid, the center of the rectangle is the center of the field of view, and the constructed quadrangular pyramid is shown by a solid line in fig. 1C. Generally, in order to clearly display the information of the center of the field of view and effectively display the information of the peripheral area of the field of view for the viewer to understand, the volume of the constructed quadrangular pyramid needs to be smaller than the volume of the pyramid formed from the camera to the far cutting plane of the pyramid, so that the building which will most affect the center of the field of view based on the quadrangular pyramid can be hidden and invisible when being displayed.
Step S106: determining a building which collides with the quadrangular pyramid in the geographic elements contained in the three-dimensional electronic map as a geographic element to be hidden, and making the geographic element to be hidden invisible when rendering the three-dimensional electronic map to be rendered.
In the embodiment of the present application, the collision with the quadrangular pyramid means a situation where there is a partial intersection between the projection of the quadrangular pyramid on the ground and the projection of the building on the ground, that is, a situation where one part of the projection of the building on the ground intersects with the projection of the quadrangular pyramid on the ground and the other part does not intersect.
After the buildings colliding with the quadrangular pyramids are determined, when a three-dimensional electronic map, especially a three-dimensional image positioned in the center of the visual field in the three-dimensional electronic map, is rendered, the part of the buildings can be subjected to invisible processing, including but not limited to removing the part of the buildings or setting the part of the buildings to be transparent.
For convenience of explanation, the building is hidden from view by adopting the scheme of the embodiment of the application. First, referring to fig. 1D, it can be seen from fig. 1D that the center of the field of view indicated by the dotted oval is blocked by the building, and the information of the center of the field of view cannot be clearly presented. After the scheme of the embodiment of the application is adopted, the presenting effect of the center of the visual field is shown as fig. 1E. As can be seen from fig. 1E, the information of the center of the field of view indicated by the dotted oval can be clearly presented because the corresponding building is hidden from view.
Therefore, according to the embodiment, when the information of the area where the center of the field of view is located needs to be presented in a three-dimensional manner, the buildings colliding with the quadrangular pyramid, that is, the buildings affecting the current field of view, are determined through the quadrangular pyramid constructed based on the viewing pyramid corresponding to the center of the field of view, so that the buildings are hidden and invisible when the three-dimensional image of the center of the field of view is presented. Because the quadrangular pyramid is constructed based on the viewing pyramid, the quadrangular pyramid can be regarded as the extension of the viewing pyramid, and the viewing pyramid can reflect the effective representation of the current view field, so that buildings colliding with the quadrangular pyramid can be regarded as buildings influencing the current view field, the buildings can be hidden and invisible when a three-dimensional image is presented, the clear presentation of the information of the center of the view field can be effectively ensured, and the presentation effect of the three-dimensional map and the user experience are improved.
The map rendering method of the present embodiment may be performed by any suitable electronic device having data processing capabilities, including but not limited to: mobile terminals (e.g. mobile phones, PADs, etc.), PCs, servers, etc.
Example two
Referring to fig. 2A, a flowchart illustrating steps of a map rendering method according to a second embodiment of the present application is shown.
The map rendering method of the embodiment includes the following steps:
step S202: and determining the visual field center of the three-dimensional electronic map to be rendered and a visual cone corresponding to the visual field center.
In the three-dimensional electronic map, after the visual field center is determined, the visual cone corresponding to the visual field center can be determined based on the connecting line of the camera position and the visual field center. In viewing a map scene or a navigation scene, the camera sight line direction may be considered as a direction from the camera position to the center of the field of view in the three-dimensional electronic map.
Step S204: constructing a quadrangular pyramid based on the view frustum.
The vertex of the quadrangular pyramid is the same as that of the viewing pyramid, the bottom surface of the quadrangular pyramid is a rectangle parallel to the far cutting surface of the viewing pyramid, and the center of the rectangle is the center of the field of view.
Step S206: and determining buildings colliding with the quadrangular pyramids in the three-dimensional electronic map as the geographic elements to be hidden.
In the present embodiment, in order to further improve the detection performance, the collision region of the building is set as an Axis Aligned Bounding Box (AABB) to change the collision detection into the collision detection of AABB and rectangular pyramid, that is, the collision detection of two convex polyhedrons, so as to simplify the calculation and improve the detection speed, efficiency and performance. On the basis, when a building colliding with the quadrangular pyramid in the three-dimensional electronic map is determined, the building colliding with the quadrangular pyramid can be determined according to the relation between the quadrangular pyramid and an axis coordinate alignment bounding box corresponding to the building, namely AABB, and the building is used as the geographic element to be hidden.
After setting the AABB for the building, it can be determined whether the building collides with the quadrangular pyramid by a three-dimensional GJK algorithm in one possible scheme. The three-dimensional GJK algorithm can be used to calculate the distance of convex polyhedrons in three-dimensional space by first solving for the Minkowski difference of two convex polyhedrons, whose Minkowski difference must include the origin if two objects overlap or intersect. The three-dimensional GJK algorithm judges whether collision exists or not by applying a judgment principle of whether the Minkowski difference contains the origin or not. The specific implementation of the algorithm can be realized by referring to the related art, and the embodiment of the application is not described in detail herein.
However, the three-dimensional GJK algorithm is complex in calculation and large in calculation data amount, so that the calculation efficiency is low. Therefore, in the embodiment, a mode based on the projection of the quadrangular pyramid and the projection of the AABB is adopted to determine whether the building collides with the quadrangular pyramid, so as to simplify the calculation and improve the efficiency. Specifically, when a building colliding with a quadrangular pyramid is determined from the relationship between the quadrangular pyramid and the AABB corresponding to the building, the following manner may be adopted: obtaining a triangular projection of a quadrangular pyramid relative to the ground and a rectangular projection of a corresponding AABB of the building relative to the ground; determining a rectangular projection having a collision relation with the triangular projection, and taking a building corresponding to the rectangular projection having the collision relation as a candidate building; judging whether AABB completely positioned below the side face of the rectangular pyramid facing the ground exists in the AABB corresponding to the candidate building; candidate buildings corresponding to AABBs that are not located entirely under the side of the quadrangular pyramid facing the ground are determined as buildings with which the quadrangular pyramid collides. That is, the polyhedral collision problem is simplified to a two-dimensional AABB-to-triangle collision problem. And then, taking the determined building as the geographic element to be hidden.
Wherein, the determining whether there is an AABB completely located under the side surface of the rectangular pyramid facing the ground in the AABBs corresponding to the candidate buildings may include: and judging whether the AABB corresponding to the candidate building completely positioned below the side face of the rectangular pyramid facing the ground exists in the AABB corresponding to the candidate building according to the vertex coordinates of the AABB corresponding to the candidate building. The AABB can be effectively represented by the vertex coordinates of the AABB, so that the judgment is carried out in a vertex coordinate mode, the calculation can be greatly simplified, and the calculation amount is reduced.
A feasible method for judging by adopting a vertex coordinate mode comprises the following steps: determining a plane vector equation corresponding to the side face of the rectangular pyramid facing the ground, and coefficients corresponding to an X-axis coordinate, a Y-axis coordinate and a Z-axis coordinate in the plane vector equation respectively; obtaining the maximum value and the minimum value of the vertex coordinates of the AABB corresponding to each candidate building on the X axis, the Y axis and the Z axis respectively; obtaining the judgment vertex coordinates of the AABB corresponding to each candidate building according to the coefficient and the maximum value and the minimum value; and judging whether the AABB completely positioned below the side face of the rectangular pyramid facing the ground exists in the AABBs corresponding to the candidate buildings according to the judgment vertex coordinates and the plane vector equation. In the mode, the plane vector equation is used for representing the side face of the quadrangular pyramid facing to one side of the ground, so that the collision detection is simplified into the realization of a specific equation, the realization process of the collision detection is further simplified, and the detection efficiency is improved.
In a possible manner, the obtaining the determination vertex coordinates of the AABB corresponding to each candidate building according to the coefficient and the maximum value and the minimum value includes: for each AABB corresponding to each candidate building and each coefficient of coefficients corresponding to the X-axis coordinate, the Y-axis coordinate and the Z-axis coordinate, if the coefficient is greater than 0, determining the maximum value in the axial direction corresponding to the coefficient on the AABB as the judgment vertex coordinate in the axial direction; otherwise, determining the minimum value in the axial direction corresponding to the coefficient as the judgment vertex coordinate in the axial direction; and obtaining the judgment vertex coordinates of the AABB according to the determined judgment vertex coordinates in each axial direction. In this way, the maximum coordinate in each axial direction of the AABB can be determined, and if the maximum coordinate is located completely below the side of the quadrangular pyramid facing the ground, the other coordinates should also be located completely below the side of the quadrangular pyramid facing the ground. Therefore, calculation does not need to be carried out on each vertex coordinate of the AABB, the calculation process is further simplified, the calculation data amount is reduced, and the calculation efficiency is improved.
Specifically, the judging whether there is an AABB completely located below the side of the quadrangular pyramid facing the ground among the AABBs corresponding to the candidate buildings according to the judgment vertex coordinates and the plane vector equation includes: aiming at the AABB corresponding to each candidate building, taking the judgment vertex coordinates of the AABB as coordinate parameters in the plane vector equation to obtain an equation result; if the equation results in greater than 0, then it is determined that the AABB is not completely located below the side of the quadrangular pyramid facing the ground (i.e., there is a collision); if the equation result is less than 0, then it is determined that the AABB is completely below the ground-facing side of the quadrangular pyramid (i.e., there is no collision).
Hereinafter, the above-described collision detection process is schematically described with a specific example.
As shown in fig. 2B, the largest rectangle on the bottom represents the ground, several solid line cuboids standing on the ground represent the building, the middle three buildings with dotted line frames represent the building with the AABB set, the dotted line frames are the AABB, the right cylinder represents the camera, the upper light gray dotted line cone structure represents a quadrangular pyramid (symmetrical quadrangular pyramid, each side is an isosceles triangle) constructed based on a viewing cone, the vertex of the quadrangular pyramid is the camera, the bottom is a rectangle parallel to the far and near cut plane of the viewing cone of the camera, the center of the rectangle is the center of the field of view (intersection point of the line of sight of the camera and the ground), and the lower dark gray dotted line triangle represents the triangular projection of the quadrangular pyramid on the ground. It should be noted that, in the present embodiment, the midpoint of the base of the triangle overlaps the center of the bottom face of the quadrangular pyramid.
When judging whether the AABB of the building collides with the quadrangular pyramid, firstly considering the projection of the quadrangular pyramid on the ground (the dotted triangle with dark gray below, judging whether the projection of the AABB of the building on the ground collides with the triangle, namely, performing two-dimensional collision detection of the AABB and the triangle).
Namely: and recording the plane of the side face of the quadrangular pyramid facing the ground as p, judging whether the AABB of the building is completely below p, if so, the building does not need to be hidden, and otherwise, the building is hidden and cannot be seen.
Wherein, determining whether an AABB is completely located on one side of the plane p is equivalent to determining whether all the vertices of the AABB are located on one side of the plane p.
First, let the analytical formula of plane p be: function (X, Y, Z) ═ ax + by + cz + d ═ 0, i.e., a plane vector equation of the plane p, where X, Y, and Z respectively represent coordinates on the corresponding X, Y, and Z axes, and a, b, and c are coefficients corresponding to the coordinates of the three coordinate axes; when vector (a, b, c) is normalized, the absolute value of d is equal to the distance of the plane from the origin of coordinates. If the plane passes through the origin of coordinates, d is 0. Thus, specific numerical values of the coefficients a, b, c can be obtained by coordinate points on a plane passing through the origin of coordinates. Further, the specific value of d may be obtained based on other coordinate points on a plane that does not pass through the origin of coordinates. It can be seen that, in the rectangular pyramid, coordinate points (x, y, z) at which the above ax + by + cz + d ═ 0 equation holds are coordinate points on the plane p, and all such coordinate points constitute the plane p.
If the point (x, y, z) on AABB is below p, then: function (x, y, z) < 0.
Based on this, the ranges of the AABB of the building to be detected on the three coordinate axes, i.e., the X axis, the Y axis, and the Z axis, are [ xmin, xmax ], [ ymin, ymax ], [ zmin, zmax ], respectively. Then, of the 8 vertices of the AABB, the decision vertex coordinates (u, v, w) are determined. Wherein:
u=xmax if a>0else xmin
v=ymax if b>0else ymin
w=zmax if c>0else zmin
it can be seen that, through the above three simple comparison operations, the value of (u, v, w) can be obtained, which is the value of the vertex (u, v, w) of the AABB that can maximize the function.
Finally, only whether the function (u, v, w) is greater than zero is needed to be judged, if so, the building corresponding to the AABB is not completely below p, namely, the building collides with the quadrangular pyramid; if less than zero, the building corresponding to the AABB is completely below p, and no collision occurs with the quadrangular pyramid.
In addition, it should be noted that, in practical applications, the split axis algorithm and the two-dimensional GJK algorithm may also implement the two-dimensional AABB and triangle collision detection in the embodiment of the present application.
It should be noted that, in practical applications, the size of the bottom surface of the quadrangular pyramid can be adjusted according to a proper adjustment strategy, so as to adjust the range of the road surface which is prevented from being shielded. The adjustment strategy may be appropriately adjusted by a person skilled in the art according to actual needs, for example, scaling according to a certain ratio, and the like, which is not limited in the embodiment of the present application.
Step S208: and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are not visible.
After the buildings colliding with the quadrangular pyramids are determined, the buildings are used as the geographic elements to be hidden. When three-dimensional display is carried out, the condition that the buildings collide with the quadrangular pyramids are hidden and invisible can be avoided, and the condition that the buildings shield the road surface near the center of the visual field can be avoided. Specifically in fig. 2B, the building in the rightmost dashed line AABB is located under the quadrangular pyramid and does not need to be hidden, while the buildings in the other two dashed lines AABB are colliding with the quadrangular pyramid and need to be hidden from view.
Through the embodiment, when the information of the area where the center of the visual field is located needs to be presented in a three-dimensional mode, the building colliding with the quadrangular pyramid, namely the building affecting the current visual field, is determined through the quadrangular pyramid constructed based on the visual pyramid corresponding to the center of the visual field, so that the buildings are hidden and invisible when the three-dimensional image of the center of the visual field is presented. Because the quadrangular pyramid is constructed based on the viewing pyramid, the quadrangular pyramid can be regarded as the extension of the viewing pyramid, and the viewing pyramid can reflect the effective representation of the current view field, so that buildings colliding with the quadrangular pyramid can be regarded as buildings influencing the current view field, the buildings can be hidden and invisible when a three-dimensional image is presented, the clear presentation of the information of the center of the view field can be effectively ensured, and the presentation effect of the three-dimensional map and the user experience are improved.
The map rendering method of the present embodiment may be performed by any suitable electronic device having data processing capabilities, including but not limited to: mobile terminals (e.g. mobile phones, PADs, etc.), PCs, servers, etc.
EXAMPLE III
Referring to fig. 3, a block diagram of a map rendering apparatus according to a third embodiment of the present application is shown.
The map rendering apparatus of the present embodiment includes: a determining module 302, configured to determine a view center of a three-dimensional electronic map to be rendered and a view cone corresponding to the view center; a constructing module 304, configured to construct a quadrangular pyramid based on the view frustum, where a vertex of the quadrangular pyramid is the same as a vertex of the view frustum, a bottom surface of the quadrangular pyramid is a rectangle parallel to a far clipping surface of the view frustum, and a center of the rectangle is the center of the field of view; a hiding module 306, configured to determine, as a geographic element to be hidden, a building that collides with the quadrangular pyramid in the geographic elements included in the three-dimensional electronic map; and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are invisible.
Optionally, the hiding module 306 is configured to determine, according to a relationship between the quadrangular pyramid and the corresponding axial coordinate alignment bounding box of the building, the building colliding with the quadrangular pyramid as the geographic element to be hidden; and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are not visible.
Optionally, a hiding module 306 for obtaining a triangular projection of the quadrangular pyramid with respect to the ground and a rectangular projection of the corresponding axial coordinate alignment bounding box of the building with respect to the ground; determining a rectangular projection having a collision relation with the triangular projection, and taking a building corresponding to the rectangular projection having the collision relation as a candidate building; judging whether an axial coordinate alignment bounding box completely positioned below the side face of the quadrangular pyramid facing the ground exists in the axial coordinate alignment bounding boxes corresponding to the candidate buildings; determining a candidate building which does not have an axial coordinate alignment bounding box completely below the side face of the quadrangular pyramid facing the ground as a building colliding with the quadrangular pyramid as a geographic element to be hidden; and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are not visible.
Optionally, when determining whether there is an axis coordinate alignment bounding box completely located below the side surface of the quadrangular pyramid facing the ground in the axis coordinate alignment bounding box corresponding to the candidate building, the hiding module 306 determines whether there is an axis coordinate alignment bounding box completely located below the side surface of the quadrangular pyramid facing the ground in the axis coordinate alignment bounding box corresponding to the candidate building according to the vertex coordinates of the axis coordinate alignment bounding box corresponding to the candidate building.
Optionally, the hiding module 306 determines whether there is an axis coordinate alignment bounding box completely located under the side of the pyramid facing the ground in the axis coordinate alignment bounding box corresponding to the candidate building according to the vertex coordinates of the axis coordinate alignment bounding box corresponding to the candidate building: determining a plane vector equation corresponding to the side face of the quadrangular pyramid facing the ground, and coefficients corresponding to an X-axis coordinate, a Y-axis coordinate and a Z-axis coordinate in the plane vector equation respectively; obtaining the maximum value and the minimum value of the vertex coordinate of the axis coordinate alignment bounding box corresponding to each candidate building on the X axis, the Y axis and the Z axis respectively; obtaining the judgment vertex coordinates of the axis coordinate alignment bounding box corresponding to each candidate building according to the coefficient and the maximum value and the minimum value; and judging whether an axial coordinate alignment bounding box completely positioned below the side face of the rectangular pyramid facing the ground exists in the axial coordinate alignment bounding boxes corresponding to the candidate buildings according to the judgment vertex coordinates and the plane vector equation.
Optionally, the hiding module 306, when obtaining the determined vertex coordinates of the axis coordinate alignment bounding box corresponding to each candidate building according to the coefficient and the maximum and minimum values: for each of the axis coordinate alignment bounding box corresponding to each of the candidate buildings and each of coefficients corresponding to the X-axis coordinate, the Y-axis coordinate, and the Z-axis coordinate, if the coefficient is greater than 0, determining the maximum value in the axial direction corresponding to the coefficient on the axis coordinate alignment bounding box as the determination vertex coordinate in the axial direction; otherwise, determining the minimum value in the axial direction corresponding to the coefficient as the judgment vertex coordinate in the axial direction; and obtaining the judgment vertex coordinate of the axis coordinate alignment bounding box according to the determined judgment vertex coordinate in each axis direction.
Optionally, the hiding module 306 determines whether an axis coordinate alignment bounding box completely located below a side of the pyramid facing the ground exists in the axis coordinate alignment bounding boxes corresponding to the candidate buildings according to the determined vertex coordinates and the plane vector equation: aiming at the axis coordinate alignment bounding box corresponding to each candidate building, taking the judgment vertex coordinate of the axis coordinate alignment bounding box as a coordinate parameter in the plane vector equation to obtain an equation result; if the equation result is greater than 0, determining that the axis coordinate alignment bounding box is not completely positioned below the side face of the square pyramid facing the ground; if the result of the equation is less than 0, it is determined that the axis coordinate alignment bounding box is located entirely below the side of the quadrangular pyramid facing the ground.
The map rendering device of this embodiment is used to implement the corresponding map rendering method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the map rendering apparatus of this embodiment can refer to the description of the corresponding part in the foregoing method embodiment, and is not repeated herein.
Example four
Referring to fig. 4, a schematic structural diagram of an electronic device according to a fourth embodiment of the present application is shown, and the specific embodiment of the present application does not limit a specific implementation of the electronic device.
As shown in fig. 4, the electronic device may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein:
the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408.
A communication interface 404 for communicating with other electronic devices or servers.
The processor 402 is configured to execute the program 410, and may specifically perform relevant steps in the above-described map rendering method embodiment.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a CPU, or an application Specific Integrated circuit (asic), or one or more Integrated circuits configured to implement embodiments of the present application. The intelligent device comprises one or more processors which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may be specifically configured to cause the processor 402 to execute the map rendering method described in the foregoing first or second method embodiment.
For specific implementation of each step in the program 410, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing map rendering method embodiment, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
Through the electronic equipment of the embodiment, when the information of the area where the center of the visual field is located needs to be presented in a three-dimensional manner, the buildings colliding with the quadrangular pyramid, namely the buildings affecting the current visual field, are determined through the quadrangular pyramid constructed based on the visual pyramid corresponding to the center of the visual field, so that the buildings are hidden and invisible when the three-dimensional image of the center of the visual field is presented. Because the quadrangular pyramid is constructed based on the viewing pyramid, the quadrangular pyramid can be regarded as the extension of the viewing pyramid, and the viewing pyramid can reflect the effective representation of the current view field, so that buildings colliding with the quadrangular pyramid can be regarded as buildings influencing the current view field, the buildings can be hidden and invisible when a three-dimensional image is presented, the clear presentation of the information of the center of the view field can be effectively ensured, and the presentation effect of the three-dimensional map and the user experience are improved.
In addition, a computer program product is further provided in an embodiment of the present application, and includes computer instructions that instruct a computing device to perform operations corresponding to the map rendering method described in the first or second embodiment.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present application may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present application.
The above-described methods according to embodiments of the present application may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the methods described herein may be stored in such software processes on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the map rendering methods described herein. Further, when a general-purpose computer accesses code for implementing the map rendering methods shown herein, execution of the code transforms the general-purpose computer into a special-purpose computer for performing the map rendering methods shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The above embodiments are only used for illustrating the embodiments of the present application, and not for limiting the embodiments of the present application, and those skilled in the relevant art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application, so that all equivalent technical solutions also belong to the scope of the embodiments of the present application, and the scope of patent protection of the embodiments of the present application should be defined by the claims.

Claims (10)

1. A map rendering method, comprising:
determining a visual field center of a three-dimensional electronic map to be rendered and a visual cone corresponding to the visual field center;
constructing a quadrangular pyramid based on the view frustum, wherein the vertex of the quadrangular pyramid is the same as that of the view frustum, the bottom surface of the quadrangular pyramid is a rectangle parallel to the far cutting surface of the view frustum, and the center of the rectangle is the view field center;
determining a building colliding with the quadrangular pyramid in the geographic elements contained in the three-dimensional electronic map as a geographic element to be hidden;
and when the three-dimensional electronic map to be rendered is rendered, the geographic elements to be hidden are not visible.
2. The method of claim 1, wherein the determining, as the geographic element to be hidden, a building which collides with the quadrangular pyramid in the geographic elements included in the three-dimensional electronic map comprises:
and determining the building colliding with the quadrangular pyramid as the geographic element to be hidden according to the relation between the quadrangular pyramid and the corresponding axial coordinate alignment bounding box of the building.
3. The method of claim 2, wherein the determining a building colliding with the quadrangular pyramid as the geographic element to be hidden according to the relationship between the quadrangular pyramid and the building corresponding axis coordinate alignment bounding box comprises:
obtaining a triangular projection of the quadrangular pyramid relative to the ground and a rectangular projection of the corresponding axial coordinate alignment bounding box of the building relative to the ground;
determining a rectangular projection having a collision relation with the triangular projection, and taking a building corresponding to the rectangular projection having the collision relation as a candidate building;
judging whether an axial coordinate alignment bounding box completely positioned below the side face of the quadrangular pyramid facing the ground exists in the axial coordinate alignment bounding boxes corresponding to the candidate buildings;
and determining the candidate building without the axis coordinate alignment bounding box completely below the side surface of the quadrangular pyramid facing the ground as the building colliding with the quadrangular pyramid as the geographic element to be hidden.
4. The method of claim 3, wherein said determining whether there is an axis coordinate aligned bounding box in the axis coordinate aligned bounding box corresponding to the candidate building that is completely below the ground facing side of the pyramid comprises:
and judging whether the axis coordinate alignment bounding box completely positioned below the side face of the quadrangular pyramid facing the ground exists in the axis coordinate alignment bounding box corresponding to the candidate building according to the vertex coordinates of the axis coordinate alignment bounding box corresponding to the candidate building.
5. The method of claim 4, wherein said determining whether there is an axis coordinate aligned bounding box in the axis coordinate aligned bounding box corresponding to the candidate building that is completely below the ground facing side of the pyramid comprises:
determining a plane vector equation corresponding to the side face of the rectangular pyramid facing the ground, and coefficients corresponding to an X-axis coordinate, a Y-axis coordinate and a Z-axis coordinate in the plane vector equation;
obtaining the maximum value and the minimum value of the vertex coordinate of the axis coordinate alignment bounding box corresponding to each candidate building on the X axis, the Y axis and the Z axis respectively;
obtaining the judgment vertex coordinates of the axis coordinate alignment bounding box corresponding to each candidate building according to the coefficient and the maximum value and the minimum value;
and judging whether an axis coordinate alignment bounding box completely positioned below the side face of the quadrangular pyramid facing the ground exists in the axis coordinate alignment bounding boxes corresponding to the candidate buildings according to the judgment vertex coordinates and the plane vector equation.
6. The method of claim 5, wherein said obtaining, from the coefficients and the maximum and minimum values, a decision vertex coordinate of an axis coordinate alignment bounding box corresponding to each of the candidate buildings comprises:
for each of the axis coordinate alignment bounding box corresponding to each of the candidate buildings and each of coefficients corresponding to the X-axis coordinate, the Y-axis coordinate, and the Z-axis coordinate, if the coefficient is greater than 0, determining the maximum value in the axial direction corresponding to the coefficient on the axis coordinate alignment bounding box as the determination vertex coordinate in the axial direction; otherwise, determining the minimum value in the axial direction corresponding to the coefficient as the judgment vertex coordinate in the axial direction;
and obtaining the judgment vertex coordinate of the axis coordinate alignment bounding box according to the determined judgment vertex coordinate in each axis direction.
7. The method of claim 5 or 6, wherein said determining whether there is an axis coordinate aligned bounding box located completely below the ground-facing side of the pyramid from the determined vertex coordinates and the plane vector equation for the corresponding axis coordinate aligned bounding box of the candidate building comprises:
aiming at the axis coordinate alignment bounding box corresponding to each candidate building, taking the judgment vertex coordinate of the axis coordinate alignment bounding box as a coordinate parameter in the plane vector equation to obtain an equation result;
if the equation result is greater than 0, determining that the axis coordinate alignment bounding box is not completely positioned below the side surface of the square pyramid facing the ground;
if the result of the equation is less than 0, then it is determined that the axis coordinate alignment bounding box is located entirely below the ground-facing side of the pyramid.
8. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the map rendering method according to any one of claims 1-7.
9. A computer storage medium on which a computer program is stored which, when executed by a processor, implements a map rendering method as claimed in any one of claims 1 to 7.
10. A computer program product comprising computer instructions to instruct a computing device to perform operations corresponding to the map rendering method of any of claims 1-7.
CN202210331707.5A 2022-03-31 2022-03-31 Map rendering method, electronic device and computer storage medium Pending CN114708394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210331707.5A CN114708394A (en) 2022-03-31 2022-03-31 Map rendering method, electronic device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210331707.5A CN114708394A (en) 2022-03-31 2022-03-31 Map rendering method, electronic device and computer storage medium

Publications (1)

Publication Number Publication Date
CN114708394A true CN114708394A (en) 2022-07-05

Family

ID=82170253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210331707.5A Pending CN114708394A (en) 2022-03-31 2022-03-31 Map rendering method, electronic device and computer storage medium

Country Status (1)

Country Link
CN (1) CN114708394A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117830587A (en) * 2024-03-05 2024-04-05 腾讯科技(深圳)有限公司 Map annotation drawing method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117830587A (en) * 2024-03-05 2024-04-05 腾讯科技(深圳)有限公司 Map annotation drawing method and device, computer equipment and storage medium
CN117830587B (en) * 2024-03-05 2024-05-28 腾讯科技(深圳)有限公司 Map annotation drawing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US11263816B2 (en) Method and device for a placement of a virtual object of an augmented or mixed reality application in a real-world 3D environment
US9747721B2 (en) Technique for filling holes in a three-dimensional model
US5579456A (en) Direct rendering of textured height fields
US7212207B2 (en) Method and apparatus for real-time global illumination incorporating stream processor based hybrid ray tracing
US20170186219A1 (en) Method for 360-degree panoramic display, display module and mobile terminal
EP1508877A2 (en) Texture mapping with high resolution lighting characteristics
US9165397B2 (en) Texture blending between view-dependent texture and base texture in a geographic information system
CN114708394A (en) Map rendering method, electronic device and computer storage medium
CN112488910A (en) Point cloud optimization method, device and equipment
US20230260218A1 (en) Method and apparatus for presenting object annotation information, electronic device, and storage medium
CN109427084B (en) Map display method, device, terminal and storage medium
JP2003233836A (en) Image processor for conducting rendering shading processing by using distance component in modeling and its method
CN114549775A (en) Rendering method, device and computer program product of electronic map
CN115131513A (en) Three-dimensional terrain clipping method, device and equipment and readable storage medium
KR20100075351A (en) Method and system for rendering mobile computer graphic
CN109976533B (en) Display control method and device
US6188409B1 (en) 3D graphics device
CN113570661A (en) Object position detection method, furniture position detection method and device
KR102304932B1 (en) Method and apparatus for processing graphics data and recording medium thereof
CN117876566A (en) Horizon bending special effect realization method and device, electronic equipment and storage medium
CN118015197B (en) Live-action three-dimensional logic singulation method and device and electronic equipment
CN116510292A (en) Blasting effect rendering method and device, electronic equipment and storage medium
WO2023029424A1 (en) Method for rendering application and related device
CN116758197A (en) Map rendering method, device, equipment and storage medium
CN117808951A (en) Three-dimensional scene updating 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