Method and device for determining rendering vertex of building and electronic equipment

By determining the center of the arc and rendering vertices of the arc on the building surface, the problem of overly sharp corners of the building in the prior art is solved, the visual effect of the electronic map is optimized, and the user experience is improved.

CN120451366APending Publication Date: 2025-08-08BEIJING AUTONAVI YUNMAP TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410132409.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-30
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The corners of buildings rendered by the prior art are too sharp, affecting the visual effect and user experience of electronic maps.

Method used

By determining the vertices on the building surface, calculate the center of the arc that forms an edge tangent to the adjacent vertices, and determine at least three rendered vertices from the arc, and optimize the rendering effect of the corners of the building with the center of the arc as the basis point.

Benefits of technology

The corners of buildings are arc-shaped, which improves the visual effect of building corners in electronic maps and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451366A_ABST
    Figure CN120451366A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method and device for determining rendering vertexes of a building and electronic equipment, and the method comprises the steps: determining more than three vertexes of the building, and enabling the vertexes to form one surface of the building; taking one vertex as a target vertex, and according to a preset distance, determining the circle center of an arc tangent to the edge formed by the target vertex and the other two adjacent vertexes; and determining at least three rendering vertexes corresponding to the target vertex from the arc by taking the circle center of the arc as a vertex. According to the technical scheme, at least three rendering vertexes located on the arc are determined for the same target vertex, so that the corners, corresponding to the target vertex rendered based on the rendering vertexes, in the corresponding surface of the building are in an arc shape, and the problem that the corner rendered through one target vertex is sharp in the prior art is solved; the corner visual effect of the building in the visual electronic map is optimized, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of map rendering technology, and in particular to a method, device, and electronic device for determining rendering vertices of a building. Background Art

[0002] When rendering a visual electronic map (the electronic map displayed on a screen) based on electronic map data, it is typically necessary to render the top and bottom outlines of buildings on the electronic map, as well as lighting and shadow effects, based on vertex data. However, current rendering solutions produce sharp corners on the top and bottom surfaces of buildings, resulting in a poor visual effect of the buildings on the visual electronic map and affecting the user experience. Therefore, a solution is needed to optimize the visual effect of building corners. Summary of the Invention

[0003] Embodiments of the present disclosure provide a method, device, and electronic device for determining rendering vertices of a building.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for determining rendering vertices of a building.

[0005] Specifically, the method for determining the rendering vertices of the building includes:

[0006] determining three or more vertices of a building, wherein the vertices constitute a face of the building;

[0007] Taking a vertex as a target vertex, and determining the center of an arc tangent to an edge formed by the target vertex and two adjacent vertices according to a preset distance;

[0008] Taking the center of the arc as a vertex, a rendering vertex corresponding to the target vertex is determined on the arc, and the number of the rendering vertices is at least three.

[0009] In a second aspect, an embodiment of the present disclosure provides a method for rendering a building.

[0010] Specifically, the building rendering method includes:

[0011] Acquire rendering data of a building, the rendering data including at least rendering vertices constituting a top surface and / or a bottom surface of the building;

[0012] Based on the rendering vertices of the building, the top surface and / or the bottom surface of the building are rendered, wherein the rendering vertices of the building are determined based on the above-mentioned method for determining the rendering vertices of the building.

[0013] In a third aspect, an embodiment of the present disclosure provides a device for determining rendering vertices of a building.

[0014] Specifically, the device for determining the rendering vertices of the building includes:

[0015] A first determining module is configured to determine three or more vertices of a building, wherein the vertices constitute a face of the building;

[0016] A second determining module is configured to use a vertex as a target vertex and determine, based on a preset distance, a center point of an arc tangent to an edge formed by the target vertex and two other adjacent vertices;

[0017] The third determining module is configured to determine, from the arc, a rendering vertex corresponding to the target vertex, with the center of the arc as a vertex, and the number of the rendering vertices is at least three.

[0018] In a fourth aspect, an embodiment of the present disclosure provides an electronic device comprising a memory and at least one processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the at least one processor to implement the above method.

[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by the above-mentioned device, which includes computer instructions involved in the above-mentioned device for executing the above-mentioned method.

[0020] In a sixth aspect, an embodiment of the present disclosure provides a computer program product, comprising a computer program / instruction, wherein the computer program / instruction implements the above method when executed by a processor.

[0021] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:

[0022] The above technical solution targets the vertices constituting a face of a building, takes one vertex as the target vertex, and determines, based on a preset distance, an arc tangent to the edge formed by the target vertex and two other adjacent vertices and its center point. Furthermore, based on the center point of the arc, at least three rendering vertices corresponding to the target vertex are determined from the arc. Because the present application determines at least three rendering vertices located on the arc for the same target vertex, the corner corresponding to the target vertex rendered based on the rendering vertex on the corresponding face of the building will appear arc-shaped, avoiding the problem of relatively sharp corners rendered by a single target vertex in the prior art, optimizing the visual effect of building corners in a visualized electronic map, and improving the user experience.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0025] Figure 1 A flowchart showing a method for determining rendering vertices of a building according to an embodiment of the present disclosure;

[0026] Figure 2A and Figure 2B A schematic diagram illustrating a method for determining the position of the center O of an arc according to an embodiment of the present disclosure is shown;

