Method and device for generating road resources in virtual scene and computer equipment
By using normal vectors to determine a projection plane and cut road centerlines, the method automates road resource generation at intersections, addressing inefficiencies and manual labor issues, ensuring smooth and controllable road surfaces in virtual scenes.
Patent Information
- Application Number
- CN202310654250.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2024-12-06
AI Technical Summary
Existing methods for generating road resources in virtual scenes, particularly at intersections, are inefficient and require manual adjustment, leading to uneven connections and increased labor costs, with existing algorithms failing to handle three-dimensional spaces and irregular intersections effectively.
A method and device that utilize normal vectors to determine a projection plane, cut road centerlines into cutting centerlines based on projection intersection points, and generate road resources using these cutting centerlines and road widths, automating the process without manual intervention.
This approach improves the efficiency of road resource generation and virtual scene development by automating the process, ensuring smooth and controllable road surfaces, even in three-dimensional spaces, reducing labor costs and enhancing flexibility and stability.
Smart Images

Figure CN119090993A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and computer equipment for generating road resources in a virtual scene. Background Art
[0002] With the development of computer technology and the diversification of terminal functions, terminals often need to display virtual roads in virtual scenes, such as drawing virtual roads in game applications or drawing virtual props in map applications.
[0003] When multiple virtual roads form an intersection in a virtual scene, there may be an uneven connection at the intersection. Technical personnel are usually required to manually adjust or repair the geometry of the intersection, which reduces the efficiency of road resource generation and virtual scene development. Summary of the invention
[0004] The embodiment of the present application provides a method, device and computer equipment for generating road resources in a virtual scene, which can improve the generation efficiency of road resources, thereby improving the development efficiency of the virtual scene. The technical solution is as follows:
[0005] In one aspect, a method for generating road resources in a virtual scene is provided, the method comprising:
[0006] For an intersection of multiple virtual roads in a virtual scene, obtaining a road centerline of an intersection section of each virtual road in the intersection, wherein at least one of two endpoints of the road centerline is an intersection endpoint, and the intersection endpoint is adjacent to a non-intersection section of the virtual road;
[0007] Determining a projection plane of the intersection in the virtual scene based on normal vectors of each intersection section;
[0008] Based on the projection intersection points of the road center lines in the projection plane, each of the road center lines is cut to obtain a plurality of cut center lines;
[0009] The road resources of the intersection are generated based on the multiple cutting center lines and the road width of each intersection segment.
[0010] In one aspect, a device for generating road resources in a virtual scene is provided, the device comprising:
[0011] An acquisition module, for acquiring, for an intersection of multiple virtual roads in a virtual scene, a road centerline of an intersection section of each virtual road in the intersection, wherein at least one of two endpoints of the road centerline is an intersection endpoint, and the intersection endpoint is adjacent to a non-intersection section of the virtual road;
[0012] A determination module, configured to determine a projection plane of the intersection in the virtual scene based on normal vectors of each intersection section;
[0013] A cutting module, used for cutting each of the road center lines based on the projection intersection points of each of the road center lines in the projection plane to obtain a plurality of cutting center lines;
[0014] A generating module is used to generate the road resources of the intersection based on the multiple cutting center lines and the road width of each intersection section.
[0015] In some embodiments, the acquisition module is used to:
[0016] For each of the intersection sections in the intersection, reading the three-dimensional geometric data of the road centerline from the intersection curve parameters of the intersection section, wherein the intersection curve parameters are used to indicate the intersection curve of the intersection section in the intersection;
[0017] Based on the three-dimensional geometric data, the road centerline is resampled into a polyline so that distances between adjacent three-dimensional points in the resampled polyline are the same.
[0018] In some embodiments, the intersection curve parameters include: three-dimensional geometric data of the road centerline, an intersection identifier of the intersection section, a normal vector of the intersection section, and a road width of the intersection section.
[0019] In some embodiments, the determining module is used to:
[0020] Normalizing the normal vector of each intersection section to obtain the first normal vector of each intersection section;
[0021] Taking the road width of each intersection as a weight coefficient, weighted averaging the first normal vectors of each intersection to obtain the second normal vector of each intersection;
[0022] Normalizing the second normal vector of each intersection section to obtain the third normal vector of each intersection section;
[0023] Based on the average normal vector of the third normal vectors of each intersection section, the projection plane is determined from the virtual scene, so that the projection plane is perpendicular to the average normal vector and passes through the origin of the world coordinate system in the virtual scene.
[0024] In some embodiments, the cutting module comprises:
[0025] A projection submodule, used for projecting each of the road center lines onto the projection plane to obtain a projection center line;
[0026] A first determination submodule is used to determine at least one projection intersection point formed by each projection center line in the projection plane, wherein the projection intersection point refers to an intersection point of multiple projection center lines in the projection plane;
[0027] A cutting submodule, configured to cut each projection center line based on the at least one projection intersection point to obtain a plurality of projection cutting lines;
[0028] The projection submodule is further used to project the multiple projected cutting lines back to the virtual scene to obtain the multiple cutting center lines.
[0029] In some embodiments, the cutting submodule comprises:
[0030] A determination unit, configured to determine, for each of the projection center lines, at least one projection intersection point on the projection center line or an extension line of the projection center line, and to cut the projection center line into at least one projection cutting line using the at least one projection intersection point as a cutting point;
[0031] The elimination unit is used to eliminate the projection cutting lines that meet the cleaning conditions from each projection cutting line.
[0032] In some embodiments, the determining unit is configured to:
[0033] If there is an intersection between the projection center line and other projection center lines, the intersection is determined as the projection intersection point;
[0034] If there is no intersection between the projection center line and other projection center lines, the projection center line is marked as an uncut polyline. For each uncut polyline marked in the projection plane, if there is an extension line intersection between the extension line of the uncut polyline and the extension line of other uncut polylines, the extension line intersection is determined as the projection intersection point.
[0035] In some embodiments, the determining unit is further configured to:
[0036] If there is no intersection between the extension line of the uncut polyline and the extension lines of other uncut polylines, determine a first adjacent point from the uncut polyline and determine a second adjacent point from other uncut polylines, so that the distance between any three-dimensional point in the uncut polyline and any three-dimensional point in the other uncut polylines is not less than a minimum distance, where the minimum distance refers to the distance between the first adjacent point and the second adjacent point;
[0037] The first neighboring point and the second neighboring point are both determined as the projection intersection points.
[0038] In some embodiments, the cleaning condition includes: two endpoints of the projected cutting line include one of the projected intersection points and an isolated endpoint, and the isolated endpoint refers to an endpoint that is neither the intersection endpoint nor the projected intersection point.
[0039] In some embodiments, the generating module comprises:
[0040] A second determination submodule is used to determine, for each cutting center line, a road surface of the intersection section based on a road width and a normal vector of the intersection section from which the cutting center line originates;
[0041] A third determination submodule is used to determine the intersection road surface of the intersection in the virtual scene based on various road curved surfaces;
[0042] A generating submodule, for generating a contour curve of the intersection road surface based on the contour polyline of the intersection road surface;
[0043] The synthesis submodule is used to synthesize the road resources of the intersection based on the contour curve of the intersection road surface.
[0044] In some embodiments, the second determining submodule is used to:
[0045] Based on the road width and the normal vector, the cutting center line is offset to obtain two road edge lines, wherein two end points of the road edge line are marked as intersection points, and three-dimensional points on the road edge line other than the two end points are marked as edge points;
[0046] The two road edge lines are used as the bilateral road edges to determine the enclosed road curved surface.
[0047] In some embodiments, the third determining submodule is used to:
[0048] Projecting each of the road curved surfaces onto the projection plane to obtain a projected road surface;
[0049] In the projection plane, determining a union road surface between each projection road surface;
[0050] The union road surface is projected back to the virtual scene to obtain the intersection road surface.
[0051] In some embodiments, the generating submodule is used to:
[0052] Eliminate the line segments that meet the deletion condition from the line segments of the contour polyline of the intersection road surface;
[0053] Smoothing the eliminated contour polylines to obtain contour smoothing lines;
[0054] Based on the contour smooth line, a contour curve of the intersection road surface is generated. In addition to the contour smooth line, the contour curve also includes a plurality of connection lines, and each connection line is obtained by connecting a group of intersection endpoints with the same source point.
[0055] In some embodiments, the intersection point includes the intersection endpoint, the projected intersection point, the isolated endpoint and the contour intersection point, and the contour intersection point refers to the intersection point of the contour lines in the union road surface; the deletion condition includes: both endpoints of the line segment belong to the intersection point.
[0056] In some embodiments, the apparatus further comprises:
[0057] The connection marking module is used to delete the three-dimensional points between any pair of intersection points in the contour polyline of the intersection road surface if there is any pair of intersection points that meet the repair conditions, connect the pair of intersection points, and mark the pair of intersection points as edge points.
[0058] In some embodiments, the repair condition includes at least one of the following: there are no other contour intersection points between any pair of contour intersection points, and there is only one intersection point between the pair of contour intersection points that does not belong to the intersection endpoint; or, there are no edge points between any pair of specified intersection points, and the specified intersection point refers to the projected intersection point or the isolated endpoint.
[0059] In some embodiments, the synthesis submodule is used to:
[0060] Filling the contour curve to obtain a closed road surface;
[0061] Retopologically retopologically the closed road surface to obtain a topological road surface;
[0062] Smoothing the topological road surface to obtain a smooth road surface;
[0063] Based on the smooth road surface, the road resources of the intersection are synthesized.
[0064] On the one hand, a computer device is provided, which includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, and the at least one computer program is loaded and executed by the one or more processors to implement the method for generating road resources in the virtual scene as described above.
[0065] On the one hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the method for generating road resources in a virtual scene as described above.
[0066] In one aspect, a computer program product is provided, the computer program product comprising one or more computer programs, the one or more computer programs being stored in a computer-readable storage medium. One or more processors of a computer device can read the one or more computer programs from the computer-readable storage medium, and the one or more processors execute the one or more computer programs, so that the computer device can execute the above-mentioned method for generating road resources in a virtual scene.
[0067] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0068] Through the normal vectors of each intersection section in the intersection, a projection plane is found in the virtual scene, so that each road center line can be cut to generate a cutting center line through the projection intersection points of the road center lines of each intersection section in the projection plane, so that through the projection intersection points marked in the projection plane, the part of the road center line that may cause the road surface to convex or concave and affect the edge flatness can be cut off in three-dimensional space, and finally the road resources of the intersection are produced according to each cutting center line. The computer program can automatically execute and produce road resources when the road center line of each intersection section is given, without the need for manual modeling of road resources such as intersection geometry, saving the labor cost of scene development, greatly improving the efficiency of road resource generation, and thus improving the efficiency of virtual scene development. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0070] Figure 1 is a schematic diagram of a polyline provided in an embodiment of the present application;
[0071] Figure 2 is a schematic diagram of an intersection provided in an embodiment of the present application;
[0072] Figure 3 is a schematic diagram of an intersection range provided in an embodiment of the present application;
[0073] Figure 4 is a schematic diagram of an intersection endpoint provided in an embodiment of the present application;
[0074] Figure 5 is a schematic diagram of an intersection generating an error result provided by an embodiment of the present application;
[0075] Figure 6 This is a schematic diagram of an intersection section intersecting at two points provided in an embodiment of the present application;
[0076] Figure 7 It is a schematic diagram of an implementation environment of a method for generating road resources in a virtual scene provided in an embodiment of the present application;
[0077] Figure 8 It is a flow chart of a method for generating road resources in a virtual scene provided by an embodiment of the present application;
[0078] Fig. 9 It is a flow chart of a method for generating road resources in a virtual scene provided by an embodiment of the present application;
[0079] Fig.10 It is a marked diagram of intersection curve parameters provided in an embodiment of the present application;
[0080] Fig.11 is a schematic diagram of a road centerline provided in an embodiment of the present application;
[0081] Fig.12 is a schematic diagram of the intersection of projection center lines provided in an embodiment of the present application;
[0082] Fig.13 is a schematic diagram of a projection center line that does not intersect provided by an embodiment of the present application;
[0083] Fig.14 is a schematic diagram of an extension line of a projection center line provided in an embodiment of the present application;
[0084] Fig.15 is a schematic diagram of an intersection of extended lines provided in an embodiment of the present application;
[0085] Fig.16 It is a schematic diagram of an embodiment of the present application in which the extension lines of the projection center lines do not intersect;
[0086] Fig.17 is a schematic diagram of a proximity point provided in an embodiment of the present application;
[0087] Fig.18 This is a comparison diagram before and after cleaning of a projected cutting line provided in an embodiment of the present application;
[0088] Fig.19 is a schematic diagram of a road edge line provided in an embodiment of the present application;
[0089] Fig. 20 is a schematic diagram of a road curved surface provided in an embodiment of the present application;
[0090] Fig.21is a schematic diagram of a contour polyline of an intersection road surface provided in an embodiment of the present application;
[0091] Fig. 22 is a schematic diagram of a damaged contour polyline that meets repair condition 1 provided in an embodiment of the present application;
[0092] Fig.23 is a repair schematic diagram of a segment to be repaired in a damaged contour polyline that meets repair condition 1 provided in an embodiment of the present application;
[0093] Fig.24 is a schematic diagram of a damaged contour polyline that meets the second repair condition provided in an embodiment of the present application;
[0094] Fig.25 is a repair schematic diagram of a section to be repaired in a damaged contour polyline that meets the second repair condition provided in an embodiment of the present application;
[0095] Fig.26 is a schematic diagram of a contour smoothing line provided in an embodiment of the present application;
[0096] Fig. 27 is a schematic diagram of a contour curve provided in an embodiment of the present application;
[0097] Fig.28 is a schematic diagram of a closed road surface provided in an embodiment of the present application;
[0098] Fig.29 It is a rendering of a road resource provided in an embodiment of the present application;
[0099] Fig.30 It is a structural schematic diagram of a device for generating road resources in a virtual scene provided in an embodiment of the present application;
[0100] Fig.31 is a structural schematic diagram of a computer device provided in an embodiment of the present application;
[0101] Fig.32 It is a structural diagram of another computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0102] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0103] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity and execution order.
[0104] In the present application, the term "at least one" means one or more, and the meaning of "plurality" means two or more. For example, a plurality of three-dimensional points means two or more three-dimensional points.
[0105] In this application, the term "including at least one of A or B" refers to the following situations: including only A, including only B, and including both A and B.
[0106] The user-related information (including but not limited to the user's device information, personal information, behavior information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application, when applied to specific products or technologies in the manner of the embodiments of this application, are all permitted, agreed, authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant information, data and signals must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the intersection curve parameters of the intersection sections involved in this application are all obtained with full authorization.
[0107] The following describes the terms involved in the embodiments of the present application.
[0108] Virtual scene: is a virtual environment displayed (or provided) when an application is running on a terminal. The virtual scene can be a simulation environment of the real world, a semi-simulated and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiment of the present application does not limit the dimension of the virtual scene. For example, the virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities, and users can control virtual objects to move in the virtual scene. Optionally, the virtual scene can also be used for virtual scene confrontation between at least two virtual objects, and there are virtual resources in the virtual scene that can be used by at least two virtual objects.
[0109] Game engine: refers to some pre-written editable computer game systems or core components of some interactive real-time graphics applications. These systems provide game designers with various tools needed to write games, with the aim of allowing game designers to easily and quickly create game programs without starting from scratch. Game engines include the following systems: rendering engine (i.e. "renderer", including 2D graphics engine and 3D graphics engine), physics engine, collision detection system, sound effects, script engine, computer animation, artificial intelligence, network engine and scene management.
[0110] Procedural Content Generation (PCG): also known as programmatic content dynamic generation, it requires users to input parameters and basic materials, and then uses a series of established rules and algorithms to generate content in large quantities in real time or offline.
[0111] Mesh: The basic unit in computer graphics is called Mesh, and the most common Mesh is a triangular face mesh. For 3D models, since 3D models are made up of polygons, and a complex polygon is actually made up of multiple triangular faces, the outer surface of a 3D model is composed of multiple triangular faces connected to each other. In three-dimensional space, the points that make up these triangular faces and the collection of the edges of the triangles are Mesh.
[0112] Polyline: Also known as polyline, it refers to a polyline obtained by connecting points in three-dimensional space using straight line segments in a specific order. In other words, a polyline is in the shape of a polyline and is defined by a series of three-dimensional points (also called vertices). Usually, a polyline is described by a set of ordered three-dimensional points. A three-dimensional point refers to a point in three-dimensional space defined by three-dimensional coordinates of x, y, and z.
[0113] like Figure 1 As shown in the figure, a polyline is shown: the polyline contains a total of 19 3D points with indices ranging from 0 to 18, and each two adjacent 3D points are connected to form a line segment on the polyline. Therefore, in other words, this polyline contains 18 line segments, and each line segment is formed by connecting a pair of adjacent 3D points. This polyline involves two endpoints, one endpoint is the 3D point with index 0 (the starting point of the polyline), and the other endpoint is the 3D point with index 18 (the end point of the polyline).
[0114] Convex polygon: When a set of adjacent convex polygons is used to describe a 3D virtual scene, a convex polygon is the component unit of the virtual road mesh. Unlike polylines, convex polygons connect the starting point and the end point of a polyline with a straight line to form a closed graphic area.
[0115] Vector normalization: refers to converting a vector into a vector with the same direction and a modulus of 1. It can be seen that the direction of the vector does not change before and after normalization, but the modulus becomes unit 1.
[0116] Intersection range: refers to the range of an intersection formed by multiple virtual roads. The section of each virtual road within the intersection range is called an intersection section.
[0117] like Figure 2As shown, an intersection is shown: the center lines of several virtual roads are input (such as Figure 2 ), and specify the road width of each virtual road (such as Figure 2 The strip shadow part in the figure constitutes three intersections in the virtual scene.
[0118] like Figure 3 As shown, a kind of intersection range is shown: Figure 2 The three intersections formed on the basis of each intersection have the following intersection range: Figure 3 As shown in the dotted shadow part in the figure, each intersection range is the coverage range of the intersection generated for the input virtual road. It can be seen that the intersection range cuts the center line of the virtual road into thick black lines and thick white lines. The thick white line is the intersection curve, and the thick black line is the non-intersection curve.
[0119] Intersection endpoint: Since the intersection range not only cuts the center line of the virtual road into intersection curves and non-intersection curves, the point where the intersection curve and the non-intersection curve meet on the center line of each virtual road is called the intersection endpoint. In other words, the intersection range is also regarded as cutting the entire virtual road into intersection sections and non-intersection sections. In this way, the endpoint of each virtual road on the center line of the intersection section adjacent to the non-intersection section is called the intersection endpoint.
[0120] like Figure 4 As shown, a kind of intersection endpoint is shown: the intersection curve of each virtual road is drawn as a black solid line, and the non-intersection curve of each virtual road is drawn as a black dotted line, so that the intersection curve and the non-intersection curve are connected (such as Figure 4 The dot marked in the middle is the endpoint of the intersection.
[0121] Boolean calculation: Boolean calculation is a digital symbolic logic deduction method, including union, intersection, and subtraction. This logic calculation method is used in graphics processing operations to combine simple basic graphics to produce new shapes, and has developed from two-dimensional Boolean calculations to three-dimensional graphics Boolean calculations. Due to Boole's special contribution to symbolic logic calculations, many computer languages refer to logical operations as Boolean operations, and their results as Boolean values.
[0122] The technical concept of the embodiments of the present application is described below.
[0123] At present, terminals generally have the need to draw virtual roads in virtual scenes, such as the need to display virtual road conditions in some game applications, or the need to display simulated road conditions in some map applications and navigation applications. When the terminal displays an intersection formed by multiple virtual roads, it is easy to have an uneven connection at the intersection. Therefore, technicians need to manually model road resources (such as road geometry, road 3D model), mark each intersection, and manually make / adjust / repair the geometry of all intersection sections in each intersection according to business needs. In addition, once the intersection is modified, a lot of related work needs to be started again. Considering that road resources themselves are a large number of frequently modified parts in business scenarios such as games, maps, and navigation, it is obvious that the generation efficiency of road resources is low, the development efficiency of virtual scenes is low, and a lot of manpower is consumed. Furthermore, even if manual modeling is adopted, it is difficult to ensure that the intersection curves in the intersection are unified and smooth, and the final results are often difficult to control.
[0124] Furthermore, for intersections in some specific cases, a programmatic generation algorithm can be used to generate road resources. In the first specific case, for intersections without vertical height differences, each road surface within the intersection range can be intersected by Boolean operations, and then the road edge lines of the obtained intersections can be smoothed. In the second specific case, for the situation where the road center lines of all intersection sections within the intersection range intersect at one point, for each intersection endpoint, it is sorted clockwise (or counterclockwise) with the intersection point as the center, and then, for each two adjacent intersection endpoints, it is connected in the order of the starting intersection endpoint, the road center point, and the ending intersection endpoint, and a polyline Polyline can be obtained, and after offsetting according to the road width of each intersection endpoint, another polyline Polyline can be obtained, and then smoothed.
[0125] However, the above programmatic generation algorithms can only generate road resources for intersections in specific situations. In the above two specific situations, since both require the input intersection curve and the output intersection geometry to be in the same plane, they do not support the generation of intersections in three-dimensional space, such as when there is a vertical height difference between virtual roads.
[0126] Furthermore, for the solution to the first specific case, since the algorithm needs to smooth the road edge line after the Boolean operation, if the road edge line is damaged, the intersection cannot be generated normally, so it is difficult to generate correct results for some irregular intersections. Figure 5As shown, the erroneous results (a) and (b) generated at two special-shaped intersections are shown. It can be seen that due to the damage to the road edge line, the generated intersection is not smooth and even has a convex road surface, which obviously affects the rendering effect of the virtual scene. Moreover, for some racing games, it may also cause the player's virtual car to get stuck on the convex road surface and other bugs (problems).
[0127] Furthermore, for the solution to the second specific situation, since the algorithm requires that the center lines of all intersections within the intersection meet at one point, this has very narrow applicability in virtual scenes and poor flexibility in actual operations, because in most cases the center lines of the intersections within the intersection do not meet at the same point, or even have no intersection. In this case, the algorithm is not applicable and it is often necessary to switch to manual modeling. Figure 6 As shown, it shows a situation where the center lines of the roads of various intersection sections within the intersection range intersect at two points. At this time, the algorithm is not available and the correct result cannot be generated programmatically, requiring technicians to manually model.
[0128] In view of this, the embodiments of the present application provide a method for generating road resources in a virtual scene, which specifically involves a programmatic intersection geometry generation algorithm based on Boolean operations, which is used to programmatically generate the geometry of intersections (geometry is a type of road resource), and can be regarded as a fully automated PCG algorithm for intersections. The technician only needs to simply input the intersection curve parameters of each intersection section in the intersection, and configure a separate intersection identifier for all intersection sections in each intersection. After that, the intersection geometry will be quickly calculated and automatically produced by the computer program, and encapsulated into road resources. The entire process does not require manual modeling by the technician, which improves the efficiency of road resource generation, thereby improving the efficiency of virtual scene development, and also saving the labor cost of scene development. The intersection geometry here refers to the curved surface geometry of the intersection, that is, the road resources generated based on the smooth road surface involved in the embodiments below.
[0129] Furthermore, the intersection geometry generation algorithm of the present application not only supports the generation of intersections in three-dimensional space, but also does not restrict the intersection of virtual roads in the intersection. For example, it does not restrict whether there is a vertical height difference between the virtual roads at the intersection, nor does it restrict the road center lines of all virtual roads at the intersection to intersect at one point, and does not even require any intersection between the road center lines of the virtual roads. Therefore, the correct intersection geometry can be generated under any circumstances, and the standardization requirements for the input intersection curve parameters are extremely low, which greatly improves the calculation efficiency of road resources, and the generation results are more stable and more compatible.
[0130] Furthermore, the intersection geometry output by the algorithm can also ensure smooth contours and smooth road surfaces, and the final road surface results are easy to control, highly controllable, editable, and operable. In this way, even in the face of a large number of frequently modified road parts in business scenarios such as games, maps, and navigation, it is possible to quickly edit the roads in the virtual scene, improving the editing efficiency of the virtual scene.
[0131] The following is an introduction to the system architecture of the embodiments of the present application.
[0132] Figure 7 Schematic diagram of the implementation environment of a method for generating road resources in a virtual scene provided by an embodiment of the present application. Figure 7 The implementation environment includes: a terminal 101 and a server 102, and the terminal 101 is directly or indirectly connected to the server 102 through a wired network or a wireless network.
[0133] Terminal 101 installs and runs an application that supports virtual scenes. Optionally, the application includes: any one of a game application, a map application, a navigation application, a virtual reality application or a three-dimensional map program. In some embodiments, when terminal 101 runs the application, the user interface of the application is displayed on the screen of terminal 101, and based on the user's opening operation in the user interface, the virtual scene is loaded and displayed in the application, and the user uses terminal 101 to operate the virtual object in the virtual scene to perform activities, and the activities include but are not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing, and confronting. Schematically, the virtual object can be a virtual character, such as a simulated character or an anime character.
[0134] The server 102 includes at least one of a single server, multiple servers, a cloud computing platform, or a virtualization center. The server 102 is used to provide background services for applications that support virtual scenes. Optionally, the server 102 undertakes the main computing work, and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the main computing work; or, the server 102 and the terminal 101 adopt a distributed computing architecture for collaborative computing.
[0135] The embodiment of the present application does not specifically limit the execution entity of the intersection geometry generation algorithm.
[0136] In an exemplary scenario, the intersection geometry generation algorithm of the present application runs in the server 102, that is, the server 102 runs the intersection geometry generation algorithm on all intersections in the virtual scene to programmatically and automatically produce road resources (at least including intersection geometry) for the intersections, thereby realizing offline production of road resources, and then encapsulating the road resources into the installation package of the application, so that the terminal 101 can download the installation package and install the application, and then decompress the road resources, and then draw each virtual road and the intersection formed by them when the virtual scene needs to be presented.
[0137] In another exemplary scenario, the intersection geometry generation algorithm of the present application runs in the terminal 101. This is aimed at some more flexible virtual scenes. The position where the virtual image controlled by the user appears / is born / is launched / logged in / refreshed in the virtual scene is not fixed. Therefore, if the terminal 101 detects that there is an intersection in the virtual scene that needs to be drawn this time, the intersection geometry generation algorithm can be run locally to programmatically and automatically produce the road resources of the intersection (at least including the intersection geometry), and then draw the various virtual roads and the intersections formed by them on the screen based on the road resources.
[0138] Optionally, server 102 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0139] Optionally, the device type of the terminal 101 includes at least one of: a smart phone, a tablet computer, a smart speaker, a smart watch, an XR (Extended Reality) device, a VR (Virtual Reality) device, an AR (Augmented Reality) device, an MR (Mixed Reality) device, a smart handheld game device, a vehicle-mounted terminal, a laptop computer, and a desktop computer, but is not limited thereto. For example, the terminal 101 is a smart phone, or other handheld portable game devices. The following embodiments are illustrated by taking the terminal including a smart phone as an example.
[0140] Those skilled in the art will appreciate that terminal 101 generally refers to one of a plurality of terminals, and the number of the terminals 101 may be more or less. For example, there may be only one terminal, or there may be dozens or hundreds of terminals, or a greater number. The present application embodiment only uses terminal 101 as an example, but does not limit the number of terminals and device types.
[0141] The following describes the basic process of the method for generating road resources in a virtual scene according to an embodiment of the present application.
[0142] Figure 8 is a flow chart of a method for generating road resources in a virtual scene provided by an embodiment of the present application. Figure 8 This embodiment is executed by a computer device, which may be provided as the terminal 101 or the server 102 in the above implementation environment. This embodiment includes the following steps:
[0143] 801. A computer device obtains, for an intersection of multiple virtual roads in a virtual scene, a road centerline of an intersection section of each virtual road in the intersection, wherein at least one of two endpoints of the road centerline is an intersection endpoint, and the intersection endpoint is adjacent to a non-intersection section of the virtual road.
[0144] Among them, the virtual road refers to a road set in a virtual scene. The road material can change according to the scene environment, such as wood, asphalt, asphalt, etc. The road dimension can be two-dimensional or three-dimensional. For example, a three-dimensional virtual road is set in a three-dimensional virtual scene, and a two-dimensional virtual road is set in a two-dimensional virtual scene. The embodiment of the present application does not specifically limit this.
[0145] Among them, an intersection refers to an intersection formed by the intersection of at least two virtual roads. For example, an intersection can be a T-junction, a crossroads, etc. The area covered by the intersection is called the intersection range. The intersection range divides each virtual road into intersection sections and non-intersection sections, and at the same time divides the center line of each virtual road into intersection curves and non-intersection curves. The embodiments of the present application do not specifically limit this.
[0146] Among them, since the intersection range of the intersection divides the road centerline of each virtual road into intersection curves and non-intersection curves, the road centerline of the intersection section of each virtual road in the intersection refers to the intersection curve of this virtual road in the intersection, and the road centerline of the non-intersection section of each virtual road in the intersection refers to the non-intersection curves of this virtual road except the intersection curve. Since the embodiment of the present application does not involve operating the non-intersection curves of virtual roads, unless otherwise specified, the road centerline of the intersection section of each virtual road in the intersection is referred to as the road centerline of the intersection section or the intersection curve.
[0147] Among them, each road centerline (i.e., intersection curve) must contain two endpoints. In order to distinguish the endpoint attributes, the endpoints on the road centerline that are adjacent to the non-intersection section are called intersection endpoints. In other words, the endpoints adjacent to the intersection curve and the non-intersection curve are called intersection endpoints, and the endpoints that are not intersection endpoints are called isolated endpoints. It can be seen that for the road centerline of each virtual road, at least one of the two endpoints of the center of this road is an intersection endpoint.
[0148] In some embodiments, the road resources of the intersection are generated with each intersection in the virtual scene as a unit. Thus, for the intersection to be processed currently, each virtual road within the intersection range is determined, and the section of each virtual road within the intersection range is called an intersection section, and the remaining sections of the virtual road that are not intersection sections are called non-intersection sections. Furthermore, the road centerline of the intersection section is obtained for each intersection section of the virtual road. The road centerline of the intersection section is also called the intersection curve of the virtual road in the intersection, and the road centerline of the non-intersection section is also called the non-intersection curve of the virtual road. Each intersection curve contains two endpoints, and at least one of the two endpoints belongs to the intersection endpoint. The intersection endpoint refers to the endpoint on the road centerline adjacent to the non-intersection section. The method for obtaining the intersection curve will be described in detail in the next embodiment, and will not be repeated here.
[0149] 802. The computer device determines a projection plane of the intersection in the virtual scene based on normal vectors of each intersection segment.
[0150] The normal vector of each intersection section refers to a direction vector that is perpendicular to the road surface of the intersection section and points upward.
[0151] The projection plane is a plane passing through the origin of the world coordinate system in the virtual scene. For example, the projection plane is a plane passing through the origin and perpendicular to the average normal vector of each intersection. The calculation method of the average normal vector will be described in detail in the next embodiment and will not be repeated here.
[0152] In some embodiments, for each intersection section of a virtual road in an intersection, it is also necessary to obtain the normal vector of the intersection section, and then based on the normal vectors of all intersection sections, a projection plane can be found in the virtual scene, so that the center line of the road of each intersection section can be automatically cut with the help of this projection plane. This is because it is difficult to measure the topological relationship of the center line of each intersection section in three-dimensional space, and the complexity of its cutting is relatively high. By finding a projection plane through the normal vectors of all intersection sections, the topological relationship of each intersection section in three-dimensional space can be projected into a two-dimensional plane, and the analysis and calculation of the topological relationship in the two-dimensional plane are easy to implement, which can greatly improve the efficiency of cutting the center line of the road, and then improve the calculation efficiency of the road resources at the intersection. The method for determining the projection plane will be described in detail in the next embodiment, and will not be repeated here.
[0153] 803. The computer device cuts each of the road center lines based on the projection intersection points of each of the road center lines in the projection plane to obtain a plurality of cut center lines.
[0154] Among them, each projection intersection point refers to the intersection point formed by at least two road center lines (or their extension lines) after being projected onto the projection plane. For example, two (or more) road center lines meet at an intersection point after being projected onto the projection plane. This intersection point belongs to a projection intersection point. For another example, the extension lines of two (or more) road center lines after being projected onto the projection plane meet at an intersection point. This intersection point also belongs to a projection intersection point. For another example, if there are multiple road center lines themselves and their extension lines have no intersection points in the projection plane, the next embodiment will also describe a case of finding a point from the road center line marked as a projection intersection point. The specific search method will be described in detail in the next embodiment and will not be repeated here.
[0155] In some embodiments, for each road centerline, it is necessary to ensure that after the road centerline is projected onto the projection plane determined in step 802, there is at least one projection intersection point on itself or its extension line. In this way, the road centerline can be cut according to each projection intersection point on the road centerline to obtain the cutting centerline generated by cutting the road centerline.
[0156] Optionally, since at least one cutting centerline will be generated after cutting a road centerline, the cutting centerlines generated by the cutting can be cleaned, for example, the cutting centerlines formed by the connection of the projected intersection points and the isolated endpoints can be discarded. This is to avoid introducing convex and uneven edges in the road surface, because the polylines formed by the connection of the projected intersection points and the isolated endpoints are likely to cause convex or concave uneven edges, and have no additional contribution to the formation of the road surface at the intersection. Therefore, the road surface at the intersection does not need to consider the polylines formed by the connection of the projected intersection points and the isolated endpoints, and can be discarded to improve the flatness of the edges of the road surface.
[0157] It should be noted that the cutting center line and the road center line both refer to polylines in the three-dimensional space, that is, the virtual scene (rather than polylines in the projection plane). The cutting method of the road center line will be described in detail in the next embodiment and will not be repeated here.
[0158] 804. The computer device generates road resources of the intersection based on the multiple cutting center lines and the road width of each intersection segment.
[0159] In some embodiments, for each virtual road, a cutting centerline generated after cutting the road centerline of its intersection section is obtained in step 803, and then, the road resources of the intersection are generated according to the cutting centerlines of all intersection sections in the intersection and the road widths of all intersection sections. Optionally, the road resource at least includes the geometry of the intersection, and the geometry at least includes the Mesh data of the smooth road surface of the intersection. In this case, the cutting center line of each intersection section can be offset according to the road width of the intersection section to obtain the road edge lines on both sides of the intersection section, and then the road surface covered by the intersection section itself can be determined. Then, the road surfaces of all intersection sections will surround the intersection road surface of the entire intersection, and then post-processing is performed on the basis of the intersection road surface to obtain the Mesh data of the smooth road surface (i.e., the intersection geometry). The Mesh data of the smooth road surface can be directly encapsulated into the road resource of the intersection, or the Mesh data of the smooth road surface and the point cloud data of each triangle vertex in the Mesh can be packaged and packaged into the road resource of the intersection. The Mesh data of the smooth road surface, the point cloud data of each triangle vertex in the Mesh and the road material of the intersection can also be combined to package and package them into the road resource of the intersection. The embodiment of the present application does not specifically limit the content of the road resources.
[0160] In the above process, a programmed intersection geometry generation algorithm is provided. It only needs to give the intersection curves of each intersection section as input signals, and the above steps 801 to 804 can be automatically executed by a computer program to produce road resources for the intersection. Any intersection in the virtual scene can use this intersection geometry generation algorithm, which not only supports the geometry generation of intersections in three-dimensional space, but is also not limited to a limited number of specific situations. Instead, it can be applied to the intersection of any virtual roads, such as being compatible with or without vertical height differences, and all virtual roads intersecting at one point, multiple points, or even without intersections. Therefore, it has strong versatility and compatibility. And because steps 801 to 804 are computer programs that quickly and automatically generate road resources, there is no need for technical personnel to manually model intersection geometry, which saves the labor cost of scene development, improves the efficiency of road resource generation, and thus improves the efficiency of virtual scene development. In addition, even if it is necessary to edit the intersection in the virtual scene later, the editing process can be re-run by the computer program, which greatly improves the editing efficiency of the virtual scene. It can also be applied to any development tool with geometric development functions, and can also be integrated into a game development engine, with good portability.
[0161] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.
[0162] The method provided in the embodiment of the present application finds a projection plane in the virtual scene through the normal vectors of each intersection section in the intersection, so that each road center line can be cut to generate a cutting center line through the projection intersection points of the road center lines of each intersection section in the projection plane, so that the part of the road center line that may cause the road surface to convex or concave and affect the edge flatness can be cut off in three-dimensional space through the projection intersection points marked in the projection plane, and finally the road resources of the intersection are produced according to each cutting center line. The computer program can automatically execute and produce road resources when the road center line of each intersection section is given, without the need for manual modeling of road resources such as intersection geometry, saving the labor cost of scene development, greatly improving the generation efficiency of road resources, and thus improving the development efficiency of virtual scenes.
[0163] Furthermore, this road resource generation scheme not only supports the generation of intersections in three-dimensional space, but also does not restrict the intersection of virtual roads in the intersection. For example, it does not restrict whether there is a vertical height difference between the virtual roads at the intersection, nor does it restrict the center lines of all virtual roads at the intersection to intersect at one point. It does not even require any intersection between the center lines of the virtual roads. Therefore, the correct intersection geometry can be generated under any circumstances, and the standardization requirements for the input intersection curve parameters are extremely low, which greatly improves the calculation efficiency of road resources, and the generation results are more stable and more compatible.
[0164] Furthermore, the road resources generated by the computer program will remove the possible uneven connection phenomenon due to the cut-off part of the projection intersection point, ensuring its smooth contour and road surface, and the final road surface result is easy to control, so the generated road resources have high accuracy, good rendering effect, high controllability, strong editability and operability. In this way, even in the face of a large number of frequently modified road parts in business scenarios such as games, maps, and navigation, it is possible to realize the rapid editing of roads in virtual scenes, improving the editing efficiency of virtual scenes.
[0165] In the previous embodiment, the basic process of the road resource generation solution at the intersection in the virtual scene was briefly introduced. In the embodiment of the present application, a proposed intersection geometry generation algorithm will be combined to explain in detail the various implementation methods of each step of the entire road resource generation solution.
[0166] Fig. 9 is a flow chart of a method for generating road resources in a virtual scene provided by an embodiment of the present application. Fig. 9 This embodiment is executed by a computer device, which may be provided as the terminal 101 or the server 102 in the above implementation environment. This embodiment includes the following steps:
[0167] 901. A computer device obtains, for an intersection of multiple virtual roads in a virtual scene, intersection curve parameters of an intersection section of each virtual road in the intersection, where the intersection curve parameters are used to indicate an intersection curve of the intersection section in the intersection.
[0168] In some embodiments, the road resources of the intersection are generated with each intersection in the virtual scene as a unit, so that for the intersection to be processed currently, each virtual road within the intersection range is determined, and the section of each virtual road within the intersection range is called an intersection section, and the remaining sections of the virtual road that are not intersection sections are called non-intersection sections. Then, for each intersection section of the virtual road, the intersection curve parameter of the intersection section is obtained, and this intersection curve parameter is used to indicate the intersection curve of the intersection section (i.e., the road centerline of the intersection section involved in the following step 902).
[0169] In some embodiments, the above-mentioned intersection curve parameters can be parameters of the intersection to be created, or can be parameters of the intersection to be edited. The embodiment of the present application does not specifically limit whether the production plan of road resources is applied to creating intersections or editing intersections.
[0170] In some embodiments, the above-mentioned intersection curve parameters may be parameters input by a technician, may be parameters read from a local database, or may be parameters downloaded from a cloud database. The embodiment of the present application does not specifically limit the source of the intersection curve parameters.
[0171] In some embodiments, the technician inputs the road width and rotation information related to each intersection curve in the virtual scene, and then the technician or computer device sets a separate intersection identification (ID) for all intersection curves involved in each intersection, and the intersection identification is recorded as junction_id, so that all intersection curves in the same intersection have the same intersection identification junction_id, while intersection curves in different intersections have different intersection identification junction_ids. In this way, the intersection to which the intersection curve belongs is distinguished according to the intersection identification junction_id, and then all intersection curves with the same intersection identification junction_id are regarded as an intersection parameter set of an intersection, and each intersection curve in the intersection parameter set is an intersection curve parameter of a virtual road in this intersection.
[0172] In some embodiments, the intersection curve parameter of any virtual road at an intersection includes at least one of the following:
[0173] (a) 3D geometric data of the road centerline
[0174] In the case where the road centerline is implemented as a polyline including multiple 3D points, its 3D geometric data may include the 3D spatial coordinates of each 3D point on the road centerline.
[0175] like Fig.10 As shown, Fig.10 The thick black line in the figure shows the center line of a virtual road at an intersection. The center line of the road is a polyline of multiple three-dimensional points. Its three-dimensional geometric data includes the three-dimensional spatial coordinates (x, y, z) of each three-dimensional point in the world coordinate system of the virtual scene. Of course, it may also include three-dimensional spatial coordinates in other coordinate systems, because the three-dimensional spatial coordinates between different coordinate systems can be converted to each other.
[0176] (b) The left and right widths of each 3D point on the road centerline
[0177] Each road centerline has a road width attribute, which is used to generate the road surface. The road width can be divided into left width and right width. The left width indicates how far the road centerline needs to be offset to the left to get the left edge of the road surface, and the right width indicates how far the road centerline needs to be offset to the right to get the right edge of the road surface.
[0178] If there is only one width data, it can be considered that the left width and the right width are equal. This width data can be the width of a single side or the total width of both sides, which is configured by the technician. The embodiment of the present application does not specifically limit this.
[0179] When generating a road surface, the road centerline needs to be offset to the left according to the left width to obtain the left edge line of the road surface, and offset to the right according to the right width to obtain the right edge line of the road surface. Then, the offset trajectories of the left edge line, the right edge line and the two end points of the road centerline can form a closed road surface.
[0180] When the road centerline is implemented as a polyline containing multiple 3D points, each 3D point has the attribute of road width. Similarly, each 3D point has a left width and a right width. The left width indicates how far the 3D point needs to be offset to the left to get the corresponding edge point on the left edge line, and the right width indicates how far the 3D point needs to be offset to the right to get the corresponding edge point on the right edge line. In this way, the road width of the intersection can be finely controlled. For example, if the width of the two ends of the intersection is inconsistent, it can be achieved by controlling the left and right widths of the 3D points one by one.
[0181] like Fig.10 As shown, Fig.10The thin black line in the figure shows the contour of the road surface of an intersection in a virtual road. It can be found that the road width is narrower at the left end of the intersection and wider at the right end. This is actually because the left and right widths of a series of three-dimensional points on the road centerline from the left end to the right end gradually increase, presenting a visual effect that the road surface gradually widens from the left end to the right end.
[0182] (c) Normal direction of each 3D point on the road centerline
[0183] When the road centerline is implemented as a polyline containing multiple 3D points, each 3D point has a normal direction attribute, which refers to the direction perpendicular to the road surface and upward. It is similar to the point normal vector of the vertex in Mesh. The point normal vector means: for a regular surface R(u, v) in three-dimensional space, the normal vector of the tangent plane (Ru, Rv) at the point (u, v) is the normal vector of the surface at the point (u, v). The regular surface here refers to the road surface, and the point refers to the 3D point on the road centerline, so the point normal vector of the 3D point can indicate the normal direction of the 3D point.
[0184] like Fig.10 As shown, Fig.10 The dotted line starting from each 3D point on the center line of the middle road shows the normal direction of each 3D point. The normal direction of each 3D point is actually a ray starting from the 3D point.
[0185] (d) The intersection sign of the intersection where the intersection section belongs
[0186] That is, each intersection has an intersection identifier (i.e., intersection ID) of the intersection to which it belongs, recorded as junction_id of the intersection. All intersections located at the same intersection have the same intersection identifier junction_id, and intersections located at different intersections have different intersection identifiers junction_id.
[0187] The above intersection curve parameters (a) to (d) can comprehensively describe the various attributes of the intersection section of any virtual road at an intersection, and technical personnel can use development tools to conveniently set them when performing scene editing or scene development. For example, development tools include but are not limited to some geometry development software that supports PCG (programmed generation), such as SideFX Houdini, etc., and can also be integrated into the game engine in the form of plug-ins to realize plug-in-based interactive identification of intersection ranges and configuration of intersection curve parameters. Therefore, it is convenient, fast and easy to implement, which helps to improve the efficiency of scene editing and scene development.
[0188] In some embodiments, the intersection curve parameters of the intersection section of any virtual road in the intersection include: three-dimensional geometric data of the centerline of the road, the intersection identification of the intersection section, the normal vector of the intersection section and the road width of the intersection section, wherein the normal vector of the entire intersection section includes the point normal vector of each three-dimensional point on the centerline of the road.
[0189] In this way, it is convenient to classify intersection curve parameters based on intersection signs, because intersection curves with the same intersection sign must belong to the same intersection. Therefore, after determining the uniquely assigned intersection sign for each intersection, all intersection curve parameters with the same intersection sign can be found. These intersection curve parameters are a set of intersection curve parameters of all intersection sections in the intersection.
[0190] Furthermore, in the subsequent road resource production stage, the intersection curve parameters are read in step 902 to obtain the three-dimensional geometric data of the road centerline, the intersection curve parameters are read in step 904 to obtain the normal vector of the intersection section, and the intersection curve parameters are read in step 909 to obtain the road width and normal vector of the intersection section, thereby facilitating data access in the subsequent road resource production stage.
[0191] 902. The computer device reads the three-dimensional geometric data of the road centerline of each intersection section in the intersection from the intersection curve parameters of the intersection section, wherein at least one of the two endpoints of the road centerline is an intersection endpoint.
[0192] The intersection endpoint is adjacent to the non-intersection section in the virtual road.
[0193] In some embodiments, for any intersection to be processed, based on the intersection identifier uniquely assigned to the intersection, all intersection curve parameters with the intersection identifier are found, that is, the intersection curve parameters of all intersection sections in the intersection are found, and then, for each intersection section in the intersection, the three-dimensional geometric data of the centerline of the road is read from the intersection curve parameters of the intersection section.
[0194] In some embodiments, when the road centerline is implemented as a polyline containing multiple three-dimensional points, the three-dimensional geometric data of the road centerline may include the three-dimensional spatial coordinates of each three-dimensional point on the road centerline. In addition, the multiple three-dimensional points of each road centerline are arranged in order, and the order of the three-dimensional points represents the connection order of the two end three-dimensional points of each line segment in the polyline. Among them, each road centerline has two endpoints, and at least one of the two endpoints is an intersection endpoint, which refers to the endpoint on the road centerline that is adjacent to the non-intersecting road segment.
[0195] like Fig.11 As shown, an intersection consisting of three intersecting road sections is shown, and three thick black lines represent the road center lines 11 to 13 of the three intersecting road sections respectively, wherein each road center line has two endpoints, and one of the two endpoints is the intersection endpoint, and the other is not the intersection endpoint (called an isolated endpoint). Fig.11 In the figure, the intersection endpoints 11a to 13a are marked with circles, and the isolated endpoints 11b to 13b are marked with squares.
[0196] In some embodiments, an attribute tag is configured for the two endpoints of each road centerline, and this attribute tag is used to identify the topological attributes of the endpoints in the intersection. For example, the attribute tag junction_terminal_point is used to represent the intersection endpoint, and the attribute tag insular_terminal_point is used to represent the isolated endpoint. In this way, for the two endpoints of the start point and the end point of each road centerline Polyline, if any endpoint belongs to the intersection endpoint, the attribute tag of the endpoint is set to junction_terminal_point, otherwise the attribute tag of the endpoint is set to insular_terminal_point. Obviously, Fig.11 The three intersection endpoints 11a-13a (ie, circular points) are marked as junction_terminal_point, and the three isolated endpoints 11b-13b (ie, square points) are marked as insular_terminal_point.
[0197] 903. The computer device resamples the road centerline of the intersection into a polyline based on the three-dimensional geometric data, so that the distances between adjacent three-dimensional points in the resampled polyline are the same.
[0198] In some embodiments, the road centerline of each intersection section in the intersection is resampled according to the three-dimensional geometric data of the road centerline in accordance with a preset accuracy requirement to obtain a resampled polyline Polyline, so as to ensure that the distances between all adjacent three-dimensional points on the resampled polyline Polyline are the same, and this same distance meets the preset accuracy requirement.
[0199] In one example, the preset accuracy requirement is that the resolution of the polyline is not less than 0.5 meters. Then, the distance between all adjacent 3D points on the resampled polyline Polyline is required to be no greater than 0.5 meters. For example, the road centerline is resampled, and newly sampled 3D points are added according to the interpolation method, so that the distance between all adjacent 3D points after interpolation is equal to 0.5 meters, so that the resampled polyline Polyline meets the preset accuracy requirement.
[0200] In the above steps 902 to 903, a possible implementation method is provided for obtaining the road centerline of each intersection section of the virtual road at the intersection of multiple virtual roads in the virtual scene. In this way, by first obtaining the road centerline and then resampling, the user does not need to consider whether the road centerline meets the accuracy requirements when configuring the intersection curve parameters. The algorithm will automatically resample the road centerline that does not meet the accuracy requirements (which can be regarded as a preprocessing method) so that it meets the accuracy requirements after resampling, thereby greatly reducing the normative requirements for the intersection curve parameters input to the algorithm, improving the versatility of the algorithm, and making the accuracy of the polyline controllable, that is, the spacing between adjacent three-dimensional points on the polyline is controllable, improving the controllability and editability of road resources, and improving the efficiency of scene development and scene editing.
[0201] It should be noted that this step 903 is an optional step. If the road centerline itself already meets the pre-set accuracy requirements, then there is no need to perform the resampling step. Or if the accuracy requirements for the road centerline are not specified, then there is no need to perform the resampling step. The embodiments of the present application do not make specific limitations on this.
[0202] 904. The computer device determines a projection plane of the intersection in the virtual scene based on normal vectors of each intersection segment.
[0203] In some embodiments, for each intersection segment in the intersection, the normal vector of the intersection segment is read from the intersection curve parameters of the intersection segment, wherein the normal vector of the intersection segment includes the point normal vector of each three-dimensional point on the centerline of the road.
[0204] Furthermore, according to the normal vectors of all the intersections in the current intersection, a projection plane can be found in the virtual scene, so that the center line of each intersection can be automatically cut with the help of this projection plane. This is because it is difficult to measure the topological relationship of the center line of each intersection in three-dimensional space, and the complexity of its cutting is relatively high. By finding a projection plane through the normal vectors of all intersections, the topological relationship of each intersection in three-dimensional space can be projected into a two-dimensional plane, and the analysis and calculation of the topological relationship in the two-dimensional plane are easy to implement, which can greatly improve the efficiency of cutting the center line of the road, and then improve the calculation efficiency of the road resources at the intersection.
[0205] In some embodiments, based on the following steps A1 to A4, a possible implementation method for determining the projection plane is introduced, so that the finally determined projection plane passes through the origin of the world coordinate system in the virtual scene and is perpendicular to the average normal vector of each intersection section, as described below:
[0206] A1. The computer device normalizes the normal vector of each intersection section to obtain the first normal vector of each intersection section.
[0207] In some embodiments, the point normal vector of each three-dimensional point on the road centerline of the intersection is recorded as up_direction, and the point normal vectors up_direction of all three-dimensional points on all road centerlines are vector normalized to obtain the first normal vector of each three-dimensional point on each road centerline. It should be noted that the above normalization process refers to converting the point normal vector up_direction of each three-dimensional point into a first normal vector with the same direction and a modulus of 1, that is, the direction of each point normal vector up_direction does not change before and after normalization, but the modulus will become unit 1.
[0208] A2. The computer device uses the road width of each intersection section as a weight coefficient, performs weighted averaging on the first normal vectors of each intersection section, and obtains the second normal vector of each intersection section.
[0209] In some embodiments, for the first normal vectors of all three-dimensional points on all road centerlines, a weighted average is performed using the road width of this three-dimensional point as a weight coefficient, that is, as introduced in step 901, each three-dimensional point has the attribute of left width and right width. Adding the left width and the right width can obtain the road width to which this three-dimensional point should be offset. Then, the first normal vector of each three-dimensional point is multiplied by the road width of the three-dimensional point to obtain the weighted normal vector of the three-dimensional point, and then the modulus of the weighted normal vectors of all three-dimensional points is summed to obtain a total modulus, and the weighted normal vector of each three-dimensional point is divided by the total modulus to obtain the second normal vector of each three-dimensional point. Then, the set of the second normal vectors of all three-dimensional points on the road centerline belonging to the same intersection is the second normal vector of this intersection.
[0210] A3. The computer device normalizes the second normal vector of each intersection section to obtain the third normal vector of each intersection section.
[0211] In some embodiments, for the second normal vector of each three-dimensional point on each road centerline obtained in step A2, the vector is normalized again in the same manner as step A1 to obtain the third normal vector of each three-dimensional point on each road centerline, that is, the second normal vector of each three-dimensional point is converted into a third normal vector with the same direction and a modulus of 1.
[0212] In the above process, the road width is used for weighted averaging. After two normalizations, the third normal vector of each 3D point is weighted by the road width. This allows the third normal vector of each 3D point to be obtained after weighted averaging with the road width as the weight at the 3D point granularity level, which helps to improve the accuracy of the calculated average normal vector.
[0213] In other embodiments, in addition to calculating the average normal vector using the method of steps A1 to A3, the road width may not be used for weighted averaging. That is, the average value of the first normal vectors of all intersection sections calculated in step A1 may be directly used as the average normal vector. This can simplify the calculation process of the average normal vector and improve the calculation efficiency of the average normal vector. The embodiments of the present application do not specifically limit this.
[0214] A4. The computer device determines the projection plane from the virtual scene based on the average normal vector of the third normal vectors of each intersection, so that the projection plane is perpendicular to the average normal vector and passes through the origin of the world coordinate system in the virtual scene.
[0215] In some embodiments, the third normal vector of each three-dimensional point on each road centerline obtained in step A3 is averaged to obtain an average normal vector, so that the average normal vector can represent the global normal direction of the entire intersection level. It can be considered that this average normal vector is the surface normal of the projection plane to be solved. Thus, a projection plane passing through the origin of the world coordinate system and perpendicular to the average normal vector can be found in the virtual scene. This is to facilitate the implementation of Boolean operations in the projection plane, which is used to improve the computational efficiency of the subsequent intersection geometry generation algorithm.
[0216] For example, the average normal vector of the entire intersection is recorded as average_up_direction, and then assume that there is a plane project_plane in the three-dimensional space. If the plane project_plane satisfies: passing through the origin of the three-dimensional space and being perpendicular to the average normal vector average_up_direction, then the plane project_plane is determined as the projection plane of the current intersection.
[0217] In other embodiments, the projection plane does not need to pass through the origin of the world coordinate system. In this case, it is only necessary to find any plane perpendicular to the average normal vector in the three-dimensional space as the projection plane. The embodiments of the present application do not specifically limit this.
[0218] In the above process, through steps A1 to A3, an average normal vector applicable to all intersections is calculated based on the normal vectors of each intersection, and then according to the average normal vector and the origin of the world coordinate system, a projection plane that passes through the origin of the world coordinate system and is perpendicular to the average normal vector can be found in the virtual scene. In this way, the topological relationship of each intersection in the three-dimensional space can be projected into the two-dimensional plane, and the analysis and calculation of the topological relationship in the two-dimensional plane are easy to implement, which can greatly improve the efficiency of cutting the center line of the road, and then improve the calculation efficiency of the road resources at the intersection. Furthermore, this can ensure that the PCG intersection geometry generation algorithm of this scheme can support the generation of intersections in three-dimensional space, because even if the virtual scene map is large and the road surface is not close to the horizontal plane, the analysis and calculation of the topological relationship can be realized in the projection plane, thereby improving the applicability of the algorithm.
[0219] In other embodiments, if there is no vertical height difference between the virtual roads at the intersection, and all virtual roads intersect on the ground plane to form an intersection, then it is not necessary to find the projection plane through the above steps A1 to A4. Instead, the ground plane can be directly used as the projection plane. The embodiments of the present application do not specifically limit this.
[0220] 905. The computer device projects each center line of the road onto the projection plane to obtain a projection center line.
[0221] In some embodiments, for each intersection section in the intersection, the road center line of the intersection section is projected onto the projection plane determined in step 904 to obtain a projection center line.
[0222] In one example, since the road centerline itself is a polyline Polyline formed by a series of orderly arranged 3D points connected in sequence, when projecting, it means: projecting each 3D point on the polyline Polyline into the projection plane project_plane to obtain a projection point, and then a series of projection points can be determined in the projection plane project_plane, and then these projection points are connected in sequence in the same order to form a projection centerline. Optionally, before projection, the position coordinates original_position of each 3D point in the 3D space are recorded, and then the projection process of each 3D point is implemented.
[0223] It should be noted that after each three-dimensional point is projected onto the projection plane to obtain the projection point, the three-dimensional coordinates of each projection point in the world coordinate system of the three-dimensional space (i.e., the virtual scene) can be recorded, or the two-dimensional coordinates of each projection point in the plane coordinate system of the two-dimensional plane (i.e., the projection plane mirror) can be recorded. The embodiments of the present application do not specifically limit this.
[0224] 906. The computer device determines, in the projection plane, at least one projection intersection point formed by the projection center lines, where the projection intersection point refers to an intersection point of multiple projection center lines in the projection plane.
[0225] In some embodiments, by analyzing the intersection of all projection center lines in the projection plane, it is possible to obtain the intersection points (i.e., intersection points, whose attribute labels are marked as intersection_point) formed after the projection center lines themselves are projected. The intersection points can be formed by the intersection of two projection center lines, i.e., the two projection center lines intersect at the same intersection point, or they can be formed by the intersection of three or more projection center lines, i.e., three or more projection center lines intersect at the same intersection point. It is only necessary to count all the intersection points formed by the intersection of each projection center line itself in the projection plane, and then determine all the intersection points obtained by the above statistics as at least one projection intersection point, and set the attribute label of each projection intersection point to intersection_point.
[0226] like Fig.12 As shown, an intersection formed by three intersecting road sections in a projection plane is shown. The three thick black lines represent the three projection center lines 21 to 23 formed after the road center lines of the three intersecting road sections are projected onto the projection plane. Among the six endpoints of the three projection center lines 21 to 23, there are three intersection endpoints 21a to 23a (i.e., circular points) and three isolated endpoints 21b to 23b (i.e., square points). Furthermore, the three projection center lines 21 to 23 also intersect in the projection plane to form two projection intersection points c and d (i.e., triangular points). The attribute labels of the three intersection endpoints 21a to 23a are marked as junction_terminal_point, the attribute labels of the three isolated endpoints 21b to 23b are marked as insular_terminal_point, and the attribute labels of the two projection intersection points c to d are marked as intersection_point.
[0227] 907. The computer device cuts each projection center line based on the at least one projection intersection point to obtain a plurality of projection cutting lines.
[0228] In some embodiments, all the projection intersection points intersection_point marked in step 906 are used to cut all the projection center lines Polyline projected in the projection plane to obtain multiple projection cutting lines, where the projection center lines and projection cutting lines are in the projection plane.
[0229] Still Fig.12 Taking an example to illustrate, for the projection center line 21, it will be cut twice by the projection intersection points c and d to form three projection cutting lines: the first projection cutting line formed from 21a to c, the second projection cutting line formed from c to d, and the third projection cutting line formed from d to 21b; similarly, for the projection center line 22, it will be cut once by the projection intersection point c to form two projection cutting lines: the first projection cutting line formed from 22a to c, and the second projection cutting line formed from c to 22b; similarly, for the projection center line 23, it will be cut once by the projection intersection point d to form two projection cutting lines: the first projection cutting line formed from 23a to d, and the second projection cutting line formed from d to 23b. Therefore, a total of 7 projection cutting lines are generated in the projection plane.
[0230] In some embodiments, based on the following steps B1 to B2, a possible method for cutting the projection center line is introduced. After cutting the projection center line using the projection intersection point, a projection center line may be cut into at least one projection cutting line, and then all the projection cutting lines formed by the cutting are filtered. Here, filtering according to the cleaning condition is taken as an example, which can simplify the subsequent processing logic of each projection cutting line, reduce the calculation amount of the intersection geometry generation algorithm, and improve the generation efficiency of road resources. The following is an explanation:
[0231] B1. The computer device determines at least one projection intersection point on each projection center line or the extension line of the projection center line, and uses the at least one projection intersection point as a cutting point to cut the projection center line into at least one projection cutting line.
[0232] In some embodiments, taking each projection center line after projection in the projection plane as a unit, for each projection center line, at least one projection intersection point can be determined on the projection center line or the extension line of the projection center line, and then all the projection intersection points on this projection center line (or its extension line) are used as cutting points to cut this projection center line into at least one projection cutting line.
[0233] For example, in the cutting process of any projection center line, if it is cut once by a projection intersection point to form two projection cutting lines, if it is cut twice by two projection intersection points to form three projection cutting lines, etc., the number of projection cutting lines formed depends on the total number of projection intersection points on the projection center line (or its extension line); and, if the projection intersection point coincides with an endpoint of the projection center line, the length of the projection center line remains unchanged before and after cutting, that is, at this time the projection center line is equal to the projection cutting line, although it is cut once, only one projection cutting line is formed.
[0234] Since the way the projection intersection points are determined determines which points will be used as cutting points, which is crucial to the cutting process based on cutting points, the following will discuss how to determine all the projection intersection points on a projection centerline in three cases.
[0235] Case 1: There is an intersection between the projection center line and other projection center lines
[0236] In some embodiments, for any projection center line, if there is an intersection point between the projection center line and other projection center lines, the intersection point is directly determined as the projection intersection point.
[0237] Still Fig.12 Taking an example to illustrate, there are two intersection points c and d on the projection center line 21, only the intersection point c on the projection center line 22, and only the intersection point d on the projection center line 23. Therefore, the three projection center lines 21 to 23 have their own intersection points, and there is no need to extend any projection center line. The projection intersection points that need to be marked here must be deduplicated, and finally the two projection intersection points c and d can be marked.
[0238] In this case, if there is at least one intersection formed by a natural intersection on the projection centerline itself, then all the intersection points formed by the intersection will be directly determined as projection intersection points, that is, these projection intersection points will be used as cutting points to cut the projection centerline. Therefore, there is no need to find projection intersection points on the extension line of the projection centerline, nor is there any need to extend the projection centerline.
[0239] Case 2: There is no intersection between the projection center line and other projection center lines, but there is an intersection between their extension lines
[0240] In some embodiments, for any projection center line, if there is no intersection between the projection center line and other projection center lines, then the projection center line is marked as an uncut polyline, and all projection center lines are traversed. Each projection center line will not be marked as an uncut polyline if it meets the first condition, and will be marked as an uncut polyline if it does not meet the first condition.
[0241] In other words, if any projection centerline in the projection plane satisfies condition (A) that it is not cut by any projection intersection point; and satisfies condition (B) that the starting point and the end point (i.e., the two endpoints) are not projection intersection points, then this projection centerline is marked as an uncut polyline no_intersection.
[0242] In some embodiments, all marked uncut polylines in the projection plane are counted, and for each uncut polyline marked in the projection plane, the original road centerline of each uncut polyline in the three-dimensional space, i.e., the virtual scene, is found, and the isolated endpoints on the road centerline are extended by a preset length along the tangent direction, and the endpoints formed after the extension are also marked as isolated endpoints, inheriting the road width and normal vector of the original isolated endpoint, and then the extension line of the road centerline is also projected back to the projection plane to obtain the extension line of the uncut polyline.
[0243] The extension process in the above three-dimensional space can be implemented as follows: insert a series of new three-dimensional points along the tangential direction of the isolated endpoints of the road centerline, and ensure that the distance between the newly generated endpoints and the original endpoints is equal to a preset length, wherein the preset length is pre-configured by a technician, or the preset length may be infinite, for example, the preset length is 20 meters or other values, and the embodiments of the present application do not specifically limit this.
[0244] In other words, after traversing all the projected centerlines, if there are uncut polylines Polyline marked as no_intersection in all the projected centerlines Polyline in the current intersection, that is, the number of uncut polylines Polyline marked as no_intersection is greater than 0, then find each uncut polyline Polyline marked as no_intersection in the virtual scene (the road centerline has not been projected into the projection plane at this time), and extend all isolated endpoints insular_terminal_point on the road centerline by a preset length along its tangent direction (for example For example, 20 meters), the new endpoint obtained by extension is also marked as an isolated endpoint insular_terminal_point, and inherits the road width on the left and right sides of the original isolated endpoint insular_terminal_point, the point normal vector up_direction, etc. At this time, the original isolated endpoint is no longer marked as insular_terminal_point because it is no longer an endpoint (just a 3D point in the middle of the extension line). In this way, the original road centerline and the extended part form an extension line, and then the extension line is projected back to the projection plane to obtain the extension line of the uncut polyline Polyline marked as no_intersection.
[0245] It should be noted that here only the extension of isolated endpoints is used as an example, because the intersection endpoint itself is adjacent to the non-intersection section, so even if it is extended along the intersection endpoint, the intersection of the newly generated extension line will be outside the intersection range of the intersection, so there is no need to extend along the intersection endpoint, which can improve the calculation efficiency of the extension line. Optionally, both the isolated endpoints and the intersection endpoints can be extended, that is, the attribute labels of the two ports of each road centerline are not distinguished, and each endpoint of the road centerline is directly extended along the tangent direction, which can save a step of judgment logic on the attribute labels of the endpoints, thereby simplifying the calculation process of the extension line.
[0246] In some embodiments, each uncut polyline is extended by a preset length to obtain an extension line of each uncut polyline. In this way, after the extension lines of all uncut polylines are generated, for any uncut polyline, if the extension line of the uncut polyline has an extension line intersection with the extension lines of other uncut polylines, the extension line intersection is determined as the projection intersection point.
[0247] In other words, whether there is any extension line intersection in the projection plane is determined, that is, whether the extension lines of each uncut polyline Polyline marked as no_intersection intersect to form an extension line intersection, and the extension line intersection is marked as the projection intersection point intersection_point. Since this projection center line Polyline finds the projection intersection point intersection_point on the extension line, this projection center line Polyline will no longer be marked as no_intersection and no longer belongs to the uncut polyline.
[0248] like Fig.13 As shown, an intersection formed by two intersecting road sections in a projection plane is shown. The two thick black lines represent the two projection center lines 31 and 32 respectively. It can be seen that there is no natural intersection between the projection center lines 31 and 32, so it does not meet the situation 1. At this time, the projection center lines 31 and 32 are marked together as uncut polylines no_intersection.
[0249] like Fig.14 As shown, in Fig.13 On this basis, in the three-dimensional space, the original road center lines of the uncut polylines 31 and 32 marked with no_intersection are extended by a preset length along the tangent direction of all isolated endpoints insular_terminal_point on the road center lines and then projected back to the projection plane, and finally the extension lines of the uncut polylines 31 and 32 in the two-dimensional plane are generated. Fig.14 The thick dashed lines added to the two uncut polylines 31 and 32 are the extended parts of the extension line. It can be seen that the two isolated endpoints generated after the extension are marked as insular_terminal_point (square points), while the original two isolated endpoints are no longer marked as insular_terminal_point because they are no longer endpoints (just a 3D point in the middle of the extension line).
[0250] like Fig.15 As shown, in Fig.14On this basis, observe the extension lines of the two uncut polylines 31 and 32. It is found that the two extension lines form an extension line intersection point v. Therefore, the extension line intersection point v is marked as the projection intersection point intersection_point (in the form of a triangulated point), and this projection intersection point v is used as the cutting point to participate in the cutting process of the projection center line. For example, for the extension line of the projection center line 31 or 32, it will be cut once by the extension line intersection point v to form two projection cutting lines: a projection cutting line formed from the intersection endpoint to the projection intersection point, and another projection cutting line formed from the projection intersection point to the isolated endpoint. It should be noted that the extension line intersection point may appear on the extended portion of the extension line, or it may appear on the portion of the extension line that was originally the projection center line, such as Fig.15 The middle extension line intersection point v is the projection intersection point formed by the extended portion of the projection center line 31 and the original projection center line 32.
[0251] In this case, if there is no natural intersection on the projection center line, mark the projection center line as an uncut polyline, and make extension lines of all uncut polylines. At this time, extension line intersections may occur between different extension lines. Therefore, all extension line intersections formed by the intersection of the extension lines are determined as projection intersection points, and these projection intersection points will also participate in the cutting process of the projection center line as cutting points.
[0252] In the above cases 1 and 2, the formed projected intersection point can be found on each projected center line or its extended line, which makes it convenient to cut each projected center line or its extended line according to the projected intersection point as the cutting point, so as to obtain the projected cutting line generated by the cutting. In this way, the cases where the projected intersection point can be found on all projected center lines or their extended lines are covered, but there is another case, that is, if there is an uncut polyline and no projected intersection point can be found on itself and its extended line, then it is necessary to configure the projected intersection point for it through the following case 3.
[0253] Case 3: There is no intersection between the projection center line and other projection center lines, and there is no intersection between their extension lines.
[0254] In some embodiments, for any uncut polyline marked in the projection plane, if there is no extension line intersection between the extension line of the uncut polyline and the extension lines of other uncut polylines, then it is necessary to determine a first adjacent point from the uncut polyline and a second adjacent point from other uncut polylines so that the distance between any three-dimensional point in the uncut polyline and any three-dimensional point in the other uncut polylines is not less than a minimum distance, and the minimum distance refers to the distance between the first adjacent point and the second adjacent point. Then, the first adjacent point and the second adjacent point are both determined as the projection intersection point.
[0255] In other words, if in the projection plane, after the extension process of situation 2, there are still uncut polylines Polyline marked as no_intersection in the current intersection, that is, the number of uncut polylines Polyline marked as no_intersection is greater than 0, then for any uncut polyline Polyline marked as no_intersection, find a first neighboring point self_near_point on the current uncut polyline Polyline, and find respective second neighboring points other_near_point on all other uncut polylines Polyline, so that: the distance distance between any 3D point self_point on the current uncut polyline Polyline and any 3D point other_point on other uncut polylines Polyline is not less than the minimum distance min_distance, and the minimum distance min_distance refers to the distance between the first neighboring point self_near_point and the second neighboring point other_near_point.
[0256] like Fig.16 As shown, an intersection formed by two intersecting road sections in a projection plane is shown, and two thick black lines represent two projection center lines 61 and 62 respectively. It can be seen that there is no natural intersection between the projection center lines 61 and 62, so it does not meet the first situation. In addition, it can be seen from the partial enlarged view on the right that the extension line formed by the projection center line 61 after extension still does not have an extension line intersection with the projection center line 62, so it does not meet the second situation. Among them, since the two endpoints of the projection center line 62 are both junction endpoints junction_terminal_point (i.e., round points), and the extension is only for the isolated endpoint insular_terminal_point (i.e., square points), there is no need to extend the projection center line 62. At this time, the projection center lines 61 and 62 should be marked as uncut polylines no_intersection.
[0257] like Fig.17 As shown, in Fig.16On this basis, the distance between each 3D point in the uncut polyline 61 marked with no_intersection and each 3D point in the uncut polyline 62 marked with no_intersection can be calculated, and then a pair of nearest neighboring points x~y can be found in the two uncut polylines 61~62, and the pair of neighboring points x~y are marked as the projection intersection point intersection_point (in the form of triangulation points), and the projection intersection point x~y is used as the cutting point to participate in the cutting process of the projection center line. At the same time, the projection center lines 61 and 62 are no longer marked as no_intersection, that is, they are no longer uncut polylines.
[0258] Among them, the neighboring points x~y include a first neighboring point x located in the projection center line 61 and a second neighboring point y located in the projection center line 62, wherein the projection center line 61 will be cut once by the first neighboring point x to form two projection cutting lines: a projection cutting line formed from the intersection endpoint to the first neighboring point x, and another projection cutting line formed from the first neighboring point x to the isolated endpoint; the projection center line 62 will be cut once by the second neighboring point y to form two projection cutting lines: a projection cutting line formed from one intersection endpoint to the second neighboring point y, and another projection cutting line formed from the second neighboring point y to another intersection endpoint.
[0259] The first neighboring point x is recorded as self_near_point, and the second neighboring point y is recorded as other_near_point, so that the distance distance between any point self_point on the projection center line 61 and any point other_point on the other projection center line 62 is not less than the minimum distance min_distance between the first neighboring point self_near_point and the second neighboring point other_near_point. The first neighboring point self_near_point and the second neighboring point other_near_point are also marked as projection intersection points intersection_point, and the projection center lines Polyline to which they belong are cut.
[0260] This is equivalent to finding the nearest neighboring points on each non-intersecting, uncut polyline, and marking the neighboring points as projection intersection points. These projection intersection points will also participate in the cutting process of the projection center line as cutting points. Therefore, combining situations one to three can ensure that each projection center line will be cut by the projection intersection point at least once in any intersection situation at the intersection.
[0261] In the above-mentioned third situation, a fallback strategy is provided for the situation where no projected intersection point can be found on the uncut polyline itself and its extension line. By ensuring that there is a projected intersection point on the uncut polyline that meets the definition of adjacent points, at least one projected intersection point can be found at the intersection of any intersection. This is not only applicable to the situation where the projected center lines do not intersect at the same point, but also to the situation where the projected center lines do not intersect at all. This greatly expands the applicability of the PCG intersection geometry generation algorithm and reduces the design requirements for the road center lines of each virtual road in the intersection, thereby improving the algorithm compatibility and applicability.
[0262] B2. The computer equipment removes the projection cutting lines that meet the cleaning conditions from each projection cutting line.
[0263] In some embodiments, the projection intersection points of all intersections can be found from the three situations in step B1, and then the projection intersection points are used to cut each projection center line to obtain the projection cutting lines formed by all the cuts in the projection plane. Further, all the projection cutting lines are filtered to remove all the projection cutting lines that meet the cleaning conditions to obtain the remaining projection cutting lines to be processed. In other words, it is judged whether each projection cutting line meets the cleaning conditions. If it meets the cleaning conditions, this projection cutting line is removed. If it does not meet the cleaning conditions, this projection cutting line is retained, and then the next projection cutting line is judged. After traversing all the projection cutting lines, all the projection cutting lines that meet the cleaning conditions can be removed to obtain the remaining projection cutting lines to be processed.
[0264] In some embodiments, the cleaning condition includes: two endpoints of the projected cutting line include a projected intersection point and an isolated endpoint, and the isolated endpoint refers to an endpoint that is neither the intersection endpoint nor the projected intersection point.
[0265] In other words, for any Polyline among all the projected cutting line Polylines obtained by cutting in step B1, if one of the two endpoints has an attribute label of an isolated endpoint insular_terminal_point and the other endpoint has an attribute label of a projected intersection point intersection_point, then this Polyline is considered to meet the cleaning condition and needs to be deleted. Therefore, all deleted Polylines are either Polylines whose starting point is an isolated endpoint insular_terminal_point and whose end point is a projected intersection point intersection_point, or Polylines whose starting point is a projected intersection point intersection_point and whose end point is an isolated endpoint insular_terminal_point.
[0266] like Fig.18 As shown, the left side shows three projection cutting lines (a) to (c) before cleaning, and the right side shows three projection cutting lines (a') to (c') after cleaning. Each row shows the comparison effect of a projection cutting line before and after cleaning, that is, the projection cutting line (a) is (a') after cleaning, the projection cutting line (b) is (b') after cleaning, and the projection cutting line (c) is (c') after cleaning. Since the intersection endpoint junction_terminal_point is drawn as a circle, the isolated endpoint insular_terminal_point is drawn as a square point, and the projection intersection point intersection_point is drawn as a triangle point, then the Polyline that actually meets the cleaning conditions refers to all Polylines with one end as a square point and the other end as a triangle point (without distinguishing the direction, that is, without distinguishing who is the starting point and who is the end point).
[0267] In the above process, by judging the attribute labels of the two endpoints of the projection cutting line, it can be determined whether the projection cutting line meets the cleaning conditions, and then the projection cutting line that meets the cleaning conditions is cleaned up, thereby realizing data cleaning of all projection cutting lines. The ultimate goal is to discard the projection cutting line formed by the projection intersection point and the isolated endpoint. This is done to avoid introducing convex and uneven edges in the road surface, because the projection cutting line formed by the projection intersection point and the isolated endpoint is likely to cause convex or concave uneven edges, and has no additional contribution to the formation of the road surface at the intersection, so it can be discarded to improve the flatness of the edge of the road surface.
[0268] In the above steps B1 to B2, a possible method for cutting the projection center line is provided. After the projection center line is cut using the projection intersection point, all the projection cutting lines formed by the cutting are filtered. The entire process is to implement cutting and filtering in the projection plane, thereby simplifying the subsequent processing logic of each projection cutting line, reducing the calculation amount of the intersection geometry generation algorithm, and improving the generation efficiency of road resources.
[0269] In other embodiments, after all the projected cutting lines are obtained through cutting in step B1, the projected cutting lines can be directly projected back to the virtual scene to obtain the full amount of cutting center lines, and the cutting center lines in the virtual scene can be cleaned in the same way as step B2. The embodiment of the present application does not specifically limit whether the cleaning process is completed for the projected cutting lines in the two-dimensional plane or for the cutting center lines in the three-dimensional space.
[0270] 908. The computer device projects the multiple projected cutting lines back to the virtual scene to obtain multiple cutting center lines.
[0271] In some embodiments, each remaining projected cutting line after cutting and filtering in step 907 is projected from the projection plane back to the virtual scene to obtain a cutting center line, and all remaining projected cutting lines after cutting and filtering are traversed to obtain all cutting center lines in the virtual scene. For example, since the projected cutting line is cut from the projection center line, and the projection center line is projected from the road center line, each 3D point on the road center line has a coordinate mapping relationship with each 3D point on the projection center line, and all 3D points on the projected cutting line must be a subset of all 3D points on the projection center line. In this way, it is only necessary to store the position coordinates original_position of each 3D point in the 3D space before projecting the road center line, so that the position coordinates original_position of each 3D point on the projected cutting line with a coordinate mapping relationship can be found, and the position coordinates original_position of all 3D points on the projected cutting line can be used to restore the entire projected cutting line Polyline to its original position in the 3D space.
[0272] In the above steps 905 to 908, a possible implementation method is provided for cutting each road centerline based on the projection intersection point of each road centerline in the projection plane to obtain multiple cutting centerlines. By projecting the road centerline into the projection plane to obtain the projection centerline, the cutting and filtering processes of the projection centerline can be transferred to the projection plane for implementation, and then the results obtained after cutting and filtering in the projection plane are projected back to the virtual scene to obtain the final required cutting centerline, thereby converting the logical operations required for cutting and filtering into logical operations of topological relationships in a two-dimensional plane, such as through Boolean operations, hash operations, etc., to quickly implement, thereby greatly improving the cutting efficiency of the road centerline, and thereby improving the calculation efficiency of intersection road resources.
[0273] In other embodiments, the same method can also be used in the ground plane to achieve cutting and filtering of the road centerline, so as to directly obtain the required cutting centerline, which is not specifically limited in the embodiments of the present application.
[0274] 909. The computer device determines the road surface of each intersection section for each cutting center line based on the road width and normal vector of the intersection section from which the cutting center line originates.
[0275] In some embodiments, for each cutting center line projected in step 908, since the cutting center line is also a polyline composed of multiple three-dimensional points, each three-dimensional point has two attributes: road width and normal vector, where the road width can include left width and right width. For each three-dimensional point, the offset direction is determined according to the normal vector, and the three-dimensional point is controlled to offset leftward along the offset direction to the left width, thereby obtaining an edge point on the left edge line of the road surface. Similarly, the three-dimensional point is offset rightward along the offset direction to the right width, thereby obtaining an edge point on the right edge line of the road surface. Similarly, after all the three-dimensional points of the entire cutting center line are offset leftward along their respective offset directions by their respective left widths, the left edge line of the road surface will be obtained. After all the three-dimensional points of the entire cutting center line are offset rightward along their respective offset directions by their respective right widths, the right edge line of the road surface will be obtained. The closed surface enclosed by the offset trajectories of the left edge line, the right edge line and the two end points of the cutting center line is determined as the road surface of an intersection section.
[0276] In some embodiments, based on the following steps C1 to C2, a possible method for obtaining a road surface is introduced. When obtaining a road surface, some settings may be made on the attribute tags of the endpoints to facilitate the logical operations that may be involved in the subsequent production process of road resources. The following is an explanation:
[0277] C1. The computer device offsets the cutting center line based on the road width and the normal vector to obtain two road edge lines, wherein the two end points of the road edge line are marked as intersection points, and the three-dimensional points on the road edge line other than the two end points are marked as edge points.
[0278] In some embodiments, for each cutting center line, since the cutting center line is a polyline Polyline composed of multiple three-dimensional points, each three-dimensional point has two attributes: road width and normal vector up_direction, where the road width can include left width and right width. For each three-dimensional point, the offset direction is determined according to the normal vector up_direction, and the three-dimensional point is controlled to offset leftward along the offset direction to the left width, thereby obtaining an edge point on the left edge line of the road surface. Similarly, the three-dimensional point is offset rightward along the offset direction to the right width, thereby obtaining an edge point on the right edge line of the road surface. Similarly, after all the three-dimensional points of the entire cutting center line are offset leftward along their respective offset directions by their respective left widths, the left edge line of the road surface will be obtained. After all the three-dimensional points of the entire cutting center line are offset rightward along their respective offset directions by their respective right widths, the right edge line of the road surface will be obtained. The left edge line and the right edge line are collectively referred to as the road edge lines of the intersection section.
[0279] In some embodiments, for each road edge line, each 3D point on the road edge line inherits the attribute label of the 3D point from which it originates in the cutting center line (hereinafter referred to as the source point), that is, each offset 3D point inherits the junction endpoint junction_terminal_point label, isolated endpoint insular_terminal_point label or projection intersection point intersection_point label of the respective source point. Furthermore, the two endpoints (starting point and end point) of this road edge line Polyline can also be marked as intersection points terminal_point, and all other 3D points are marked as edge points edge_point. It can be seen that all intersection endpoints junction_terminal_point, isolated endpoint insular_terminal_point and projection intersection point intersection_point will be marked as terminal_point, and 3D points that do not belong to any of the above will be marked as edge points edge_point.
[0280] like Fig.19As shown, three cutting center lines 91 to 93 are shown, wherein the intersection endpoint A and the projected intersection point B are connected to form the cutting center line 91, the projected intersection point B and the intersection endpoint C are connected to form the cutting center line 92, and the intersection endpoint D and the projected intersection point B are connected to form the cutting center line 93. For the cutting center line 91, it is offset to the left to obtain the left edge line 91a, and the endpoint A' of the left edge line 91a inherits the intersection endpoint junction_terminal_point attribute label of the source point A, and the endpoint B' of the left edge line 91a inherits the projection intersection point intersection_point attribute label of the source point B. Similarly, it is offset to the right to obtain the right edge line 91b, and the endpoint A" of the right edge line 91b inherits the intersection endpoint junction_terminal_point attribute label of the source point A, and the endpoint B" of the right edge line 91b inherits the projection intersection point intersection_point attribute label of the source point B. The offset process of the cutting center lines 92 to 93 is the same as that of the cutting center line 91, and will not be repeated. Intuitively, among the 6 road edge lines finally formed, all the circular points A', A", C', C", D', D" will inherit the junction endpoint junction_terminal_point attribute label, and all the triangulated points B' and B" will inherit the projection intersection point intersection_point attribute label. The above 8 endpoints in total will be marked as terminal_point, and the remaining 3D points on the 6 road edge points will be marked as edge points edge_point.
[0281] C2. The computer device uses the two road edge lines as the road edges on both sides to determine the enclosed road curved surface.
[0282] In some embodiments, based on the left edge line and the right edge line obtained in step C1, and the offset trajectories of the two end points of the cutting center line, the closed surface surrounded by these four lines can be determined, and this closed surface is determined as a road surface of an intersection section.
[0283] like Fig. 20 As shown, in Fig.19 Based on this, the road surfaces 910, 920 and 930 of the three intersection sections can be determined. Taking the road surface 910 as an example, the road surface 910 is a closed surface surrounded by four lines: the left edge line 91a, the right edge line 91b, the offset track formed by A' and A", and the offset track formed by B' and B". The determination process of road surfaces 920-930 is the same as that of road surface 910, which will not be repeated.
[0284] In the above steps C1 to C2, a possible implementation method is provided for determining the road surfaces constituted by cutting center lines as units, so that the number of road surfaces finally constituted is equal to the number of cutting center lines. However, since different road surfaces may overlap in space, the final intersection road surface cannot be simply unioned, but it is necessary to execute the processing in step 910 to accurately find the correct intersection road surface.
[0285] 910. The computer device determines the intersection road surface of the intersection in the virtual scene based on various road surfaces.
[0286] In some embodiments, since different road surfaces may overlap in space, the final intersection road surface cannot be simply obtained by union. Instead, an intersection road surface of the entire intersection is determined based on all road surfaces obtained in step 909 .
[0287] In some embodiments, logical operations can still be projected into the projection plane to speed up the calculation efficiency of the intersection road surface, thereby converting complex graphic logical operations in three-dimensional space into two-dimensional graphic logical operations in the projection plane. Steps D1 to D3 will be used as examples to illustrate this below.
[0288] D1. The computer device projects each road surface onto the projection plane to obtain a projected road surface.
[0289] In some embodiments, the contour lines of each road surface are projected into the projection plane in the same manner as step 905, so that the projected contour lines in the projection plane will enclose a projection road surface. The contour lines of each road surface include: a left edge line, a right edge line, and offset tracks of the two end points of the cutting center line. The projection method is the same as step 905 and will not be repeated.
[0290] D2. The computer device determines the union road surface between each projection road surface in the projection plane.
[0291] In some embodiments, after all the road surfaces acquired in step 909 are projected onto the projection plane, all the projected road surfaces can be acquired. Then, a two-dimensional graphic logic operation is performed on all the projected road surfaces to obtain a union road surface, where the union road surface refers to the union area of all the projected road surfaces. Here, the logic operation of the two-dimensional image can adopt Boolean operation, or hash operation, etc., and the embodiment of the present application does not specifically limit the method of the logic operation.
[0292] In one example, for each road surface, the position coordinates original_position of each 3D point in the contour line in the 3D space are recorded, and the contour line is projected onto the projection plane project_plane to obtain a projected road surface. Then, a Boolean operation of the 2D graphics union operation is performed on all projected road surfaces to obtain a union road surface.
[0293] D3. The computer device projects the union road surface back to the virtual scene to obtain the intersection road surface.
[0294] In some embodiments, the union road surface calculated in step D2 is projected from the projection plane back into the virtual scene to obtain an intersecting road surface in the virtual scene.
[0295] In one example, for the new intersection point generated in the logical operation of the union road surface, its attribute label is set as the contour intersection point new_intersection_point, and the contour intersection point new_intersection_point is also marked as the terminal_point. Then, the original_position of the position coordinates of each 3D point on the contour line of the union road surface in the 3D space is read, and the positions of all 3D points in the 3D space are reset, that is, the contour line of the union road surface is projected back to the virtual scene to obtain the contour polyline of the intersection road surface, and then the intersection road surface enclosed by the projected contour polyline can be determined.
[0296] In the above steps D1 to D3, a possible implementation method is provided in which a road surface is projected into a projection plane to perform logical operations, the intersection road surface is calculated, and then projected back to the virtual scene to obtain an intersection road surface. By converting complex graphic logical operations in three-dimensional space into two-dimensional graphic logical operations in the projection plane, the calculation efficiency of the intersection road surface can be improved.
[0297] On the other hand, since the normal direction of the projection plane is actually the average normal vector, and there may be a certain direction deviation between the average normal vector and the normal vector of each intersection section itself, by projecting it to the projection plane for Boolean operations and then projecting it back to the virtual scene, the intersection road surface calculated in this way can ensure that the normal direction of each three-dimensional point is consistent with its original normal vector, thereby improving the calculation accuracy of the intersection road surface.
[0298] In other embodiments, if the normal vectors of all intersection sections are the same and vertically upward, the same method can be used in the ground plane to directly use the union road surface of all road surfaces as the final intersection road surface. Because the average normal vector will not be corrected or adjusted before and after projection (the average normal vector is also vertically upward), there is no need to expend computing power for secondary projection, and the embodiments of the present application do not specifically limit this.
[0299] 911. The computer device generates a contour curve of the intersection road surface based on the contour polyline of the intersection road surface.
[0300] In some embodiments, for the crossroad obtained in step 910, the closed surface is converted into its own contour polyline Polyline, and the position information and attribute labels of all three-dimensional points on the contour polyline Polyline are retained, as well as the mark of the intersection point terminal_point or edge point edge_point. Then, the contour curve of the crossroad can be generated according to the contour polyline Polyline, which can make the contour curve of the crossroad smoother, thereby overcoming the possible defects of sharp turning of the road edge at the intersection and the uneven curvature, and optimizing the display effect of the generated crossroad.
[0301] In some embodiments, based on the following steps E1 to E3, a possible method for obtaining a contour curve is introduced. First, each line segment in the overall contour polyline Polyline is screened, and then smoothing and repairing are performed based on the screened contour polyline Polyline, which can improve the accuracy of generating the contour curve. The following is an explanation:
[0302] E1. The computer device removes the line segments that meet the deletion conditions from the various line segments of the contour polyline of the intersection road surface.
[0303] In some embodiments, since the contour polyline of the intersection road surface itself is a Polyline composed of multiple three-dimensional points, that is, the contour polyline Polyline is formed by connecting multiple line segments end to end, all line segments on the contour polyline Polyline are filtered to remove line segments that meet the deletion conditions. This makes it easier for the contour polyline Polyline after removal to participate in the subsequent calculation process of generating road resources, which helps to improve the calculation efficiency of road resources.
[0304] In some embodiments, through step C1, it can be known that all intersection endpoints junction_terminal_point, isolated endpoints insular_terminal_point and projection intersection points intersection_point will be marked as transaction points terminal_point, and through step D3, it can be known that all contour intersection points new_intersection_point will also be marked as transaction points terminal_point. In other words, the intersection points terminal_point marked in the contour polyline Polyline include the following four cases: intersection endpoints junction_terminal_point, projection intersection points intersection_point, isolated endpoints insular_terminal_point and contour intersection points new_intersection_point, where the contour intersection point new_intersection_point refers to the intersection of the contour lines in the road surface of the union. All remaining three-dimensional points that are not marked as transaction points terminal_point will be marked as edge points edge_point.
[0305] In some embodiments, in the case of the marking of the above intersection point terminal_point and edge point edge_point, the deletion condition of a single line segment in this step E1 can be defined as: both endpoints of the line segment belong to the intersection point terminal_point. In other words, for each line segment in the contour polyline Polyline, if both endpoints of the line segment are the intersection point terminal_point, that is, if both endpoints of the line segment are not edge points edge_point, then the line segment meets the deletion condition and needs to be deleted from the contour polyline Polyline; on the contrary, if at least one of the two endpoints of the line segment is an edge point edge_point, for example, one of the two endpoints is an edge point edge_point, or both endpoints are edge points edge_point, in this case, the deletion condition is not met, so the line segment is retained in the contour polyline Polyline.
[0306] like Fig.21As shown, for each line segment in the contour polyline Polyline of the intersection road surface, if both endpoints of the line segment are not edge points edge_point, then the deletion condition is met and the line segment is deleted. Among them, both endpoints of line segments 211 to 213 are intersection endpoints junction_terminal_point, and the intersection endpoint junction_terminal_point belongs to the intersection point terminal_point. Therefore, both endpoints of line segments 211 to 213 are intersection points terminal_point, which meets the deletion condition. Therefore, line segments 211 to 213 should be deleted in the contour polyline Polyline, and all remaining line segments should be retained.
[0307] In the deletion condition defined in the above way, by deleting the line segments directly connected to the two intersection points terminal_point in the contour polyline Polyline, it can be ensured that the subsequent line smoothing process is only for the line segments containing the edge point edge_point. This is to avoid incorrect smoothing of the line segments directly connected to the two intersection points terminal_point, because the line segments directly connected to the two intersection points terminal_point should be a straight line segment and do not need to be converted into a smooth curve. Filtering the line segments in the contour polyline Polyline in this way can improve the accuracy of line smoothing.
[0308] In some embodiments, before executing this step E1, the contour polyline Polyline itself may be damaged to a certain extent, so it is necessary to repair the damaged contour polyline Polyline before executing the line segment filtering process in this step E1. The following will describe the method of repairing the contour polyline Polyline.
[0309] In some embodiments, if there is any pair of intersection points terminal_point in the contour polyline Polyline of the intersection road surface that meets the repair condition, the three-dimensional points between the pair of intersection points terminal_point are deleted, the pair of intersection points terminal_point are connected, and the pair of intersection points terminal_point are marked as edge points edge_point.
[0310] Since there may be many intersection points terminal_point in the contour polyline Polyline, it is necessary to traverse all combinations of any two intersection points terminal_point, and determine whether each pair of possible intersection points terminal_point meets the repair conditions one by one. If they meet the repair conditions, all three-dimensional points in this pair of intersection points terminal_point are deleted, and this pair of intersection points terminal_point are directly connected, and then this pair of intersection points terminal_point are marked as edge points edge_point, and the intersection point terminal_point is no longer marked.
[0311] In the above process, you only need to define the repair conditions to define the circumstances under which the contour polyline Polyline itself is considered damaged, such as bulging or uneven connection, and then realize the automatic programmatic repair of the contour polyline Polyline. The entire contour polyline repair process does not require human intervention, which can greatly improve the calculation accuracy, flatness and aesthetics of the contour polyline Polyline.
[0312] Below, two possible repair conditions are described by way of example, wherein the repair conditions include at least one of the following:
[0313] Condition 1: There are no other contour intersection points between any pair of contour intersection points, and there is only one intersection point between the pair of contour intersection points that is not an intersection endpoint.
[0314] In the contour polyline Polyline, if there is a contour intersection point new_intersection_point to another contour intersection point new_intersection_point and both of the following conditions are met: (i) there are no other contour intersection points new_intersection_point; (ii) there is only one intersection point terminal_point, and this intersection point terminal_point is not the intersection endpoint junction_terminal_point, then it is considered to meet the repair condition one.
[0315] It should be noted that, since (i) specifies that the intersection point terminal_point cannot be the contour intersection point new_intersection_point, and (ii) specifies that the intersection point terminal_point cannot be the intersection endpoint junction_terminal_point, and there are only four possible cases for the intersection point terminal_point, therefore, the intersection point terminal_point can only be the projected intersection point intersection_point or the isolated endpoint insular_terminal_point. According to the definition given in the following repair condition 2, the intersection point terminal_point can only be a specified intersection point.
[0316] like Fig. 22 As shown, the left side shows a damaged contour polyline Polyline that meets the repair condition one. In the contour polyline Polyline, a triangle point is used to represent the contour intersection point new_intersection_point, a circle point is used to represent the intersection endpoint junction_terminal_point, and a diamond point is used to represent the projection intersection point intersection_point or the isolated endpoint insular_terminal_point. Among them, the dotted line represents the intersection curve, the shaded filled area represents the cross road surface obtained by the Boolean operation in step 910, and the bold line represents the contour polyline Polyline expected to be retained in step E1, that is, a set with at least one endpoint being an edge point edge_point is found to constitute the contour polyline Polyline expected to be retained. In the process of repairing the damaged contour polyline Polyline, the damaged contour polyline Polyline on the left side needs to be repaired into the repaired contour polyline Polyline on the right side, and then the repaired contour polyline Polyline is sent to step E1 for line segment deletion.
[0317] against Fig. 22 This kind of damage of the contour polyline Polyline meets the repair condition 1, and the segment to be repaired needs to be identified first, and then processed for the segment to be repaired. That is, if along the contour polyline Polyline, a contour intersection point new_intersection_point to another contour intersection point new_intersection_point is found, that is, between one triangle point and another triangle point, it satisfies:
[0318] (i) There is no other contour intersection point new_intersection_point, that is, there is no other triangulation point;
[0319] (ii) There is only one junction point terminal_point, and this junction point terminal_point is not the intersection endpoint junction_terminal_point, that is, there is only one diamond point.
[0320] Then it is considered to meet the repair condition 1, and all line segments between the two triangle points are determined as the segments to be repaired in the contour polyline Polyline. Fig.23 As shown, in Fig. 22 Based on the above repair condition 1, we can find Fig.23 The dotted circle and dotted square in the left part are the sections to be repaired.
[0321] For the segment to be repaired: delete all 3D points between the two contour intersection points new_intersection_point (including the two contour intersection points new_intersection_point) and connect the newly generated endpoints after deletion. Fig.23 As shown in the right part, in the section to be repaired, all the 3D points in this path including two contour intersection points new_intersection_point and one isolated endpoint insular_terminal_point or projection intersection point intersection_point are deleted, including the two contour intersection points new_intersection_point, and the newly generated endpoints are connected after the deletion. In other words, all the 3D points in this path including two triangle points and one diamond point are deleted (including the two triangle points), and the newly generated endpoints are connected after the deletion to obtain the repaired contour polyline Polyline shown in the right part.
[0322] Condition 2: There is no edge point between any pair of specified intersection points, where the specified intersection point refers to the projection intersection point or the isolated endpoint.
[0323] Among them, the specified intersection point also belongs to the intersection point terminal_point, but because the intersection point terminal_point includes 4 cases, the specified intersection point can only be the projection intersection point intersection_point or the isolated endpoint insular_terminal_point, and cannot be the intersection endpoint junction_terminal_point or the outline intersection point new_intersection_point.
[0324] In the contour polyline Polyline, if there is no edge point edge_point between a specified intersection point and another specified intersection point, then it is considered to meet the repair condition 2. In other words, if there is no edge point edge_point between any two projected intersection points intersection_point or isolated endpoints insular_terminal_point, then it is considered to meet the repair condition 2.
[0325] like Fig.24 As shown, a damaged contour polyline Polyline that meets the second repair condition is shown on the left. In the contour polyline Polyline, a triangle point is used to represent the contour intersection point new_intersection_point, a circle point is used to represent the intersection endpoint junction_terminal_point, and a diamond point is used to represent the specified intersection point, that is, the projected intersection point intersection_point or the isolated endpoint insular_terminal_point. Among them, the dotted line represents the intersection curve, the shaded filled area represents the cross road surface obtained by the Boolean operation in step 910, and the thick line represents the contour polyline Polyline expected to be retained in step E1, that is, a set with at least one endpoint being an edge point edge_point is found to constitute the contour polyline Polyline expected to be retained. In the process of repairing the damaged contour polyline Polyline, the damaged contour polyline Polyline on the left side needs to be repaired into the repaired contour polyline Polyline on the right side, and then the repaired contour polyline Polyline is sent to step E1 for line segment deletion.
[0326] against Fig.24 For this kind of damage that meets the second repair condition of the contour polyline Polyline, it is necessary to first identify the segment to be repaired, and then process the segment to be repaired. That is, if along the contour polyline Polyline, it is found that there is no edge point edge_point between a specified intersection point and another specified intersection point, that is, between a diamond point and another diamond point, then it is considered to meet the second repair condition, and all line segments between the two diamond points are determined as the segment to be repaired in the contour polyline Polyline.
[0327] like Fig.25 As shown, in Fig.24 Based on the above repair condition 2, we can find Fig.25In the left part, the section to be repaired is encircled by the dotted circle. In this section, there are only triangle points between the two diamond points, and there is no edge point edge_point on the remaining thin line (because it does not belong to the contour polyline Polyline that is expected to be retained).
[0328] For the segment to be repaired: delete all 3D points between the two specified intersection points (excluding the two specified intersection points), connect a line segment between the two specified intersection points, and then mark the two intersection points as edge points edge_point. Fig.25 As shown in the right part, in the segment to be repaired, all triangle points between two diamond points are deleted, and the two diamond points are connected to form a line segment, and the two diamond points are marked as edge points edge_point, so as to obtain the repair contour polyline Polyline shown in the right part.
[0329] The above two possible repair conditions can realize automatic program repair of the contour polyline Polyline for the situation of bulging or uneven connection. The entire contour polyline Polyline repair process does not require manual intervention. The repaired contour polyline Polyline is then input into step E1 to realize line segment removal, which can greatly improve the calculation accuracy, flatness and aesthetics of the contour polyline Polyline.
[0330] In some embodiments, the damaged contour polyline Polyline may not be repaired programmatically, but the contour polyline Polyline that is expected to be retained in step E1 may be printed out to allow technicians to perform manual repairs, and the repaired contour polyline Polyline may be input into step E1 to achieve line segment removal. The embodiments of the present application do not specifically limit this.
[0331] E2. The computer device smoothes the eliminated contour polylines to obtain contour smooth lines.
[0332] In some embodiments, the contour polyline Polyline removed in the previous step E1 is smoothed to obtain a contour smooth line. Optionally, chamfering is used for smoothing, or Bezier curve (Bezier) fitting, NURBS (Non Uniform Rational B-Spline) fitting, etc. The present application embodiment does not specifically limit the smoothing algorithm of the contour polyline Polyline.
[0333] like Fig.26 As shown, in Fig.21 Based on the removed contour polyline Polyline, we can get Fig.26The contour smoothing line shown in the figure is smoothed by adding chamfers. Fig.21 Generally speaking, the sharper connecting angles in the contour smoothing lines become smooth, making the contour more rounded and smooth, avoiding unnatural road curvature and other phenomena.
[0334] E3. The computer device generates a contour curve of the intersection road surface based on the contour smooth line. In addition to the contour smooth line, the contour curve also includes multiple connecting lines, and each connecting line is obtained by connecting a group of intersection endpoints with the same source point.
[0335] In some embodiments, for the contour smooth line obtained in step E2, since a part of the line segment is deleted in step E1, in order to still form a closed curve, it is necessary to connect all the intersection endpoints junction_terminal_point with the same source points to obtain one or more connecting lines, and the contour smooth line obtained in step E2 and the closed curve formed by all the connecting lines formed by the above connections are determined as the contour curve of the entire intersection road surface.
[0336] like Fig. 27 As shown, in Fig.26 On the basis of, the intersection endpoint O' and the intersection endpoint O" belong to the same source point, so the intersection endpoint O' and the intersection endpoint O" form a connecting line 271, similarly, the intersection endpoint P' and the intersection endpoint P" form a connecting line 272, and similarly, the intersection endpoint Q' and the intersection endpoint Q" form a connecting line 273, so that the contour smoothing line and the three connecting lines 271~273 will form a closed contour curve.
[0337] In the above steps E1 to E3, by first screening each line segment in the overall contour polyline Polyline, and then smoothing and repairing the screened contour polyline Polyline, a final smooth and accurate contour curve is obtained, which can improve the accuracy of contour curve generation.
[0338] In other embodiments, the three-dimensional points on the contour polyline Polyline may be directly screened, and then the remaining three-dimensional points may be connected in sequence to obtain the filtered contour polyline Polyline, and then the filtered contour polyline Polyline may be smoothed to obtain a contour curve. The embodiments of the present application do not specifically limit this.
[0339] 912. The computer device synthesizes the road resources of the intersection based on the contour curve of the intersection road surface.
[0340] In some embodiments, the road resource of the intersection is synthesized based on the contour curve obtained in step 911. Optionally, the road resource at least includes the geometry of the intersection, and the geometry at least includes the Mesh data of the intersection, and then post-processing is performed on the basis of the contour curve of the intersection road surface to obtain the Mesh data of the intersection (i.e., the intersection geometry).
[0341] In some embodiments, the Mesh data of the intersection is directly packaged into the road resources of the intersection, or the Mesh data of the intersection and the point cloud data of each triangle vertex in the Mesh are packaged into the road resources of the intersection. The Mesh data of the intersection, the point cloud data of each triangle vertex in the Mesh, and the road material of the intersection can also be combined and packaged into the road resources of the intersection. The embodiments of the present application do not specifically limit the content of the road resources.
[0342] A possible road resource generation method will be introduced below through steps F1 to F4, which can ensure that the generated intersection road surface is smoother, thereby further optimizing the rendering performance of the intersection geometry of the intersection, which is explained below.
[0343] F1. The computer equipment fills the contour curve to obtain a closed road surface.
[0344] In some embodiments, the contour curve generated in step 911 is filled to obtain a closed road surface surrounded by the contour curve itself. Fig.28 As shown, in Fig. 27 Filling is performed based on the contour curve shown to obtain a closed road surface shown in a shaded area.
[0345] F2. Computer equipment retopologies the closed road surface to obtain a topological road surface.
[0346] In some embodiments, the closed road surface filled in step F1 is retopologically retopologically performed, that is, the entire closed road surface is retopologically retopologically performed using triangular fragments to obtain a topological road surface in the form of a triangular mesh.
[0347] F3. Computer equipment smoothes the topological road surface to obtain a smooth road surface.
[0348] In some embodiments, the topological road surface retopologically processed in step F2 is smoothed, i.e., the triangular mesh is smoothed to obtain a smooth road surface (i.e., a smoothed mesh). It should be noted that the surface smoothing implemented in step F3 improves the sharp corners between the road surfaces covered by different intersections (smoothing in three-dimensional space), while step E2 implements curve smoothing, which improves the sharp road edges (smoothing in two-dimensional plane).
[0349] F4. The computer device synthesizes the road resources of the intersection based on the smooth road surface.
[0350] In some embodiments, the smoothed road surface in step F3 is used to synthesize the road resources of the entire intersection. For example, the smoothed Mesh grid exported in step F3 is directly encapsulated into the road resources of the intersection, or the smoothed Mesh grid and the point cloud data of each triangle vertex of the Mesh are packaged and packaged into the road resources of the intersection, or the smoothed Mesh grid, the point cloud data of each triangle vertex of the Mesh and the road material of the intersection are packaged and packaged into the road resources of the intersection. The embodiments of the present application do not specifically limit this.
[0351] In the above steps F1 to F4, a possible road resource generation method is provided, which can ensure that the generated intersection road surface is smoother, thereby further optimizing the rendering performance of the intersection geometry of the intersection.
[0352] like Fig.29 As shown, a rendering of road resources synthesized according to the PCG intersection geometry generation algorithm of the present application is shown. It can be seen that this algorithm supports the generation of three-dimensional intersections. For three-dimensional intersections, it is only necessary to project them into the projection plane to perform logical operations of intersection, and then project each point back to the correct position in the three-dimensional space. In this way, the intersection geometry of each intersection can be accurately, efficiently and quickly generated. Therefore, it is not required that the generated intersections or the input intersection curves are located in the same plane.
[0353] In the above steps 909 to 912, a possible implementation method for generating the road resources of the intersection based on the multiple cutting center lines and the road width of each intersection section is provided, and the intersection road surface is obtained through the road surface of each intersection section, and then the curve is smoothed according to the contour polyline of the intersection road surface to obtain the contour curve, and then the contour curve is filled, retopologically and surface smoothed to obtain the final smooth road surface, and then the road resources are synthesized on the basis of the smooth road surface. The whole process is automatically executed by a computer program, which greatly saves labor costs and improves the efficiency of road resource synthesis. Optionally, it is also possible to simplify the synthesis process of road resources without surface smoothing, and this embodiment of the application does not specifically limit this.
[0354] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.
[0355] The method provided in the embodiment of the present application finds a projection plane in the virtual scene through the normal vectors of each intersection section in the intersection, so that each road center line can be cut to generate a cutting center line through the projection intersection points of the road center lines of each intersection section in the projection plane, so that the part of the road center line that may cause the road surface to convex or concave and affect the edge flatness can be cut off in three-dimensional space through the projection intersection points marked in the projection plane, and finally the road resources of the intersection are produced according to each cutting center line. The computer program can automatically execute and produce road resources when the road center line of each intersection section is given, without the need for manual modeling of road resources such as intersection geometry, saving the labor cost of scene development, greatly improving the generation efficiency of road resources, and thus improving the development efficiency of virtual scenes.
[0356] Furthermore, this road resource generation scheme not only supports the generation of intersections in three-dimensional space, but also does not restrict the intersection of virtual roads in the intersection. For example, it does not restrict whether there is a vertical height difference between the virtual roads at the intersection, nor does it restrict the center lines of all virtual roads at the intersection to intersect at one point. It does not even require any intersection between the center lines of the virtual roads. Therefore, the correct intersection geometry can be generated under any circumstances, and the standardization requirements for the input intersection curve parameters are extremely low, which greatly improves the calculation efficiency of road resources, and the generation results are more stable and more compatible.
[0357] Furthermore, the road resources generated by the computer program will remove the possible uneven connection phenomenon due to the cut-off part of the projection intersection point, ensuring its smooth contour and road surface, and the final road surface result is easy to control, so the generated road resources have high accuracy, good rendering effect, high controllability, strong editability and operability. In this way, even in the face of a large number of frequently modified road parts in business scenarios such as games, maps, and navigation, it is possible to realize the rapid editing of roads in virtual scenes, improving the editing efficiency of virtual scenes.
[0358] In the previous embodiment, each step of the generation scheme of the road resources of the present application is described in detail. The above generation scheme can be provided as a programmed intersection geometry generation algorithm. It only needs to give the intersection curves of each intersection section as input signals, and the computer program can automatically execute steps 901 to 912 in the above embodiment to produce road resources for the intersection.
[0359] Below, the generation scheme of the road resources of this application will be described again from the perspective of the PCG algorithm for generating programmatic intersection geometry.
[0360] 1. Input parameters of the algorithm
[0361] The intersection curves of all intersection segments within the intersection range of each intersection.
[0362] The information required to input an intersection curve includes:
[0363] 3D geometric data of the road centerline, such as Fig.10 The thick black line in
[0364] The left and right widths of each 3D point on the road centerline are used to generate the road surface. Fig.10 The points in the figure, the contour lines of the road surface are as follows Fig.10 The thin black line in
[0365] Each 3D point is perpendicular to the upward direction of the road surface, that is, the normal vector, such as Fig.10 The dotted line in
[0366] The intersection ID is junction_id. Note that all intersection curves within the same intersection have the same junction_id.
[0367] 2. Algorithm processing logic
[0368] For all intersection curves with the same junction_id, perform the following operations:
[0369] Step 1: Resample each intersection curve (i.e., road centerline) into a Polyline according to the accuracy requirements, so that the distance between all adjacent points on each Polyline (i.e., resolution, such as 0.5 meters) is the same.
[0370] Step 2: For the start and end point of each Polyline, if it is a junction endpoint, the attribute label is marked as junction_terminal_point; otherwise, it is an isolated endpoint and the attribute label is marked as insular_terminal_point. Fig.11 As shown, the thick black line represents the intersection curve, the round dot represents the intersection endpoint junction_terminal_point, and the square dot represents the isolated endpoint insular_terminal_point.
[0371] Step 3: Taking the width of each point as the weight, normalize the up_direction (i.e., point normal vector) at each point perpendicular to the road surface, then perform weighted average and normalize again to obtain the average vertical direction average_up_direction (i.e., average normal vector) of the intersection. Suppose there is a plane project_plane, which passes through the origin of the three-dimensional space and is perpendicular to average_up_direction. Record the project_plane as the projection plane of the intersection.
[0372] Step 4: Record the position of each point as original_position, and then project all points to the project_plane projection plane.
[0373] Step 5: Analyze the intersection of all curves on the projection plane and obtain all intersection points (marked as projection intersection points intersection_point). Use all intersection_points to cut all projected Polylines (i.e., projection center lines). Fig.12 As shown, the triangle point represents the projection intersection point intersection_point.
[0374] Step 6: For each curve (i.e., projection centerline), if a curve meets the following conditions: (1) it is not cut by any projection intersection point; and (2) neither the starting point nor the end point is a projection intersection point, mark this curve as no_intersection (i.e., it does not cut the polyline). Fig.13 As shown, both curves should be marked as no_intersection.
[0375] Step 7: If there is a Polyline marked as no_intersection among all the Polyllines at the current intersection:
[0376] Step 7.1, return to the node completed in step 3 (at this time, all curves have not been projected to the projection plane), and extend all insular_terminal_points (i.e. isolated endpoints) of all Polylines marked as no_intersection along their tangent direction for a sufficient distance (e.g., 20 meters). The new endpoints obtained by extension are also marked as insular_terminal_points, and inherit the left and right widths, up_direction, etc. of the original insular_terminal_points. Fig.14 As shown, the thick dotted line is the part extended along the tangent direction.
[0377] Step 7.2: Repeat the operations in steps 4 to 6 for the new Polyline. Fig.15 As shown, the intersection point of the extended lines represented by the triangulated points is found, and the intersection point of the extended lines is also marked as intersection_point.
[0378] Step 8: If there are still Polylines marked as no_intersection after step 7, Fig.16 The situation shown:
[0379] Step 8.1. Return to the node completed in step 7.1 (at this time all curves have not been projected onto the projection plane).
[0380] Step 8.2: Repeat the steps in step 4.
[0381] Step 8.3, for all Polylines marked as no_intersection:
[0382] Step 8.3.1, find a point self_near_point (i.e., the first neighboring point) on the Polyline, and find a point other_near_point (i.e., the second neighboring point) on all other Polylines, so that the distance distance between any point self_point on the Polyline and any point other_point on other Polylines is not less than the minimum distance min_distance between self_near_point and other_near_point.
[0383] Step 8.3.2: Repeat the operation in step 5.
[0384] Step 8.3.3, mark other_near_point and self_near_point as intersection_point, and cut their respective Polylines. Fig.17 As shown, two triangle points represent a pair of adjacent points, which are also marked as intersection_point.
[0385] Step 9. For all the cut Polylines: if one of their starting point and end point is an intersection_point and the other is an insular_terminal_point, delete the Polyline. Fig.18 As shown, the result on the left is cleaned up to get the result on the right.
[0386] Step 10. Use the stored original_position to restore the remaining Polyline to its original position in the three-dimensional space.
[0387] Step 11. For each Polyline:
[0388] Step 11.1, offset the left and right edge lines of the road according to the left and right widths and up_direction (two new Polylines, such as Fig.19 The two endpoints (starting point and ending point) of the edge line are marked as terminal_point (i.e., intersection point), and all the points in the middle are marked as edge_point (i.e., edge point). Note that the offset point still inherits the junction_terminal_point, insular_terminal_point, and intersection_point tags of its source point. Fig.19 As shown in the figure, the offset circular point still inherits the attribute label junction_terminal_point of the intersection endpoint, and the triangulated point still inherits the attribute label intersection_point of the isolated endpoint. In addition, all junction_terminal_point, insular_terminal_point and intersection_point are terminal_point.
[0389] Step 11.2: Enclose the two new Polylines into a road surface to obtain the following Fig. 20 The road surface shown (the input curves are not in the same plane, so they cross each other).
[0390] Step 12: For all the road surfaces obtained: record the original_position of each point, project it to the project_plane, and perform the Boolean union operation of the two-dimensional graphics. All newly generated intersection points are marked as new_intersection_point (i.e., contour intersection points), and then read the original_position to reset the positions of all points.
[0391] Step 13: Convert the closed surface (i.e., the union road surface) of the previous step 12 into a contour line Polyline, and retain the information and marks of all its points.
[0392] Step 14: For each line segment of the contour line Polyline obtained in step 13, if both points of the line segment are not edge_point, delete the line segment. Fig.21 As shown, delete the crossed thin dotted line and keep the remaining thick solid line.
[0393] Step 15: Smooth the multiple Polylines obtained in step 14. This step does not limit the smoothing algorithm, which can be chamfering, Bezier fitting, NURBS fitting, etc. Fig.26 As shown, the Polyline obtained after smoothing is called the contour smoothing line.
[0394] Step 16: Connect all junction_terminal_points with the same source points to obtain a closed curve (i.e., contour curve). Fig. 27 As shown, all junction_terminal_points with the same source points are connected on the contour smooth line to obtain a closed contour curve.
[0395] Step 17: Fill, retopology and smooth the closed curve obtained in step 16. This step does not limit the specific algorithm. Fig.28 As shown, the contour curve is filled, retopologically reshaped, and smoothed to obtain a smooth road surface.
[0396] Note: Before processing step 14, some special cases need to be handled, that is, to repair the broken contour polyline Polyline, including:
[0397] Case 1: Fig. 22 As shown in the figure, the triangle point represents the new_intersection_point, the circle point represents the junction_terminal_point, and the diamond point represents the intersection_point or insular_terminal_point. The dotted line represents the intersection curve, the shaded area represents the cross road surface obtained by Boolean operation, and the bold line represents the line segment expected to be retained in step 14 (at least one point is a set of edge_point). At this time, you need to Fig. 22 The correct result can only be obtained by processing the situation on the left side into the situation on the right side.
[0398] The processing rules include: if along the contour polyline Polyline (i.e., the outer contour of the shaded filled area), a new_intersection_point is found to be connected to another new_intersection_point: (1) there is no other new_intersection_point; (2) there is only one terminal_point, and the terminal_point is not a junction_terminal_point (i.e., the terminal_point should be a diamond point), such as Fig.23As shown in the figure, the dotted circle and the dotted box encircle the segment. Then, this segment contains two new_intersection_points and one insular_terminal_point or intersection_point. All points in the path are deleted (including the two new_intersection_points), and the newly generated endpoints are connected to obtain Fig.23 The repaired contour polyline is shown on the right.
[0399] Case 2: Fig.24 As shown in the figure, the triangle point represents the new_intersection_point, the circle point represents the junction_terminal_point, and the diamond point represents the intersection_point or insular_terminal_point. The dotted line represents the intersection curve, the shaded area represents the cross road surface obtained by Boolean operation, and the bold line represents the line segment expected to be retained in step 14 (at least one point is a set of edge_point). At this time, you need to Fig.24 The correct result can only be obtained by processing the situation on the left side into the situation on the right side.
[0400] The processing rules include: if there is no edge_point between any two intersection_points or insular_terminal_points (i.e., specified intersection points) along the contour polyline Polyline (i.e., the outer contour of the shaded area), then delete all points between the two points, connect a line segment between the two points, and mark the two points as edge_points. Fig.25 As shown in the figure, the section encircled by the dotted circle is repaired to obtain Fig.25 The repaired contour polyline is shown on the right.
[0401] The programmed intersection geometry generation PCG algorithm provided in the embodiment of the present application automatically produces road resources for intersections by a computer program. Any intersection in a virtual scene can use this intersection geometry generation algorithm, which not only supports the geometry generation of intersections in three-dimensional space, but is also not limited to a limited number of specific situations. Instead, it can be applied to the intersection of any virtual roads, such as being compatible with or without vertical height differences, and being compatible with all virtual roads intersecting at one point, multiple points, or even at no intersection. Therefore, it has strong versatility and compatibility.
[0402] Moreover, the computer program quickly and automatically generates road resources, and there is no need for technical personnel to manually model intersection geometry, which saves the manpower cost of scene development, improves the efficiency of road resource generation, and thus improves the efficiency of virtual scene development. In addition, even if the intersection in the virtual scene needs to be edited later, the editing process can be re-run by the computer program, which greatly improves the editing efficiency of the virtual scene. It can also be applied to any development tool with geometric development functions, and can also be integrated into the game development engine, with good portability.
[0403] Fig.30 is a schematic diagram of the structure of a device for generating road resources in a virtual scene provided by an embodiment of the present application, such as Fig.30 As shown, the device comprises:
[0404] An acquisition module 3001 is used to acquire, for an intersection of multiple virtual roads in a virtual scene, a road centerline of an intersection section of each virtual road in the intersection, wherein at least one of the two endpoints of the road centerline is an intersection endpoint, and the intersection endpoint is adjacent to a non-intersection section of the virtual road;
[0405] A determination module 3002 is used to determine the projection plane of the intersection in the virtual scene based on the normal vectors of each intersection section;
[0406] A cutting module 3003, used for cutting each of the road center lines based on the projection intersection points of each of the road center lines in the projection plane to obtain a plurality of cutting center lines;
[0407] The generating module 3004 is used to generate the road resources of the intersection based on the multiple cutting center lines and the road width of each intersection section.
[0408] The device provided in the embodiment of the present application finds a projection plane in the virtual scene through the normal vectors of each intersection section in the intersection, so that each road center line can be cut to generate a cutting center line through the projection intersection points of the road center lines of each intersection section in the projection plane, so that the part of the road center line that may cause the road surface to convex or concave and affect the edge flatness can be cut off in three-dimensional space through the projection intersection points marked in the projection plane, and finally the road resources of the intersection are produced according to each cutting center line. The computer program can automatically execute and produce road resources when the road center line of each intersection section is given, without the need to manually model road resources such as intersection geometry, saving the labor cost of scene development, greatly improving the generation efficiency of road resources, and thus improving the development efficiency of virtual scenes.
[0409] In some embodiments, the acquisition module 3001 is used to:
[0410] For each intersection section in the intersection, reading the three-dimensional geometric data of the road centerline from the intersection curve parameter of the intersection section, the intersection curve parameter is used to indicate the intersection curve of the intersection section in the intersection;
[0411] Based on the three-dimensional geometric data, the road centerline is resampled into a polyline so that distances between adjacent three-dimensional points in the resampled polyline are the same.
[0412] In some embodiments, the intersection curve parameters include: three-dimensional geometric data of the road centerline, an intersection identifier of the intersection section, a normal vector of the intersection section, and a road width of the intersection section.
[0413] In some embodiments, the determination module 3002 is used to:
[0414] Normalizing the normal vector of each intersection section to obtain the first normal vector of each intersection section;
[0415] Taking the road width of each intersection as a weight coefficient, weighted averaging the first normal vectors of each intersection to obtain the second normal vector of each intersection;
[0416] Normalizing the second normal vector of each intersection section to obtain the third normal vector of each intersection section;
[0417] Based on the average normal vector of the third normal vectors of each intersection section, the projection plane is determined from the virtual scene so that the projection plane is perpendicular to the average normal vector and passes through the origin of the world coordinate system in the virtual scene.
[0418] In some embodiments, based on Fig.30 The cutting module 3003 comprises:
[0419] A projection submodule, used for projecting each center line of the road onto the projection plane to obtain a projection center line;
[0420] A first determination submodule is used to determine at least one projection intersection point formed by each projection center line in the projection plane, where the projection intersection point refers to an intersection point of multiple projection center lines in the projection plane;
[0421] A cutting submodule, configured to cut each projection center line based on the at least one projection intersection point to obtain a plurality of projection cutting lines;
[0422] The projection submodule is also used to project the multiple projected cutting lines back to the virtual scene to obtain the multiple cutting center lines.
[0423] In some embodiments, based on Fig.30The cutting submodule comprises:
[0424] A determination unit, configured to determine, for each of the projection center lines, at least one projection intersection point on the projection center line or an extension line of the projection center line, and use the at least one projection intersection point as a cutting point to cut the projection center line into at least one projection cutting line;
[0425] The elimination unit is used to eliminate the projection cutting lines that meet the cleaning conditions from each projection cutting line.
[0426] In some embodiments, the determining unit is configured to:
[0427] If there is an intersection between the projection center line and other projection center lines, the intersection is determined as the projection intersection point;
[0428] If there is no intersection between the projection center line and other projection center lines, the projection center line is marked as an uncut polyline. For each uncut polyline marked in the projection plane, if there is an extension line intersection between the extension line of the uncut polyline and the extension line of other uncut polylines, the extension line intersection is determined as the projection intersection point.
[0429] In some embodiments, the determining unit is further configured to:
[0430] If there is no intersection between the extension of the uncut polyline and the extension of other uncut polylines, determine a first adjacent point from the uncut polyline and determine a second adjacent point from other uncut polylines, so that the distance between any three-dimensional point in the uncut polyline and any three-dimensional point in the other uncut polylines is not less than a minimum distance, where the minimum distance refers to the distance between the first adjacent point and the second adjacent point;
[0431] The first adjacent point and the second adjacent point are both determined as the projection intersection point.
[0432] In some embodiments, the cleaning condition includes: two endpoints of the projected cutting line include a projected intersection point and an isolated endpoint, and the isolated endpoint refers to an endpoint that is neither the intersection endpoint nor the projected intersection point.
[0433] In some embodiments, based on Fig.30 The generating module 3004 comprises:
[0434] A second determination submodule is used to determine, for each cutting center line, a road surface of the intersection section based on a road width and a normal vector of the intersection section from which the cutting center line originates;
[0435] A third determination submodule is used to determine the intersection road surface of the intersection in the virtual scene based on each road surface;
[0436] A generating submodule, for generating a contour curve of the intersection road surface based on the contour polyline of the intersection road surface;
[0437] The synthesis submodule is used to synthesize the road resources of the intersection based on the contour curve of the intersection road surface.
[0438] In some embodiments, the second determining submodule is used to:
[0439] Based on the road width and the normal vector, the cutting center line is offset to obtain two road edge lines, wherein two end points of the road edge line are marked as intersection points, and three-dimensional points on the road edge line other than the two end points are marked as edge points;
[0440] The two road edge lines are used as the road edges on both sides to determine the enclosed road curved surface.
[0441] In some embodiments, the third determining submodule is used to:
[0442] Projecting each of the road curved surfaces onto the projection plane to obtain a projected road surface;
[0443] In the projection plane, determine the union road surface between each projection road surface;
[0444] The union road surface is projected back to the virtual scene to obtain the intersection road surface.
[0445] In some embodiments, the generating submodule is used to:
[0446] From each line segment of the contour polyline of the intersection road surface, remove the line segment that meets the deletion condition;
[0447] Smoothing the eliminated contour polylines to obtain contour smoothing lines;
[0448] Based on the contour smooth line, a contour curve of the intersection road surface is generated. In addition to the contour smooth line, the contour curve also includes a plurality of connection lines, and each connection line is obtained by connecting a group of intersection endpoints with the same source point.
[0449] In some embodiments, the intersection point includes the intersection endpoint, the projection intersection point, the isolated endpoint and the contour intersection point, and the contour intersection point refers to the intersection point of the contour lines in the union road surface; the deletion condition includes: both endpoints of the line segment belong to the intersection point.
[0450] In some embodiments, based on Fig.30 The device is composed of:
[0451] The connection marking module is used to delete the three-dimensional points between any pair of intersection points in the contour polyline of the intersection road surface if the pair of intersection points meet the repair conditions, connect the pair of intersection points, and mark the pair of intersection points as edge points.
[0452] In some embodiments, the repair condition includes at least one of the following: there are no other contour intersection points between any pair of contour intersection points, and there is only one intersection point between the pair of contour intersection points that does not belong to the intersection endpoint; or, there are no edge points between any pair of specified intersection points, and the specified intersection point refers to the projected intersection point or the isolated endpoint.
[0453] In some embodiments, the synthesis submodule is used to:
[0454] Filling the contour curve to obtain a closed road surface;
[0455] Retopology is performed on the closed road surface to obtain a topological road surface;
[0456] Smoothing the topological road surface to obtain a smooth road surface;
[0457] Based on the smooth road surface, the road resources of the intersection are synthesized.
[0458] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.
[0459] It should be noted that: the device for generating road resources in a virtual scene provided in the above embodiment only uses the division of the above functional modules as an example when generating road resources for an intersection. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for generating road resources in a virtual scene provided in the above embodiment and the embodiment of the method for generating road resources in a virtual scene belong to the same concept. The specific implementation process is detailed in the embodiment of the method for generating road resources in a virtual scene, which will not be repeated here.
[0460] Fig.31 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application, such as Fig.31As shown, the computer device is taken as the terminal 3100 for example. Optionally, the device type of the terminal 3100 includes: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, a laptop computer or a desktop computer. The terminal 3100 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0461] Typically, the terminal 3100 includes: a processor 3101 and a memory 3102 .
[0462] Optionally, the processor 3101 includes one or more processing cores, such as a 4-core processor, an 8-core processor, etc. Optionally, the processor 3101 is implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). In some embodiments, the processor 3101 includes a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 3101 is integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 3101 also includes an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0463] In some embodiments, the memory 3102 includes one or more computer-readable storage media, and optionally, the computer-readable storage medium is non-transitory. Optionally, the memory 3102 also includes a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 3102 is used to store at least one program code, and the at least one program code is used to be executed by the processor 3101 to implement the method for generating road resources in the virtual scene provided in each embodiment of the present application.
[0464] In some embodiments, the terminal 3100 may further optionally include: a peripheral device interface 3103 and at least one peripheral device. The processor 3101, the memory 3102 and the peripheral device interface 3103 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 3103 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 3104, a display screen 3105, a camera assembly 3106, an audio circuit 3107 and a power supply 3108.
[0465] The peripheral device interface 3103 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 3101 and the memory 3102. In some embodiments, the processor 3101, the memory 3102 and the peripheral device interface 3103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 3101, the memory 3102 and the peripheral device interface 3103 are implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0466] The radio frequency circuit 3104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 3104 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 3104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 3104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. Optionally, the radio frequency circuit 3104 communicates with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 3104 also includes circuits related to NFC (Near Field Communication), which is not limited in this application.
[0467] The display screen 3105 is used to display a UI (User Interface). Optionally, the UI includes graphics, text, icons, videos, and any combination thereof. When the display screen 3105 is a touch display screen, the display screen 3105 also has the ability to collect touch signals on the surface or above the surface of the display screen 3105. The touch signal can be input to the processor 3101 as a control signal for processing. Optionally, the display screen 3105 is also used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 3105 is one, and the front panel of the terminal 3100 is set; in other embodiments, the display screen 3105 is at least two, which are respectively set on different surfaces of the terminal 3100 or are folded; in some embodiments, the display screen 3105 is a flexible display screen, which is set on the curved surface or folded surface of the terminal 3100. Even, optionally, the display screen 3105 is set to a non-rectangular irregular shape, that is, a special-shaped screen. Optionally, the display screen 3105 is made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0468] The camera assembly 3106 is used to capture images or videos. Optionally, the camera assembly 3106 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 3106 also includes a flash. Optionally, the flash is a monochrome temperature flash, or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which is used for light compensation at different color temperatures.
[0469] In some embodiments, the audio circuit 3107 includes a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 3101 for processing, or input them into the radio frequency circuit 3104 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there are multiple microphones, which are respectively arranged at different parts of the terminal 3100. Optionally, the microphone is an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 3101 or the radio frequency circuit 3104 into sound waves. Optionally, the speaker is a traditional film speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 3107 also includes a headphone jack.
[0470] The power supply 3108 is used to power various components in the terminal 3100. Optionally, the power supply 3108 is an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 3108 includes a rechargeable battery, the rechargeable battery supports wired charging or wireless charging. The rechargeable battery is also used to support fast charging technology.
[0471] In some embodiments, the terminal 3100 further includes one or more sensors 3110 , including but not limited to: an acceleration sensor 3111 , a gyroscope sensor 3112 , a pressure sensor 3113 , an optical sensor 3114 , and a proximity sensor 3115 .
[0472] In some embodiments, the acceleration sensor 3111 detects the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 3100. For example, the acceleration sensor 3111 is used to detect the components of gravity acceleration on the three coordinate axes. Optionally, the processor 3101 controls the display screen 3105 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 3111. The acceleration sensor 3111 is also used for collecting motion data of games or users.
[0473] In some embodiments, the gyroscope sensor 3112 detects the body direction and rotation angle of the terminal 3100, and the gyroscope sensor 3112 and the acceleration sensor 3111 cooperate to collect the user's 3D actions on the terminal 3100. The processor 3101 implements the following functions based on the data collected by the gyroscope sensor 3112: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0474] Optionally, the pressure sensor 3113 is arranged on the side frame of the terminal 3100 and / or the lower layer of the display screen 3105. When the pressure sensor 3113 is arranged on the side frame of the terminal 3100, it can detect the user's holding signal of the terminal 3100, and the processor 3101 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 3113. When the pressure sensor 3113 is arranged on the lower layer of the display screen 3105, the processor 3101 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 3105. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0475] The optical sensor 3114 is used to collect the ambient light intensity. In one embodiment, the processor 3101 controls the display brightness of the display screen 3105 according to the ambient light intensity collected by the optical sensor 3114. Specifically, when the ambient light intensity is high, the display brightness of the display screen 3105 is increased; when the ambient light intensity is low, the display brightness of the display screen 3105 is decreased. In another embodiment, the processor 3101 also dynamically adjusts the shooting parameters of the camera assembly 3106 according to the ambient light intensity collected by the optical sensor 3114.
[0476] The proximity sensor 3115, also called a distance sensor, is usually arranged on the front panel of the terminal 3100. The proximity sensor 3115 is used to collect the distance between the user and the front of the terminal 3100. In one embodiment, when the proximity sensor 3115 detects that the distance between the user and the front of the terminal 3100 is gradually decreasing, the processor 3101 controls the display screen 3105 to switch from the screen-on state to the screen-off state; when the proximity sensor 3115 detects that the distance between the user and the front of the terminal 3100 is gradually increasing, the processor 3101 controls the display screen 3105 to switch from the screen-off state to the screen-on state.
[0477] Those skilled in the art will understand that Fig.31 The structure shown in the figure does not constitute a limitation on the terminal 3100, and it can include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0478] Fig.32 It is a structural diagram of another computer device provided in an embodiment of the present application. The computer device 3200 may have relatively large differences due to different configurations or performances. The computer device 3200 includes one or more processors (Central Processing Units, CPU) 3201 and one or more memories 3202, wherein the memory 3202 stores at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 3201 to implement the method for generating road resources in the virtual scene provided in the above-mentioned various embodiments. Optionally, the computer device 3200 also has components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The computer device 3200 also includes other components for realizing the functions of the device, which will not be described in detail here.
[0479] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including at least one computer program, and the at least one computer program can be executed by a processor in a computer device to complete the method for generating road resources in a virtual scene in each of the above embodiments. For example, the computer-readable storage medium includes ROM (Read-Only Memory), RAM (Random-Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, optical data storage device, etc.
[0480] In an exemplary embodiment, a computer program product is also provided, including one or more computer programs, which are stored in a computer-readable storage medium. One or more processors of a computer device can read the one or more computer programs from the computer-readable storage medium, and the one or more processors execute the one or more computer programs, so that the computer device can execute to complete the method for generating road resources in a virtual scene in the above embodiment.
[0481] A person of ordinary skill in the art will understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing related hardware through a program. Optionally, the program is stored in a computer-readable storage medium. Optionally, the above-mentioned storage medium is a read-only memory, a disk or an optical disk, etc.
[0482] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating road resources in a virtual scene, characterized in that: The method comprises: For an intersection of multiple virtual roads in a virtual scene, obtaining a road centerline of an intersection section of each virtual road in the intersection, wherein at least one of two endpoints of the road centerline is an intersection endpoint, and the intersection endpoint is adjacent to a non-intersection section of the virtual road; Determining a projection plane of the intersection in the virtual scene based on normal vectors of each intersection segment; Based on the projection intersection points of the road center lines in the projection plane, each of the road center lines is cut to obtain a plurality of cut center lines; The road resources of the intersection are generated based on the multiple cutting center lines and the road width of each intersection segment.
2. The method according to claim 1, characterized in that The road centerline is a multi-segment line including a plurality of three-dimensional points, and obtaining the road centerline of each intersection section of the virtual road at the intersection includes: For each of the intersection sections in the intersection, reading the three-dimensional geometric data of the road centerline from the intersection curve parameters of the intersection section, wherein the intersection curve parameters are used to indicate the intersection curve of the intersection section in the intersection; Based on the three-dimensional geometric data, the road centerline is resampled into a polyline so that distances between adjacent three-dimensional points in the resampled polyline are the same.
3. The method according to claim 2, characterized in that The intersection curve parameters include: three-dimensional geometric data of the road centerline, the intersection mark of the intersection section, the normal vector of the intersection section, and the road width of the intersection section.
4. The method according to claim 1, characterized in that: The determining of the projection plane of the intersection in the virtual scene based on the normal vectors of each intersection segment comprises: Normalizing the normal vector of each intersection section to obtain the first normal vector of each intersection section; Taking the road width of each intersection as a weight coefficient, weighted averaging the first normal vectors of each intersection to obtain the second normal vector of each intersection; Normalizing the second normal vector of each intersection section to obtain the third normal vector of each intersection section; Based on the average normal vector of the third normal vectors of each intersection section, the projection plane is determined from the virtual scene, so that the projection plane is perpendicular to the average normal vector and passes through the origin of the world coordinate system in the virtual scene.
5. The method according to claim 1, characterized in that The method of cutting each of the road center lines based on the projection intersection points of each of the road center lines in the projection plane to obtain a plurality of cutting center lines includes: Projecting each of the road center lines onto the projection plane to obtain a projection center line; In the projection plane, determining at least one projection intersection point formed by each projection center line, wherein the projection intersection point refers to an intersection point of multiple projection center lines in the projection plane; Based on the at least one projection intersection point, each projection center line is cut to obtain a plurality of projection cutting lines; The plurality of projected cutting lines are projected back to the virtual scene to obtain the plurality of cutting center lines.
6. The method according to claim 5, characterized in that The step of cutting each projection center line based on the at least one projection intersection point to obtain a plurality of projection cutting lines comprises: For each of the projection center lines, at least one projection intersection point is determined on the projection center line or an extension line of the projection center line, and the projection center line is cut into at least one projection cutting line using the at least one projection intersection point as a cutting point; From each projected cutting line, the projected cutting lines that meet the cleaning conditions are eliminated.
7. The method according to claim 6, characterized in that Determining at least one projection intersection point on the projection center line or the extension line of the projection center line comprises: If there is an intersection between the projection center line and other projection center lines, the intersection is determined as the projection intersection point; If there is no intersection between the projection center line and other projection center lines, the projection center line is marked as an uncut polyline. For each uncut polyline marked in the projection plane, if there is an extension line intersection between the extension line of the uncut polyline and the extension line of other uncut polylines, the extension line intersection is determined as the projection intersection point.
8. The method according to claim 7, characterized in that The method further comprises: If there is no intersection between the extension line of the uncut polyline and the extension lines of other uncut polylines, determine a first adjacent point from the uncut polyline and determine a second adjacent point from other uncut polylines, so that the distance between any three-dimensional point in the uncut polyline and any three-dimensional point in the other uncut polylines is not less than a minimum distance, where the minimum distance refers to the distance between the first adjacent point and the second adjacent point; The first neighboring point and the second neighboring point are both determined as the projection intersection points.
9. The method according to any one of claims 6 to 8, characterized in that: The cleaning condition includes: the two endpoints of the projected cutting line include a projected intersection point and an isolated endpoint, and the isolated endpoint refers to an endpoint that is neither the intersection endpoint nor the projected intersection point.
10. The method according to claim 1, characterized in that The generating the road resources of the intersection based on the multiple cutting center lines and the road width of each intersection section comprises: For each of the cutting center lines, based on the road width and normal vector of the intersection section from which the cutting center line originates, determining the road surface of the intersection section; Based on each road surface, determining an intersection road surface of the intersection in the virtual scene; Generating a contour curve of the intersection road surface based on the contour polyline of the intersection road surface; The road resources of the intersection are synthesized based on the contour curve of the intersection road surface.
11. The method according to claim 10, characterized in that The determining of the road surface of the intersection section based on the road width and the normal vector of the intersection section from which the cutting center line originates comprises: Based on the road width and the normal vector, the cutting center line is offset to obtain two road edge lines, wherein two end points of the road edge line are marked as intersection points, and three-dimensional points on the road edge line other than the two end points are marked as edge points; The two road edge lines are used as the bilateral road edges to determine the enclosed road curved surface.
12. The method according to claim 10, characterized in that The determining, based on each road surface, of the intersection road surface in the virtual scene comprises: Projecting each of the road curved surfaces onto the projection plane to obtain a projected road surface; In the projection plane, determining a union road surface between each projection road surface; The union road surface is projected back to the virtual scene to obtain the intersection road surface.
13. The method according to claim 10, characterized in that The step of generating a contour curve of the intersection road surface based on the contour polyline of the intersection road surface comprises: Eliminate the line segments that meet the deletion condition from the line segments of the contour polyline of the intersection road surface; Smoothing the eliminated contour polylines to obtain contour smoothing lines; Based on the contour smooth line, a contour curve of the intersection road surface is generated. In addition to the contour smooth line, the contour curve also includes a plurality of connection lines, and each connection line is obtained by connecting a group of intersection endpoints with the same source point.
14. The method according to claim 13, characterized in that The intersection point includes the intersection endpoint, the projection intersection point, the isolated endpoint and the contour intersection point, and the contour intersection point refers to the intersection point of the contour lines in the union road surface; The deletion condition includes: both endpoints of the line segment belong to the intersection point.
15. The method according to claim 14, characterized in that Before removing the line segments that meet the deletion condition from the line segments of the contour polyline of the intersection road surface, the method further includes: If any pair of intersection points in the contour polyline of the intersection road surface meets the repair condition, the three-dimensional point between the pair of intersection points is deleted, the pair of intersection points are connected, and the pair of intersection points are marked as edge points.
16. The method according to claim 15, characterized in that The repair condition includes at least one of the following: there are no other contour intersection points between any pair of contour intersection points, and there is one and only one intersection point between the pair of contour intersection points that does not belong to the intersection endpoint; or, there are no edge points between any pair of designated intersection points, and the designated intersection point refers to the projected intersection point or the isolated endpoint.
17. The method according to any one of claims 10 to 16, characterized in that The synthesizing the road resources of the intersection based on the contour curve of the intersection road surface comprises: Filling the contour curve to obtain a closed road surface; Retopologically retopologically the closed road surface to obtain a topological road surface; Smoothing the topological road surface to obtain a smooth road surface; Based on the smooth road surface, the road resources of the intersection are synthesized.
18. A device for generating road resources in a virtual scene, characterized in that: The device comprises: An acquisition module, for acquiring, for an intersection of multiple virtual roads in a virtual scene, a road centerline of an intersection section of each virtual road in the intersection, wherein at least one of two endpoints of the road centerline is an intersection endpoint, and the intersection endpoint is adjacent to a non-intersection section of the virtual road; A determination module, configured to determine a projection plane of the intersection in the virtual scene based on normal vectors of each intersection section; A cutting module, used for cutting each of the road center lines based on the projection intersection points of each of the road center lines in the projection plane to obtain a plurality of cutting center lines; A generating module is used to generate the road resources of the intersection based on the multiple cutting center lines and the road width of each intersection section.
19. A computer device, characterized in that: The computer device includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, and the at least one computer program is loaded and executed by the one or more processors to implement the method for generating road resources in a virtual scene as described in any one of claims 1 to 17.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to implement the method for generating road resources in a virtual scene as described in any one of claims 1 to 17.