[0027] Figure 2C A schematic diagram showing a segmentation point according to an embodiment of the present disclosure;

[0028] Figure 2D A schematic diagram of determining normals of rendering vertices according to an embodiment of the present disclosure is shown;

[0029] Figure 3 A flowchart showing a method for rendering a building according to an embodiment of the present disclosure;

[0030] Figure 4 A structural block diagram showing a device for determining rendering vertices of a building according to an embodiment of the present disclosure is shown;

[0031] Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0032] Figure 6 It is a structural diagram of a computer system suitable for implementing the method for determining rendering vertices of a building / the method for rendering a building according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0033] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0034] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, actions, components, parts, or combinations thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, components, parts, or combinations thereof exist or are added.

[0035] It should also be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0036] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0037] Figure 1 A flow chart showing a method for determining rendering vertices of a building according to an embodiment of the present disclosure is shown. Figure 1 As shown, the method for determining the rendering vertices of the building includes the following steps S101-S103:

[0038] In step S101, three or more vertices of a building are determined, wherein the vertices constitute a face of the building;

[0039] In step S102, a vertex is used as a target vertex, and the center of an arc tangent to the edge formed by the target vertex and two adjacent vertices is determined according to a preset distance;

[0040] In step S103 , the center of the arc is used as a vertex, and rendering vertices corresponding to the target vertex are determined on the arc, where the number of the rendering vertices is at least three.

[0041] The above is the method for determining the rendering vertices of a building provided by the present application. This method targets the vertices constituting a face of the building, takes a vertex as the target vertex, and determines the arc tangent to the edge formed by the target vertex and two other adjacent vertices and its center according to a preset distance. Furthermore, based on the center of the arc, at least three rendering vertices corresponding to the target vertex are determined from the arc. Since the present application determines at least three rendering vertices located on the arc for the same target vertex, the corner corresponding to the target vertex rendered based on the rendering vertex in the corresponding face of the building will appear in an arc shape, avoiding the problem of relatively sharp corners rendered by a single target vertex in the prior art, optimizing the visual effect of the corners of the building in the visualized electronic map, and improving the user experience.

[0042] In one embodiment of the present disclosure, the method for determining rendering vertices of a building may be applicable to a computer, a computing device, an electronic device, a server, a server cluster, etc. for determining rendering vertices of a building.

[0043] As mentioned above, the corners of buildings rendered by the current rendering scheme are relatively sharp, and the rendering of relatively sharp corners needs to be optimized. To this end, in one embodiment of the present disclosure, corresponding rendering vertices can be determined for all the vertices constituting a face of the above-mentioned building. That is, all the vertices constituting a face of the building are respectively used as target vertices, and the corresponding rendering vertices are determined, or only the vertices with relatively sharp corners rendered based on the vertex are used as target vertices, and the corresponding rendering vertices are determined. The present disclosure does not impose any restrictions on which vertices are used as target vertices.

[0044] In one embodiment of the present disclosure, the preset distance refers to the distance value from the target vertex of the building to the tangent point of the arc, and the tangent point refers to the point where the arc is tangent to the edge formed by the target vertex and its two adjacent vertices. Those skilled in the art can set the value of the preset distance according to the needs of actual application, wherein the value of the preset distance can be one, that is, no matter which vertex is used as the target vertex, the value of the preset distance is the same. Of course, different distance values can also be set for different vertices. The present disclosure does not limit the specific value of the preset distance and the way of setting the value.

[0045] In another embodiment of the present disclosure, the preset distance may also be set to the radius of the circle where the arc is located. According to the value of the radius, a corresponding distance value between the target vertex and the tangent point of the arc may be calculated.

[0046] Those skilled in the art may define and assign a value to the preset distance according to the needs of actual applications. The above two definition and assignment methods achieve the same rendering effect.

[0047] To facilitate the explanation and description of the present disclosure, the specific embodiments provided by the present disclosure are described in detail below by taking the preset distance as the distance between the target vertex and the tangent point of the arc as an example.

[0048] Regarding the need to obtain three or more vertices constituting a certain surface of a building in the present disclosure, the surface in the present disclosure can be either the top surface or the bottom surface of the building, and the present disclosure does not impose any limitation.

[0049] Regarding taking one of the vertices as the target vertex, determining the center of the arc tangent to the edge formed by the target vertex and the other two adjacent vertices based on the preset distance, in one embodiment of the present disclosure, if the preset distance values set for different vertices are different, then before determining the center of the arc tangent to the edge formed by the target vertex and the other two adjacent vertices based on the preset distance, a step of determining the preset distance based on the target vertex can be further performed.

[0050] When the preset distance is the distance between the target vertex and the tangent point of the arc, in one embodiment of the present disclosure, in step S102, determining the center of the arc tangent to the edge formed by the target vertex and two adjacent vertices based on the preset distance may include the following steps:

[0051] On two edges formed by the target vertex and two adjacent vertices, respectively determining points whose distances to the target vertex are equal to the preset distances as tangent points;

[0052] Calculate the first angle formed by the two tangent points and the target vertex according to the preset distance, where the target vertex is the vertex of the first angle;

[0053] The center of the arc tangent to the edge formed by the target vertex and two other adjacent vertices is determined according to the first angle and the preset distance.

[0054] In this embodiment, when determining the center of the arc tangent to the edge formed by the target vertex and the other two adjacent vertices according to the preset distance, first, on the two edges formed by the target vertex and the other two adjacent vertices, points whose distance to the target vertex is equal to the preset distance are determined as tangent points, such as Figure 2A As shown, Figure 2A In the example, it is assumed that a plane of a building includes four vertices: B1, B2, B3 and B4, where vertex B2 is the target vertex to be processed, and the preset distance is expressed as d. First, the two edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3 are determined. Then, on these two edges, two points A1 and A2 with a distance d from the target vertex B2 are determined respectively. Points A1 and A2 are the determined tangent points on the two edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3, which are tangent to the arc; then, according to the preset distance d, the angle of the first angle, that is, the angle of ∠A2B2A1, is calculated; finally, according to the angle of the first angle and the preset distance d, the position of the center O of the arc tangent to the edge formed by the target vertex B2 and the other two adjacent vertices B1 and B3 can be determined.

[0055] Furthermore, in one embodiment of the present disclosure, the step of calculating the first angle formed by the two tangent points and the target vertex according to the preset distance may include the following steps:

[0056] Get the first vector and the second vector formed by the target vertex and the two tangent points;

[0057] Calculate the dot product of the first vector and the second vector;

[0058] multiplying the value of the preset distance by the value of the preset distance as the product of the length of the first vector and the length of the second vector;

[0059] An arc cosine operation is performed on the quotient of the point product value and the product to obtain the angle of a first angle formed by the two tangent points and the target vertex.

[0060] Continue with Figure 2A Taking an example, the process of calculating the angle of the first angle formed by two tangent points and the target vertex is introduced. First, the first vector formed by the target vertex B2 and the tangent point A1 and the second vector formed by the target vertex B2 and the tangent point A2 are obtained respectively; then the dot product value between the first vector and the second vector is calculated; then the preset distance value d is multiplied by the preset distance value d as the product of the length of the first vector and the length of the second vector; finally, the quotient of the dot product value and the product is subjected to an arc cosine operation to obtain the angle of the first angle formed by the two tangent points A1 and A2 and the target vertex B2. That is, the angle of the first angle can be calculated using the following formula:

[0061]

[0062] Where θ represents the first angle, represents the first vector, represents the length of the first vector, represents the second vector, Represents the length of the second vector. Since the length of the first vector and the length of the second vector are equal to the preset distance d in the present disclosure, the present disclosure uses the value d of the preset distance multiplied by the value d of the preset distance as the product of the length of the first vector and the length of the second vector.

[0063] Furthermore, in one embodiment of the present disclosure, the step of determining the center of the arc tangent to the side formed by the target vertex and two other adjacent vertices based on the first angle and the preset distance may include the following steps:

[0064] Obtain a difference between 90 degrees and the first angle divided by 2;

[0065] Obtaining a sine function value of the angle difference;

[0066] Dividing the preset distance by the sine function value to obtain the distance from the target vertex to the center of the arc;

[0067] The center of the arc is obtained according to the position of the target vertex and the distance from the target vertex to the center of the arc.

[0068] Continued use Figure 2AThe scenario shown introduces the process of determining the center of the circle. Considering that points A1 and A2 are tangent points of the arc located on the two edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3, and tangent to the edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3, therefore, Figure 2B The line OA1 formed by the center O of the arc and the tangent point A1 is perpendicular to the line A1B formed by the tangent point A1 and the target vertex B2, that is, ∠OA1B2 is 90 degrees. In this way, the tangent point A1, the center O and the target vertex B2 form a right triangle. It can be seen from the above that the distance between the tangent point A1 and the target vertex B2 is the preset distance d. Therefore, based on the relevant knowledge of right triangles, it can be obtained that the distance between the center O and the target vertex B2 is the length d of the right angle formed by the tangent point A1 and the target vertex B2 divided by the sine function value of the corresponding right triangle internal angle, that is, ∠A1OB2. Since the distance between the tangent point A2 and the target vertex B2 is also d, the line between the center O and the target vertex B2 is actually the first The angle bisector of an angle, so it can be obtained that the angle of ∠A1B2O is the angle of the first angle divided by 2, ∠A1B2A2, that is, the angle of the first angle has been obtained before, then the angle of ∠A1OB2 is equal to 90 degrees minus the angle of ∠A1B2O, that is, 90 degrees minus the angle of the first angle divided by 2, so the distance between the center O and the target vertex B2 can be obtained by using the sine function value of the difference between d divided by 90 degrees and the angle of the first angle divided by 2, which can be expressed by the formula: OB2 = d / sin(90°-first angle / 2), finally, according to the position of the target vertex B2 and the calculated distance from the target vertex B2 to the center O of the arc, the position of the center of the arc can be obtained.

[0069] In one embodiment of the present disclosure, step S103, i.e., the step of determining a rendering vertex corresponding to the target vertex on the arc with the center of the arc as the vertex, may include the following steps:

[0070] Subtract the first angle from 180 degrees to get the second angle formed by the two tangent points and the center of the arc.

[0071] Dividing the second included angle by the preset number of segments to obtain an angle value of the segmentation angle;

[0072] Taking the center of the arc as the vertex of the segmentation angle, determining a segmentation point on the arc according to the angle value of the segmentation angle, wherein the segmentation point is located between the two tangent points;

[0073] The segmentation point and the tangent point are used as rendering vertices corresponding to the target vertex.

[0074] Continued use Figure 2A, in this embodiment, when determining the rendering vertex corresponding to the target vertex from the arc, considering that points A1 and A2 are both tangent points, ∠OA1B2 and ∠OA2B2 are both right angles, and therefore, by subtracting the angle of the first angle from 180 degrees, the second angle formed by the two tangent points A1 and A2 and the center O of the arc with the center O as the vertex, that is, ∠A1OA2, can be obtained; and then the angle of the second angle is divided by the preset number of segments to obtain the angle value of the segmentation angle, wherein the number of segments can be based on a target. The number of rendering vertices corresponding to the vertex is set, and the present disclosure does not make any special restrictions on it. For example, if the number of rendering vertices corresponding to the final target vertex is set to 3, the number of segments can be set to the number of rendering vertices minus 1, that is, 3-1=2; then the center of the arc is used as the vertex of the segmentation angle, and according to the angle value of the segmentation angle, the segmentation point corresponding to the segmentation angle can be determined on the arc between the two tangent points. For example, when the number of segments is set to 2, the angle of the segmentation angle is the angle of the second angle divided by 2, and the segmentation point obtained in this way can be as follows Figure 2C As shown in point A3, where the angle values of ∠A2OB2 and ∠B2OA1 are equal, both equal to the angle of the second included angle divided by 2; then the split point A3 and the tangent points A1 and A2 can be used as the rendering vertex corresponding to the target vertex B2. Figure 2C As shown, the dividing point A3, the tangent points A1 and A2, and an arc can be drawn based on these three points. Therefore, the number of rendering vertices set in this application is at least 3. Those skilled in the art can set different numbers of rendering vertices according to actual needs, and this disclosure does not impose any restrictions.

[0075] Considering that the display effects of light, shadow, and color of a rendered vertex during rendering are related to the normal of the rendered vertex, in one embodiment of the present disclosure, the method may further include the following steps:

[0076] Determines the normal corresponding to the rendered vertex.

[0077] Furthermore, in one embodiment of the present disclosure, the step of determining the normal corresponding to the rendering vertex may include the following steps:

[0078] If the rendering vertex is a tangent point, the surface normal of the plane where the target vertex and the adjacent vertex are located is used as the normal of the rendering vertex, and the tangent point is located on the edge formed by the target vertex and the adjacent vertex;

[0079] If the rendering vertex is a segmentation point, the normal of the segmentation point is used as the normal of the rendering vertex.

[0080] The point normal of a point refers to the sum of the surface normals (unit vectors) of all planes sharing the point, where a unit vector refers to a vector with a modulus equal to 1.

[0081] like Figure 2D As shown, for the rendering vertices A1, A2 and A3, since the rendering vertex A1 is the tangent point, its corresponding normal is the surface normal of the plane A where the target vertex B2 and the adjacent vertex B1 are located. Similarly, since the rendering vertex A2 is also the tangent point, its corresponding normal is the surface normal of the plane B where the target vertex B2 and the adjacent vertex B3 are located. Since the rendering vertex A3 is the dividing point, its corresponding normal is the normal of the dividing point, that is, the sum of the surface normals of all planes sharing this point.

[0082] In order to achieve a natural transition in the lighting effect of the corners of buildings rendered based on the rendered vertices, after determining the normals corresponding to the rendered vertices, the lighting parameters corresponding to the rendered vertices can also be determined based on the normals corresponding to the rendered vertices. That is, in one embodiment of the present disclosure, the method can further include the following steps:

[0083] Determine the lighting parameters of the rendered vertex based on the normal corresponding to the rendered vertex.

[0084] Furthermore, in one embodiment of the present disclosure, the lighting parameters of the rendering vertex are determined according to the normal corresponding to the rendering vertex, and the following specific embodiments can be used:

[0085] The maximum value between the dot product of the normal of the rendering vertex and the illumination direction and 0 is determined as the rendering vertex corresponding to the rendering vertex. Then, the split point A3 and the tangent points A1 and A2 can be used as the rendering vertex corresponding to the target vertex B2.

[0086] In this embodiment, the maximum value between the dot product of the normal corresponding to the rendering vertex and the illumination direction and 0 can be determined as the illumination parameter corresponding to the rendering vertex, that is:

[0087] float diff=max(dot(norm, lightDir), 0.0),

[0088] Among them, float diff represents the lighting parameter corresponding to the rendered vertex, norm represents the normal corresponding to the rendered vertex, lightDir represents the lighting direction, dot(norm, lightDir) represents the dot product of the normal and the lighting direction, and max(dot(norm, lightDir), 0.0) means taking the maximum value of dot(norm, lightDir) and 0.0, so as to ensure that the lighting parameter corresponding to the rendered vertex is not less than 0.

[0089] Figure 3A flowchart of a method for rendering a building according to an embodiment of the present disclosure is shown. Figure 3 As shown, the building rendering method includes the following steps S301-S302:

[0090] In step S301, rendering data of a building is obtained, wherein the rendering data at least includes rendering vertices constituting the top surface and / or bottom surface of the building;

[0091] In step S302 , the top surface and / or bottom surface of the building is rendered based on the rendering vertices of the building, wherein the rendering vertices of the building are determined based on the above-mentioned method for determining the rendering vertices of the building.

[0092] In this embodiment, when rendering a building, rendering data of the building can be first obtained, including at least the rendering vertices constituting the top and / or bottom surfaces of the building. The rendering vertices of the building are not the vertices of the top and / or bottom surfaces of the building, but the rendering vertices corresponding to the vertices determined based on the above-mentioned method for determining the rendering vertices of the building; then, based on the rendering vertices of the building, the top and / or bottom surfaces of the building can be rendered. This technical solution determines at least three rendering vertices located on an arc for the same target vertex, so that the corner corresponding to the target vertex rendered based on the rendering vertex in the corresponding face of the building will appear in the shape of an arc, thereby avoiding the problem of relatively sharp corners rendered by a single target vertex in the prior art, optimizing the visual effect of building corners in the visualized electronic map, and improving the user experience.

[0093] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein.

[0094] Figure 4 The structural block diagram of the device for determining the rendering vertex of a building according to an embodiment of the present disclosure is shown. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 4 As shown, the device for determining the rendering vertex of the building includes:

[0095] A first determining module 401 is configured to determine three or more vertices of a building, wherein the vertices constitute a face of the building;

[0096] The second determining module 402 is configured to use a vertex as a target vertex and determine, based on a preset distance, the center of an arc tangent to an edge formed by the target vertex and two other adjacent vertices;

[0097] The third determining module 403 is configured to determine, from the arc, a rendering vertex corresponding to the target vertex, with the center of the arc as the vertex, and the number of the rendering vertices is at least three.

[0098] The above is a device for determining the rendering vertices of a building provided by the present application. The device targets the vertices constituting a face of the building, takes a vertex as the target vertex, and determines the arc tangent to the edge formed by the target vertex and the other two adjacent vertices and its center according to a preset distance, and further determines at least three rendering vertices corresponding to the target vertex from the arc according to the center of the arc. Since the present application determines at least three rendering vertices located on the arc for the same target vertex, the corner corresponding to the target vertex rendered based on the rendering vertex in the corresponding face of the building will appear in an arc shape, avoiding the problem of relatively sharp corners rendered by a single target vertex in the prior art, optimizing the visual effect of the corners of the building in the visualized electronic map, and improving the user experience.

[0099] In one embodiment of the present disclosure, the apparatus for determining the rendering vertices of the building may be implemented as a computer, a computing device, an electronic device, a server, a server cluster, etc. for determining the rendering vertices of the building.

[0100] As mentioned above, the corners of buildings rendered by the current rendering scheme are relatively sharp, and the rendering of relatively sharp corners needs to be optimized. To this end, in one embodiment of the present disclosure, corresponding rendering vertices can be determined for all the vertices constituting a face of the above-mentioned building. That is, all the vertices constituting a face of the building are respectively used as target vertices, and the corresponding rendering vertices are determined, or only the vertices with relatively sharp corners rendered based on the vertex are used as target vertices, and the corresponding rendering vertices are determined. The present disclosure does not impose any restrictions on which vertices are used as target vertices.

[0101] In one embodiment of the present disclosure, the preset distance refers to the distance value from the target vertex of the building to the tangent point of the arc, and the tangent point refers to the point where the arc is tangent to the edge formed by the target vertex and its two adjacent vertices. Those skilled in the art can set the value of the preset distance according to the needs of actual application, wherein the value of the preset distance can be one, that is, no matter which vertex is used as the target vertex, the value of the preset distance is the same. Of course, different distance values can also be set for different vertices. The present disclosure does not limit the specific value of the preset distance and the way of setting the value.

[0102] In another embodiment of the present disclosure, the preset distance can also be set to the radius of the circle where the arc is located. According to the value of the radius, a corresponding distance value between the target vertex and the tangent point of the arc can be calculated.

[0103] Those skilled in the art may define and assign a value to the preset distance according to the needs of actual applications. The above two definition and assignment methods achieve the same rendering effect.

[0104] To facilitate the explanation and description of the present disclosure, the specific embodiments provided by the present disclosure are described in detail below by taking the preset distance as the distance between the target vertex and the tangent point of the arc as an example.

[0105] Regarding the need to obtain three or more vertices constituting a certain surface of a building in the present disclosure, the surface in the present disclosure can be either the top surface or the bottom surface of the building, and the present disclosure does not impose any limitation.

[0106] Regarding taking one of the vertices as the target vertex, determining the center of the arc tangent to the edge formed by the target vertex and the other two adjacent vertices based on the preset distance, in one embodiment of the present disclosure, if the preset distance values set for different vertices are different, then before determining the center of the arc tangent to the edge formed by the target vertex and the other two adjacent vertices based on the preset distance, the device further includes a part that determines the preset distance based on the target vertex.

[0107] When the preset distance is the distance between the target vertex and the tangent point of the arc, in one embodiment of the present disclosure, the second determining module determines, based on the preset distance, the portion of the center of the arc tangent to the edge formed by the target vertex and two other adjacent vertices, which may be configured as follows:

[0108] On two edges formed by the target vertex and two adjacent vertices, respectively determining points whose distances to the target vertex are equal to the preset distances as tangent points;

[0109] Calculate the first angle formed by the two tangent points and the target vertex according to the preset distance, where the target vertex is the vertex of the first angle;

[0110] The center of the arc tangent to the edge formed by the target vertex and two other adjacent vertices is determined according to the first angle and the preset distance.

[0111] In this embodiment, when determining the center of the arc tangent to the edge formed by the target vertex and the other two adjacent vertices according to the preset distance, first, on the two edges formed by the target vertex and the other two adjacent vertices, points whose distance to the target vertex is equal to the preset distance are determined as tangent points, such as Figure 2A As shown, Figure 2AIn the example, it is assumed that a plane of a building includes four vertices: B1, B2, B3 and B4, where vertex B2 is the target vertex to be processed, and the preset distance is expressed as d. First, the two edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3 are determined. Then, on these two edges, two points A1 and A2 with a distance d from the target vertex B2 are determined respectively. Points A1 and A2 are the determined tangent points on the two edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3, which are tangent to the arc; then, according to the preset distance d, the angle of the first angle, that is, the angle of ∠A2B2A1, is calculated; finally, according to the angle of the first angle and the preset distance d, the position of the center O of the arc tangent to the edge formed by the target vertex B2 and the other two adjacent vertices B1 and B3 can be determined.

[0112] Furthermore, in one embodiment of the present disclosure, the step of calculating the first angle formed by the two tangent points and the target vertex according to the preset distance may be configured as follows:

[0113] Get the first vector and the second vector formed by the target vertex and the two tangent points;

[0114] Calculate the dot product of the first vector and the second vector;

[0115] multiplying the value of the preset distance by the value of the preset distance as the product of the length of the first vector and the length of the second vector;

[0116] An arc cosine operation is performed on the quotient of the point product value and the product to obtain the angle of a first angle formed by the two tangent points and the target vertex.

[0117] Continue with Figure 2A Taking an example, the process of calculating the angle of the first angle formed by two tangent points and the target vertex is introduced. First, the first vector formed by the target vertex B2 and the tangent point A1 and the second vector formed by the target vertex B2 and the tangent point A2 are obtained respectively; then the dot product value between the first vector and the second vector is calculated; then the preset distance value d is multiplied by the preset distance value d as the product of the length of the first vector and the length of the second vector; finally, the quotient of the dot product value and the product is subjected to an arc cosine operation to obtain the angle of the first angle formed by the two tangent points A1 and A2 and the target vertex B2. That is, the angle of the first angle can be calculated using the following formula:

[0118]

[0119] Where θ represents the first angle, represents the first vector, represents the length of the first vector, represents the second vector, Represents the length of the second vector. Since the length of the first vector and the length of the second vector are equal to the preset distance d in the present disclosure, the present disclosure uses the value d of the preset distance multiplied by the value d of the preset distance as the product of the length of the first vector and the length of the second vector.

[0120] Further, in one embodiment of the present disclosure, the portion of determining the center of the arc tangent to the edge formed by the target vertex and the other two adjacent vertices based on the angle of the first included angle and the preset distance may be configured as follows:

[0121] Obtain a difference between 90 degrees and the first angle divided by 2;

[0122] Obtaining a sine function value of the angle difference;

[0123] Dividing the preset distance by the sine function value to obtain the distance from the target vertex to the center of the arc;

[0124] The center of the arc is obtained according to the position of the target vertex and the distance from the target vertex to the center of the arc.

[0125] Continued use Figure 2A The scenario shown introduces the process of determining the center of the circle. Considering that points A1 and A2 are tangent points of the arc located on the two edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3, and tangent to the edges formed by the target vertex B2 and the other two adjacent vertices B1 and B3, therefore, Figure 2BThe line OA1 formed by the center O of the arc and the tangent point A1 is perpendicular to the line A1B formed by the tangent point A1 and the target vertex B2, that is, ∠OA1B2 is 90 degrees. In this way, the tangent point A1, the center O and the target vertex B2 form a right triangle. It can be seen from the above that the distance between the tangent point A1 and the target vertex B2 is the preset distance d. Therefore, based on the relevant knowledge of right triangles, it can be obtained that the distance between the center O and the target vertex B2 is the length d of the right angle formed by the tangent point A1 and the target vertex B2 divided by the sine function value of the corresponding right triangle internal angle, that is, ∠A1OB2. Since the distance between the tangent point A2 and the target vertex B2 is also d, the line between the center O and the target vertex B2 is actually the first The angle bisector of an angle, so it can be obtained that the angle of ∠A1B2O is the angle of the first angle divided by 2, ∠A1B2A2, that is, the angle of the first angle has been obtained before, then the angle of ∠A1OB2 is equal to 90 degrees minus the angle of ∠A1B2O, that is, 90 degrees minus the angle of the first angle divided by 2, so the distance between the center O and the target vertex B2 can be obtained by using the sine function value of the difference between d divided by 90 degrees and the angle of the first angle divided by 2, which can be expressed by the formula: OB2 = d / sin(90°-first angle / 2), finally, according to the position of the target vertex B2 and the calculated distance from the target vertex B2 to the center O of the arc, the position of the center of the arc can be obtained.

[0126] In one embodiment of the present disclosure, the third determining module may be configured as follows:

[0127] Subtract the first angle from 180 degrees to get the second angle formed by the two tangent points and the center of the arc.

[0128] Dividing the second included angle by the preset number of segments to obtain an angle value of the segmentation angle;

[0129] Taking the center of the arc as the vertex of the segmentation angle, determining a segmentation point on the arc according to the angle value of the segmentation angle, wherein the segmentation point is located between the two tangent points;

[0130] The segmentation point and the tangent point are used as rendering vertices corresponding to the target vertex.

[0131] Continued use Figure 2A, in this embodiment, when determining the rendering vertex corresponding to the target vertex from the arc, considering that points A1 and A2 are both tangent points, ∠OA1B2 and ∠OA2B2 are both right angles, and therefore, by subtracting the angle of the first angle from 180 degrees, the second angle formed by the two tangent points A1 and A2 and the center O of the arc with the center O as the vertex, that is, ∠A1OA2, can be obtained; and then the angle of the second angle is divided by the preset number of segments to obtain the angle value of the segmentation angle, wherein the number of segments can be based on a target. The number of rendering vertices corresponding to the vertex is set, and the present disclosure does not make any special restrictions on it. For example, if the number of rendering vertices corresponding to the final target vertex is set to 3, the number of segments can be set to the number of rendering vertices minus 1, that is, 3-1=2; then the center of the arc is used as the vertex of the segmentation angle, and according to the angle value of the segmentation angle, the segmentation point corresponding to the segmentation angle can be determined on the arc between the two tangent points. For example, when the number of segments is set to 2, the angle of the segmentation angle is the angle of the second angle divided by 2, and the segmentation point obtained in this way can be as follows Figure 2C As shown in point A3 in the figure, the angles ∠A2OB2 and ∠B2OA1 are equal, both equal to the second angle divided by 2. The split point A3 and the tangent points A1 and A2 can then be used together as the rendering vertex corresponding to the target vertex B2. Since three points can form an arc, the number of rendering vertices set in this application is at least 3. Those skilled in the art can set a different number of rendering vertices based on actual needs, and this disclosure does not impose any restrictions.

[0132] Considering that the display effects of light, shadow, and color of a rendered vertex during rendering are related to the normal of the rendered vertex, in one embodiment of the present disclosure, the apparatus may further include:

[0133] The fourth determining module is configured to determine the normal corresponding to the rendering vertex.

[0134] Furthermore, in an embodiment of the present disclosure, the fourth determining module may be configured as follows:

[0135] If the rendering vertex is a tangent point, the surface normal of the plane where the target vertex and the adjacent vertex are located is used as the normal of the rendering vertex, and the tangent point is located on the edge formed by the target vertex and the adjacent vertex;

[0136] If the rendering vertex is a segmentation point, the normal of the segmentation point is used as the normal of the rendering vertex.

[0137] The point normal of a point refers to the sum of the surface normals (unit vectors) of all planes sharing the point, where a unit vector refers to a vector with a modulus equal to 1.

[0138] like Figure 2D As shown, for the rendering vertices A1, A2 and A3, since the rendering vertex A1 is the tangent point, its corresponding normal is the surface normal of the plane A where the target vertex B2 and the adjacent vertex B1 are located. Similarly, since the rendering vertex A2 is also the tangent point, its corresponding normal is the surface normal of the plane B where the target vertex B2 and the adjacent vertex B3 are located. Since the rendering vertex A3 is the dividing point, its corresponding normal is the normal of the dividing point, that is, the sum of the surface normals of all planes sharing this point.

[0139] In order to achieve a natural transition in the lighting effect of the corners of buildings rendered based on the rendering vertices, after determining the normals corresponding to the rendering vertices, the lighting parameters corresponding to the rendering vertices can also be determined based on the normals corresponding to the rendering vertices. That is, in one embodiment of the present disclosure, the apparatus may further include:

[0140] The fifth determining module is configured to determine the lighting parameters of the rendering vertex according to the normal corresponding to the rendering vertex.

[0141] Furthermore, in an embodiment of the present disclosure, the fifth determining module may be specifically configured as follows:

[0142] The maximum value between the dot product of the normal of the rendering vertex and the lighting direction and 0 is determined as the lighting parameter corresponding to the rendering vertex.

[0143] In this embodiment, the maximum value between the dot product of the normal corresponding to the rendering vertex and the illumination direction and 0 can be determined as the illumination parameter corresponding to the rendering vertex, that is:

[0144] float diff=max(dot(norm, lightDir), 0.0),

[0145] Among them, float diff represents the lighting parameter corresponding to the rendered vertex, norm represents the normal corresponding to the rendered vertex, lightDir represents the lighting direction, dot(norm, lightDir) represents the dot product of the normal and the lighting direction, and max(dot(norm, lightDir), 0.0) means taking the maximum value of dot(norm, lightDir) and 0.0, so as to ensure that the lighting parameter corresponding to the rendered vertex is not less than 0.

[0146] The present disclosure also discloses an electronic device, Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 5 As shown, the electronic device 500 includes a memory 501 and a processor 502; wherein,

[0147] The memory 501 is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 502 to implement the above method steps.

[0148] Figure 6 It is a structural diagram of a computer system suitable for implementing the method for determining rendering vertices of a building / the method for rendering a building according to an embodiment of the present disclosure.

[0149] like Figure 6 As shown, the computer system 600 includes a processing unit 601, which can execute various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the computer system 600 are also stored in the RAM 603. The processing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0150] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom can be installed into the storage section 608 as needed. Among them, the processing unit 601 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, or an NPU.

[0151] In particular, according to embodiments of the present disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a computer-readable medium, the computer program comprising program code for executing the methods described. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 609 and / or installed from a removable medium 611.

[0152] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the diagram or block diagram can represent a module, program segment or part of the code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, as well as the combination of boxes in the block diagram and / or flow chart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0153] The units or modules described in the embodiments of the present disclosure may be implemented in software or hardware. The units or modules described may also be provided in a processor, and the names of these units or modules do not, in certain circumstances, limit the units or modules themselves.

[0154] As another aspect, the present disclosure further provides a computer-readable storage medium. This computer-readable storage medium may be included in the apparatus described in the above embodiments, or may be a standalone computer-readable storage medium not incorporated into the apparatus. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the methods described in the present disclosure.

[0155] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

Claims

1. A method for determining the rendering vertices of a building, wherein: include: determining three or more vertices of a building, wherein the vertices constitute a face of the building; Taking a vertex as a target vertex, and determining the center of an arc tangent to an edge formed by the target vertex and two adjacent vertices according to a preset distance; Taking the center of the arc as a vertex, a rendering vertex corresponding to the target vertex is determined on the arc, and the number of the rendering vertices is at least three.

2. The method according to claim 1, wherein The preset distance is the distance between the target vertex and the tangent point of the arc. Then, based on the preset distance, determining the center of the arc tangent to the edge formed by the target vertex and two adjacent vertices includes: On two edges formed by the target vertex and two adjacent vertices, respectively determining points whose distances to the target vertex are equal to the preset distances as tangent points; Calculate the first angle formed by the two tangent points and the target vertex according to the preset distance, where the target vertex is the vertex of the first angle; The center of the arc tangent to the edge formed by the target vertex and two other adjacent vertices is determined according to the first angle and the preset distance.

3. The method according to claim 2, wherein: Calculating a first angle formed by the two tangent points and the target vertex according to the preset distance includes: Get the first vector and the second vector formed by the target vertex and the two tangent points; Calculate the dot product of the first vector and the second vector; multiplying the value of the preset distance by the value of the preset distance as the product of the length of the first vector and the length of the second vector; An arc cosine operation is performed on the quotient of the point product value and the product to obtain the angle of a first angle formed by the two tangent points and the target vertex.

4. The method according to claim 2, wherein: The determining, based on the first included angle and a preset distance, of a center point of an arc tangent to a side formed by the target vertex and two other adjacent vertices includes: Obtain a difference between 90 degrees and the first angle divided by 2; Obtaining a sine function value of the angle difference; Dividing the preset distance by the sine function value to obtain the distance from the target vertex to the center of the arc; The center of the arc is obtained according to the position of the target vertex and the distance from the target vertex to the center of the arc.

5. The method according to any one of claims 1 to 4, wherein: The step of determining a rendering vertex corresponding to the target vertex on the arc with the center of the arc as the vertex includes: Subtract the first angle from 180 degrees to get the second angle formed by the two tangent points and the center of the arc. Dividing the second included angle by the preset number of segments to obtain an angle value of the segmentation angle; Taking the center of the arc as the vertex of the segmentation angle, determining a segmentation point on the arc according to the angle value of the segmentation angle, wherein the segmentation point is located between the two tangent points; The segmentation point and the tangent point are used as rendering vertices corresponding to the target vertex.

6. The method according to claim 5, wherein: The method further comprises: Determines the normal corresponding to the rendered vertex.

7. The method according to claim 6, wherein: Determining the normal corresponding to the rendering vertex includes: If the rendering vertex is a tangent point, the surface normal of the plane where the target vertex and the adjacent vertex are located is used as the normal of the rendering vertex, and the tangent point is located on the edge formed by the target vertex and the adjacent vertex; If the rendering vertex is a segmentation point, the normal of the segmentation point is used as the normal of the rendering vertex.

8. A method for rendering a building, wherein: include: Acquire rendering data of a building, the rendering data including at least rendering vertices constituting a top surface and / or a bottom surface of the building; Based on the rendering vertices of the building, the top surface and / or the bottom surface of the building are rendered, wherein the rendering vertices of the building are determined based on the method according to any one of claims 1 to 7.

9. A device for determining rendering vertices of a building, comprising: A first determining module is configured to determine three or more vertices of a building, wherein the vertices constitute a face of the building; A second determining module is configured to use a vertex as a target vertex and determine, based on a preset distance, a center point of an arc tangent to an edge formed by the target vertex and two other adjacent vertices; The third determining module is configured to determine, from the arc, a rendering vertex corresponding to the target vertex, with the center of the arc as a vertex, and the number of the rendering vertices is at least three.

10. An electronic device comprising a memory and at least one processor; wherein: The memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the at least one processor to implement the method steps according to any one of claims 1 to 8.